@infinilabs/discover 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
1
  import { o as __toESM, r as __export, t as __commonJSMin } from "./chunk-D-4zIDrl.js";
2
- import { C as BehaviorSubject, E as Subscription, T as operate, _ as onRedirectNoIndexPattern, b as FilterManager, d as baseFormattersPublic, f as getTimezone, g as onUnsupportedTimePattern, h as IndexPatternsApiClient, l as generateFilters, m as SavedObjectsClientPublicToCommon, n as search, p as deserializeFieldFormat, u as createSearchBar, v as TimeHistory, w as createOperatorSubscriber, x as AutocompleteService, y as Timefilter } from "./public-Bt8l4NcG.js";
2
+ import { C as BehaviorSubject, E as Subscription, T as operate, _ as onRedirectNoIndexPattern, b as FilterManager, d as baseFormattersPublic, f as getTimezone, g as onUnsupportedTimePattern, h as IndexPatternsApiClient, l as generateFilters, m as SavedObjectsClientPublicToCommon, n as search, p as deserializeFieldFormat, u as createSearchBar, v as TimeHistory, w as createOperatorSubscriber, x as AutocompleteService, y as Timefilter } from "./public-CZIzm_ir.js";
3
3
  import { a as createHashHistory, c as require_object_assign, d as FieldIcon, i as setIndexPatterns$1, l as require_url, o as _extends, t as getIndexPatterns, u as FieldButton } from "./services-C8UxrSbr.js";
4
4
  import { t as require_classnames } from "./classnames-BCXlvRQ0.js";
5
5
  import { t as require_lodash } from "./lodash-Gv_ptthU.js";
6
6
  import { n as createGetterSetter } from "./common-1_7zA8Zc.js";
7
7
  import { C as intervalOptions$1, K as FilterStateStore, P as FieldFormatsRegistry, S as TimeBuckets, bt as init_moment, k as IndexPatternsService, xt as moment_default, yt as require_moment_timezone, z as buildEsQuery } from "./common-6ueRhcZj.js";
