import { r as xe, T as we, b as ze, c as je, a4 as Pe, f as Oe, h as Te, j as De, v as z, aJ as Ie, s as Se, k as Ee, m as o, W as k, al as Ce, q as ke } from "./publicApi-fkG2o0UD.js";
import h, { useState as w, useRef as qe, useEffect as Re, Suspense as q } from "react";
import { r as $e, p as re, E as Le } from "./ErrorBoundary-D8xyNCpV.js";
var W = { exports: {} }, te;
function Ae() {
  return te || (te = 1, (() => {
    var i = {};
    i.n = (e) => {
      var t = e && e.__esModule ? (
        /******/
        () => e.default
      ) : () => e;
      return i.d(t, {
        a: t
      }), t;
    }, i.d = (e, t) => {
      for (var a in t)
        i.o(t, a) && !i.o(e, a) && Object.defineProperty(e, a, {
          enumerable: !0,
          get: t[a]
        });
    }, i.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t), i.r = (e) => {
      typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
        value: "Module"
      }), Object.defineProperty(e, "__esModule", {
        value: !0
      });
    };
    var u = {};
    i.r(u), i.d(u, {
      Panel: () => (
        /* reexport */
        F
      ),
      default: () => (
        /* reexport */
        he
      )
    });
    const s = h;
    var d = i.n(s);
    const j = /* @__PURE__ */ xe();
    var n = i.n(j);
    const P = we();
    var R = i.n(P);
    const b = ze();
    var $ = i.n(b);
    const p = je();
    var O = i.n(p);
    const T = Pe(), ie = $e();
    var B = i.n(ie);
    const N = Oe;
    var H = i.n(N);
    const U = Te();
    var V = H().div.withConfig({
      displayName: "TabLayoutStyles__StyledPanel",
      componentId: "lf0quy-0"
    })(["", ""], U.mixins.reset("block")), oe = H().div.withConfig({
      displayName: "TabLayoutStyles__Styled",
      componentId: "lf0quy-1"
    })(["text-align:center;margin-top:", ";", ""], U.variables.spacingLarge, function(e) {
      var t = e.$layout;
      return t === "vertical" && (0, N.css)(
        ["display:flex;& > [role='tablist']{flex:0 0 auto;}& > ", "{width:100%;}"],
        /* sc-sel */
        V
      );
    });
    function L() {
      return L = Object.assign ? Object.assign.bind() : function(e) {
        for (var t = 1; t < arguments.length; t++) {
          var a = arguments[t];
          for (var r in a)
            ({}).hasOwnProperty.call(a, r) && (e[r] = a[r]);
        }
        return e;
      }, L.apply(null, arguments);
    }
    function le(e, t) {
      if (e == null) return {};
      var a, r, l = se(e, t);
      if (Object.getOwnPropertySymbols) {
        var _ = Object.getOwnPropertySymbols(e);
        for (r = 0; r < _.length; r++)
          a = _[r], t.includes(a) || {}.propertyIsEnumerable.call(e, a) && (l[a] = e[a]);
      }
      return l;
    }
    function se(e, t) {
      if (e == null) return {};
      var a = {};
      for (var r in e)
        if ({}.hasOwnProperty.call(e, r)) {
          if (t.includes(r)) continue;
          a[r] = e[r];
        }
      return a;
    }
    var de = {
      children: n().node,
      count: n().number,
      disabled: n().bool,
      elementRef: n().oneOfType([n().func, n().object]),
      icon: n().node,
      label: n().oneOfType([n().string, n().element]),
      panelId: n().string.isRequired,
      tooltip: n().node
    };
    function J(e) {
      var t = e.children;
      e.disabled;
      var a = e.elementRef, r = e.panelId, l = le(e, ["children", "disabled", "elementRef", "panelId"]);
      return d().createElement(V, L({
        "data-test-panel-id": r,
        "data-test": "panel",
        ref: a,
        role: "tabpanel"
      }, O()(l, ["icon", "label", "tooltip"])), t);
    }
    J.propTypes = de;
    const F = J;
    function f(e) {
      "@babel/helpers - typeof";
      return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
        return typeof t;
      } : function(t) {
        return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
      }, f(e);
    }
    function D() {
      return D = Object.assign ? Object.assign.bind() : function(e) {
        for (var t = 1; t < arguments.length; t++) {
          var a = arguments[t];
          for (var r in a)
            ({}).hasOwnProperty.call(a, r) && (e[r] = a[r]);
        }
        return e;
      }, D.apply(null, arguments);
    }
    function ce(e, t) {
      if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
    }
    function ue(e, t) {
      for (var a = 0; a < t.length; a++) {
        var r = t[a];
        r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, K(r.key), r);
      }
    }
    function pe(e, t, a) {
      return t && ue(e.prototype, t), Object.defineProperty(e, "prototype", {
        writable: !1
      }), e;
    }
    function _e(e, t) {
      if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
      e.prototype = Object.create(t && t.prototype, {
        constructor: {
          value: e,
          writable: !0,
          configurable: !0
        }
      }), Object.defineProperty(e, "prototype", {
        writable: !1
      }), t && A(e, t);
    }
    function A(e, t) {
      return A = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, r) {
        return a.__proto__ = r, a;
      }, A(e, t);
    }
    function ge(e) {
      var t = G();
      return function() {
        var a, r = S(e);
        if (t) {
          var l = S(this).constructor;
          a = Reflect.construct(r, arguments, l);
        } else a = r.apply(this, arguments);
        return be(this, a);
      };
    }
    function be(e, t) {
      if (t && (f(t) == "object" || typeof t == "function")) return t;
      if (t !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return I(e);
    }
    function I(e) {
      if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return e;
    }
    function G() {
      try {
        var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
      } catch {
      }
      return (G = function() {
        return !!e;
      })();
    }
    function S(e) {
      return S = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
        return t.__proto__ || Object.getPrototypeOf(t);
      }, S(e);
    }
    function m(e, t, a) {
      return (t = K(t)) in e ? Object.defineProperty(e, t, {
        value: a,
        enumerable: !0,
        configurable: !0,
        writable: !0
      }) : e[t] = a, e;
    }
    function K(e) {
      var t = fe(e, "string");
      return f(t) == "symbol" ? t : t + "";
    }
    function fe(e, t) {
      if (f(e) != "object" || !e) return e;
      var a = e[Symbol.toPrimitive];
      if (a !== void 0) {
        var r = a.call(e, t);
        if (f(r) != "object") return r;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (t === "string" ? String : Number)(e);
    }
    var me = {
      autoActivate: n().bool,
      activePanelId: n().string,
      appearance: n().oneOf(["navigation", "context"]),
      children: n().node,
      count: n().number,
      defaultActivePanelId: n().string,
      elementRef: n().oneOfType([n().func, n().object]),
      iconSize: n().oneOf(["inline", "small", "large"]),
      layout: n().oneOf(["horizontal", "vertical"]),
      onChange: n().func,
      tabWidth: n().number
    }, ve = {
      appearance: "navigation",
      layout: "horizontal"
    }, E = function(e) {
      _e(a, e);
      var t = ge(a);
      function a(r) {
        var l;
        return ce(this, a), l = t.call(this, r), m(I(l), "controlledExternally", void 0), m(I(l), "guid", void 0), m(I(l), "handleChange", function(_, M) {
          var y, v, x = M.selectedTabId;
          l.isControlled() || l.setState({
            activePanelId: x
          }), (y = (v = l.props).onChange) === null || y === void 0 || y.call(v, _, {
            activePanelId: x
          });
        }), l.controlledExternally = R()(r, "activePanelId"), l.guid = (0, T.createDOMID)(), l.isControlled() || (l.state = {
          activePanelId: r.defaultActivePanelId
        }), l;
      }
      return pe(a, [{
        key: "componentDidUpdate",
        value: function(l) {
        }
      }, {
        key: "isControlled",
        value: function() {
          return this.controlledExternally;
        }
      }, {
        key: "render",
        value: function() {
          var l = this, _ = this.props, M = _.children, y = _.layout, v = this.isControlled() ? this.props.activePanelId : this.state.activePanelId, x, ye = s.Children.toArray(M).filter(s.isValidElement).map(function(Q) {
            var c = Q.props, X = "".concat(l.guid, "-").concat(c.panelId), Y = "".concat(l.guid, "-").concat(c.panelId, "-tab");
            c.panelId === v && (x = (0, s.cloneElement)(Q, {
              "aria-labelledby": Y,
              id: X
            }));
            var Z = {}, ee = c["data-title"];
            return ee != null && (Z["data-title"] = ee), d().createElement(B().Tab, D({
              count: c.count,
              icon: c.icon,
              key: c.panelId,
              label: c.label,
              tabId: c.panelId,
              id: Y,
              ariaControls: X,
              tooltip: c.tooltip,
              disabled: c.disabled
            }, Z));
          });
          return d().createElement(oe, D({
            "data-test-active-panel-id": v,
            "data-test": "tab-layout",
            ref: this.props.elementRef,
            $layout: y
          }, O()(this.props, $()(a.propTypes))), d().createElement(B(), {
            autoActivate: this.props.autoActivate,
            activeTabId: v,
            appearance: this.props.appearance,
            iconPosition: this.props.iconPosition,
            iconSize: this.props.iconSize,
            layout: this.props.layout,
            onChange: this.handleChange,
            tabWidth: this.props.tabWidth
          }, ye), x);
        }
      }]), a;
    }(s.Component);
    m(E, "propTypes", me), m(E, "defaultProps", ve), m(E, "Panel", F);
    const he = E;
    W.exports = u;
  })()), W.exports;
}
var Me = Ae();
const ne = /* @__PURE__ */ De(Me), We = Ie`
    body {
        background-color: ${re({
  enterprise: {
    light: z.gray96,
    dark: z.gray20
  },
  prisma: z.backgroundColorSection
})};
    }

    #dashboardTable [data-test='tab-bar'] {
        margin-bottom: 15px;

        button {
            min-width: 115px;
        }
    }

    [data-input-id='overview_input'] {
        grid-column: 5 / 5;
        grid-row: 3;
    }

    #overview_main_label_viz {
        grid-column: 1 / span 4;
        grid-row: 3;
        height: fit-content;
    }

    #main_page_description_viz {
        margin-top: 40px;
    }

    #overview_timerange_label_start_viz {
        grid-row: 3;
        margin-top: 28px;
    }

    #overview_timerange_label_end_viz {
        grid-row: 3;
        margin-left: 145px;
        margin-top: 28px;
        display: flex;
    }

    /* data ingestion */

    [data-input-id='data_ingestion_input'] {
        grid-column: 8 / 9;
        grid-row: 2;
    }

    #data_ingestion_description_viz {
        margin-top: 32px;
        width: 600px;
    }

    #data_ingestion_timerange_label_start_viz {
        grid-row: 2;
        margin-top: 12px;
    }

    #data_ingestion_timerange_label_end_viz {
        grid-row: 2;
        margin-left: 145px;
        display: flex;
        margin-top: 12px;
    }

    #data_ingestion_table_viz {
        grid-column: 1 / 9;
        height: 100%;
        max-height: 500px;
        grid-row: 6;
        margin-top: 100px;

        [data-test='viz-waiting-for-input'] {
            min-height: 100px;
        }
    }

    #data_ingestion_data_volume_viz {
        grid-row: 3 / 6;
        margin-top: 20px;
        grid-column: 1 / 5;
    }

    #data_ingestion_events_count_viz {
        grid-row: 3 / 6;
        margin-top: 20px;
        grid-column: 5 / 9;
    }

    #data_ingestion_search {
        grid-row: 6;
        width: 150px;
        grid-column: 1;
        margin-top: 16px;
    }

    #data_ingestion_search_label {
        margin-bottom: 4px;
    }

    [data-input-id='data_ingestion_table_input'] {
        width: 200px;
        margin-left: 150px;
        grid-row: 6;
        grid-column: 1;
        margin-top: 21px;
        [data-test='input-title'] {
            font-size: 14px;
        }
    }

    #switch_hide_no_traffic_wrapper {
        grid-column: 1;
        grid-row: 6;
        width: 200px;
        margin: 32px 350px;
    }

    /* error tab */

    [data-input-id='errors_tab_input'] {
        grid-column: 2;
        grid-row: 1;
    }

    #errors_tab_description_viz {
        grid-column: 1 / 3;
        grid-row: 1;
        height: 20px;
        margin-top: 32px;
        width: 600px;
    }

    #errors_tab_timerange_label_start_viz {
        grid-column: 1;
        grid-row: 1;
        margin-top: 37px;
    }

    #errors_tab_timerange_label_end_viz {
        grid-column: 1;
        grid-row: 1;
        margin-left: 145px;
        display: flex;
        margin-top: 37px;
    }

    [data-test='status-icon-container'] {
        z-index: 1;
    }

    .invisible_before_moving {
        display: none;
    }

    #errors_tab_errors_list_viz {
        margin-top: 8px;
        height: fit-content;
        grid-row: 5;
        grid-column: 1 / 3;
    }

    #errors_tab_errors_count_viz {
        grid-row: 2;
        height: 400px;
        grid-column: 1 / 3;
        margin-top: 16px;
    }

    [data-input-id='errors_type_input'] {
        grid-column: 1;
        grid-row: 4;
    }

    #errors_tab_errors_list_viz div {
        height: fit-content;
    }

    [data-test-panel-id='errorsTabPanel'] [data-test='grid-layout-canvas'] {
        grid-template-columns: 94.5% 5%;
        grid-template-rows: auto auto auto auto auto;
        height: fit-content;
        overflow-x: hidden;
    }

    #errors_tab_label_viz {
        grid-column: 1;
        grid-row: 1;
    }

    /* resource tab */

    #resource_tab_label_viz {
        min-width: 450px;
    }

    [data-input-id='resource_tab_input'] {
        grid-column: 6;
        grid-row: 1;
        margin-top: 32px;
    }

    #resource_tab_description_viz {
        margin-top: 32px;
        width: 600px;
    }

    #resource_tab_timerange_label_start_viz {
        grid-row: 1;
        margin-top: 35px;
    }

    #resource_tab_timerange_label_end_viz {
        grid-row: 1;
        margin-left: 145px;
        display: flex;
        margin-top: 35px;
    }

    #resource_tab_cpu_consumption_viz,
    #resource_tab_memory_consumption_viz {
        grid-row: 2 / 6;
        margin-top: 20px;
        height: 300px;
    }

    /* data ingestion table modal */

    #data_ingestion_modal_dropdown {
        grid-row: 1;
        grid-column: 1;
        align-content: center;
        margin-left: 2px;
        width: 160px;
    }

    [data-input-id='data_ingestion_modal_time_window'] {
        grid-row: 1;
        grid-column: 1;
        margin-left: 170px;
    }

    #data_ingestion_dropdown_label {
        margin: 0;
        margin-bottom: 5px;
    }

    #data_ingestion_modal_timerange_label_end_viz {
        margin-left: 145px;
        display: flex;
    }

    /* shared styles for time labels */
    #overview_timerange_label_start_viz,
    #overview_timerange_label_end_viz,
    #data_ingestion_timerange_label_start_viz,
    #data_ingestion_timerange_label_end_viz,
    #errors_tab_timerange_label_start_viz,
    #errors_tab_timerange_label_end_viz,
    #resource_tab_timerange_label_start_viz,
    #resource_tab_timerange_label_end_viz,
    #data_ingestion_modal_timerange_label_start_viz,
    #data_ingestion_modal_timerange_label_end_viz {
        inline-size: fit-content;
        grid-column: 1;
        width: 145px;

        [data-test='majorValue'] {
            font-size: 14px;
            line-height: 14px;
            font-family: 'Splunk Platform Sans', 'Splunk Platform Sans', 'Proxima Nova', Roboto, Droid,
            'Helvetica Neue', Helvetica, Arial, sans-serif;
            font-weight: 400;
            color: var(--muted-text-color);
        }
        [data-test='action-menu-wrapper'] {
            display: none;
        }
    }

    /* shared styles page grid titles */
    #main_page_label_viz,
    #main_page_description_viz,
    #data_ingestion_description_viz,
    #data_ingestion_label_viz,
    #errors_tab_description_viz,
    #resource_tab_description_viz {
        grid-column: 1 / span 4;
        grid-row: 1;
        height: fit-content;
    }

    /* data input shared styles  */
    [data-input-id='overview_input'],
    [data-input-id='data_ingestion_input'],
    [data-input-id='errors_tab_input'],
    [data-input-id='resource_tab_input'] {
        align-content: flex-end;
        place-self: end;

        [data-test='input-container'] {
            display: inline-flex;
            padding: 0;
        }
        /* Time selector */
        [data-test='input-title'] {
            margin: 5px;
            font-size: 14px;
        }
    }

    /* mark between dates  */

    #overview_timerange_label_end_viz::before,
    #data_ingestion_timerange_label_end_viz::before,
    #errors_tab_timerange_label_end_viz::before,
    #resource_tab_timerange_label_end_viz::before,
    #data_ingestion_modal_timerange_label_end_viz::before {
        content: '- ';
        margin: auto;
        color: var(--muted-text-color);
    }

    #errors_tab_errors_list_viz svg[data-test='placeholder-icon'] {
        max-height: 100px;
    }

    [data-test-panel-id='dataIngestionTabPanel'] [data-test='grid-layout-canvas'] {
        grid-template-columns: repeat(8, 12%);
        overflow-x: hidden;
    }

    [data-test-panel-id='dataIngestionModalDefTabPanel'] [data-test='input-layout-container'],
    [data-test-panel-id='dataIngestionModalDefTabPanel'] [data-test='grid-layout-canvas'] {
        background-color: var(--muted-text-color);
        padding: 0px;
        display: grid;
    }

    /* muted color */
    #main_page_description_viz p,
    #data_ingestion_description_viz p,
    #errors_tab_description_viz p {
        color: var(--muted-text-color);
    }

    #data_ingestion_table_viz [data-test='table-container'] > div {
        height: fit-content;
        
        [data-test="scroll-container"] {
            overflow-y: hidden;
        }
    }

    #data_ingestion_table_viz [data-test='table-container'] td:first-child {
        cursor: pointer;
        color: #006eaa !important;
    }

    #data_ingestion_table_viz [data-test='table-container'] td:first-child:hover {
        text-decoration: underline;
    }

    .dropdown_menu_item {
        padding: 6px 16px;
        min-width: 200px;
    }

`, ae = h.lazy(() => import("./Custom-CliqgaY8.js")), Be = h.lazy(() => import("./DataIngestion-BWu98xSu.js")), Ne = h.lazy(() => import("./Overview-BZ5lh44c.js")), He = h.lazy(() => import("./Error-tJiioZIy.js")), Ue = h.lazy(() => import("./Resource-BnQUE0gx.js"));
function g(i, u, s) {
  fetch(
    /* @vite-ignore */
    `${Se()}/custom/${i}`
  ).then((d) => d.json()).then((d) => {
    u && s(d);
  }).catch((d) => {
    console.error("Loading file failed: ", d);
  });
}
const Ve = ke.div`
    --muted-text-color: ${re({
  enterprise: {
    light: z.gray45,
    dark: z.gray80
  }
})};
`, C = ({
  label: i,
  panelId: u,
  children: s
}) => /* @__PURE__ */ o.jsx(ne.Panel, { label: i, panelId: u, children: /* @__PURE__ */ o.jsx(q, { fallback: /* @__PURE__ */ o.jsx(k, { size: "medium" }), children: s }) });
function Je() {
  const [i, u] = w(null), [s, d] = w(null), [j, n] = w(null), [P, R] = w(null), [b, $] = w(null), p = qe(!0);
  Re(() => (g(
    "panels_to_display.json",
    p.current,
    (T) => {
      T?.default && (g(
        "overview_definition.json",
        p.current,
        u
      ), g(
        "data_ingestion_tab_definition.json",
        p.current,
        d
      ), g("errors_tab_definition.json", p.current, n), g(
        "resources_tab_definition.json",
        p.current,
        R
      )), T?.custom && g("custom.json", p.current, $);
    }
  ), () => {
    p.current = !1;
  }), []);
  const O = Ee();
  return /* @__PURE__ */ o.jsxs(Le, { children: [
    /* @__PURE__ */ o.jsx(We, {}),
    /* @__PURE__ */ o.jsxs(Ve, { children: [
      /* @__PURE__ */ o.jsx(q, { fallback: /* @__PURE__ */ o.jsx(k, { size: "medium" }), children: /* @__PURE__ */ o.jsx(Ne, { dashboardDefinition: i }) }),
      i ? (
        // if overview is loaded then all default tabs should be present so table is injected
        /* @__PURE__ */ o.jsxs(
          ne,
          {
            autoActivate: !0,
            defaultActivePanelId: "dataIngestionTabPanel",
            id: "dashboardTable",
            "data-test": "dashboardTable",
            style: { minHeight: "98vh" },
            children: [
              s && /* @__PURE__ */ o.jsx(C, { label: "Data ingestion", panelId: "dataIngestionTabPanel", children: /* @__PURE__ */ o.jsx(Be, { dashboardDefinition: s }) }),
              j && /* @__PURE__ */ o.jsx(C, { label: "Errors", panelId: "errorsTabPanel", children: /* @__PURE__ */ o.jsx(q, { fallback: /* @__PURE__ */ o.jsx(k, { size: "medium" }), children: /* @__PURE__ */ o.jsx(He, { dashboardDefinition: j }) }) }),
              P && /* @__PURE__ */ o.jsx(C, { label: "Resource consumption", panelId: "resourceTabPanel", children: /* @__PURE__ */ o.jsx(Ue, { dashboardDefinition: P }) }),
              b && /* @__PURE__ */ o.jsx(
                C,
                {
                  label: O.pages.dashboard?.settings?.custom_tab_name || "Custom",
                  panelId: "customTabPanel",
                  children: /* @__PURE__ */ o.jsx(ae, { dashboardDefinition: b })
                }
              )
            ]
          }
        )
      ) : (
        // if overview is null then custom tab is the only displayed component
        // so no need to show table
        /* @__PURE__ */ o.jsx(q, { fallback: /* @__PURE__ */ o.jsx(k, { size: "medium" }), children: /* @__PURE__ */ o.jsx(ae, { dashboardDefinition: b }) })
      ),
      !i && !b ? /* @__PURE__ */ o.jsx(Ce, { size: "medium", "data-testid": "wait-spinner" }) : null
    ] })
  ] });
}
const Qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: Je,
  loadJson: g
}, Symbol.toStringTag, { value: "Module" }));
export {
  Qe as D,
  ne as T
};
