@odigos/ui-kit 0.0.281 → 0.0.282
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.
- package/CHANGELOG.md +8 -0
- package/lib/chunks/{helpers-BCQhqBdU.js → helpers-CAVGqyMb.js} +1 -1
- package/lib/chunks/index-Cy3rRes8.js +257 -0
- package/lib/chunks/source-instrument-form-context-DSXDMVmM.js +5 -0
- package/lib/chunks/{ui-components-D1sa0AJ8.js → ui-components-Dcg3x769.js} +228 -223
- package/lib/components/segment/index.d.ts +1 -0
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/edit-action-drawer/helpers.d.ts +3 -2
- package/lib/containers/_drawers/edit-rule-drawer/helpers.d.ts +3 -2
- package/lib/containers.js +228 -228
- package/lib/contexts.js +1 -1
- package/lib/functions/build-catalog-fields-data-card/index.d.ts +42 -2
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions/render-catalog-field-segments/index.d.ts +8 -0
- package/lib/functions.js +1 -1
- package/lib/hooks/useActionFormData.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/enable-disable-segment/index.d.ts +7 -0
- package/lib/snippets/index.d.ts +1 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme/palettes/index.d.ts +1 -0
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-CAqgZyIB.js +0 -257
- package/lib/chunks/source-instrument-form-context-Cng6X7Mt.js +0 -5
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a,r as x,a as y}from"./chunks/source-instrument-form-context-
|
|
1
|
+
import{u as a,r as x,a as y}from"./chunks/source-instrument-form-context-DSXDMVmM.js";export{A as ActionFormContextProvider,C as CloudConnectorFormContextProvider,D as DataStreamFormContextProvider,b as DestinationFormContextProvider,O as OdigosApiConnectionsScope,c as OdigosApiProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,d as SamplingRulesFormProvider,e as SourceEditFormContextProvider,f as SourceInstrumentFormContextProvider,p as prepareNamespacePayloads,g as prepareSourcePayloads,h as useActionFormContext,i as useApiLazyQuery,j as useApiMutation,k as useApiQuery,l as useCloudConnectorFormContext,m as useDataStreamFormContext,n as useDestinationFormContext,o as useOdigosApi,q as useRuleFormContext,s as useSamplingRulesFormContext,t as useSourceEditFormContext,v as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-DSXDMVmM.js";export{O as OdigosProvider,c as checkVersionSupport,r as resolveMinSupportedVersion,u as useOdigos}from"./chunks/helpers-CAVGqyMb.js";import{jsx as F}from"react/jsx-runtime";import{useMemo as P,useContext as E,createContext as T}from"react";import{P as I,t as _}from"./chunks/ui-components-Dcg3x769.js";import{useApolloClient as w}from"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";const M=()=>{const o=w(),{operations:r,context:e}=a();return{multiFetch:async(t,s,n)=>{const i=r[t];return i?y(o,i,s,n,e):{results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:s.length,error:`Operation ${String(t)} not configured`}},bulkPersistSources:async(t,s)=>{const n=[];for(const i of t){const t={...e,proxyID:i},{error:a}=await x(o,r.PERSIST_SOURCES,s,t);a&&n.push(`${i}: ${a}`)}return n.length?{error:n.join(", ")}:void 0},applyConfigurations:async(t,s)=>{if(!r.UPDATE_REMOTE_CONFIG)return{error:"UPDATE_REMOTE_CONFIG not configured"};if(!t.length)return{error:"No connections selected"};const n={formData:s,connectionIds:t},i=r.UPDATE_REMOTE_CONFIG;let a;return 1===t.length?({error:a}=await x(o,i,n,e)):({error:a}=await y(o,i,t,n,e)),a?{error:a}:void 0}}},N=(o,r)=>o.platformType===I.K8s?r.K8s:[I.Vm,I.Connector,I.AwsEcs].includes(o.platformType)?r.Vm:void 0,V=o=>r=>{const e=o[r.platformType];if(!e)return;const t=Object.keys(e);if(0===t.length)return;const s=_(r.schemaVersion??r.version),n=[...t].sort((o,r)=>_(r)-_(o)).find(o=>s>=_(o));return n?e[n]:void 0},U=(o,r)=>{const e={};for(const t of Object.keys(o))e[t]=r(o[t]);return e},z=T({formType:void 0}),G=({children:o,formType:r})=>{const e=P(()=>({formType:r}),[r]);return F(z.Provider,{value:e,children:o})},$=()=>E(z);export{G as StorybookProvider,N as pickByPlatform,M as useApiForConnections,$ as useStorybook,V as versionedDocument,U as vmDialectMap};
|
|
@@ -6,12 +6,52 @@ export type BuildCatalogFieldsDataCardOptions = {
|
|
|
6
6
|
/** Skip these component types (e.g. `sourceScopes`, rendered elsewhere). */
|
|
7
7
|
skipComponentTypes?: FieldTypes[];
|
|
8
8
|
};
|
|
9
|
+
type DataCardItems = NonNullable<DataCardProps['items']>;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* View-mode field segments. Drawers render one nested `DataCard` per segment so
|
|
12
|
+
* complex values (lists, key/value pairs, repeatable groups) get the room they
|
|
13
|
+
* need instead of being crammed into a single ellipsised cell next to scalars.
|
|
14
|
+
*
|
|
15
|
+
* - `cells` — group of scalar fields shown together with `cellsPerRow=2`.
|
|
16
|
+
* - `list` — MultiInput / CheckboxList selections; each entry is its own cell.
|
|
17
|
+
* - `pairs` — KeyValuePair rows; each `{ key, value }` is its own cell.
|
|
18
|
+
* - `group` — one MultiTabledInput row or FieldGroup entry; may nest further
|
|
19
|
+
* segments for nested lists/tables inside a FieldGroup.
|
|
20
|
+
*/
|
|
21
|
+
export type CatalogFieldSegment = {
|
|
22
|
+
kind: 'cells';
|
|
23
|
+
id: string;
|
|
24
|
+
items: DataCardItems;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'list';
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
items: DataCardItems;
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'pairs';
|
|
32
|
+
id: string;
|
|
33
|
+
title: string;
|
|
34
|
+
items: DataCardItems;
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'group';
|
|
37
|
+
id: string;
|
|
38
|
+
title: string;
|
|
39
|
+
items?: DataCardItems;
|
|
40
|
+
segments?: CatalogFieldSegment[];
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Build view-mode field segments from a YAML catalog field list.
|
|
11
44
|
*
|
|
12
45
|
* Used by edit drawers (actions, instrumentation rules) for Configuration /
|
|
13
46
|
* Collect read views so new types and nested fields show up without per-type
|
|
14
47
|
* hard-coding. `values` is the bag keyed by YAML `name` (action.fields for
|
|
15
48
|
* actions; the rule root for instrumentation rules).
|
|
16
49
|
*/
|
|
17
|
-
export declare const
|
|
50
|
+
export declare const buildCatalogFieldsSegments: (values: Record<string, unknown>, yamlFields: YamlFieldProperties[], options?: BuildCatalogFieldsDataCardOptions) => CatalogFieldSegment[];
|
|
51
|
+
/**
|
|
52
|
+
* Flattened `DataCard` items from a YAML catalog field list.
|
|
53
|
+
* Prefer `buildCatalogFieldsSegments` for drawer read views so lists/groups
|
|
54
|
+
* render as dedicated cards; this helper remains for callers that need a flat list.
|
|
55
|
+
*/
|
|
56
|
+
export declare const buildCatalogFieldsDataCard: (values: Record<string, unknown>, yamlFields: YamlFieldProperties[], options?: BuildCatalogFieldsDataCardOptions) => DataCardItems;
|
|
57
|
+
export {};
|
package/lib/functions/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './build-badge-for-desired-status';
|
|
2
2
|
export * from './build-catalog-fields-data-card';
|
|
3
|
+
export * from './render-catalog-field-segments';
|
|
3
4
|
export * from './capitalize-first-letter';
|
|
4
5
|
export * from './clean-object-empty-strings-values';
|
|
5
6
|
export * from './compare-condition';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { CatalogFieldSegment } from '../build-catalog-fields-data-card';
|
|
3
|
+
/**
|
|
4
|
+
* Renders catalog field segments as nested `DataCard`s for view-mode drawers.
|
|
5
|
+
* Mirrors the destination drawer layout: scalars share a card; lists, pairs, and
|
|
6
|
+
* repeatable groups each get their own card so values aren't ellipsised.
|
|
7
|
+
*/
|
|
8
|
+
export declare const renderCatalogFieldSegments: (segments: CatalogFieldSegment[]) => ReactNode;
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{bl as adaptInstrumentationRuleFromWire,bj as adaptInstrumentationRuleInputForWire,cl as buildBadgeForDesiredStatus,fx as buildCatalogFieldsDataCard,ca as buildCatalogFieldsSegments,fy as capitalizeFirstLetter,fz as cleanObjectEmptyStringsValues,a3 as compareCondition,fA as decimalsOnly,aZ as deepClone,eF as entityIdKey,eK as filterActions,eJ as filterDestinations,cf as filterDestinationsByStream,eI as filterSources,ev as filterSourcesByStream,fB as flattenObjectKeys,cz as formatBytes,fC as formatDuration,b5 as generateId,eC as getActionConditions,cd as getActionIcon,eD as getConditionsBooleans,cR as getContainersIcons,fD as getContainersInstrumentedCount,fE as getDeepValue,c2 as getDestinationIcon,fF as getDetectedLanguageIcons,cp as getEffectiveLanguage,cH as getEffectiveRuntimeVersion,eG as getEntityIcon,bi as getEntityId,eB as getEntityIdKey,eE as getEntityLabel,fG as getHealthBadgeLabel,bg as getIdFromSseTarget,ch as getInstrumentationRuleIcon,fH as getMainContainerLanguage,fI as getMetricForEntity,fJ as getMonitorIcon,fK as getNearestTypographySize,cQ as getPlatformIcon,er as getPlatformLabel,O as getProgrammingLanguageIcon,fL as getRecursiveValues,cy as getSourceKindLabel,cv as getSourceLanguageIcons,b9 as getSseTargetFromId,cF as getStatusColor,eM as getStatusFromPodStatus,cG as getStatusIcon,cA as getStatusTypeFromOdigosHealth,fM as getValueForRange,cu as getVirtualServiceIcon,ct as getWorkloadId,cg as getYamlFieldsForDestination,fN as hasUnhealthyInstances,fO as instrumentationRuleSourceScopesFromWire,fP as instrumentationRuleSourceScopesToWire,bq as isEmpty,br as isLegalK8sLabel,da as isOverTime,fQ as isStringABoolean,fR as isTimeElapsed,cE as isValidVersion,fS as mapConditions,cn as mapDesiredStatusToConditionStatus,c8 as mapDesiredStatusesToConditions,ce as mapDestinationFieldsForDisplay,bv as mapExportedSignals,bt as mapSupportedSignals,fT as numbersOnly,fU as parseBooleanFromString,fV as parseJsonStringToPrettyString,bK as prepareDestinationFormData,fW as removeEmptyValuesFromObject,cc as renderCatalogFieldSegments,v as safeJsonParse,fX as safeJsonStringify,fY as setDeepValue,fZ as sleep,ah as splitCamelString,f_ as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-Dcg3x769.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Action, type ActionFormData } from '../types';
|
|
2
2
|
export declare const useActionFormData: () => {
|
|
3
3
|
formData: ActionFormData;
|
|
4
|
-
formErrors: Partial<Record<"disabled" | "type" | "name" | "
|
|
4
|
+
formErrors: Partial<Record<"disabled" | "type" | "name" | "fields" | "notes" | "signals", string>>;
|
|
5
5
|
handleFormChange: (key?: string | undefined, val?: any, obj?: ActionFormData | undefined) => void;
|
|
6
6
|
resetFormData: (overrideForm?: ActionFormData | undefined) => void;
|
|
7
7
|
validateForm: (params?: {
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{gf as IGNORE_OUTSIDE_CLICK_ATTR,gg as useActionFormData,gh as useBodyScroll,eH as useContainerSize,b4 as useCopy,gi as useDataStreamFormData,gj as useDestinationFormData,bm as useGenericForm,gk as useInstrumentationRuleFormData,d9 as useKeyDown,cB as useOnClickOutside,gl as useOverflow,gm as usePopup,ck as useScrollIntoViewWhen,f5 as useScrollTo,ey as useSessionStorage,gn as useSourceFormData,ci as useTimeAgo}from"./chunks/ui-components-Dcg3x769.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/snippets/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './colored-span';
|
|
|
4
4
|
export * from './connector-created-modal';
|
|
5
5
|
export * from './delete-modal';
|
|
6
6
|
export * from './dynamic-field';
|
|
7
|
+
export * from './enable-disable-segment';
|
|
7
8
|
export * from './instrumentation-rule-form-sections';
|
|
8
9
|
export * from './odigos-logo-text-by-tier';
|
|
9
10
|
export * from './rich-title';
|
package/lib/snippets.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-
|
|
1
|
+
export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-Dcg3x769.js";export{C as CancelModal,a as ConnectorCreatedModal,D as DURATION_OPTIONS,b as DeleteModal,c as DurationErrorsSection,d as DynamicActionFields,e as DynamicField,f as DynamicFields,E as EnableDisableSegment,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,O as OdigosLogoTextByTier,g as OperationSection,P as PERCENTAGE_OPTIONS,h as PercentageSection,i as PresetWithCustomInput,R as RuleInfoSection,j as RuleTypeSection,S as SamplingPreviewSection,k as SignalsCheckboxList,l as SourceScopeSection,U as UpgradeModal,W as WIDE_DRAWER_WIDTH,m as WideDrawer,Y as YamlSectionCard}from"./chunks/index-Cy3rRes8.js";export{C as ColoredSpan,a as ColoredSpanVariant}from"./chunks/helpers-CAVGqyMb.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{de as DrawerType,bf as ProgressKeys,ez as getDrawerTypeForAdd,cx as getDrawerTypeForEdit,ge as useDarkMode,bc as useDataStreamStore,cs as useDrawerStore,eu as useFilterStore,b7 as useNotificationStore,bd as useProgressStore,eA as useSelectedStore,be as useSetupStore}from"./chunks/ui-components-Dcg3x769.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{go as Provider,gp as animations,gq as opacity,gr as palettes}from"./chunks/ui-components-Dcg3x769.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b_ as ActionCategoryTypes,
|
|
1
|
+
export{b_ as ActionCategoryTypes,bo as ActionKeyTypes,bp as ActionType,f6 as AgentInjectedReason,f7 as BooleanOperation,c6 as CloudConnectorFeatureKey,ag as CodeAttributesKeyTypes,f8 as ConditionType,ba as Crud,aa as CustomInstrumentationsKeyTypes,f9 as DesiredConditionActionItemType,cm as DesiredStateProgress,fa as DestinationTypes,bb as EntityTypes,bF as ExtractionDataFormat,n as FieldTypes,ac as GolangCustomProbe,ae as HeadersCollectionKeyTypes,y as InputTypes,fb as InstallationMethod,fc as InstallationStatus,a9 as InstrumentationRuleType,fd as IntrumentationStatus,ab as JavaCustomProbe,fe as JsonOperation,bD as K8sAttributesFrom,bx as K8sResourceKind,ff as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,fg as ListDirection,fh as NumberOperation,fi as OtelDistroName,fj as OtherEntityTypes,af as PayloadCollectionKeyTypes,ad as PhpCustomProbe,P as PlatformType,fk as PodContainerLifecycleStatus,fl as PodContainerStatus,fm as PodPhase,fn as Profile,M as ProgrammingLanguages,fo as SIGNAL_KEY_TO_TYPE,fp as SIGNAL_TYPE_TO_KEY,fq as SignalKey,bu as SignalType,fr as SortDirection,S as StatusType,fs as StringOperation,b as Tier,ft as WorkloadRolloutReason,eN as WorkloadRolloutStatus}from"./chunks/ui-components-Dcg3x769.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/visuals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{fu as VISUAL_ODIGOS_LOGO_HEIGHT,fv as VISUAL_ODIGOS_LOGO_WIDTH,V as VisualGreenRings,fw as VisualOdigosLogo,dp as VisualPurpleRings}from"./chunks/ui-components-Dcg3x769.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/package.json
CHANGED
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a,Fragment as t}from"react/jsx-runtime";import{D as l,c as r,F as n,d as i,e as s,f as o,g as c,h as d,B as u,i as p,j as h,k as g,W as m,l as v,m as b,V as f,n as y,o as x,p as k,q as C,r as S,C as T,s as $,u as w,I as M,v as A,w as O,x as L,y as P,z as E,N as I,E as R,S as N,G as V,H as z,U as D,J as X,K as H,L as _,M as q,O as B,Q as j,X as K,Y as U,Z as G,_ as F,$ as W,a0 as J,a1 as Y,a2 as Z,a3 as Q,a4 as ee,T as ae,a5 as te,a6 as le,a7 as re,a8 as ne,a9 as ie,aa as se,ab as oe,ac as ce,ad as de,ae as ue,af as pe,ag as he,b as ge,ah as me,ai as ve,aj as be,ak as fe,al as ye,am as xe,an as ke,ao as Ce,ap as Se,aq as Te,ar as $e,as as we,at as Me,au as Ae,av as Oe,aw as Le,ax as Pe,ay as Ee,az as Ie,aA as Re,aB as Ne,aC as Ve,aD as ze,aE as De,aF as Xe,aG as He,aH as _e,aI as qe,aJ as Be,aK as je,aL as Ke,aM as Ue,aN as Ge,aO as Fe,aP as We,aQ as Je,aR as Ye,aS as Ze,aT as Qe,aU as ea,aV as aa,aW as ta,aX as la,aY as ra,aZ as na,a_ as ia,a$ as sa,b0 as oa,b1 as ca,R as da,b2 as ua,b3 as pa,A as ha,b4 as ga,b5 as ma}from"./ui-components-D1sa0AJ8.js";import{VIcon as va,TrashIcon as ba,PlusIcon as fa,EditIcon as ya,OdigosLogoTextCentral as xa,OdigosLogoTextEnterprise as ka,OdigosLogoTextCommunity as Ca,OdigosLogoTextColoredCentral as Sa,OdigosLogoTextColoredEnterprise as Ta,OdigosLogoTextColoredCommunity as $a,ArrowLeftIcon as wa,ArrowRightIcon as Ma,VSquareIcon as Aa,CopyIcon as Oa,YamlIcon as La}from"../icons.js";import Pa,{useMemo as Ea,useRef as Ia,useCallback as Ra,useState as Na,useEffect as Va,Fragment as za,forwardRef as Da,useImperativeHandle as Xa}from"react";import Ha,{css as _a,useTheme as qa}from"styled-components";import{i as Ba,m as ja,u as Ka,n as Ua,a as Ga,C as Fa,b as Wa,d as Ja,e as Ya,f as Za,g as Qa,h as et,j as at,k as tt}from"./helpers-BCQhqBdU.js";const lt=/^[a-zA-Z]$/,rt=new Set(["*","+","?"]),nt=new Set(["^","$"]),it={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},st=Ha.div`
|
|
2
|
-
padding: 8px 16px;
|
|
3
|
-
border-radius: 6px;
|
|
4
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
5
|
-
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
6
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
7
|
-
font-size: 12px;
|
|
8
|
-
line-height: 20px;
|
|
9
|
-
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
10
|
-
word-break: break-all;
|
|
11
|
-
white-space: pre-wrap;
|
|
12
|
-
user-select: text;
|
|
13
|
-
|
|
14
|
-
/* Wraps the background tightly to each visual fragment when a colored
|
|
15
|
-
token gets split across two visual lines. Without this the highlight
|
|
16
|
-
stretches all the way to the right edge of the container. */
|
|
17
|
-
& > span {
|
|
18
|
-
box-decoration-break: clone;
|
|
19
|
-
-webkit-box-decoration-break: clone;
|
|
20
|
-
}
|
|
21
|
-
`,ot=Ha.span`
|
|
22
|
-
background: ${({$kind:e})=>it[e]};
|
|
23
|
-
`,ct=({pattern:a,"data-id":t})=>{const l=Ea(()=>(e=>{const a=[];let t=0,l=!1;const r=(e,t)=>{const l=a[a.length-1];l&&l.kind===t?l.text+=e:a.push({text:e,kind:t})};for(;t<e.length;){const a=e[t];if(l){if("]"===a){r("]","class-bracket"),l=!1,t++;continue}if("\\"===a&&t+1<e.length){r(e.slice(t,t+2),"class-content"),t+=2;continue}r(a,"class-content"),t++}else{if("("===a&&"?"===e[t+1]){let a=2;const l=e[t+2];if(":"===l||"="===l||"!"===l)a=3;else if("<"===l){const l=e[t+3];if("="===l||"!"===l)a=4;else{const l=e.indexOf(">",t+2);-1!==l&&(a=l-t+1)}}r(e.slice(t,t+a),"group"),t+=a;continue}if("("!==a&&")"!==a)if("["!==a)if(rt.has(a)||nt.has(a))r(a,"anchor-quantifier"),t++;else{if("{"===a){const a=e.indexOf("}",t);if(a>t&&/^\{\d+,?\d*\}$/.test(e.slice(t,a+1))){r(e.slice(t,a+1),"anchor-quantifier"),t=a+1;continue}}if("\\"===a&&t+1<e.length){const a=e[t+1];lt.test(a)?r(e.slice(t,t+2),"anchor-quantifier"):r(e.slice(t,t+2),"literal"),t+=2;continue}"|"!==a?(r(a,"literal"),t++):(r("|","alternation"),t++)}else"^"===e[t+1]?(r("[^","class-bracket"),t+=2):(r("[","class-bracket"),t++),l=!0;else r(a,"group"),t++}}return a})(a),[a]);return e(st,a?{"data-id":t,children:l.map((a,t)=>e(ot,{$kind:a.kind,children:a.text},t))}:{"data-id":t,children:" "})},dt="rgba(102, 191, 255, 0.5)",ut=_a`
|
|
24
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
25
|
-
font-size: 12px;
|
|
26
|
-
line-height: 20px;
|
|
27
|
-
letter-spacing: 0;
|
|
28
|
-
white-space: pre-wrap;
|
|
29
|
-
word-wrap: break-word;
|
|
30
|
-
overflow-wrap: break-word;
|
|
31
|
-
/* tab-size keeps tabs visually consistent across the two layers — some
|
|
32
|
-
browsers default to 8 on a textarea but 4 on a div. */
|
|
33
|
-
-moz-tab-size: 4;
|
|
34
|
-
tab-size: 4;
|
|
35
|
-
margin: 0;
|
|
36
|
-
`,pt=Ha.div`
|
|
37
|
-
position: relative;
|
|
38
|
-
width: 100%;
|
|
39
|
-
min-height: ${({$minHeight:e})=>e}px;
|
|
40
|
-
border-radius: 6px;
|
|
41
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
42
|
-
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
43
|
-
|
|
44
|
-
&:hover,
|
|
45
|
-
&:focus-within {
|
|
46
|
-
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
47
|
-
}
|
|
48
|
-
`,ht=Ha.div`
|
|
49
|
-
${ut}
|
|
50
|
-
position: absolute;
|
|
51
|
-
inset: 0;
|
|
52
|
-
padding: 12px;
|
|
53
|
-
pointer-events: none;
|
|
54
|
-
color: transparent;
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
|
|
57
|
-
/* Mandatory for backgrounds that wrap across visual lines. */
|
|
58
|
-
& > span {
|
|
59
|
-
box-decoration-break: clone;
|
|
60
|
-
-webkit-box-decoration-break: clone;
|
|
61
|
-
}
|
|
62
|
-
`,gt=Ha.textarea`
|
|
63
|
-
${ut}
|
|
64
|
-
position: relative;
|
|
65
|
-
z-index: 1;
|
|
66
|
-
display: block;
|
|
67
|
-
width: 100%;
|
|
68
|
-
min-height: ${({$minHeight:e})=>e}px;
|
|
69
|
-
padding: 12px;
|
|
70
|
-
border: 0;
|
|
71
|
-
background: transparent;
|
|
72
|
-
outline: none;
|
|
73
|
-
resize: vertical;
|
|
74
|
-
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
75
|
-
caret-color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
76
|
-
box-sizing: border-box;
|
|
77
|
-
|
|
78
|
-
&::placeholder {
|
|
79
|
-
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
|
-
}
|
|
81
|
-
`,mt=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),vt=({regex:t,value:l,onChange:r,minHeight:n=240,...i})=>{const s=Ia(null),o=Ia(null),c=Ea(()=>((e,a)=>{if(!e||!a)return mt(a);let t;try{t=new RegExp(e)}catch{return mt(a)}const l=t.exec(a);if(!l)return mt(a);const r=l.index,n=l.index+l[0].length;if(l.length<2||null==l[1])return{before:a.slice(0,r),matchPre:"",capture:a.slice(r,n),matchPost:"",after:a.slice(n)};const i=l[0].indexOf(l[1]),s=i>=0?r+i:r,o=s+l[1].length;return{before:a.slice(0,r),matchPre:a.slice(r,s),capture:a.slice(s,o),matchPost:a.slice(o,n),after:a.slice(n)}})(t,l),[t,l]),d=Ra(()=>{s.current&&o.current&&(s.current.scrollTop=o.current.scrollTop,s.current.scrollLeft=o.current.scrollLeft)},[]);return a(pt,{$minHeight:n,children:[a(ht,{ref:s,"aria-hidden":!0,children:[c.before,e("span",{style:{background:dt},children:c.matchPre}),e("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:c.capture}),e("span",{style:{background:dt},children:c.matchPost}),c.after,l.endsWith("\n")?" ":""]}),e(gt,{ref:o,$minHeight:n,value:l,onChange:e=>r(e.target.value),onScroll:d,spellCheck:!1,...i})]})},bt=Ha.div`
|
|
82
|
-
flex: 1;
|
|
83
|
-
min-height: 0;
|
|
84
|
-
overflow-y: auto;
|
|
85
|
-
`,ft=Ha.div`
|
|
86
|
-
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
87
|
-
border-radius: 8px;
|
|
88
|
-
padding: 8px;
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
gap: 12px;
|
|
92
|
-
`,yt=Ha.div`
|
|
93
|
-
padding: 8px 16px;
|
|
94
|
-
border-radius: 8px;
|
|
95
|
-
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
96
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
97
|
-
font-size: 12px;
|
|
98
|
-
line-height: 20px;
|
|
99
|
-
color: ${({theme:e,$tone:a})=>"error"===a?e.v2.colors.red[500]:"match"===a?e.v2.colors.white[500]:e.v2.colors.silver[200]};
|
|
100
|
-
word-break: break-all;
|
|
101
|
-
white-space: pre-wrap;
|
|
102
|
-
user-select: text;
|
|
103
|
-
`,xt=({isOpen:t,regex:m,onClose:v,initialTestString:b=""})=>{const[f,y]=Na(b),x=Ea(()=>((e,a)=>{if(!e)return{ok:!0,isMatch:!1,message:r.RESULT_EMPTY_REGEX};if(!a)return{ok:!0,isMatch:!1,message:r.RESULT_EMPTY_INPUT};let t;try{t=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:r.RESULT_INVALID_REGEX_FALLBACK}}const l=t.exec(a);return l?{ok:!0,isMatch:!0,message:l.length>1?l[1]:l[0]}:{ok:!0,isMatch:!1,message:r.RESULT_NO_MATCH}})(m,f),[m,f]),k=x.ok?x.isMatch?"match":"neutral":"error";return e(l,{isOpen:t,header:{title:r.TITLE,onClose:()=>{y(""),v()}},children:e(bt,{children:a(ft,{children:[a(n,{$gap:6,children:[e(i,{label:r.REGEX_LABEL}),e(ct,{pattern:m,"data-id":"regex-tester-regex"}),!m&&e(s,{size:c.XXS,color:o.Secondary,children:r.REGEX_EMPTY_HINT})]}),a(n,{$gap:6,children:[a(d,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[e(i,{label:r.TEST_STRING_LABEL}),e(u,{"data-id":"regex-tester-unescape",label:r.UNESCAPE_LABEL,tooltip:r.UNESCAPE_TOOLTIP,variant:h.Secondary,size:p.S,onClick:()=>y(e=>(e=>{let a="";for(let t=0;t<e.length;t++){if("\\"===e[t]&&t+1<e.length){const l=e[t+1],r="n"===l?"\n":"t"===l?"\t":"r"===l?"\r":'"'===l?'"':"'"===l?"'":"\\"===l?"\\":null;if(null!=r){a+=r,t++;continue}}a+=e[t]}return a})(e)),disabled:(C=f,!/\\["'\\nrt]/.test(C))})]}),e(vt,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:r.TEST_STRING_PLACEHOLDER,regex:m,value:f,onChange:y,minHeight:240}),e(g,{helpMessage:r.TEST_STRING_HELP})]}),a(n,{$gap:8,children:[e(i,{label:r.RESULT_LABEL}),e(yt,{$tone:k,"data-id":"regex-tester-result",children:x.message}),x.ok&&x.isMatch&&e(s,{size:c.XXS,color:o.Secondary,children:r.RESULT_CAPTURE_HINT})]})]})})});var C},kt=({isOpen:a,onClose:t,onDeny:l,onApprove:r})=>e(m,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:a,onClose:t,denyButton:{label:"Keep editing",variant:h.Secondary,onClick:()=>{l?.(),t()}},approveButton:{label:"Discard changes",variant:h.Primary,onClick:()=>{r?.(),t()}}}),Ct=({isOpen:a,onClose:t,onViewConnector:l})=>e(m,{isOpen:a,onClose:t,visual:()=>e(f,{scale:1.2,icon:va}),title:b.CLOUD_CONNECTOR_CREATED_MODAL_TITLE,description:b.CLOUD_CONNECTOR_CREATED_MODAL_DESC,denyButton:{label:v.STAY_ON_CONNECTIONS,variant:h.Secondary,onClick:t},approveButton:{label:v.GO_TO_CONNECTOR_OVERVIEW,variant:h.Primary,onClick:l??t}}),St=({isOpen:a,onClose:t,onDeny:l,onApprove:r,action:n="delete",target:i,description:s,overrideApproveButtonLabel:o,overrideDenyButtonLabel:c})=>{const d=n.charAt(0).toUpperCase()+n.substring(1),u=i?.endsWith("s")?"these":"this";return e(m,{title:`${d}${i?` ${i}`:""}?`,description:s??`Are you sure you want to ${n}${i?` ${u} ${i}`:""}?`,isOpen:a,onClose:t,denyButton:{label:c??"Go back",variant:h.Secondary,onClick:()=>{l?.(),t()}},approveButton:{label:o??d,variant:h.Primary,onClick:()=>{r?.(),t()}}})},Tt=({componentType:a,inputType:t,name:l,label:r,tooltip:n,badge:i,placeholder:s,required:o,disabled:c,value:d,setValue:u,errorMessage:p,warnMessage:h,helpMessage:g,dropdownOptions:m,dropdownNoSearch:v,dropdownNoCheckbox:b,timeUnits:f,timeDefaultUnit:E,toggleSize:I=C.L,keyLabel:R,valueLabel:N})=>{switch(a){case y.Input:return e(L,{name:l,type:t,label:r,tooltip:n,badge:i,placeholder:s,required:o,disabled:c,value:d??"",onChange:e=>{const a=e.target.value;u(t===P.Number?""===a?null:Number(a):a)},errorMessage:p,warnMessage:h,helpMessage:g},l);case y.MultiInput:return e(O,{name:l,label:r,tooltip:n,badge:i,placeholder:s,required:o,disabled:c,values:Array.isArray(d)?d:A(d,[]),setValues:e=>u(e),errorMessage:p,warnMessage:h,helpMessage:g,plain:!0},l);case y.KeyValuePair:return e(M,{name:l,label:r,tooltip:n,badge:i,required:o,disabled:c,limitFieldsPerRow:2,columns:[{keyName:"key",label:R||"Key",placeholder:R||"Key"},{keyName:"value",label:N||"Value",placeholder:N||"Value"}],values:Array.isArray(d)?d:A(d,[]),setValues:e=>u(e),errorMessage:p,warnMessage:h,helpMessage:g},l);case y.TextArea:return e(w,{name:l,label:r,tooltip:n,badge:i,required:o,disabled:c,placeholder:s,value:d??"",onChange:e=>u(e.target.value),errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Dropdown:return e($,{name:l,label:r,tooltip:n,badge:i,placeholder:s,required:o,disabled:c,withSearch:!v,options:m?.map(e=>({id:e.id||"",label:e.label||"",withCheckbox:!b}))||[],values:d?[String(d)]:[],setValues:e=>u(e[0]),errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Checkbox:return e(T,{name:l,label:r,tooltip:n,badge:i,value:!0===d||"true"===d,onChange:e=>u(e),disabled:c,errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Time:return e(S,{name:l,label:r,tooltip:n,badge:i,placeholder:s,required:o,disabled:c,value:d??"",setValue:e=>u(e),units:f,defaultUnit:E,errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Toggle:return e(x,{name:l,size:I,labelAlign:k.Right,label:r,tooltip:n,badge:i,value:!0===d||"true"===d,onChange:e=>u(e),disabled:c,errorMessage:p,warnMessage:h,helpMessage:g},l);default:return null}},$t=Ha.div`
|
|
104
|
-
display: flex;
|
|
105
|
-
flex-wrap: wrap;
|
|
106
|
-
gap: 8px;
|
|
107
|
-
`,wt=Ha.div`
|
|
108
|
-
display: flex;
|
|
109
|
-
align-items: center;
|
|
110
|
-
gap: 8px;
|
|
111
|
-
padding: 8px 12px;
|
|
112
|
-
border-radius: 8px;
|
|
113
|
-
cursor: pointer;
|
|
114
|
-
background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[800]};
|
|
115
|
-
border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[750]};
|
|
116
|
-
|
|
117
|
-
&:hover {
|
|
118
|
-
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
119
|
-
}
|
|
120
|
-
`,Mt=Ha.div`
|
|
121
|
-
display: flex;
|
|
122
|
-
width: 32px;
|
|
123
|
-
height: 32px;
|
|
124
|
-
justify-content: center;
|
|
125
|
-
align-items: center;
|
|
126
|
-
flex-shrink: 0;
|
|
127
|
-
`,At=Ha.div`
|
|
128
|
-
display: flex;
|
|
129
|
-
flex-direction: column;
|
|
130
|
-
gap: 12px;
|
|
131
|
-
`,Ot=Ha.div`
|
|
132
|
-
display: flex;
|
|
133
|
-
flex-wrap: wrap;
|
|
134
|
-
gap: 6px;
|
|
135
|
-
`,Lt=Ha.div`
|
|
136
|
-
display: flex;
|
|
137
|
-
align-items: center;
|
|
138
|
-
gap: 8px;
|
|
139
|
-
&::before,
|
|
140
|
-
&::after {
|
|
141
|
-
content: '';
|
|
142
|
-
flex: 1;
|
|
143
|
-
height: 1px;
|
|
144
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
145
|
-
}
|
|
146
|
-
`,Pt=Ha.div`
|
|
147
|
-
padding: 2px 10px;
|
|
148
|
-
border-radius: 999px;
|
|
149
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
150
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[600]};
|
|
151
|
-
`,Et={[q.JavaScript]:"Node.js",[q.DotNet]:".NET",[q.Php]:"PHP",[q.Java]:"Java",[q.Go]:"Go",[q.Python]:"Python",[q.Ruby]:"Ruby",[q.Rust]:"Rust"},It=[q.Python,q.Java,q.JavaScript,q.DotNet,q.Php,q.Ruby,q.Go],Rt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function Nt(e){return Et[e]||e.charAt(0).toUpperCase()+e.slice(1)}function Vt(e){return null!=e?`${e}. ${Z}`:Z}const zt=({readOnly:a,...t})=>e(a?Ht:qt,{...t}),Dt=({title:t,count:l,children:r})=>a(n,{$gap:6,children:[a(d,{$gap:8,$alignItems:"center",children:[e(s,{size:c.XS,color:o.Primary,nowrap:!0,children:t}),l>1&&e(s,{size:c.XXS,color:o.Secondary,nowrap:!0,children:`(${J})`})]}),e(Ot,{children:r})]}),Xt=()=>{const a=qa();return e(Lt,{children:e(Pt,{children:e(s,{size:c.XXS,color:a.v2.colors.white[500],nowrap:!0,children:Y})})})},Ht=({scopes:t,titleNumber:l})=>{const r=Vt(l);if(Ba(t))return e(E,{bgTint:"900",richTitle:{title:r},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(I,{status:N.Default,message:R,fullWidth:!0})});const n=t.sources??[],i=t.namespaces??[],s=t.languages??[],o=[];return n.length&&o.push({kind:"sources",node:e(Dt,{title:V,count:n.length,children:n.map((a,t)=>{const l=[a.namespace,a.kind,a.name].filter(Boolean),r=l.length?l.join(" / "):D;return e(z,{label:r},`src-${t}-${r}`)})})}),i.length&&o.push({kind:"namespaces",node:e(Dt,{title:X,count:i.length,children:i.map((a,t)=>e(z,{label:a},`ns-${t}-${a}`))})}),s.length&&o.push({kind:"languages",node:e(Dt,{title:H,count:s.length,children:s.map((a,t)=>{const l=B(a);return e(z,{label:Nt(a),leftIcon:l},`lang-${t}-${a}`)})})}),e(E,{bgTint:"900",richTitle:{title:r,subTitle:o.length>1?_:void 0},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(E,{bgTint:"800",children:e(At,{children:o.map((t,l)=>a(Pa.Fragment,{children:[l>0&&e(Xt,{}),t.node]},t.kind))})})})},_t=e=>e.sources.length>0?"source":e.namespaces.length>0?"namespace":e.languages.length>0?"language":"all",qt=({scopes:t,onChange:l,sourceOptions:r=[],namespaceOptions:i=[],supportedLanguages:d,titleNumber:u,dataIdPrefix:p="source-scope",slim:h,disabled:g})=>{const m=t??ja(),[v,b]=Na(()=>_t(m)),{sources:f,namespaces:y,languages:x}=m,k=f.length>0||y.length>0||x.length>0;Va(()=>{k&&"all"===v&&b(_t(m))},[k,v]);const C=Ea(()=>Rt.map(e=>"language"===e.value&&0===d?.length?null:{...e,disabled:"all"===e.value&&k}).filter(Boolean),[k]),S=Ea(()=>f.map(e=>`${e.namespace}/${e.kind}/${e.name}`),[f]),$=Ea(()=>[...y],[y]),w=Ea(()=>new Set(x),[x]),M=Ra(e=>{b(e)},[]),A=Ra(e=>{const a=e.map(e=>(e=>{const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}})(e)).filter(e=>null!=e).map(e=>({namespace:e.namespace,kind:e.kind,name:e.name}));l({...m,sources:a})},[m,l]),O=Ra(e=>{l({...m,namespaces:e})},[m,l]),L=Ra(e=>{const a=m.languages,t=a.includes(e)?a.filter(a=>a!==e):[...a,e];l({...m,languages:t})},[m,l]),P=!k&&"all"===v,E=(d||It).map(e=>({id:e,label:Et[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:B(e)}));return a(j,{richTitle:h?{title:Vt(u),titleSize:c.XS,titleColor:o.Secondary,tooltip:K}:{title:Vt(u),subTitle:K,subTitleWrap:!0},backgroundColor:h?"transparent":void 0,padding:h?0:void 0,children:[e(I,P?{status:N.Default,message:R,fullWidth:!0,smallIcon:!0}:{status:N.Info,message:_,fullWidth:!0,smallIcon:!0}),e(n,{$alignItems:"flex-start",children:e(U,{options:C,selected:v,setSelected:M,disabled:g})}),"source"===v&&e(G,{multiple:!0,"data-id":`${p}-autocomplete-source`,options:r,value:S,onSelect:A,placeholder:F,disabled:g}),"namespace"===v&&e(G,{multiple:!0,"data-id":`${p}-autocomplete-namespace`,options:i,value:$,onSelect:O,placeholder:"Search namespace",disabled:g}),"language"===v&&E.length>0&&e($t,{children:E.map(({id:t,label:l,Icon:r})=>{const n=w.has(t);return a(wt,{$selected:n,onClick:()=>L(t),children:[e(T,{name:`${p}-lang-${t}`,size:W.S,value:n,onChange:()=>L(t),disabled:g}),e(Mt,{children:e(r,{size:20})}),e(s,{size:c.XS,nowrap:!0,children:l})]},t)})})]})},Bt=e=>{if(null!=e){if(!Array.isArray(e)&&"object"==typeof e)return Object.entries(e).map(([e,a])=>({id:e,label:null==a?e:String(a)}));if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)}},jt=e=>{if(!Array.isArray(e)||e.length<3)return;const[a,t,l]=e;return e=>{const r=null==e?.[a]?"":String(e[a]);switch(t){case"=":case"==":case"===":return r===l;case"!=":case"!==":return r!==l;default:return!0}}},Kt=e=>{if(Array.isArray(e))return e.map(e=>{const a=e;return{keyName:String(a.keyName??a.name??""),label:a.label??a.displayName,tooltip:a.tooltip,placeholder:a.placeholder,helpMessage:a.helpMessage,componentType:a.componentType,options:Bt(a.options??a.values),fullRow:a.fullRow,defaultValue:a.defaultValue,withRegexTester:a.withRegexTester,separator:a.separator,copyByColumn:a.copyByColumn,renderCondition:jt(a.renderCondition)}})},Ut=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const a=e;return{id:String(a.id??a.keyName??a.name??""),label:a.label??a.displayName??String(a.id??""),tooltip:a.tooltip,fields:Array.isArray(a.fields)?a.fields.map(Gt):void 0}})},Gt=e=>{const a="string"==typeof e.componentProperties?A(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??a.inputType??a.type,title:e.displayName,tooltip:a.tooltip,placeholder:a.placeholder,helpMessage:a.helpMessage,required:a.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:Bt(a.options??a.values),itemWrapperKey:a.itemWrapperKey,columns:Kt(a.columns),limitFieldsPerRow:a.limitFieldsPerRow,variant:a.variant,wrapKey:a.wrapKey,checkboxOptions:Ut(a.options??a.values),checkedValue:a.checkedValue??"true",valueMode:a.valueMode??"object",fields:Array.isArray(a.fields)?a.fields.map(Gt):void 0,addLabel:a.addLabel,itemLabel:a.itemLabel,keyLabel:a.titleKey??a.keyLabel,valueLabel:a.titleValue??a.valueLabel,persistAs:a.persistAs}},Ft=e=>{const a=e.initialValue;if(void 0!==a&&""!==a)return e.componentType===y.CheckboxList?"array"===e.valueMode?A(a,[]):A(a,{}):e.componentType!==y.MultiInput&&e.componentType!==y.MultiTabledInput||!e.wrapKey?e.componentType===y.MultiInput||e.componentType===y.MultiTabledInput?A(a,[]):e.componentType===y.SourceScopes?"null"===a||"{}"===a?ja():Ua(A(a,null)):e.componentType===y.Toggle||e.componentType===y.Checkbox?"true"===a:a:{[e.wrapKey]:A(a,[])}},Wt=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Jt=e=>Array.isArray(e)?e:[],Yt=e=>{const a={};return e.forEach(e=>{a[String(e.key??"")]=String(e.value??"")}),a},Zt=e=>Wt(e)?Object.entries(e).map(([e,a])=>({key:e,value:String(a??"")})):[],Qt=({field:a,value:t,setValue:l,errorMessage:r,disabled:n})=>{const[i,s]=Na(()=>Zt(t));return Va(()=>{const e=Wt(t)?t:{};((e,a)=>{const t=Object.keys(e),l=Object.keys(a);return t.length===l.length&&t.every(t=>Object.prototype.hasOwnProperty.call(a,t)&&a[t]===e[t])})(Yt(i),e)||s(Zt(t))},[t]),e(M,{name:a.name,label:a.title,tooltip:a.tooltip,helpMessage:a.helpMessage,required:a.required,disabled:n,limitFieldsPerRow:2,columns:[{keyName:"key",label:a.keyLabel||"Key",placeholder:a.keyLabel||"Key"},{keyName:"value",label:a.valueLabel||"Value",placeholder:a.valueLabel||"Value"}],values:i,setValues:e=>{s(e),l(Yt(e))},errorMessage:r})},el=({field:l,value:r,setValue:d,errorMessage:u,disabled:p,keyValuePersistAs:h,sourceOptions:m,namespaceOptions:v})=>{const{name:b,componentType:f,inputType:x,title:k,tooltip:C,placeholder:S,helpMessage:$,required:w,initialValue:A,options:L,itemWrapperKey:P,columns:E,limitFieldsPerRow:I,variant:R,wrapKey:N,checkboxOptions:V}=l,[z,D]=Na({open:!1,value:""});if(f===y.SourceScopes)return e(zt,{scopes:Ua(r),onChange:e=>d(e),sourceOptions:m,namespaceOptions:v,dataIdPrefix:`dynamic-field-${b}`,slim:!0});if(f===y.CheckboxList&&"array"===l.valueMode){const t=Jt(r),l=(e,a)=>d(a?[...t.filter(a=>a!==e),e]:t.filter(a=>a!==e));return a(n,{$gap:12,children:[k&&e(i,{label:k,tooltip:C,required:w}),e(n,{$gap:8,children:(V||[]).map(a=>{const r=e(T,{name:a.id,label:a.label,value:t.includes(a.id),disabled:p,onChange:e=>l(a.id,e)},a.id);return a.tooltip?e(ae,{text:a.tooltip,withIcon:!0,children:r},a.id):r})}),e(g,{errorMessage:u,helpMessage:$})]})}if(f===y.CheckboxList){const t=Wt(r)?r:{},i=(e=>"emptyObject"!==e.checkedValue||{})(l),m=e=>"emptyObject"===l.checkedValue?Wt(e):!!e;return a(n,{$gap:12,children:[k&&e(s,{size:c.XS,color:o.Secondary,nowrap:!0,children:k}),e(n,{$gap:12,children:(V||[]).map(l=>{const r=t[l.id],s=m(r),o=Wt(r)?r:{},c=e(T,{label:l.label,value:s,disabled:p,onChange:e=>d({...t,[l.id]:e?Wt(r)?r:i:null})}),u=l.tooltip?e(ae,{text:l.tooltip,withIcon:!0,children:c}):c,g=s&&l.fields?.length?e(n,{$gap:12,$padding:"0 0 0 24px",children:l.fields.map(a=>e(el,{field:a,value:o[a.name],setValue:e=>d({...t,[l.id]:{...o,[a.name]:e}}),disabled:p,keyValuePersistAs:h},`${b}-${l.id}-${a.name}`))}):null;return a(n,{$gap:12,children:[u,g]},l.id)})}),e(g,{errorMessage:u,helpMessage:$})]})}if(f===y.MultiTabledInput){const l=Jt(N?r?.[N]:r),n=e=>d(N?{...Wt(r)?r:{},[N]:e}:e),i=(E||[]).some(e=>e.withRegexTester);return a(t,{children:[e("cards"===R?te:M,{name:b,label:k,tooltip:C,helpMessage:$,required:w,disabled:p,columns:E||[],limitFieldsPerRow:I,values:l,setValues:n,errorMessage:u,onTestRegex:i?e=>D({open:!0,value:e}):void 0}),i&&e(xt,{isOpen:z.open,regex:z.value,onClose:()=>D({open:!1,value:""})})]})}if(f===y.MultiInput&&N){const a=Jt(r?.[N]);return e(O,{name:b,label:k,tooltip:C,helpMessage:$,required:w,disabled:p,placeholder:S,values:a,setValues:e=>d({...Wt(r)?r:{},[N]:e}),errorMessage:u})}if(f===y.MultiInput&&P){const a=Jt(r).map(e=>String(e?.[P]??""));return e(O,{name:b,label:k,tooltip:C,helpMessage:$,required:w,disabled:p,placeholder:S,values:a,setValues:e=>d(e.map(e=>({[P]:e}))),errorMessage:u})}return f===y.KeyValuePair?"map"===(l.persistAs??h)?e(Qt,{field:l,value:r,setValue:d,errorMessage:u,disabled:p}):e(Tt,{componentType:f,name:b,label:k,tooltip:C,helpMessage:$,disabled:p,required:w,errorMessage:u,keyLabel:l.keyLabel,valueLabel:l.valueLabel,value:r??[],setValue:d}):e(Tt,{componentType:f,inputType:x,name:b,label:k,tooltip:C,helpMessage:$,disabled:p,required:w,placeholder:S,errorMessage:u,dropdownOptions:L,value:(null==r?A:r)??"",setValue:d})},al=({field:l,value:r,setValue:s,disabled:o,keyValuePersistAs:c,sourceOptions:g,namespaceOptions:m})=>{const v=qa(),b=Jt(r),f=b.length?b:[{}],y=l.fields||[],x=e=>s(e);return a(t,{children:[f.map((t,r)=>a(za,{children:[e(ee,{}),a(n,{$gap:12,children:[a(d,{$justifyContent:"space-between",$alignItems:"center",children:[e(i,{label:`${l.itemLabel||l.title||"Item"} ${r+1}`}),e(u,{leftIcon:()=>e(ba,{fill:v.v2.colors.red[500]}),variant:h.Secondary,size:p.S,onClick:()=>(e=>{const a=f.filter((a,t)=>t!==e);x(a)})(r),disabled:o||1===f.length})]}),y.map(a=>e(el,{field:a,value:t[a.name],setValue:e=>((e,a,t)=>x(f.map((l,r)=>r===e?{...l,[a]:t}:l)))(r,a.name,e),disabled:o,keyValuePersistAs:c,sourceOptions:g,namespaceOptions:m},`${l.name}-group-${r}-${a.name}`))]})]},`${l.name}-group-${r}`)),e(u,{variant:h.Secondary,label:l.addLabel||"Add",leftIcon:fa,onClick:()=>x([...f,{}]),disabled:o}),e(ee,{})]})},tl=({field:t,value:l,setValue:r,errorMessage:s,disabled:o})=>a(n,{$gap:12,children:[t.title&&e(i,{label:t.title,tooltip:t.tooltip,required:t.required}),e(n,{$gap:8,children:(t.checkboxOptions||[]).map(a=>{const t=e(T,{name:a.id,label:a.label,value:!0===l?.[a.id],disabled:o,onChange:e=>r(a.id,e)},a.id);return a.tooltip?e(ae,{text:a.tooltip,withIcon:!0,children:t},a.id):t})}),e(g,{errorMessage:s,helpMessage:t.helpMessage})]}),ll=({signals:a,fields:l,value:r,setValue:n,formErrors:i,disabled:s,seedInitialValues:o,keyValuePersistAs:c="map",sourceOptions:d,namespaceOptions:u})=>{const{isK8s:p}=Ka(),h=(l||[]).filter(e=>!!e).map(e=>Gt(e));return Va(()=>{if(!o)return;const e=r||{},a={};h.forEach(t=>{if(t.componentType===y.SourceScopes&&!p)return;const l=t.componentType===y.SourceScopes?Ft(t)??ja():Ft(t);if(void 0===l)return;if(t.componentType===y.CheckboxList&&"flatFields"===t.valueMode&&Wt(l))return void Object.entries(l).forEach(([t,l])=>{void 0!==e[t]&&null!==e[t]||(a[t]=l)});const r=e[t.name];if(t.componentType===y.SourceScopes){if(void 0!==r)return}else if(null!=r)return;a[t.name]=Wt(l)&&Wt(a[t.name])?{...a[t.name],...l}:l}),Object.entries(a).forEach(([e,a])=>n(e,a))},[]),e(t,{children:h.map(t=>{const l=Object.entries(r||{}).map(([e,a])=>({name:e,key:e,value:a}));if(t.renderCondition&&!Q(t.renderCondition,a,l))return null;if(t.componentType===y.SourceScopes&&!p)return null;const o=r?.[t.name];if(t.componentType===y.FieldGroup)return e(al,{field:t,value:o,setValue:e=>n(t.name,e),disabled:s,keyValuePersistAs:c,sourceOptions:d,namespaceOptions:u},t.name);if(t.componentType===y.CheckboxList&&"flatFields"===t.valueMode){const a=t.checkboxOptions?.map(e=>i[e.id]).find(Boolean);return e(tl,{field:t,value:r||{},setValue:n,errorMessage:a,disabled:s},t.name)}return e(el,{field:t,value:o,setValue:e=>n(t.name,e),errorMessage:i[t.name],disabled:s,keyValuePersistAs:c,sourceOptions:d,namespaceOptions:u},t.name)})})},rl=ll,nl=Ha.div`
|
|
152
|
-
display: flex;
|
|
153
|
-
align-items: center;
|
|
154
|
-
gap: 24px;
|
|
155
|
-
padding: 8px 16px;
|
|
156
|
-
border-radius: 12px;
|
|
157
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
158
|
-
`,il=Ha.div`
|
|
159
|
-
flex: 1;
|
|
160
|
-
min-width: 0;
|
|
161
|
-
white-space: pre;
|
|
162
|
-
overflow-x: auto;
|
|
163
|
-
`,sl=({title:t,summary:l,onEdit:r,renderAction:n})=>{const i=Ea(()=>{const e=[];return t&&(e.push({text:t,variant:Ga.Default}),e.push({text:" - ",variant:Ga.Default})),e.push(...l),e},[t,l]);return a(nl,{children:[e(il,{children:e(Fa,{parts:i})}),n&&n(),r&&e(u,{"data-id":"sampling-btn-edit-auto-rule",label:le,rightIcon:ya,variant:h.Text,size:p.S,onClick:r})]})},ol={[ue.HttpRequest]:"HTTP request",[ue.HttpResponse]:"HTTP response",[ue.DbQuery]:"DB query",[ue.Messaging]:"messaging"};function cl(e,a,t){return 1===e?a:t??`${a}s`}function dl(e,a){const t=[],l=e.slice(0,3),r=e.slice(3);return l.forEach((e,l)=>{l>0&&t.push({text:", ",variant:Ga.Default}),t.push({text:e,variant:a})}),r.length>0&&t.push({text:` + ${r.length} more`,variant:Ga.Default,tooltipItems:r}),t}const ul=({option:a,formState:t,renderAction:l})=>{const r=Ea(()=>{const e=function(e,a){switch(e){case ne.CodeAttributes:return(e=>{const a=Object.values(pe).filter(a=>!!e.codeAttributes?.[a]).map(e=>he(e).toLowerCase());return a.length?[{text:"Collect",variant:Ga.Action},{text:" ",variant:Ga.Default},...dl(a,Ga.Endpoint)]:null})(a);case ne.PayloadCollection:return(e=>{const a=Object.values(ue).filter(a=>null!=e.payloadCollection?.[a]).map(e=>ol[e]);return a.length?[{text:"Collect",variant:Ga.Action},{text:" ",variant:Ga.Default},...dl(a,Ga.Endpoint)]:null})(a);case ne.HeadersCollection:return(e=>{const a=(e.headersCollection?.[de.HeaderKeys]??[]).map(e=>e.trim()).filter(e=>e.length>0);if(!a.length)return null;const t=cl(a.length,"HTTP header");return[{text:`Collect ${a.length} ${t}`,variant:Ga.Action},{text:"",variant:Ga.Default,tooltipItems:a}]})(a);case ne.CustomInstrumentation:return(e=>{const a=(e.customInstrumentations?.[ie.Java]??[]).map(e=>new se(e.className,e.methodName)).filter(e=>e.Verify()),t=(e.customInstrumentations?.[ie.Golang]??[]).map(e=>new oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).filter(e=>e.Verify()),l=(e.customInstrumentations?.[ie.Php]??[]).map(e=>new ce(e.className,e.functionName)).filter(e=>e.Verify());if(!(a.length+t.length+l.length))return null;const r=[];a.length&&r.push(`${a.length} Java ${cl(a.length,"probe")}`),t.length&&r.push(`${t.length} Go ${cl(t.length,"probe")}`),l.length&&r.push(`${l.length} PHP ${cl(l.length,"probe")}`);const n=[...a.map(e=>`Java: ${e.toString()}`),...t.map(e=>`Go: ${e.toString()}`),...l.map(e=>`PHP: ${e.toString()}`)];return[{text:`Apply ${r.join(" + ")}`,variant:Ga.Action},{text:"",variant:Ga.Default,tooltipItems:n}]})(a);default:return null}}(a?.type,t);return e?[...e,...Wa(t.sourceScopes)]:[]},[a?.type,t]),n=0===r.length;return e(sl,{title:n?re:"Instrumentation Rule Preview",summary:r,renderAction:l})},pl=({size:a=200,central:t=!1,useInline:l=!1})=>{const{tier:r}=Ka();if(l){if(t)return e(xa,{size:a});switch(r){case ge.Community:return e(Ca,{size:a});case ge.Onprem:return e(ka,{size:a});default:return null}}if(t)return e(Sa,{size:a});switch(r){case ge.Community:return e($a,{size:a});case ge.Onprem:return e(Ta,{size:a});default:return null}},hl=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],gl=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],ml=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],vl=({description:t,options:l,selected:r,onSelect:s,customName:o,customLabel:c,customPlaceholder:u,customValue:p,onCustomChange:h,customInputType:g=P.Number,customMin:m,customMax:v})=>a(n,{$gap:6,children:[e(i,{label:t}),a(d,{$gap:8,$alignItems:"flex-end",children:[e(U,{options:l,selected:r,setSelected:s}),"custom"===r&&e(L,{name:o,label:c,placeholder:u,type:g,value:p,onChange:h,width:160,min:m,max:v})]})]}),bl=()=>{},fl=a=>a.readOnly?e(yl,{rule:a.rule}):e(xl,{ruleType:a.ruleType,formState:a.formState,onChange:a.onChange}),yl=({rule:t})=>{const l=null!=t.durationAtLeastMs;return t.error?e(j,{richTitle:{title:me},children:e(x,{name:"sampling-view-toggle-keep-errors",onChange:bl,value:!0,size:C.S,label:ve,labelAlign:k.Right})}):l?e(j,{richTitle:{title:be},children:a("div",{children:[e(s,{size:c.XXXS,color:o.Secondary,children:fe}),e(s,{size:c.XS,children:`${t.durationAtLeastMs}ms`})]})}):null},xl=({ruleType:a,formState:t,onChange:l})=>{const r=Ra(e=>l({durationPreset:e}),[l]),n=Ra(e=>l({customDurationMs:e.target.value}),[l]);return"Duration"===a?e(j,{richTitle:{title:be,subTitle:ye},children:e(vl,{description:fe,options:ml,selected:t.durationPreset,onSelect:r,customName:"sampling-input-custom-duration",customLabel:xe,customPlaceholder:"200ms",customValue:t.customDurationMs,onCustomChange:n})}):null},kl=Ha.div`
|
|
164
|
-
display: flex;
|
|
165
|
-
gap: 32px;
|
|
166
|
-
`,Cl=Ha.div`
|
|
167
|
-
display: flex;
|
|
168
|
-
flex-direction: column;
|
|
169
|
-
gap: 4px;
|
|
170
|
-
`,Sl=Ha.div`
|
|
171
|
-
display: flex;
|
|
172
|
-
flex-wrap: wrap;
|
|
173
|
-
align-items: flex-end;
|
|
174
|
-
gap: 16px;
|
|
175
|
-
`,Tl=Ha.div`
|
|
176
|
-
display: flex;
|
|
177
|
-
align-items: flex-end;
|
|
178
|
-
gap: 16px;
|
|
179
|
-
padding: 12px 16px;
|
|
180
|
-
border-radius: 8px;
|
|
181
|
-
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
182
|
-
`,$l=Ha.div`
|
|
183
|
-
display: flex;
|
|
184
|
-
align-items: flex-end;
|
|
185
|
-
gap: 10px;
|
|
186
|
-
flex: 1;
|
|
187
|
-
`,wl=Ha.div`
|
|
188
|
-
display: flex;
|
|
189
|
-
align-items: center;
|
|
190
|
-
height: 32px;
|
|
191
|
-
`,Ml=Ha.div`
|
|
192
|
-
display: flex;
|
|
193
|
-
align-items: flex-end;
|
|
194
|
-
gap: 16px;
|
|
195
|
-
margin-bottom: 12px;
|
|
196
|
-
`,Al="Any",Ol="Kafka topic",Ll=()=>e("div",{style:{marginBottom:"8px"},children:e(s,{size:c.XS,weight:500,children:"And"})}),Pl=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],El=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Il=[{id:"",label:Al},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}],Rl=a=>a.readOnly?e(Nl,{data:a.data}):e(Vl,{category:a.category,formState:a.formState,onChange:a.onChange}),Nl=({data:t})=>{const l=Ea(()=>(e=>{if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:Ne,value:Re},{id:"route",title:Ae,value:a.httpServer.route||a.httpServer.routePrefix||Ve},{id:"method",title:Ee,value:a.httpServer.method||Al}];if(a?.httpClient){const e=[{id:"type",title:Ne,value:ze}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:Ae,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||Ve}),e.push({id:"method",title:Ee,value:a.httpClient.method||Al}),e}return[{id:"type",title:Ne,value:De}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:Ne,value:Re},{id:"route",title:Ae,value:a.httpServer.route||a.httpServer.routePrefix||Ve},{id:"method",title:Ee,value:a.httpServer.method||Al}]:a?.kafkaConsumer?[{id:"type",title:Ne,value:Xe},{id:"topic",title:Ol,value:a.kafkaConsumer.kafkaTopic||Ve}]:a?.kafkaProducer?[{id:"type",title:Ne,value:He},{id:"topic",title:Ol,value:a.kafkaProducer.kafkaTopic||Ve}]:[{id:"type",title:Ne,value:De}]})(t),[t]);return e(j,{richTitle:{title:ke},children:e(kl,{children:l.map(({id:t,title:l,value:r})=>a(Cl,{children:[e(s,{size:c.XXXS,color:o.Secondary,nowrap:!0,children:l}),e(s,{size:c.XS,nowrap:!0,children:r})]},t))})})},Vl=({category:t,formState:l,onChange:r})=>{const i=Ea(()=>"noisy"===t?Pl:El,[t]),s=Ra(e=>r({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[r]),o=Ra(e=>a=>{a&&r({routeType:e,route:""})},[r]),c=Ra(e=>r({route:e.target.value}),[r]),d=Ra(e=>r({serverAddress:e.target.value}),[r]),u=Ra(e=>r({method:e[0]||""}),[r]),g=Ra(e=>r({kafkaTopic:e.target.value}),[r]),m="httpServer"===l.operationType||"httpClient"===l.operationType,v="kafkaConsumer"===l.operationType||"kafkaProducer"===l.operationType,b="httpClient"===l.operationType?Me:Ae,f="httpClient"===l.operationType?Oe:Le;return a(j,{richTitle:{title:`2. ${ke}`,subTitle:Ce},children:[e(n,{$alignItems:"flex-start",children:e(U,{options:i,selected:l.operationType,setSelected:s})}),m&&a(Sl,{children:["httpClient"===l.operationType&&a(Ml,{children:[e(L,{name:"sampling-input-server-address",label:Te,placeholder:Se,value:l.serverAddress,onChange:d}),e(Ll,{})]}),a(Tl,{children:[a($l,{children:[e(wl,{children:e($e,{"data-id":"sampling-radio-route",value:"route"===l.routeType,onChange:o("route")})}),e(L,{name:"sampling-input-route",label:b,placeholder:we,value:"route"===l.routeType?l.route:"",onChange:c,disabled:"route"!==l.routeType})]}),a($l,{children:[e(wl,{children:e($e,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===l.routeType,onChange:o("routePrefix")})}),e(L,{name:"sampling-input-route-prefix",label:f,placeholder:we,value:"routePrefix"===l.routeType?l.route:"",onChange:c,disabled:"routePrefix"!==l.routeType})]})]}),a(Ml,{children:[e(Ll,{}),e(Pe,{label:Ee,items:Il,selectedIds:[l.method||""],setSelectedIds:e=>u(e),buttonProps:{"data-id":"sampling-btn-method",label:Il.find(e=>e.id===l.method)?.label||Al,size:p.S,variant:h.Secondary}})]})]}),v&&e(L,{name:"sampling-input-kafka-topic",label:Ie,placeholder:"Type kafka topic",value:l.kafkaTopic,onChange:g,width:"320px"})]})},zl=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Dl=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}],Xl=a=>a.readOnly?e(Hl,{data:a.data}):e(_l,{category:a.category,formState:a.formState,onChange:a.onChange}),Hl=({data:t})=>{const l=Ea(()=>(e=>{switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:qe,method:Ke,description:Be,value:`${e.rule.percentageAtLeast}%`}:{title:qe,method:Ge,description:null,value:null};case"noisy":return Ja(e.rule.percentageAtMost)?{title:qe,method:Ue,description:null,value:null}:{title:qe,method:Ke,description:je,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:qe,method:Ke,description:je,value:`${e.rule.percentageAtMost}%`}}})(t),[t]),r=[{id:"method",title:Ee,value:l.method},...null!=l.description?[{id:"value",title:l.description,value:l.value}]:[]];return e(j,{richTitle:{title:l.title},children:e(kl,{children:r.map(({id:t,title:l,value:r})=>a(Cl,{children:[e(s,{size:c.XXXS,color:o.Secondary,nowrap:!0,children:l}),e(s,{size:c.XS,nowrap:!0,children:r})]},t))})})},_l=({category:t,formState:l,onChange:r})=>{const i="highlyRelevant"===t,s=i?Dl:zl,o=`${i?4:3}. ${qe}`,c=_e[t],d=i?Be:je,u="noisy"===t?gl:hl,p=Ra(e=>r({percentageMode:e}),[r]),h=Ra(e=>r({percentagePreset:e}),[r]),g=Ra(e=>r({customPercentage:e.target.value}),[r]);return a(j,{richTitle:{title:o,subTitle:c},children:["costReduction"!==t&&e(n,{$alignItems:"flex-start",children:e(U,{options:s,selected:l.percentageMode,setSelected:p})}),("costReduction"===t||"sample"===l.percentageMode)&&e(vl,{description:d,options:u,selected:l.percentagePreset,onSelect:h,customName:"sampling-input-custom-percentage",customPlaceholder:"5%",customValue:l.customPercentage,onCustomChange:g,customInputType:P.Decimal,customMin:0,customMax:100})]})},ql=Ha.div`
|
|
197
|
-
display: flex;
|
|
198
|
-
align-items: flex-end;
|
|
199
|
-
gap: 16px;
|
|
200
|
-
`,Bl=Ha.div`
|
|
201
|
-
width: 280px;
|
|
202
|
-
flex-shrink: 0;
|
|
203
|
-
`,jl=Ha.div`
|
|
204
|
-
flex: 1;
|
|
205
|
-
min-width: 0;
|
|
206
|
-
`;function Kl(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":aa[e.category]}const Ul=a=>a.readOnly?e(Gl,{data:a.data}):e(Fl,{formState:a.formState,onChange:a.onChange}),Gl=({data:t})=>{const l=Ea(()=>[{id:"name",title:We,value:t.rule.name||Fe},{id:"type",title:Je,value:Kl(t)}],[t]),r=t.rule.notes||Ve;return a(j,{children:[e(kl,{children:l.map(({id:t,title:l,value:r})=>a(Cl,{children:[e(s,{size:c.XXXS,color:o.Secondary,nowrap:!0,children:l}),e(s,{size:c.XS,nowrap:!0,children:r})]},t))}),a(Cl,{children:[e(s,{size:c.XXXS,color:o.Secondary,children:Ye}),e(s,{size:c.XS,children:r})]})]})},Fl=({formState:t,onChange:l})=>{const r=Ra(e=>l({name:e.target.value}),[l]),n=Ra(e=>l({notes:e.target.value}),[l]);return e(j,{children:a(ql,{children:[e(Bl,{children:e(L,{name:"sampling-input-rule-name",label:We,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:Ze,value:t.name,onChange:r})}),e(jl,{children:e(L,{name:"sampling-input-note",label:Ye,tooltip:ea,placeholder:Qe,value:t.notes,onChange:n})})]})})},Wl=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],Jl=({formState:a,onChange:t})=>{const l=Ra(e=>t({ruleType:e,keepErrors:"Error"===e}),[t]);return e(j,{richTitle:{title:`3. ${Je}`,subTitle:ta},children:e(n,{$alignItems:"flex-start",children:e(U,{options:Wl,selected:a.ruleType,setSelected:l})})})},Yl=a=>{const t=Ea(()=>{if(a.readOnly)return a.summary;switch(a.category){case"noisy":return Qa(tt(a.formState));case"highlyRelevant":return Za(at(a.formState));case"costReduction":return Ya(et(a.formState))}},[a]);if(a.readOnly)return e(sl,{title:la,summary:t,renderAction:a.renderAction});const l=1===t.length&&"default"===t[0].variant;return e(sl,{title:l?re:la,summary:l?[]:t,renderAction:a.renderAction})},Zl=(e,a)=>!a?.length||!!a?.find(a=>a===e),Ql=({title:t="Signals",required:l,errorMessage:r,allowedSignals:s,selectedSignals:o,setSelectedSignals:c,disabled:u})=>{const[p,h]=Na(1===o.length),m=Ia(JSON.stringify(o));return Va(()=>{let e=ra(o).filter(e=>Zl(e,s));e.length||(e=na.filter(({id:e})=>Zl(e,s)).map(({id:e})=>e));const a=JSON.stringify(e);m.current!==a&&(m.current=a,c(e),h(1===e.length))},[s,o]),a(n,{$gap:12,children:[e(i,{label:t,required:l}),e(d,{$gap:12,children:na.map(a=>{const t=Zl(a.id,s),l=((e,a)=>!!a?.find(a=>a===e))(a.id,o);return t?e(T,{label:a.value,disabled:u||!t||p&&l,value:l,onChange:e=>((e,a)=>{const t=e,l=a?[...o,t]:o.filter(e=>e!==t);c(l),h(1===l.length)})(a.id,e)},a.id):null})}),e(g,{errorMessage:r})]})},er=({minSupportedVersion:a,currentVersion:t})=>e(m,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>e(f,{scale:2.4,icon:()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:e("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${t}.`}),ar=Ha.div`
|
|
207
|
-
display: flex;
|
|
208
|
-
flex-direction: column;
|
|
209
|
-
justify-content: flex-end;
|
|
210
|
-
width: ${({$width:e})=>e};
|
|
211
|
-
gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
|
|
212
|
-
`,tr=Ha.div`
|
|
213
|
-
display: flex;
|
|
214
|
-
align-items: center;
|
|
215
|
-
min-height: 24px;
|
|
216
|
-
padding: 12px;
|
|
217
|
-
border-radius: 16px 16px 0 0;
|
|
218
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
219
|
-
`,lr=Ha.div`
|
|
220
|
-
display: flex;
|
|
221
|
-
flex-direction: column;
|
|
222
|
-
gap: ${({$gap:e})=>e}px;
|
|
223
|
-
padding: 12px 12px 0 12px;
|
|
224
|
-
width: 100%;
|
|
225
|
-
height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
|
|
226
|
-
border-radius: ${({$columnHasHeader:e,$isLeft:a,$isRight:t})=>e?a?"0 0 0 16px":t?"0 16px 0 0":"0":a?"16px 0 0 16px":t?"0 16px 16px 0":"16px"};
|
|
227
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
228
|
-
overflow-y: auto;
|
|
229
|
-
overflow-x: hidden;
|
|
230
|
-
`,rr=({isLeft:l,isRight:r,heightOffset:n=0,width:i,header:s,list:o})=>a(ar,{$width:i,$columnHasHeader:!!s,children:[s&&e(tr,{children:s}),e(lr,{$gap:8,$isLeft:l,$isRight:r,$heightOffset:n,$columnHasHeader:!!s,children:o.length?o.length>1?e(ia,{gap:8,elements:o}):e(t,{children:o[0]}):e(sa,{$height:"100%",children:e(oa,{})})})]}),nr="75vw",ir=Ha.div`
|
|
231
|
-
display: flex;
|
|
232
|
-
flex-direction: column;
|
|
233
|
-
border-radius: 16px;
|
|
234
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
235
|
-
overflow: hidden;
|
|
236
|
-
`,sr=Ha.div`
|
|
237
|
-
display: flex;
|
|
238
|
-
gap: 12px;
|
|
239
|
-
padding: 16px 16px 0 16px;
|
|
240
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
241
|
-
position: sticky;
|
|
242
|
-
top: 0;
|
|
243
|
-
`,or=Ha.div`
|
|
244
|
-
padding: 12px 12px 0 12px;
|
|
245
|
-
`,cr=Ha.div`
|
|
246
|
-
display: flex;
|
|
247
|
-
gap: 12px;
|
|
248
|
-
padding: 16px;
|
|
249
|
-
`,dr=Ha.div`
|
|
250
|
-
padding: 5vh 10vw;
|
|
251
|
-
border-radius: 12px;
|
|
252
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
253
|
-
`,ur=Da(({isOpen:t,withOverlay:r,disableAnimation:n,onClose:i,onBack:s,onNext:o,nextIsSkip:d,onSave:u,disableSave:p,connectionIds:g,header:v,subHeader:b,leftColumn:f,rightColumn:y,search:x,filters:k,errorMessage:C,isFormDirty:S,hideDirtyNote:T,forcedNote:$,isFetching:w,progress:M},A)=>{const[O,L]=Na(!1),[P,E]=Na(!1),[I,R]=Na(void 0);Xa(A,()=>({clearErrors:()=>R(void 0)}));const V=P,z=Ra(()=>{S&&!O?L(!0):(L(!1),i?.())},[S,O,i]),D=p||P||"boolean"==typeof S&&!S,X=Ra(async()=>{E(!0);const e=await u();E(!1),!1!==e&&(e?.error?R(e.error):(g?.setValue([]),i?.()))},[u,g,i]),H=!!x||!!g||!!k,_=!!b,q=(H?48:0)+(_?50:0),B=Ea(()=>$||(w?{status:N.Info,message:"Fetching Data..."}:P&&!M?{status:N.Info,message:"Saving Changes..."}:I||C?{status:N.Error,message:I||C}:"boolean"!=typeof S||T?void 0:S?{status:N.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:{status:N.Success,message:"The values reflect the current configuration of the selected cluster."}),[w,P,M,I,C,S,T,$]),j=Ea(()=>s?{label:"Back",leftIcon:wa,variant:h.Secondary,onClick:s}:{label:"Cancel",variant:h.Secondary,onClick:z,disabled:V},[s,z,V]),[K,U]=Na(!1),G=Ea(()=>o?d?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:Ma,variant:h.Secondary,onClick:()=>U(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:Ma,variant:h.Primary,onClick:o}:{"data-id":"wide-drawer-save",label:"Save",variant:h.Primary,onClick:X,disabled:D},[o,d,X,D]);return a(l,{width:nr,isOpen:t,disableAnimation:n,hideOverlay:!P&&!r,header:{...v,onClose:i?z:void 0,onCloseDisabled:V},footer:{note:B,actions:[j,G]},children:[P?e(sa,{$height:"calc(100vh - 136px)",children:e(dr,{children:e(ca,{titleSize:c.S,subTitleSize:c.XXXS,withGradient:!0,withSpinner:!0,...M})})}):a(ir,{children:[H&&a(sr,{children:[g&&e(da,{icon:Aa,title:"Selected Clusters",badge:{label:g.value.length}}),x&&e(ua,{...x,width:x.width??"100%"}),k]}),_&&e(or,{children:e(da,{icon:b.icon,title:b.title,subTitle:b.description,badge:b.badge})}),a(cr,{children:[e(rr,{isLeft:!0,heightOffset:q,...f}),e(rr,{isRight:!0,heightOffset:q,...y})]})]}),e(kt,{isOpen:O,onClose:()=>L(!1),onApprove:z}),e(m,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:K,onClose:()=>U(!1),denyButton:{label:"Go Back",variant:h.Secondary,onClick:()=>U(!1)},approveButton:{label:"Skip",variant:h.Primary,onClick:()=>{o?.(),U(!1)}}})]})});ur.displayName=ur.name;const pr=Ha.div`
|
|
254
|
-
padding: 0 24px;
|
|
255
|
-
border-radius: 12px;
|
|
256
|
-
background-color: ${({$codeBgColor:e})=>e||"transparent"};
|
|
257
|
-
`,hr=({title:a="YAML",yaml:t,defaultOpen:l,fullHeight:r,bgTint:n="1000",codeBgColor:i})=>{const{clickCopy:s,isCopied:o}=pa(),c=Ea(()=>t?[{id:ga(),type:ha.Button,buttonProps:{variant:h.Text,size:p.S,leftIcon:o?va:Oa,onClick:()=>s(t||""),disabled:o}}]:[],[t,o]);return e(E,{bgTint:n,richTitle:{icon:La,title:a},actions:c,withCollapse:!0,collapseIsDefaultOpen:l,fullHeight:r,children:e(pr,{$codeBgColor:i,children:t?e(ma,{code:t,language:"yaml",theme:"duotoneDark"}):e(sa,{children:e(oa,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{sl as A,kt as C,ml as D,ul as I,gl as N,pl as O,hl as P,Ul as R,Yl as S,er as U,nr as W,hr as Y,Ct as a,St as b,fl as c,rl as d,Tt as e,ll as f,Rl as g,Xl as h,vl as i,Jl as j,Ql as k,zt as l,ur as m,xt as n};
|