8
8
  import { $ as DEFAULT_FONT_FAMILY, $a as IEnvironmentService, $c as isLowerAsciiLetter, $i as listHighlightForeground, $l as illegalArgument, $n as mapObservableArrayCached, $o as registerEditorCommand, $r as LineTokens, $s as getDomNodePagePosition, $t as FindInput, A as observableCodeEditor, Aa as editorWarningBorder, Ac as disposableTimeout, Ai as renderLabelWithIcons, Al as URI, An as ActionBar, Ao as LRUCache, Ar as WORKSPACE_EXTENSION, As as ICodeEditorService, At as IStandaloneThemeService, Au as isObject, B as diffDeleteDecorationEmpty, Ba as foreground, Bc as commonSuffixLength, Bi as Widget, Bl as PauseableEmitter, Bn as IStorageService, Bo as ILanguageService, Br as EditOperation, Bs as ModifierKeyEmitter, Bt as HighlightedLabel, Bu as groupBy, C as EditorState, Ca as editorInlayHintForeground, Cc as AsyncIterableObject, Ci as fuzzyScoreGracefulAggressive, Cl as TokenizationRegistry, Cn as IMarkerDecorationsService, Co as UnicodeTextModelHighlighter, Cr as GoToLineNLS, Cs as ThemeIcon, Ct as RenderLineInput, Cu as deepClone, D as bindContextKey, Da as editorInlayHintTypeForeground, Dc as TimeoutTimer, Di as matchesWords, Dl as Selection, Dn as IMarkerService, Do as OverviewRulerLane, Dr as QuickOutlineNLS, Ds as toAction, Dt as AccessibilitySignal, Du as isDefined, E as DiffEditorWidget, Ea as editorInlayHintTypeBackground, Ec as RunOnceScheduler, Ei as matchesSubString, El as Codicon, En as IMarkerData, Eo as InjectedTextCursorStops, Er as QuickHelpNLS, Es as SubmenuAction, Et as registerEditorFeature, Eu as assertType, F as isHotReloadEnabled, Fa as overviewRulerSelectionHighlightForeground, Fc as StandardKeyboardEvent, Fi as HoverWidget, Fl as CancellationToken, Fn as defaultCountBadgeStyles, Fo as ILanguageConfigurationService, Fr as TernarySearchTree, Fs as PixelRatio, Ft as registerIcon, Fu as binarySearch, G as DisposableCancellationTokenSource, Ga as transparent, Gc as escapeRegExpCharacters, Gi as IContextMenuService, Gl as RefCountedDisposable, Gn as getBaseLayerHoverDelegate, Go as createTrustedTypesPolicy, Gr as status, Gs as append, Gt as WorkbenchTreeElementCanExpand, Gu as reverseOrder, H as diffLineDeleteDecorationBackgroundWithIndicator, Ha as asCssVariable, Hc as compareIgnoreCase, Hi as Gesture, Hl as Disposable, Hn as isLocalizedString, Ho as StringBuilder, Hr as IBulkEditService, Hs as addDisposableListener, Ht as WorkbenchAsyncDataTree, Hu as isNonEmptyArray, I as IDiffProviderFactoryService, Ia as widgetBorder, Ic as KeyCodeChord, Ii as KeyDownAction, Il as CancellationTokenSource, In as defaultInputBoxStyles, Io as PLAINTEXT_LANGUAGE_ID, Ir as IEditorProgressService, Is as $, It as widgetClose, Iu as coalesce, J as StableEditorScrollState, Ja as ISemanticTokensStylingService, Jc as getLeadingWhitespace, Ji as WorkbenchHoverDelegate, Jl as isDisposable, Jn as DataTransfers, Jo as EditorCommand, Jr as MarkdownRenderer, Js as createStyleSheet2, Jt as IsWindowsContext, K as appendRemoveOnDispose, Ka as score, Kc as firstNonWhitespaceIndex, Ki as IContextViewService, Kl as combinedDisposable, Kn as createInstantHoverDelegate, Ko as EditorAction, Kr as CONTEXT_ACCESSIBILITY_MODE_ENABLED, Ks as clearNode, Kt as InputFocusedContext, L as diffAddDecoration, La as widgetShadow, Lc as isFirefox, Li as getHoverAccessibleViewHint, Ll as cancelOnDispose, Ln as defaultListStyles, Lo as Extensions$1, Lr as IProgressService, Ls as Dimension, Lt as KeybindingLabel, Lu as compareBy, M as reactToChangeWithStore, Ma as editorWidgetBackground, Mc as raceCancellation, Mi as IOpenerService, Ml as dirname$1, Mn as TextOnlyMenuEntryActionViewItem, Mo as SetMap, Mr as isSingleFolderWorkspaceIdentifier, Ms as createDecorator, Mt as HC_LIGHT_THEME_NAME, Mu as isUndefined, N as WorkbenchToolBar, Na as editorWidgetBorder, Nc as timeout, Ni as ClickAction, Nl as sep, Nn as createActionViewItem, No as CharacterSet, Nr as isStandaloneEditorWorkspace, Ns as EditorZoom, Nt as VS_DARK_THEME_NAME, Nu as Permutation, O as observableConfigValue, Oa as editorSelectionBackground, Oc as createCancelableAsyncIterable, Oi as or, Ol as Range, On as MarkerSeverity, Oo as shouldSynchronizeModel, Or as ToggleHighContrastNLS, Os as ITextModelService, Ot as IAccessibilitySignalService, Ou as isFunction, P as readHotReloadableExport, Pa as overviewRulerFindMatchForeground, Pc as StandardMouseEvent, Pi as HoverAction, Pl as KeyChord, Pn as createAndFillInActionBarActions, Po as LcsDiff, Pr as toWorkspaceIdentifier, Ps as applyFontInfo, Pt as VS_LIGHT_THEME_NAME, Pu as asArray, Q as isModelDecorationVisible, Qa as ILanguageFeatureDebounceService, Qc as isLowSurrogate, Qi as listFocusHighlightForeground, Ql as CancellationError, Qn as derivedObservableWithCache, Qo as registerEditorAction, Qr as nullTokenizeEncoded, Qs as getComputedStyle, Qt as Sash, R as diffAddDecorationEmpty, Ra as activeContrastBorder, Rc as InvisibleCharacters, Ri as DomScrollableElement, Rl as Emitter, Rn as defaultToggleStyles, Ro as Mimes, Rr as Progress$1, Rs as EventHelper, Rt as unthemedKeybindingLabelOptions, Ru as distinct, S as isDiffEditor, Sa as editorInlayHintBackground, Sc as matchesSomeScheme, Si as fuzzyScore, Sl as SymbolKinds, Sn as CursorColumns, So as mapFindFirst, Sr as IWorkspaceTrustManagementService, Ss as ICommandService, St as TabFocus, Su as localize2, T as TextModelCancellationTokenSource, Ta as editorInlayHintParameterForeground, Tc as Delayer, Ti as matchesPrefix, Tl as isLocationLink, Tn as overviewRulerRangeHighlight, To as GlyphMarginLane, Tr as QuickCommandNLS, Ts as Separator, Tt as LineDecoration, Tu as assertIsDefined, U as diffWholeLineAddDecoration, Ua as oneOf, Uc as containsRTL, Ui as GlobalPointerMoveMonitor, Ul as DisposableStore, Un as ActionViewItem, Uo as VSBuffer, Ur as ResourceTextEdit, Us as addStandardDisposableGenericMouseDownListener, Ut as WorkbenchListFocusContextKey, Uu as numberComparator, V as diffLineAddDecorationBackgroundWithIndicator, Va as iconForeground, Vc as compare, Vi as EventType, Vl as StopWatch, Vn as WillSaveStateReason, Vo as IConfigurationService, Vr as editorConfigurationBaseNode, Vs as WindowIdleValue, Vt as IListService, Vu as isFalsyOrEmpty, W as diffWholeLineDeleteDecoration, Wa as registerColor, Wc as containsUppercaseCharacter, Wi as IKeybindingService, Wl as MutableDisposable, Wn as List, Wo as IndentAction, Wr as alert, Ws as addStandardDisposableListener, Wt as WorkbenchTreeElementCanCollapse, Wu as quickSelect, X as isModelDecorationInComment, Xa as countEOL, Xc as isFalsyOrWhitespace, Xi as quickInputListFocusForeground, Xl as createSingleCallFunction, Xn as waitForState, Xo as MultiCommand, Xr as NullState, Xs as getActiveElement, Xt as SplitView, Y as CodeEditorWidget, Ya as toMultilineTokens2, Yc as isBasicASCII, Yi as quickInputListFocusBackground, Yl as toDisposable, Yn as ObservablePromise, Yo as EditorExtensionsRegistry, Yr as openLinkFromMarkdown, Ys as getActiveDocument, Yt as Sizing, Z as isModelDecorationInString, Za as TokenMetadata, Zc as isHighSurrogate, Zi as quickInputListFocusIconForeground, Zl as BugIndicatingError, Zn as constObservable, Zo as MultiEditorAction, Zr as nullTokenize, Zs as getClientArea, Zt as OrthogonalEdge, _ as formatDocumentWithSelectedProvider, _a as editorForeground, _c as svgElem, _i as stripIcons, _l as InlineEditTriggerKind, _n as DenseKeyProvider, _o as TextLength, _r as transaction, _s as ContextKeyEqualsExpr, _t as ClipboardEventUtils, _u as isNative, a as MarkerSeverity$1, aa as inputForeground, ac as h, ai as isEmptyMarkdownString, al as stripWildcards, an as Button$1, ao as IThemeService, ar as autorunOpts, as as ITelemetryService, at as getIndentMetadata, au as EditorOptions, b as getCodeEditor, ba as editorInfoBorder, bc as Schemas, bi as anyScore, bl as SelectedSuggestionInfo, bn as lengthZero, bo as findFirstMax, br as itemsEquals, bs as RawContextKey, bt as getColumnOfNodeOffset, bu as language, c as Range$1, ca as editorActiveLinkForeground, cc as isAncestor, ci as basename, cl as mainWindow, cn as ItemActivation, co as isDark, cr as derivedDisposable, cs as MenuId, ct as ProcessedIndentRulesSupport, cu as unicodeHighlightConfigKeys, d as Token$1, da as editorErrorForeground, dc as reset, di as extUri, dl as DocumentHighlightKind, dn as ModelDecorationOptions, do as ITextResourceConfigurationService, dr as derivedWithSetter, ds as SubmenuItemAction, dt as WordPartOperations, du as Iterable, ea as inputActiveOptionBackground, ec as getShadowRoot, ei as getStandardTokenTypeAtPosition, el as isUpperAsciiLetter, en as HistoryInputBox, eo as clamp, er as observableFromEvent, es as registerEditorContribution, et as CoreEditingCommands, eu as isCancellationError, f as Uri, fa as editorFindMatchForeground, fc as runAtThisOrScheduleAtNextAnimationFrame, fi as extname, fl as DocumentPasteTriggerKind, fn as TextModel, fo as Color, fr as derivedWithStore, fs as isIMenuItem, ft as MoveOperations, fu as OS, g as formatDocumentRangesWithSelectedProvider, ga as editorFindRangeHighlightBorder, gc as size, gi as relativePath, gl as InlineCompletionTriggerKind, gn as TextBufferTokenizer, go as TextEdit, gr as subtransaction, gs as assertNever, gt as CursorState, gu as isMacintosh, h as languages, ha as editorFindMatchHighlightForeground, hc as show, hi as originalFSPath, hl as InlayHintKind, hn as LanguageAgnosticBracketTokens, ho as SingleTextEdit, hr as observableValue, hs as Registry, ht as ReplaceCommandThatSelectsText, hu as isLittleEndian, i as KeyMod, ia as inputBorder, ic as getWindow, ii as MarkdownString, il as splitLinesIncludeSeparators, in as CountBadge, io as severity_default, ir as autorun, is as ILogService, it as getGoodIndentForLine, iu as EditorFontLigatures, j as reactToChange, ja as editorWarningForeground, jc as first, ji as DomEmitter, jl as basename$1, jn as MenuEntryActionViewItem, jo as ResourceMap, jr as isEmptyWorkspaceIdentifier, js as IInstantiationService, jt as HC_BLACK_THEME_NAME, ju as isString, k as HideUnchangedRegionsFeature, ka as editorSelectionHighlight, kc as createCancelablePromise, ki as renderIcon, kl as Position$1, kn as IEditorWorkerService, ko as getMapForWordSeparators, kr as IWorkspaceContextService, ks as IModelService, kt as IClipboardService, ku as isNumber, l as Selection$1, la as editorBackground, lc as isHTMLElement, li as basenameOrAuthority, ll as Command, ln as Extensions, lo as isHighContrast, lr as derivedHandleChanges, ls as MenuItemAction, lt as CursorMoveCommands, lu as USUAL_WORD_SEPARATORS, m as editor_api_exports, ma as editorFindMatchHighlightBorder, mc as setVisibility, mi as joinPath, ml as HoverVerbosityAction, mn as parseDocument, mo as RGBA, mr as disposableObservableValue, ms as KeybindingsRegistry, mt as ReplaceCommandThatPreservesSelection, mu as isLinux, n as Emitter$1, na as inputActiveOptionForeground, nc as getTotalHeight, ni as IdGenerator, nl as noBreakWhitespace, nn as RegexToggle, no as Severity, nr as observableSignalFromEvent, ns as registerModelAndPositionCommand, nt as TypeOperations, nu as onUnexpectedExternalError, o as MarkerTag, oa as minimapFindMatch, oc as hide, oi as isMarkdownString, ol as trim, on as Toggle, oo as registerThemingParticipant, or as autorunWithStore, os as Action2, ot as ShiftCommand, ou as ShowLightbulbIconMode, p as editor, pa as editorFindMatchHighlight, pc as runWhenWindowIdle, pi as isEqual, pl as FoldingRangeKind, pn as computeIndentLevel, po as HSVA, pr as asyncTransaction, ps as registerAction2, pt as ReplaceCommand, pu as isIOS, q as applyStyle, qa as hasDriveLetter, qc as format, qi as IHoverService, ql as dispose, qn as getDefaultHoverDelegate, qo as EditorAction2, qr as IAccessibilityService, qs as createCSSRule, qt as IsWebContext, r as KeyCode, ra as inputBackground, rc as getTotalWidth, ri as defaultGenerator, rl as splitLines, rn as WholeWordsToggle, ro as IDialogService, rr as recomputeInitiallyAndOnChange, rs as registerMultiEditorAction, rt as EnterOperation, ru as EDITOR_FONT_DEFAULTS, s as Position$2, sa as minimapSelectionOccurrenceHighlight, sc as isActiveElement, si as DataUri, sl as Lazy, sn as IQuickInputService, so as themeColorFromId, sr as derived, ss as IMenuService, st as getEnterAction, su as inUntrustedWorkspace, t as CancellationTokenSource$1, ta as inputActiveOptionBorder, tc as getTopLeftOffset, ti as renderMarkdown, tl as lastNonWhitespaceIndex, tn as CaseSensitiveToggle, to as INotificationService, tr as observableSignal, ts as registerInstantiatedEditorAction, tt as EditorContextKeys, tu as onUnexpectedError, u as SelectionDirection, ua as editorErrorBorder, uc as removeCSSRulesContainingSelector, ui as dirname, ul as CompletionItemKinds, un as ModelDecorationInjectedTextOptions, uo as ILanguageFeaturesService, ur as derivedOpts, us as MenuRegistry, ut as WordOperations, uu as LinkedList, v as getOnTypeFormattingEdits, va as editorHoverBackground, vc as trackFocus, vi as FuzzyScore, vl as NewSymbolNameTag, vn as lengthAdd, vo as LineRange, vr as equalsIfDefined, vs as ContextKeyExpr, vt as CopyOptions, vu as isWeb, w as EditorStateCancellationTokenSource, wa as editorInlayHintParameterBackground, wc as DeferredPromise, wi as matchesContiguousSubString, wl as getAriaLabelForSymbol, wn as ghostTextForeground, wo as SearchParams, wr as InspectTokensNLS, ws as Action, wt as renderViewLine, wu as mixin, x as isCodeEditor, xa as editorInfoForeground, xc as matchesScheme, xi as createMatches, xl as SignatureHelpTriggerKind, xn as normalizeIndentation, xo as findLast, xr as structuralEquals, xs as CommandsRegistry, xt as DynamicCssRules, xu as localize, y as FormattingEdit, ya as editorHoverBorder, yc as hash, yi as FuzzyScoreOptions, yl as NewSymbolNameTriggerKind, yn as lengthGetColumnCountIfZeroLineCount, yo as findFirstIdxMonotonousOrArrLen, yr as itemEquals, ys as IContextKeyService, yt as InMemoryClipboardMetadataManager, yu as isWindows, z as diffDeleteDecoration, za as contrastBorder, zc as commonPrefixLength, zi as ScrollableElement, zl as Event, zn as getListStyles, zo as registerSingleton, zr as ILabelService, zs as EventType$1, zt as IconLabel, zu as equals } from "./editor.api-B3Kwz8AU.js";
9
- import React, { Component, Fragment, createElement, forwardRef, memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
9
+ import React, { Component, Fragment, createElement, createRef, forwardRef, memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
10
10
  import "@elastic/eui/dist/eui_theme_light.min.css";
11
11
  import { Badge, Button, Card, Empty, Form, Input, InputNumber, Menu, Modal, Popover, Progress, Radio, Select, Space, Spin, Switch, Tabs, Tooltip, Tree, Typography } from "antd";
12
12
  import { EuiCallOut, EuiCodeBlock, EuiFlexGroup, EuiFlexItem, EuiHideFor, EuiIcon, EuiSpacer, EuiTitle, EuiToolTip } from "@elastic/eui";
13
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
14
  import { CarryOutOutlined } from "@ant-design/icons";
15
- import { AnnotationDomainType, Axis, Chart, DARK_THEME, HistogramBarSeries, LIGHT_THEME, LineAnnotation, Position, RectAnnotation, ScaleType, Settings, TooltipType } from "@elastic/charts";
15
+ import { AnnotationDomainType, Axis, Chart, DARK_THEME, HistogramBarSeries, LIGHT_THEME, LineAnnotation, Position, RectAnnotation, ScaleType, Settings, Tooltip as Tooltip$1 } from "@elastic/charts";
16
16
  import lightEuiTheme from "@elastic/eui/dist/eui_theme_light.json";
17
17
  import darkEuiTheme from "@elastic/eui/dist/eui_theme_dark.json";
18
18
  import { appendIconComponentCache } from "@elastic/eui/es/components/icon/icon";
@@ -1085,7 +1085,7 @@ function DiscoverSidebar({ columns: e, fieldCounts: t, hits: n, onAddField: i, o
1085
1085
  children: C.selected_label || "Selected fields"
1086
1086
  }),
1087
1087
  /* @__PURE__ */ jsx("ul", {
1088
- className: "dscSidebarList dscFieldList--selected mb-8px",
1088
+ className: "dscSidebarList dscFieldList--selected mb-8px py-2px",
1089
1089
  "aria-labelledby": "selected_fields",
1090
1090
  children: F.map((t) => /* @__PURE__ */ jsx("li", {
1091
1091
  "data-attr-field": t.name,
@@ -1153,6 +1153,7 @@ function DiscoverSidebar({ columns: e, fieldCounts: t, hits: n, onAddField: i, o
1153
1153
  })] }),
1154
1154
  /* @__PURE__ */ jsx("div", {
1155
1155
  id: "fields-tree-wrapper",
1156
+ className: "py-2px",
1156
1157
  children: /* @__PURE__ */ jsx(Tree, {
1157
1158
  showLine: !1,
1158
1159
  showIcon: !1,
@@ -1270,40 +1271,40 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1270
1271
  function Z(e) {
1271
1272
  return A(e) === m;
1272
1273
  }
1273
- function qZ(e) {
1274
+ function GZ(e) {
1274
1275
  return A(e) === f;
1275
1276
  }
1276
- function JZ(e) {
1277
+ function Q(e) {
1277
1278
  return A(e) === u;
1278
1279
  }
1279
- function YZ(e) {
1280
+ function KZ(e) {
1280
1281
  return typeof e == "object" && !!e && e.$$typeof === n;
1281
1282
  }
1282
- function XZ(e) {
1283
+ function qZ(e) {
1283
1284
  return A(e) === g;
1284
1285
  }
1285
- function ZZ(e) {
1286
+ function JZ(e) {
1286
1287
  return A(e) === a;
1287
1288
  }
1288
- function QZ(e) {
1289
+ function YZ(e) {
1289
1290
  return A(e) === S;
1290
1291
  }
1291
- function $Z(e) {
1292
+ function XZ(e) {
1292
1293
  return A(e) === x;
1293
1294
  }
1294
- function eQ(e) {
1295
+ function ZZ(e) {
1295
1296
  return A(e) === i;
1296
1297
  }
1297
- function Q(e) {
1298
+ function QZ(e) {
1298
1299
  return A(e) === s;
1299
1300
  }
1300
- function tQ(e) {
1301
+ function $Z(e) {
1301
1302
  return A(e) === o;
1302
1303
  }
1303
- function nQ(e) {
1304
+ function eQ(e) {
1304
1305
  return A(e) === y;
1305
1306
  }
1306
- e.AsyncMode = M, e.ConcurrentMode = N, e.ContextConsumer = P, e.ContextProvider = F, e.Element = I, e.ForwardRef = L, e.Fragment = R, e.Lazy = z, e.Memo = B, e.Portal = V, e.Profiler = U, e.StrictMode = W, e.Suspense = G, e.isAsyncMode = J, e.isConcurrentMode = Z, e.isContextConsumer = qZ, e.isContextProvider = JZ, e.isElement = YZ, e.isForwardRef = XZ, e.isFragment = ZZ, e.isLazy = QZ, e.isMemo = $Z, e.isPortal = eQ, e.isProfiler = Q, e.isStrictMode = tQ, e.isSuspense = nQ, e.isValidElementType = O, e.typeOf = A;
1307
+ e.AsyncMode = M, e.ConcurrentMode = N, e.ContextConsumer = P, e.ContextProvider = F, e.Element = I, e.ForwardRef = L, e.Fragment = R, e.Lazy = z, e.Memo = B, e.Portal = V, e.Profiler = U, e.StrictMode = W, e.Suspense = G, e.isAsyncMode = J, e.isConcurrentMode = Z, e.isContextConsumer = GZ, e.isContextProvider = Q, e.isElement = KZ, e.isForwardRef = qZ, e.isFragment = JZ, e.isLazy = YZ, e.isMemo = XZ, e.isPortal = ZZ, e.isProfiler = QZ, e.isStrictMode = $Z, e.isSuspense = eQ, e.isValidElementType = O, e.typeOf = A;
1307
1308
  })();
1308
1309
  })), require_react_is = /* @__PURE__ */ __commonJSMin(((e, t) => {
1309
1310
  process.env.NODE_ENV === "production" ? t.exports = require_react_is_production_min() : t.exports = require_react_is_development();
@@ -1712,26 +1713,55 @@ var partialDataText = "The selected time range does not include this entire buck
1712
1713
  grow: !1,
1713
1714
  children: /* @__PURE__ */ jsx(EuiIcon, { type: "iInCircle" })
1714
1715
  }), /* @__PURE__ */ jsx(EuiFlexItem, { children: partialDataText })]
1715
- });
1716
- const renderEndzoneTooltip = (e, t, n, i, a = !0) => (o) => {
1717
- let s = o.value, u = i ? i(s) : s;
1718
- return t !== void 0 && t > s || n !== void 0 && e !== void 0 && n - e < s ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Prompt, {}), a && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(EuiSpacer, { size: "xs" }), /* @__PURE__ */ jsx("p", { children: u })] })] }) : a ? u : null;
1719
- };
1720
- var import_moment_timezone = /* @__PURE__ */ __toESM(require_moment_timezone(), 1), import_prop_types$1 = /* @__PURE__ */ __toESM(require_prop_types(), 1);
1721
- function getTimezone$1() {
1722
- return import_moment_timezone.default.tz.guess() || (0, import_moment_timezone.default)().format("Z");
1723
- }
1724
- var DiscoverHistogram = class extends Component {
1716
+ }), import_moment_timezone = /* @__PURE__ */ __toESM(require_moment_timezone(), 1), import_prop_types$1 = /* @__PURE__ */ __toESM(require_prop_types(), 1), DiscoverHistogram = class extends Component {
1725
1717
  static propTypes = {
1726
1718
  chartData: import_prop_types$1.default.object,
1727
- timefilterUpdateHandler: import_prop_types$1.default.func
1719
+ timefilterUpdateHandler: import_prop_types$1.default.func,
1720
+ theme: import_prop_types$1.default.string,
1721
+ timeZone: import_prop_types$1.default.string
1722
+ };
1723
+ containerRef = createRef();
1724
+ tooltipCloseTimer = null;
1725
+ TOOLTIP_DELAY = 200;
1726
+ state = {
1727
+ tooltipVisible: !1,
1728
+ tooltipPos: {
1729
+ x: 0,
1730
+ y: 0
1731
+ },
1732
+ pointerEvent: null
1728
1733
  };
1729
- subscription;
1730
- state = {};
1731
- componentDidMount() {}
1732
1734
  componentWillUnmount() {
1733
- this.subscription && this.subscription.unsubscribe();
1734
- }
1735
+ this.tooltipCloseTimer && clearTimeout(this.tooltipCloseTimer);
1736
+ }
1737
+ handleMouseMove = (e) => {
1738
+ if (!this.containerRef.current) return;
1739
+ let t = this.containerRef.current.getBoundingClientRect();
1740
+ this.setState({ tooltipPos: {
1741
+ x: e.clientX - t.left,
1742
+ y: e.clientY - t.top
1743
+ } });
1744
+ };
1745
+ handlePointerUpdate = (e) => {
1746
+ let { chartData: t } = this.props;
1747
+ if (this.tooltipCloseTimer && clearTimeout(this.tooltipCloseTimer), e.type === "Over" && e.x && t?.values) {
1748
+ let n = t.values.find((t) => t.x === e.x);
1749
+ if (n) {
1750
+ let t = {
1751
+ ...e,
1752
+ yValue: n.y
1753
+ };
1754
+ this.setState({
1755
+ pointerEvent: t,
1756
+ tooltipVisible: !0
1757
+ });
1758
+ } else this.tooltipCloseTimer = setTimeout(() => {
1759
+ this.setState({ tooltipVisible: !1 });
1760
+ }, this.TOOLTIP_DELAY);
1761
+ } else this.tooltipCloseTimer = setTimeout(() => {
1762
+ this.setState({ tooltipVisible: !1 });
1763
+ }, this.TOOLTIP_DELAY);
1764
+ };
1735
1765
  onBrushEnd = ({ x: e }) => {
1736
1766
  if (!e) return;
1737
1767
  let [t, n] = e;
@@ -1747,72 +1777,107 @@ var DiscoverHistogram = class extends Component {
1747
1777
  };
1748
1778
  this.props.timefilterUpdateHandler(i);
1749
1779
  };
1750
- formatXValue = (e) => {
1751
- let t = this.props.chartData.xAxisFormat.params?.pattern;
1752
- return (0, import_moment_timezone.default)(e).format(t);
1753
- };
1780
+ formatXValue = (e) => (0, import_moment_timezone.default)(e).format(this.props.chartData.xAxisFormat.params?.pattern);
1781
+ renderCustomTooltip() {
1782
+ let { tooltipVisible: e, tooltipPos: t, pointerEvent: n } = this.state;
1783
+ if (!e || !n) return null;
1784
+ let i = this.containerRef.current?.clientWidth || 0, a = this.containerRef.current?.clientHeight || 0, o = t.x + 180 > i, s = t.y + 80 > a, u = o ? "-100% - 12px" : "12px", f = s ? "-100% - 12px" : "12px";
1785
+ return /* @__PURE__ */ jsxs("div", {
1786
+ className: "absolute z-100 pointer-events-none p-2 rounded-md \n bg-white/98 shadow-[0_6px_16px_0_rgba(0,0,0,0.08),0_3px_6px_-4px_rgba(0,0,0,0.12)] \n w-max min-w-100px dark:bg-[#1f1f1f]",
1787
+ style: {
1788
+ left: `${t.x}px`,
1789
+ top: `${t.y}px`,
1790
+ transform: `translate(calc(${u}), calc(${f}))`,
1791
+ transition: "transform 0.1s cubic-bezier(0.23, 1, 0.32, 1)"
1792
+ },
1793
+ children: [/* @__PURE__ */ jsx("div", {
1794
+ className: "text-[12px] text-black/45 dark:text-white/45 mb-2 leading-none",
1795
+ children: this.formatXValue(n.x)
1796
+ }), /* @__PURE__ */ jsxs("div", {
1797
+ className: "flex justify-between items-center gap-8",
1798
+ children: [/* @__PURE__ */ jsx("div", {
1799
+ className: "flex items-center",
1800
+ children: /* @__PURE__ */ jsx("span", {
1801
+ className: "text-[12px] text-black/85 dark:text-white/85",
1802
+ children: this.props.chartData.yAxisLabel
1803
+ })
1804
+ }), /* @__PURE__ */ jsx("span", {
1805
+ className: "text-[12px] font-600 text-black/85 dark:text-white/85",
1806
+ children: n.yValue?.toLocaleString()
1807
+ })]
1808
+ })]
1809
+ });
1810
+ }
1754
1811
  render() {
1755
- let e = getTimezone$1(), { chartData: t, height: n = 100 } = this.props, { chartsTheme: i, chartsBaseTheme: a } = this.state;
1756
- if (!t) return null;
1757
- let o = t.values, { intervalESValue: s, intervalESUnit: u, interval: f } = t.ordered, p = f.asMilliseconds(), m = t.xAxisOrderedValues, g = m[m.length - 1], y = t.ordered, b = y.min.valueOf(), x = y.max.valueOf(), S = {
1758
- min: Math.min(o[0]?.x, b),
1759
- max: Math.max(x - p, g),
1760
- minInterval: getAdjustedInterval(m, s, u, e)
1761
- }, C = {
1762
- headerFormatter: renderEndzoneTooltip(p, b, x, this.formatXValue),
1763
- type: TooltipType.VerticalCursor
1764
- }, w = { convert: (e) => e };
1765
- return /* @__PURE__ */ jsxs(Chart, {
1766
- size: { height: n },
1767
- children: [
1768
- /* @__PURE__ */ jsx(Settings, {
1769
- xDomain: S,
1770
- onBrushEnd: this.onBrushEnd,
1771
- onElementClick: this.onElementClick(p),
1772
- tooltip: C,
1773
- theme: this.props.theme === "dark" ? DARK_THEME : LIGHT_THEME
1774
- }),
1775
- /* @__PURE__ */ jsx(Axis, {
1776
- id: "discover-histogram-left-axis",
1777
- position: Position.Left,
1778
- ticks: 5,
1779
- title: t.yAxisLabel,
1780
- integersOnly: !0,
1781
- tickFormat: (e) => w.convert(e),
1782
- showGridLines: !0,
1783
- hide: !0
1784
- }),
1785
- /* @__PURE__ */ jsx(Axis, {
1786
- id: "discover-histogram-bottom-axis",
1787
- position: Position.Bottom,
1788
- tickFormat: this.formatXValue,
1789
- ticks: 10,
1790
- hide: !0
1791
- }),
1792
- /* @__PURE__ */ jsx(CurrentTime, {
1793
- isDarkMode: !1,
1794
- domainEnd: x
1795
- }),
1796
- /* @__PURE__ */ jsx(Endzones, {
1797
- isDarkMode: !1,
1798
- domainStart: b,
1799
- domainEnd: x,
1800
- interval: S.minInterval,
1801
- domainMin: S.min,
1802
- domainMax: S.max
1803
- }),
1804
- /* @__PURE__ */ jsx(HistogramBarSeries, {
1805
- id: "discover-histogram",
1806
- minBarHeight: 2,
1807
- xScaleType: ScaleType.Time,
1808
- yScaleType: ScaleType.Linear,
1809
- xAccessor: "x",
1810
- yAccessors: ["y"],
1811
- data: o,
1812
- timeZone: e,
1813
- name: t.yAxisLabel
1814
- })
1815
- ]
1812
+ let { timeZone: e, theme: t, chartData: n, height: i = 100 } = this.props;
1813
+ if (!n) return null;
1814
+ let a = n.values, o = t === "dark", { interval: s } = n.ordered, u = s.asMilliseconds(), f = n.ordered, p = f.min.valueOf(), m = f.max.valueOf(), g = {
1815
+ min: Math.min(a[0]?.x, p),
1816
+ max: Math.max(m - u, n.xAxisOrderedValues[n.xAxisOrderedValues.length - 1]),
1817
+ minInterval: getAdjustedInterval(n.xAxisOrderedValues, n.ordered.intervalESValue, n.ordered.intervalESUnit, e)
1818
+ }, y = { convert: (e) => e };
1819
+ return /* @__PURE__ */ jsxs("div", {
1820
+ ref: this.containerRef,
1821
+ className: "relative w-full h-full",
1822
+ onMouseMove: this.handleMouseMove,
1823
+ onMouseLeave: () => {
1824
+ this.tooltipCloseTimer && clearTimeout(this.tooltipCloseTimer), this.tooltipCloseTimer = setTimeout(() => {
1825
+ this.setState({ tooltipVisible: !1 });
1826
+ }, this.TOOLTIP_DELAY);
1827
+ },
1828
+ children: [this.renderCustomTooltip(p, m, u), /* @__PURE__ */ jsxs(Chart, {
1829
+ size: { height: i },
1830
+ children: [
1831
+ /* @__PURE__ */ jsx(Settings, {
1832
+ xDomain: g,
1833
+ onBrushEnd: this.onBrushEnd,
1834
+ onElementClick: this.onElementClick(u),
1835
+ theme: o ? DARK_THEME : LIGHT_THEME,
1836
+ onPointerUpdate: this.handlePointerUpdate
1837
+ }),
1838
+ /* @__PURE__ */ jsx(Tooltip$1, { customTooltip: () => null }),
1839
+ /* @__PURE__ */ jsx(Axis, {
1840
+ id: "discover-histogram-left-axis",
1841
+ position: Position.Left,
1842
+ ticks: 5,
1843
+ title: n.yAxisLabel,
1844
+ integersOnly: !0,
1845
+ tickFormat: (e) => y.convert(e),
1846
+ showGridLines: !0,
1847
+ hide: !0
1848
+ }),
1849
+ /* @__PURE__ */ jsx(Axis, {
1850
+ id: "discover-histogram-bottom-axis",
1851
+ position: Position.Bottom,
1852
+ tickFormat: this.formatXValue,
1853
+ ticks: 10,
1854
+ hide: !0
1855
+ }),
1856
+ /* @__PURE__ */ jsx(CurrentTime, {
1857
+ isDarkMode: o,
1858
+ domainEnd: m
1859
+ }),
1860
+ /* @__PURE__ */ jsx(Endzones, {
1861
+ isDarkMode: o,
1862
+ domainStart: p,
1863
+ domainEnd: m,
1864
+ interval: g.minInterval,
1865
+ domainMin: g.min,
1866
+ domainMax: g.max
1867
+ }),
1868
+ /* @__PURE__ */ jsx(HistogramBarSeries, {
1869
+ id: "discover-histogram",
1870
+ minBarHeight: 2,
1871
+ xScaleType: ScaleType.Time,
1872
+ yScaleType: ScaleType.Linear,
1873
+ xAccessor: "x",
1874
+ yAccessors: ["y"],
1875
+ data: a,
1876
+ timeZone: e,
1877
+ name: n.yAxisLabel
1878
+ })
1879
+ ]
1880
+ })]
1816
1881
  });
1817
1882
  }
1818
1883
  }, QueryStringManager = class {
@@ -2197,7 +2262,8 @@ var import_lodash$7 = require_lodash(), import_url$1 = require_url(), JSON_CONTE
2197
2262
  }, renameKeys = (e, t) => Object.keys(t).reduce((n, i) => ({
2198
2263
  ...n,
2199
2264
  [e[i] || i]: t[i]
2200
- }), {}), timeBucketConfig = {
2265
+ }), {});
2266
+ const timeBucketConfig = {
2201
2267
  "histogram:maxBars": 100,
2202
2268
  "histogram:barTarget": 50,
2203
2269
  dateFormat: "YYYY-MM-DD",
@@ -2209,7 +2275,8 @@ var import_lodash$7 = require_lodash(), import_url$1 = require_url(), JSON_CONTE
2209
2275
  ["P1DT", "YYYY-MM-DD"],
2210
2276
  ["P1YT", "YYYY"]
2211
2277
  ]
2212
- }, basePath = {
2278
+ };
2279
+ var basePath = {
2213
2280
  get: () => "",
2214
2281
  prepend: (e) => e,
2215
2282
  remove: (e) => e,
@@ -2305,7 +2372,8 @@ var indexPatternsApiClient = new IndexPatternsApiClient(http$1), uiconfigs = {
2305
2372
  };
2306
2373
  remove = (e) => this.store.removeItem(e);
2307
2374
  clear = () => this.store.clear();
2308
- }, filterManager$1 = new FilterManager(), storage$1 = new Storage(localStorage), queryStringManager$1 = new QueryStringManager(storage$1), timefilter$1 = new Timefilter({
2375
+ }, filterManager$1 = new FilterManager(), storage$1 = new Storage(localStorage), queryStringManager$1 = new QueryStringManager(storage$1);
2376
+ const timefilterConfig = {
2309
2377
  timeDefaults: {
2310
2378
  from: "",
2311
2379
  to: ""
@@ -2314,7 +2382,8 @@ var indexPatternsApiClient = new IndexPatternsApiClient(http$1), uiconfigs = {
2314
2382
  pause: !0,
2315
2383
  value: 1e4
2316
2384
  }
2317
- }, new TimeHistory(storage$1)), getTimeBuckets$1 = (e) => {
2385
+ };
2386
+ var timefilter$1 = new Timefilter(timefilterConfig, new TimeHistory(storage$1)), getTimeBuckets$1 = (e) => {
2318
2387
  let t = timefilter$1.getBounds();
2319
2388
  if (t.max && t.min) {
2320
2389
  let n = new TimeBuckets(timeBucketConfig);
@@ -2349,20 +2418,24 @@ const getContext = () => ({
2349
2418
  var getEsQuery$1 = (e) => {
2350
2419
  let t = timefilter$1.createFilter(e);
2351
2420
  return buildEsQuery(e, queryStringManager$1.getQuery(), [...filterManager$1.getFilters(), ...t ? [t] : []]);
2352
- }, getSearchParams$1 = (e, t, n, i, a, o, s, u = 20) => {
2353
- let f = getTimeBuckets$1(t)?.getInterval(!0).expression, p = e.timeFieldName ? [{ [e.timeFieldName]: { order: "desc" } }] : [];
2354
- n && (p = n.reduce((e, t) => {
2421
+ }, getSearchParams$1 = (e, t, n, i, a, o, s, u = 20, f) => {
2422
+ let p = getTimeBuckets$1(t)?.getInterval(!0).expression, m = e.timeFieldName ? [{ [e.timeFieldName]: { order: "desc" } }] : [];
2423
+ n && (m = n.reduce((e, t) => {
2355
2424
  let [n, i] = t;
2356
2425
  return e.push({ [n]: { order: i } }), e;
2357
2426
  }, []));
2358
- let m = {};
2359
- f && (m.counts = { date_histogram: {
2360
- [f.includes("w") || f.includes("d") || f.includes("y") || f.includes("M") ? "calendar_interval" : "fixed_interval"]: f,
2427
+ let g = {};
2428
+ e.timeFieldName && (p ? g.counts = { date_histogram: {
2429
+ [p.includes("w") || p.includes("d") || p.includes("y") || p.includes("M") ? "calendar_interval" : "fixed_interval"]: p,
2361
2430
  field: e.timeFieldName,
2362
2431
  min_doc_count: 1,
2363
- time_zone: "Asia/Shanghai"
2432
+ time_zone: f
2433
+ } } : g.counts = { auto_date_histogram: {
2434
+ field: e.timeFieldName,
2435
+ buckets: 10,
2436
+ time_zone: f
2364
2437
  } });
2365
- let g = {
2438
+ let y = {
2366
2439
  index: e.index || e.title,
2367
2440
  body: {
2368
2441
  query: getEsQuery$1(e),
@@ -2373,10 +2446,10 @@ var getEsQuery$1 = (e) => {
2373
2446
  post_tags: ["@/highlighted-field@"],
2374
2447
  fields: { "*": {} }
2375
2448
  },
2376
- sort: p
2449
+ sort: m
2377
2450
  }
2378
2451
  };
2379
- return e.timeFieldName && (g.body.aggs = m), i && (g.body.aggs = i), a?.field && a?.enabled && (g.distinct_by_field = a), s && (g.body.track_total_hits = s), g;
2452
+ return e.timeFieldName && (y.body.aggs = g), i && (y.body.aggs = i), a?.field && a?.enabled && (y.distinct_by_field = a), s && (y.body.track_total_hits = s), y;
2380
2453
  }, fetchESRequest$1 = (e, t, n) => {}, import_prop_types = /* @__PURE__ */ __toESM(require_prop_types(), 1), DiscoverNoResultsUI = class extends Component {
2381
2454
  static propTypes = { timeFieldName: import_prop_types.default.string };
2382
2455
  render() {
@@ -3091,25 +3164,25 @@ function highlight_default(e, t) {
3091
3164
  numberStyle: A,
3092
3165
  startingLineNumber: T,
3093
3166
  codeString: W
3094
- }) : null, Z = s.hljs || s["pre[class*=\"language-\"]"] || { backgroundColor: "#fff" }, qZ = isHighlightJs(G) ? "hljs" : "prismjs", JZ = y ? Object.assign({}, K, { style: Object.assign({}, Z, f) }) : Object.assign({}, K, {
3095
- className: K.className ? `${qZ} ${K.className}` : qZ,
3167
+ }) : null, Z = s.hljs || s["pre[class*=\"language-\"]"] || { backgroundColor: "#fff" }, GZ = isHighlightJs(G) ? "hljs" : "prismjs", Q = y ? Object.assign({}, K, { style: Object.assign({}, Z, f) }) : Object.assign({}, K, {
3168
+ className: K.className ? `${GZ} ${K.className}` : GZ,
3096
3169
  style: Object.assign({}, f)
3097
3170
  });
3098
- if (P ? m.style = _objectSpread({ whiteSpace: "pre-wrap" }, m.style) : m.style = _objectSpread({ whiteSpace: "pre" }, m.style), !G) return /* @__PURE__ */ React.createElement(z, JZ, J, /* @__PURE__ */ React.createElement(V, m, W));
3171
+ if (P ? m.style = _objectSpread({ whiteSpace: "pre-wrap" }, m.style) : m.style = _objectSpread({ whiteSpace: "pre" }, m.style), !G) return /* @__PURE__ */ React.createElement(z, Q, J, /* @__PURE__ */ React.createElement(V, m, W));
3099
3172
  (M === void 0 && L || P) && (M = !0), L ||= defaultRenderer;
3100
- var YZ = [{
3173
+ var KZ = [{
3101
3174
  type: "text",
3102
3175
  value: W
3103
- }], XZ = getCodeTree({
3176
+ }], qZ = getCodeTree({
3104
3177
  astGenerator: G,
3105
3178
  language: i,
3106
3179
  code: W,
3107
- defaultCodeValue: YZ
3180
+ defaultCodeValue: KZ
3108
3181
  });
3109
- XZ.language === null && (XZ.value = YZ);
3110
- var ZZ = T + (W.match(/\n/g)?.length ?? 0), QZ = processLines(XZ, M, I, x, C, T, ZZ, A, P);
3111
- return /* @__PURE__ */ React.createElement(z, JZ, /* @__PURE__ */ React.createElement(V, m, !C && J, L({
3112
- rows: QZ,
3182
+ qZ.language === null && (qZ.value = KZ);
3183
+ var JZ = T + (W.match(/\n/g)?.length ?? 0), YZ = processLines(qZ, M, I, x, C, T, JZ, A, P);
3184
+ return /* @__PURE__ */ React.createElement(z, Q, /* @__PURE__ */ React.createElement(V, m, !C && J, L({
3185
+ rows: YZ,
3113
3186
  stylesheet: s,
3114
3187
  useInlineStyles: y
3115
3188
  })));
@@ -20997,7 +21070,7 @@ var pageCount = 20, table_default = React.memo(({ columns: e, hits: t, sortOrder
20997
21070
  });
20998
21071
  });
20999
21072
  init_moment();
21000
- var Info_default = ({ bucketInterval: e, dateFormat: t = "YYYY-MM-DD H:mm", timeRange: n, stateInterval: i, total: a, took: o }) => {
21073
+ var Info_default = ({ bucketInterval: e, dateFormat: t = "YYYY-MM-DD HH:mm:ss", timeRange: n, stateInterval: i, total: a, took: o }) => {
21001
21074
  let { i18n: s } = useContext(GlobalConfigContext), u = s?.result || {}, [f, p] = useState(i), m = useCallback((e) => e ? t ? moment_default(e).format(t) : e : "", [t]);
21002
21075
  return useEffect(() => {
21003
21076
  p(i);
@@ -51573,53 +51646,53 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51573
51646
  store: FilterStateStore.APP_STATE
51574
51647
  })));
51575
51648
  }, []);
51576
- let [O, A] = useState({
51649
+ let [A, M] = useState({
51577
51650
  columns: s.columns || ["_source"],
51578
51651
  interval: "15s",
51579
51652
  sort: s.sort || []
51580
- }), M = {
51653
+ }), N = {
51581
51654
  type: "string",
51582
51655
  field: "",
51583
51656
  enabled: !1
51584
- }, [N, P] = React.useState(M), F = (e) => {
51585
- P({
51586
- ...N,
51657
+ }, [P, F] = React.useState(N), I = (e) => {
51658
+ F({
51659
+ ...P,
51587
51660
  ...e
51588
51661
  });
51589
51662
  };
51590
51663
  useMemo(() => {
51591
- P({
51592
- ...N,
51593
- type: M.type,
51594
- field: M.field
51664
+ F({
51665
+ ...P,
51666
+ type: N.type,
51667
+ field: N.field
51595
51668
  });
51596
51669
  }, [t]), useEffect(() => {
51597
- if (t) if (P({
51598
- ...N,
51599
- type: M.type,
51600
- field: M.field
51670
+ if (t) if (F({
51671
+ ...P,
51672
+ type: N.type,
51673
+ field: N.field
51601
51674
  }), t?.timeFieldName) {
51602
51675
  let e = [[t?.timeFieldName, "desc"]];
51603
- A({
51604
- ...O,
51676
+ M({
51677
+ ...A,
51605
51678
  columns: ["_source"],
51606
51679
  sort: e
51607
- }), B({ sort: e });
51608
- } else A({
51609
- ...O,
51680
+ }), V({ sort: e });
51681
+ } else M({
51682
+ ...A,
51610
51683
  columns: ["_source"],
51611
51684
  sort: []
51612
- }), B({ sort: [] });
51685
+ }), V({ sort: [] });
51613
51686
  }, [t]);
51614
- let I = useMemo(() => {
51687
+ let L = useMemo(() => {
51615
51688
  let e = new Subscription();
51616
51689
  return e.add(timefilter.getAutoRefreshFetch$().subscribe({ next: () => {
51617
- B();
51690
+ V();
51618
51691
  } })), e;
51619
- }, [t]), [L, R] = React.useState(0), z = O.columns, B = useCallback(async (e) => {
51692
+ }, [t]), [R, z] = React.useState(0), B = A.columns, V = useCallback(async (e) => {
51620
51693
  if (!t || !o) return;
51621
- G((e) => e === "next" ? e : "loading"), e?.isScrollLoad || R(0);
51622
- let n = e?.sort || O.sort, i = getSearchParams(t, e?.interval || O.interval, e?.sort || O.sort, e?.aggs || null, N || {}, e?.isScrollLoad ? L : 0, !1), a = (0, import_lodash.cloneDeep)(i?.body?.query?.bool?.filter || []);
51694
+ J((e) => e === "next" ? e : "loading"), e?.isScrollLoad || z(0);
51695
+ let n = e?.sort || A.sort, i = getSearchParams(t, e?.interval || A.interval, e?.sort || A.sort, e?.aggs || null, P || {}, e?.isScrollLoad ? R : 0, !1, 20, S), a = (0, import_lodash.cloneDeep)(i?.body?.query?.bool?.filter || []);
51623
51696
  if (a.length > 0) {
51624
51697
  let t = a[a.length - 1];
51625
51698
  t?.hasOwnProperty("range") && (e?.rangeFilter ? (a[a.length - 1] = (0, import_lodash.cloneDeep)(e?.rangeFilter), i.body.query.bool.filter = a) : E.current = t);
@@ -51627,8 +51700,8 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51627
51700
  let { index: f, body: p } = i, m = await o(f, p);
51628
51701
  (!m || !m.hits) && (m.hits = { hits: [] }), T(m);
51629
51702
  let { query: g } = queryStringManager.getQuery(), y = filterManager.getFilters();
51630
- u((e) => ({
51631
- ...e,
51703
+ u({
51704
+ ...s,
51632
51705
  query: g == s.query ? s.query : g,
51633
51706
  range: [timefilter._time?.from, timefilter._time?.to],
51634
51707
  sort: n,
@@ -51640,61 +51713,80 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51640
51713
  query: n
51641
51714
  };
51642
51715
  })
51643
- }));
51716
+ });
51644
51717
  }, [
51645
- O.interval,
51646
- O.sort,
51718
+ A.interval,
51719
+ A.sort,
51647
51720
  t,
51648
- N,
51649
- L,
51721
+ P,
51722
+ R,
51650
51723
  t?.timeFieldName,
51651
- s
51724
+ s,
51725
+ S
51652
51726
  ]);
51653
51727
  useEffect(() => {
51654
- L > 0 && B({
51728
+ R > 0 && V({
51655
51729
  isScrollLoad: !0,
51656
51730
  rangeFilter: E.current
51657
51731
  });
51658
- }, [L]), useEffect(() => {
51659
- isFrist ? isFrist = !isFrist : B();
51732
+ }, [R]), useEffect(() => {
51733
+ isFrist ? isFrist = !isFrist : V();
51660
51734
  }, [e.indices]);
51661
- let V = useCallback((e) => {
51662
- e && A({
51663
- ...O,
51735
+ let U = (e) => {
51736
+ e && M({
51737
+ ...A,
51664
51738
  interval: e
51665
51739
  });
51666
- }, [A, t]), [U, G] = useState("loading"), { histogramData: K, timeChartProps: J } = useMemo(() => {
51667
- if (!w.hits.hits || w.hits.hits.length == 0) return G("none"), {};
51668
- if (!t?.timeFieldName || !w.aggregations || !w.aggregations.counts) return G("ready"), {
51740
+ }, [G, J] = useState("loading"), { histogramData: Z, timeChartProps: Q } = useMemo(() => {
51741
+ if (!w.hits.hits || w.hits.hits.length == 0) return J("none"), {};
51742
+ if (!t?.timeFieldName || !w.aggregations || !w.aggregations.counts) return J("ready"), {
51669
51743
  histogramData: null,
51670
51744
  timeChartProps: null
51671
51745
  };
51672
- let e = getTimeBuckets(O.interval), n = e.getInterval(!0), i = {
51746
+ let e = [];
51747
+ w.aggregations.counts.buckets.forEach((t) => {
51748
+ e.push(t);
51749
+ });
51750
+ let n, i = getTimeBuckets(A.interval);
51751
+ if (i) n = timefilter;
51752
+ else {
51753
+ let t = e[0]?.key, a = e[e.length - 1]?.key;
51754
+ if (t && a) {
51755
+ n = new Timefilter(timefilterConfig, new Storage(localStorage)), n.setTime({
51756
+ from: moment_default(t).toISOString(),
51757
+ to: moment_default(a).toISOString(),
51758
+ mode: "absolute"
51759
+ });
51760
+ let e = n.getBounds(), o = new TimeBuckets(timeBucketConfig);
51761
+ o.setBounds(e), o.setInterval(w.aggregations.counts.interval), i = o;
51762
+ }
51763
+ }
51764
+ if (!i) return J("ready"), {
51765
+ histogramData: null,
51766
+ timeChartProps: null
51767
+ };
51768
+ let a = i.getInterval(!0), o = {
51673
51769
  columns: [{
51674
51770
  id: "key",
51675
- name: `${t?.getTimeField().displayName} per ${n.description}`
51771
+ name: `${t?.getTimeField().displayName} per ${a.description}`
51676
51772
  }, {
51677
51773
  id: "doc_count",
51678
51774
  name: "count"
51679
51775
  }],
51680
- rows: []
51681
- };
51682
- w.aggregations.counts.buckets.forEach((e) => {
51683
- i.rows.push(e);
51684
- });
51685
- let a = {
51776
+ rows: e
51777
+ }, s = {
51686
51778
  x: {
51687
51779
  accessor: 0,
51688
51780
  format: {
51689
51781
  id: "date",
51690
- params: { pattern: e.getScaledDateFormat() }
51782
+ params: { pattern: i.getScaledDateFormat() }
51691
51783
  },
51692
51784
  params: {
51693
51785
  date: !0,
51694
- interval: moment_default.duration(n.esValue, n.esUnit),
51695
- intervalESValue: n.esValue,
51696
- intervalESUnit: n.esUnit,
51697
- bounds: e.getBounds()
51786
+ interval: moment_default.duration(a.esValue, a.esUnit),
51787
+ intervalESValue: a.esValue,
51788
+ intervalESUnit: a.esUnit,
51789
+ bounds: i.getBounds()
51698
51790
  }
51699
51791
  },
51700
51792
  y: {
@@ -51703,67 +51795,67 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51703
51795
  label: "Count"
51704
51796
  }
51705
51797
  };
51706
- G("ready");
51707
- let o = {
51798
+ J("ready");
51799
+ let u = {
51708
51800
  timeRange: {
51709
- from: timefilter.getBounds().min,
51710
- to: timefilter.getBounds().max
51801
+ from: n?.getBounds().min,
51802
+ to: n?.getBounds().max
51711
51803
  },
51712
- stateInterval: O.interval || "15s",
51804
+ stateInterval: A.interval || w.aggregations.counts.interval || "15s",
51713
51805
  options: intervalOptions,
51714
- onIntervalChange: V,
51806
+ onIntervalChange: U,
51715
51807
  bucketInterval: {
51716
- ...n,
51808
+ ...a,
51717
51809
  timeFieldName: t?.timeFieldName
51718
51810
  }
51719
51811
  };
51720
51812
  return {
51721
- histogramData: buildPointSeriesData(i, a),
51722
- timeChartProps: o
51813
+ histogramData: buildPointSeriesData(o, s),
51814
+ timeChartProps: u
51723
51815
  };
51724
51816
  }, [
51725
51817
  w,
51726
51818
  t,
51727
51819
  t?.timeFieldName,
51728
- O.interval
51820
+ A.interval
51729
51821
  ]);
51730
51822
  useEffect(() => {
51731
51823
  u((e) => ({
51732
51824
  ...e,
51733
- columns: O.columns
51825
+ columns: A.columns
51734
51826
  }));
51735
- }, [O.columns]);
51736
- let { onAddColumn: Z, onRemoveColumn: JZ, onMoveColumn: YZ, onSetColumns: XZ } = useMemo(() => getStateColumnActions({
51827
+ }, [A.columns]);
51828
+ let { onAddColumn: KZ, onRemoveColumn: qZ, onMoveColumn: JZ, onSetColumns: YZ } = useMemo(() => getStateColumnActions({
51737
51829
  indexPattern: t,
51738
- setAppState: A,
51739
- state: O,
51830
+ setAppState: M,
51831
+ state: A,
51740
51832
  useNewFieldsApi: !1
51741
- }), [t, O]), ZZ = useCallback((e) => {
51742
- A({
51743
- ...O,
51833
+ }), [t, A]), XZ = useCallback((e) => {
51834
+ M({
51835
+ ...A,
51744
51836
  sort: e
51745
- }), B({ sort: e.reverse() });
51746
- }, [O, t]), QZ = useCallback((e, n, i) => {
51837
+ }), V({ sort: e.reverse() });
51838
+ }, [A, t]), ZZ = useCallback((e, n, i) => {
51747
51839
  typeof e == "string" || e.name;
51748
51840
  let a = generateFilters(filterManager, e, n, i, String(t.id));
51749
- filterManager.addFilters(a), B();
51750
- }, [t, B]), $Z = useCallback((e) => {
51841
+ filterManager.addFilters(a), V();
51842
+ }, [t, V]), QZ = (e) => {
51751
51843
  timefilter.setTime({
51752
51844
  from: moment_default(e.from).toISOString(),
51753
51845
  to: moment_default(e.to).toISOString(),
51754
51846
  mode: "absolute"
51755
- }), B();
51756
- }, [timefilter]), eQ = w.hits.hits || [], [Q, tQ] = useState([]);
51847
+ }), V();
51848
+ }, $Z = w.hits.hits || [], [eQ, tQ] = useState([]);
51757
51849
  useMemo(() => {
51758
- eQ.length > 0 ? tQ(L > 0 ? (e) => [...e, ...eQ] : eQ) : L === 0 && tQ([]);
51759
- }, [eQ]);
51850
+ $Z.length > 0 ? tQ(R > 0 ? (e) => [...e, ...$Z] : $Z) : R === 0 && tQ([]);
51851
+ }, [$Z]);
51760
51852
  let nQ = {
51761
51853
  savedSearch: {},
51762
51854
  timefield: t?.getTimeField()?.displayName,
51763
51855
  chartAggConfigs: {}
51764
51856
  }, rQ = {};
51765
- for (let e of Q) for (let n of Object.keys(t.flattenHit(e, !0))) rQ[n] = (rQ[n] || 0) + 1;
51766
- let iQ = Number.isInteger(w.hits.total?.value) ? w.hits.total?.value : 0, aQ = t?.timeFieldName != "", oQ = useCallback(async ({ _index: e, _id: t, _type: n, _source: i, is_new: a }) => !1, [B]), sQ = useCallback(async ({ _index: e, _id: t, _type: n }) => !1, [B]), cQ = useMemo(() => ({
51857
+ for (let e of eQ) for (let n of Object.keys(t.flattenHit(e, !0))) rQ[n] = (rQ[n] || 0) + 1;
51858
+ let iQ = Number.isInteger(w.hits.total?.value) ? w.hits.total?.value : 0, aQ = t?.timeFieldName != "", oQ = useCallback(async ({ _index: e, _id: t, _type: n, _source: i, is_new: a }) => !1, [V]), sQ = useCallback(async ({ _index: e, _id: t, _type: n }) => !1, [V]), cQ = useMemo(() => ({
51767
51859
  saveDocument: oQ,
51768
51860
  deleteDocument: sQ
51769
51861
  }), [oQ, sQ]), lQ = async (e, n, i) => {
@@ -51792,7 +51884,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51792
51884
  size: s.topNumber || 5,
51793
51885
  shard_size: 25
51794
51886
  } }
51795
- }, f = getSearchParams(t, O.interval, O.sort, u, N || {}, 0, !0, 0), p = f?.body?.query?.bool?.filter || [];
51887
+ }, f = getSearchParams(t, A.interval, A.sort, u, P || {}, 0, !0, 0, S), p = f?.body?.query?.bool?.filter || [];
51796
51888
  if (p.length > 0 && E.current) {
51797
51889
  let e = p[p.length - 1], t = (0, import_lodash.cloneDeep)(E.current);
51798
51890
  e?.hasOwnProperty("range") ? (p[p.length - 1] = t, f.body.query.bool.filter = p) : p.push(t), f.body.query.bool.filter = p;
@@ -51803,18 +51895,18 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51803
51895
  i(e || [], t || 0, y?.error);
51804
51896
  }
51805
51897
  }, uQ = async (e) => {
51806
- I.unsubscribe(), t.timeFieldName = e, n(t);
51898
+ L.unsubscribe(), t.timeFieldName = e, n(t);
51807
51899
  let i = [[e, "desc"]];
51808
- A({
51809
- ...O,
51900
+ M({
51901
+ ...A,
51810
51902
  columns: ["_source"],
51811
51903
  sort: i
51812
- }), B({ sort: i });
51904
+ }), V({ sort: i });
51813
51905
  }, dQ = async (e, n, i) => {
51814
51906
  if (!o) return;
51815
- G("downloading");
51816
- let { index: a, body: s } = getSearchParams(t, O.interval, O.sort, null, N || {}, e, !1, n), u = await o(a, s), f = Array.isArray(u?.hits?.hits) ? u?.hits?.hits : [], p = t.timeFieldName;
51817
- i?.(f, z, p), G("ready");
51907
+ J("downloading");
51908
+ let { index: a, body: s } = getSearchParams(t, A.interval, A.sort, null, P || {}, e, !1, n, S), u = await o(a, s), f = Array.isArray(u?.hits?.hits) ? u?.hits?.hits : [], p = t.timeFieldName;
51909
+ i?.(f, B, p), J("ready");
51818
51910
  };
51819
51911
  return /* @__PURE__ */ jsxs(Card, {
51820
51912
  className: "h-full",
@@ -51840,32 +51932,32 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51840
51932
  queryString: queryStringManager,
51841
51933
  timefilter,
51842
51934
  storage,
51843
- onQuerySubmit: B,
51935
+ onQuerySubmit: V,
51844
51936
  services,
51845
51937
  dateRangeFrom: s.range && s.range[0],
51846
51938
  dateRangeTo: s.range && s.range[1],
51847
51939
  selectedIndexPattern: t,
51848
51940
  setIndexPattern: (e) => {
51849
- I.unsubscribe(), i(e);
51941
+ L.unsubscribe(), i(e);
51850
51942
  },
51851
51943
  indices: e.indices,
51852
- histogramData: K,
51853
- timefilterUpdateHandler: $Z,
51944
+ histogramData: Z,
51945
+ timefilterUpdateHandler: QZ,
51854
51946
  histogramOpts: nQ,
51855
51947
  timeSetting: {
51856
- ...J || {},
51948
+ ...Q || {},
51857
51949
  showTimeSetting: !0,
51858
51950
  showTimeField: !0,
51859
51951
  timeField: t.timeFieldName,
51860
51952
  timeFields: t.fields.filter((e) => e.spec.type === "date").map((e) => e.displayName),
51861
51953
  showTimeInterval: !1,
51862
- timeInterval: J?.stateInterval,
51954
+ timeInterval: Q?.stateInterval,
51863
51955
  timeIntervals: intervalOptions?.map(({ display: e, val: t }) => ({
51864
51956
  label: e,
51865
51957
  value: t
51866
51958
  })),
51867
51959
  onTimeSettingChange: ({ timeField: e, timeInterval: n }) => {
51868
- t.timeFieldName !== e && uQ(e), J?.stateInterval !== n && V(n);
51960
+ t.timeFieldName !== e && uQ(e), Q?.stateInterval !== n && U(n);
51869
51961
  },
51870
51962
  timeZone: S,
51871
51963
  onTimeZoneChange: C,
@@ -51877,27 +51969,27 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51877
51969
  className: "flex-1 min-h-0 relative",
51878
51970
  children: /* @__PURE__ */ jsx("div", {
51879
51971
  className: "absolute inset-0 flex border-t border-t-solid border-[var(--ant-color-border)]",
51880
- children: U === "none" && L === 0 ? /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(DiscoverNoResults, {
51972
+ children: G === "none" && R === 0 ? /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(DiscoverNoResults, {
51881
51973
  timeFieldName: nQ.timefield,
51882
- queryLanguage: O.query?.language || "",
51974
+ queryLanguage: A.query?.language || "",
51883
51975
  range: s.range
51884
51976
  }) }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [!b.sideBar && /* @__PURE__ */ jsx("div", {
51885
51977
  className: "h-full w-300px p-8px border-r border-r-solid border-[var(--ant-color-border)] overflow-y-auto infini-discover-side",
51886
51978
  children: /* @__PURE__ */ jsx(SidebarMemoized, {
51887
51979
  config: {},
51888
- columns: z,
51980
+ columns: B,
51889
51981
  fieldCounts: rQ,
51890
- hits: Q,
51982
+ hits: eQ,
51891
51983
  indexPatterns: [t],
51892
- onAddField: Z,
51893
- onAddFilter: QZ,
51894
- onRemoveField: JZ,
51984
+ onAddField: KZ,
51985
+ onAddFilter: ZZ,
51986
+ onRemoveField: qZ,
51895
51987
  selectedIndexPattern: t,
51896
51988
  setIndexPattern: () => {},
51897
- setAppState: A,
51898
- state: O,
51899
- distinctParams: N,
51900
- onDistinctParamsChange: F,
51989
+ setAppState: M,
51990
+ state: A,
51991
+ distinctParams: P,
51992
+ onDistinctParamsChange: I,
51901
51993
  total: iQ,
51902
51994
  onFieldAgg: lQ,
51903
51995
  whetherToSample: s.whetherToSample,
@@ -51914,7 +52006,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51914
52006
  className: "flex-1 flex flex-col h-full overflow-hidden relative",
51915
52007
  children: [
51916
52008
  /* @__PURE__ */ jsx("div", {
51917
- style: { display: U !== "loading" && U !== "downloading" ? "none" : "" },
52009
+ style: { display: G !== "loading" && G !== "downloading" ? "none" : "" },
51918
52010
  children: /* @__PURE__ */ jsx("div", {
51919
52011
  className: "dscOverlay",
51920
52012
  children: /* @__PURE__ */ jsx(LoadingSpinner, {})
@@ -51923,43 +52015,44 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51923
52015
  /* @__PURE__ */ jsx(ResultHeader, {
51924
52016
  showCollapse: {
51925
52017
  sideBar: !0,
51926
- histogram: !!K
52018
+ histogram: !!Z
51927
52019
  },
51928
52020
  collapseState: b,
51929
52021
  setCollapseState: x,
51930
52022
  took: w.took || 1,
51931
52023
  total: iQ,
51932
- timeChartProps: J,
52024
+ timeChartProps: Q,
51933
52025
  onDownloadQuery: dQ,
51934
- downloading: U === "downloading",
52026
+ downloading: G === "downloading",
51935
52027
  exportMaxSize: g
51936
52028
  }),
51937
- !b.histogram && nQ.chartAggConfigs && K && Q.length !== 0 && /* @__PURE__ */ jsx("div", {
52029
+ !b.histogram && nQ.chartAggConfigs && Z && eQ.length !== 0 && /* @__PURE__ */ jsx("div", {
51938
52030
  className: "dscTimechart",
51939
52031
  children: /* @__PURE__ */ jsx("div", {
51940
52032
  className: "h-100px dscHistogramGrid",
51941
52033
  children: /* @__PURE__ */ jsx(DiscoverHistogram, {
51942
- chartData: K,
51943
- timefilterUpdateHandler: $Z,
51944
- theme: m
52034
+ chartData: Z,
52035
+ timefilterUpdateHandler: QZ,
52036
+ theme: m,
52037
+ timeZone: S
51945
52038
  })
51946
52039
  })
51947
52040
  }),
51948
- Q && Q.length > 0 ? /* @__PURE__ */ jsx(table_default, {
51949
- columns: z,
51950
- sortOrder: O.sort || [],
52041
+ eQ && eQ.length > 0 ? /* @__PURE__ */ jsx(table_default, {
52042
+ columns: B,
52043
+ sortOrder: A.sort || [],
51951
52044
  indexPattern: t,
51952
- onFilter: QZ,
51953
- onRemoveColumn: JZ,
51954
- onMoveColumn: YZ,
51955
- onAddColumn: Z,
51956
- onChangeSortOrder: ZZ,
52045
+ onFilter: ZZ,
52046
+ onRemoveColumn: qZ,
52047
+ onMoveColumn: JZ,
52048
+ onAddColumn: KZ,
52049
+ onChangeSortOrder: XZ,
51957
52050
  document: cQ,
51958
- hits: Q,
52051
+ hits: eQ,
51959
52052
  hitsTotal: iQ,
51960
- queryFrom: L,
52053
+ queryFrom: R,
51961
52054
  setQueryFrom: (e) => {
51962
- G("next"), R(e);
52055
+ J("next"), z(e);
51963
52056
  },
51964
52057
  theme: m
51965
52058
  }) : null
@@ -51996,7 +52089,7 @@ var components_default = (e) => {
51996
52089
  }), filterManager.removeAll(), timefilter.setTime({
51997
52090
  from: "",
51998
52091
  to: ""
51999
- })), b(n);
52092
+ }), timefilter.setRefreshInterval({ pause: !0 })), b(n);
52000
52093
  let a = [n];
52001
52094
  a.get = (e) => Promise.resolve(a.find((t) => t.id == e)), setIndexPatterns(a), x.current.loadedIndex = e, x.current.pendingIndex = null;
52002
52095
  };