@wallarm-org/design-system 4.10.0-rc-feat-parser.1 → 4.10.1

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.
Files changed (150) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Badge/generateBadgeVariants.js +9 -28
  3. package/dist/components/Checkbox/CheckboxGroup.d.ts +2 -1
  4. package/dist/components/Checkbox/CheckboxGroup.js +16 -13
  5. package/dist/components/CodeSnippet/internal/FoldToggle.js +1 -1
  6. package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -2
  7. package/dist/components/DropdownMenu/DropdownMenu.js +71 -84
  8. package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
  9. package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
  10. package/dist/components/Radio/RadioGroup.d.ts +2 -1
  11. package/dist/components/Radio/RadioGroup.js +16 -13
  12. package/dist/components/SimpleCharts/Chart/classes.js +1 -1
  13. package/dist/components/SimpleCharts/HorizontalBarStack/classes.js +1 -1
  14. package/dist/components/SimpleCharts/Metric/classes.d.ts +2 -2
  15. package/dist/components/SimpleCharts/Metric/classes.js +2 -2
  16. package/dist/components/Table/TableBody/TableBodyCell.js +4 -1
  17. package/dist/guidelines/patterns/complex-drawer.md +1084 -0
  18. package/dist/guidelines/patterns/confirmation-dialogs.md +3 -11
  19. package/dist/guidelines/patterns/detail-drawer.md +31 -13
  20. package/dist/guidelines/patterns/empty-states.md +6 -5
  21. package/dist/guidelines/patterns/entity-table.md +25 -29
  22. package/dist/guidelines/patterns/feedback-toasts.md +3 -11
  23. package/dist/guidelines/patterns/resource-list-page.md +14 -16
  24. package/dist/guidelines/rules.md +6 -5
  25. package/dist/guidelines/templates/ai-assistant.md +1133 -0
  26. package/dist/guidelines/templates/api-inventory.md +905 -0
  27. package/dist/guidelines/templates/attack-events.md +2722 -0
  28. package/dist/guidelines/templates/incident-detail.md +2085 -0
  29. package/dist/guidelines/templates/integrations-settings.md +836 -0
  30. package/dist/guidelines/templates/page-states.md +798 -0
  31. package/dist/guidelines/templates/rule-editor.md +886 -0
  32. package/dist/guidelines/templates/security-dashboard.md +681 -0
  33. package/dist/index.d.ts +0 -2
  34. package/dist/index.js +0 -2
  35. package/dist/metadata/components.json +20 -108
  36. package/dist/metadata/guidelines.json +1204 -37
  37. package/dist/theme/tokens.test.ts +52 -0
  38. package/package.json +1 -4
  39. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +0 -14
  40. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +0 -209
  41. package/dist/components/Rules/PointSelector/MatchStep.d.ts +0 -15
  42. package/dist/components/Rules/PointSelector/MatchStep.js +0 -186
  43. package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +0 -16
  44. package/dist/components/Rules/PointSelector/MenuFooterHints.js +0 -177
  45. package/dist/components/Rules/PointSelector/PointPreview.d.ts +0 -10
  46. package/dist/components/Rules/PointSelector/PointPreview.js +0 -88
  47. package/dist/components/Rules/PointSelector/PointSelector.d.ts +0 -17
  48. package/dist/components/Rules/PointSelector/PointSelector.js +0 -937
  49. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +0 -12
  50. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +0 -173
  51. package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +0 -31
  52. package/dist/components/Rules/PointSelector/PointSelectorError.js +0 -275
  53. package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +0 -20
  54. package/dist/components/Rules/PointSelector/PointSelectorInput.js +0 -130
  55. package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +0 -31
  56. package/dist/components/Rules/PointSelector/PointSelectorMenu.js +0 -317
  57. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +0 -8
  58. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +0 -73
  59. package/dist/components/Rules/PointSelector/SampleRequest.d.ts +0 -14
  60. package/dist/components/Rules/PointSelector/SampleRequest.js +0 -116
  61. package/dist/components/Rules/PointSelector/StepMenu.d.ts +0 -40
  62. package/dist/components/Rules/PointSelector/StepMenu.js +0 -210
  63. package/dist/components/Rules/PointSelector/VersionWarning.d.ts +0 -26
  64. package/dist/components/Rules/PointSelector/VersionWarning.js +0 -231
  65. package/dist/components/Rules/PointSelector/WhereBar.d.ts +0 -48
  66. package/dist/components/Rules/PointSelector/WhereBar.js +0 -263
  67. package/dist/components/Rules/PointSelector/classes.d.ts +0 -28
  68. package/dist/components/Rules/PointSelector/classes.js +0 -22
  69. package/dist/components/Rules/PointSelector/index.d.ts +0 -20
  70. package/dist/components/Rules/PointSelector/index.js +0 -18
  71. package/dist/components/Rules/PointSelector/liftLayer.d.ts +0 -8
  72. package/dist/components/Rules/PointSelector/liftLayer.js +0 -4
  73. package/dist/components/Rules/PointSelector/sampleValue.d.ts +0 -6
  74. package/dist/components/Rules/PointSelector/sampleValue.js +0 -51
  75. package/dist/components/Rules/PointSelector/sdkBridge.d.ts +0 -508
  76. package/dist/components/Rules/PointSelector/sdkBridge.js +0 -339
  77. package/dist/components/Rules/PointSelector/types.d.ts +0 -304
  78. package/dist/components/Rules/PointSelector/types.js +0 -0
  79. package/dist/components/Rules/PointSelector/usePointSelector.d.ts +0 -161
  80. package/dist/components/Rules/PointSelector/usePointSelector.js +0 -1088
  81. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +0 -28
  82. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +0 -208
  83. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +0 -23
  84. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +0 -950
  85. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +0 -21
  86. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +0 -110
  87. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +0 -20
  88. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +0 -31
  89. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +0 -23
  90. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +0 -131
  91. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +0 -17
  92. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +0 -14
  93. package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +0 -6
  94. package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +0 -6
  95. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +0 -24
  96. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +0 -245
  97. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +0 -15
  98. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +0 -691
  99. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +0 -19
  100. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +0 -72
  101. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +0 -27
  102. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +0 -407
  103. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +0 -14
  104. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +0 -269
  105. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +0 -25
  106. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +0 -99
  107. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +0 -14
  108. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +0 -118
  109. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +0 -14
  110. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +0 -446
  111. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +0 -14
  112. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +0 -266
  113. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +0 -35
  114. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +0 -57
  115. package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +0 -15
  116. package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +0 -10
  117. package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +0 -67
  118. package/dist/components/Rules/RuleBuilder/RuleBuilder.js +0 -366
  119. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +0 -32
  120. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +0 -420
  121. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +0 -27
  122. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +0 -446
  123. package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +0 -7
  124. package/dist/components/Rules/RuleBuilder/Summary/index.js +0 -2
  125. package/dist/components/Rules/RuleBuilder/classes.d.ts +0 -19
  126. package/dist/components/Rules/RuleBuilder/classes.js +0 -18
  127. package/dist/components/Rules/RuleBuilder/index.d.ts +0 -55
  128. package/dist/components/Rules/RuleBuilder/index.js +0 -11
  129. package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +0 -31
  130. package/dist/components/Rules/RuleBuilder/models/actionModel.js +0 -276
  131. package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +0 -95
  132. package/dist/components/Rules/RuleBuilder/models/conditionModel.js +0 -418
  133. package/dist/components/Rules/RuleBuilder/models/index.d.ts +0 -3
  134. package/dist/components/Rules/RuleBuilder/models/index.js +0 -3
  135. package/dist/components/Rules/RuleBuilder/models/validation.d.ts +0 -176
  136. package/dist/components/Rules/RuleBuilder/models/validation.js +0 -242
  137. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +0 -27
  138. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +0 -92
  139. package/dist/components/Rules/RuleBuilder/shared/index.d.ts +0 -1
  140. package/dist/components/Rules/RuleBuilder/shared/index.js +0 -1
  141. package/dist/components/Rules/RuleBuilder/types.d.ts +0 -384
  142. package/dist/components/Rules/RuleBuilder/types.js +0 -0
  143. package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +0 -65
  144. package/dist/components/Rules/RuleBuilder/utils/constants.js +0 -356
  145. package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +0 -48
  146. package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +0 -42
  147. package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +0 -92
  148. package/dist/components/Rules/RuleBuilder/utils/helpers.js +0 -54
  149. package/dist/components/Rules/RuleBuilder/utils/index.d.ts +0 -2
  150. package/dist/components/Rules/RuleBuilder/utils/index.js +0 -2
@@ -1,691 +0,0 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
3
- import { createListCollection } from "@ark-ui/react/collection";
4
- import { Checkbox, CheckboxIndicator, CheckboxLabel } from "../../../Checkbox/index.js";
5
- import { Field, FieldDescription, FieldLabel } from "../../../Field/index.js";
6
- import { Input } from "../../../Input/index.js";
7
- import { Select, SelectButton, SelectContent, SelectOption, SelectOptionIndicator, SelectOptionText, SelectPositioner } from "../../../Select/index.js";
8
- import { Text } from "../../../Text/index.js";
9
- import { ATTACK_SOURCE_CHOICES, XML_PROPERTY_CHOICES } from "../utils/constants.js";
10
- import { ConditionCard } from "./ConditionCard.js";
11
- const AttackCondition = (t0)=>{
12
- const $ = c(90);
13
- const { condition, onChange, onRemove, attackTypes } = t0;
14
- let t1;
15
- if ($[0] !== attackTypes) {
16
- t1 = createListCollection({
17
- items: attackTypes
18
- });
19
- $[0] = attackTypes;
20
- $[1] = t1;
21
- } else t1 = $[1];
22
- const attackCollection = t1;
23
- let t2;
24
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
25
- t2 = createListCollection({
26
- items: ATTACK_SOURCE_CHOICES
27
- });
28
- $[2] = t2;
29
- } else t2 = $[2];
30
- const sourceCollection = t2;
31
- let t3;
32
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
33
- t3 = createListCollection({
34
- items: XML_PROPERTY_CHOICES
35
- });
36
- $[3] = t3;
37
- } else t3 = $[3];
38
- const xmlPropertyCollection = t3;
39
- let t4;
40
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
41
- t4 = createListCollection({
42
- items: [
43
- {
44
- value: "equal",
45
- label: "Equal",
46
- description: "Exact match (full or relative URL)"
47
- },
48
- {
49
- value: "startswith",
50
- label: "Starts with",
51
- description: "Full http:// or https:// URL prefix"
52
- },
53
- {
54
- value: "regex",
55
- label: "Regex",
56
- description: "Regular expression (must start with http:// or https://)"
57
- }
58
- ]
59
- });
60
- $[4] = t4;
61
- } else t4 = $[4];
62
- const xmlRefOperatorCollection = t4;
63
- let t5;
64
- if ($[5] !== condition || $[6] !== onChange) {
65
- t5 = (details)=>{
66
- const attackType = details.value[0] || "";
67
- onChange({
68
- ...condition,
69
- attackType
70
- });
71
- };
72
- $[5] = condition;
73
- $[6] = onChange;
74
- $[7] = t5;
75
- } else t5 = $[7];
76
- const handleAttackTypeChange = t5;
77
- let t6;
78
- if ($[8] !== condition || $[9] !== onChange) {
79
- t6 = (e)=>{
80
- onChange({
81
- ...condition,
82
- point: e.target.value
83
- });
84
- };
85
- $[8] = condition;
86
- $[9] = onChange;
87
- $[10] = t6;
88
- } else t6 = $[10];
89
- const handlePointChange = t6;
90
- let t7;
91
- if ($[11] !== condition || $[12] !== onChange) {
92
- t7 = (details_0)=>{
93
- const source = details_0.value[0] || void 0;
94
- onChange({
95
- ...condition,
96
- source,
97
- stampIds: "stamp" === source ? condition.stampIds : void 0,
98
- ruleIds: "rule" === source ? condition.ruleIds : void 0,
99
- property: "xml" === source ? condition.property : void 0,
100
- reference: "xml" === source ? condition.reference : void 0
101
- });
102
- };
103
- $[11] = condition;
104
- $[12] = onChange;
105
- $[13] = t7;
106
- } else t7 = $[13];
107
- const handleSourceChange = t7;
108
- let t8;
109
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
110
- t8 = /*#__PURE__*/ jsx(Text, {
111
- size: "sm",
112
- children: "An attack of type"
113
- });
114
- $[14] = t8;
115
- } else t8 = $[14];
116
- let t9;
117
- if ($[15] !== condition.attackType) {
118
- t9 = condition.attackType ? [
119
- condition.attackType
120
- ] : [];
121
- $[15] = condition.attackType;
122
- $[16] = t9;
123
- } else t9 = $[16];
124
- let t10;
125
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
126
- t10 = /*#__PURE__*/ jsx(SelectButton, {
127
- "aria-label": "Attack type",
128
- placeholder: "Choose an attack type"
129
- });
130
- $[17] = t10;
131
- } else t10 = $[17];
132
- let t11;
133
- if ($[18] !== attackCollection.items) {
134
- t11 = attackCollection.items.map(_temp);
135
- $[18] = attackCollection.items;
136
- $[19] = t11;
137
- } else t11 = $[19];
138
- let t12;
139
- if ($[20] !== t11) {
140
- t12 = /*#__PURE__*/ jsx(SelectPositioner, {
141
- children: /*#__PURE__*/ jsx(SelectContent, {
142
- children: t11
143
- })
144
- });
145
- $[20] = t11;
146
- $[21] = t12;
147
- } else t12 = $[21];
148
- let t13;
149
- if ($[22] !== attackCollection || $[23] !== handleAttackTypeChange || $[24] !== t12 || $[25] !== t9) {
150
- t13 = /*#__PURE__*/ jsx("div", {
151
- className: "w-240",
152
- children: /*#__PURE__*/ jsxs(Select, {
153
- collection: attackCollection,
154
- value: t9,
155
- onValueChange: handleAttackTypeChange,
156
- children: [
157
- t10,
158
- t12
159
- ]
160
- })
161
- });
162
- $[22] = attackCollection;
163
- $[23] = handleAttackTypeChange;
164
- $[24] = t12;
165
- $[25] = t9;
166
- $[26] = t13;
167
- } else t13 = $[26];
168
- const t14 = condition.absent ? "was NOT detected" : "was detected";
169
- let t15;
170
- if ($[27] !== t14) {
171
- t15 = /*#__PURE__*/ jsx(Text, {
172
- size: "sm",
173
- children: t14
174
- });
175
- $[27] = t14;
176
- $[28] = t15;
177
- } else t15 = $[28];
178
- let t16;
179
- if ($[29] !== t13 || $[30] !== t15) {
180
- t16 = /*#__PURE__*/ jsxs("div", {
181
- className: "flex flex-wrap items-center gap-8",
182
- children: [
183
- t8,
184
- t13,
185
- t15
186
- ]
187
- });
188
- $[29] = t13;
189
- $[30] = t15;
190
- $[31] = t16;
191
- } else t16 = $[31];
192
- const t17 = true === condition.absent;
193
- let t18;
194
- if ($[32] !== condition || $[33] !== onChange) {
195
- t18 = (d)=>onChange({
196
- ...condition,
197
- absent: true === d.checked
198
- });
199
- $[32] = condition;
200
- $[33] = onChange;
201
- $[34] = t18;
202
- } else t18 = $[34];
203
- let t19;
204
- let t20;
205
- if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
206
- t19 = /*#__PURE__*/ jsx(CheckboxIndicator, {});
207
- t20 = /*#__PURE__*/ jsx(CheckboxLabel, {
208
- children: "Attack is NOT present (negated check)"
209
- });
210
- $[35] = t19;
211
- $[36] = t20;
212
- } else {
213
- t19 = $[35];
214
- t20 = $[36];
215
- }
216
- let t21;
217
- if ($[37] !== t17 || $[38] !== t18) {
218
- t21 = /*#__PURE__*/ jsxs(Checkbox, {
219
- checked: t17,
220
- onCheckedChange: t18,
221
- children: [
222
- t19,
223
- t20
224
- ]
225
- });
226
- $[37] = t17;
227
- $[38] = t18;
228
- $[39] = t21;
229
- } else t21 = $[39];
230
- let t22;
231
- if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
232
- t22 = /*#__PURE__*/ jsx(FieldLabel, {
233
- children: "Detection point (canonical string)"
234
- });
235
- $[40] = t22;
236
- } else t22 = $[40];
237
- let t23;
238
- if ($[41] !== condition.point || $[42] !== handlePointChange) {
239
- t23 = /*#__PURE__*/ jsx(Input, {
240
- value: condition.point,
241
- onChange: handlePointChange,
242
- placeholder: "flow",
243
- className: "font-mono text-sm"
244
- });
245
- $[41] = condition.point;
246
- $[42] = handlePointChange;
247
- $[43] = t23;
248
- } else t23 = $[43];
249
- let t24;
250
- if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
251
- t24 = /*#__PURE__*/ jsx(FieldDescription, {
252
- children: 'Use "flow" for anywhere, or a specific point'
253
- });
254
- $[44] = t24;
255
- } else t24 = $[44];
256
- let t25;
257
- if ($[45] !== t23) {
258
- t25 = /*#__PURE__*/ jsxs(Field, {
259
- children: [
260
- t22,
261
- t23,
262
- t24
263
- ]
264
- });
265
- $[45] = t23;
266
- $[46] = t25;
267
- } else t25 = $[46];
268
- let t26;
269
- if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
270
- t26 = /*#__PURE__*/ jsx(FieldLabel, {
271
- children: "Bind name (optional)"
272
- });
273
- $[47] = t26;
274
- } else t26 = $[47];
275
- const t27 = condition.bindAttack ?? "";
276
- let t28;
277
- if ($[48] !== condition || $[49] !== onChange) {
278
- t28 = (e_0)=>onChange({
279
- ...condition,
280
- bindAttack: e_0.target.value || void 0
281
- });
282
- $[48] = condition;
283
- $[49] = onChange;
284
- $[50] = t28;
285
- } else t28 = $[50];
286
- let t29;
287
- if ($[51] !== t27 || $[52] !== t28) {
288
- t29 = /*#__PURE__*/ jsx(Input, {
289
- value: t27,
290
- onChange: t28,
291
- placeholder: 'e.g., "a"',
292
- className: "font-mono text-sm w-160"
293
- });
294
- $[51] = t27;
295
- $[52] = t28;
296
- $[53] = t29;
297
- } else t29 = $[53];
298
- let t30;
299
- if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
300
- t30 = /*#__PURE__*/ jsx(FieldDescription, {
301
- children: "Bind matched attacks to this name for use in actions (bind_attack). Format 0.10.1+"
302
- });
303
- $[54] = t30;
304
- } else t30 = $[54];
305
- let t31;
306
- if ($[55] !== t29) {
307
- t31 = /*#__PURE__*/ jsxs(Field, {
308
- children: [
309
- t26,
310
- t29,
311
- t30
312
- ]
313
- });
314
- $[55] = t29;
315
- $[56] = t31;
316
- } else t31 = $[56];
317
- let t32;
318
- if ($[57] === Symbol.for("react.memo_cache_sentinel")) {
319
- t32 = /*#__PURE__*/ jsx("div", {
320
- className: "mb-8 text-sm font-medium text-text-primary",
321
- children: "Attack source filters (optional)"
322
- });
323
- $[57] = t32;
324
- } else t32 = $[57];
325
- let t33;
326
- if ($[58] === Symbol.for("react.memo_cache_sentinel")) {
327
- t33 = /*#__PURE__*/ jsx(FieldLabel, {
328
- children: "Source"
329
- });
330
- $[58] = t33;
331
- } else t33 = $[58];
332
- let t34;
333
- if ($[59] !== condition.source) {
334
- t34 = condition.source ? [
335
- condition.source
336
- ] : [];
337
- $[59] = condition.source;
338
- $[60] = t34;
339
- } else t34 = $[60];
340
- let t35;
341
- if ($[61] === Symbol.for("react.memo_cache_sentinel")) {
342
- t35 = /*#__PURE__*/ jsx(SelectButton, {
343
- placeholder: "Any source"
344
- });
345
- $[61] = t35;
346
- } else t35 = $[61];
347
- let t36;
348
- if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
349
- t36 = /*#__PURE__*/ jsx(SelectPositioner, {
350
- children: /*#__PURE__*/ jsx(SelectContent, {
351
- children: sourceCollection.items.map(_temp2)
352
- })
353
- });
354
- $[62] = t36;
355
- } else t36 = $[62];
356
- let t37;
357
- if ($[63] !== handleSourceChange || $[64] !== t34) {
358
- t37 = /*#__PURE__*/ jsxs(Select, {
359
- collection: sourceCollection,
360
- value: t34,
361
- onValueChange: handleSourceChange,
362
- children: [
363
- t35,
364
- t36
365
- ]
366
- });
367
- $[63] = handleSourceChange;
368
- $[64] = t34;
369
- $[65] = t37;
370
- } else t37 = $[65];
371
- let t38;
372
- if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
373
- t38 = /*#__PURE__*/ jsx(FieldDescription, {
374
- children: "Filter attacks by detection source"
375
- });
376
- $[66] = t38;
377
- } else t38 = $[66];
378
- let t39;
379
- if ($[67] !== t37) {
380
- t39 = /*#__PURE__*/ jsxs(Field, {
381
- children: [
382
- t33,
383
- t37,
384
- t38
385
- ]
386
- });
387
- $[67] = t37;
388
- $[68] = t39;
389
- } else t39 = $[68];
390
- let t40;
391
- if ($[69] !== condition || $[70] !== onChange) {
392
- t40 = "stamp" === condition.source && /*#__PURE__*/ jsxs(Field, {
393
- children: [
394
- /*#__PURE__*/ jsx(FieldLabel, {
395
- children: "Stamp IDs"
396
- }),
397
- /*#__PURE__*/ jsx(Input, {
398
- value: (condition.stampIds ?? []).join(", "),
399
- onChange: (e_1)=>{
400
- const val = e_1.target.value.trim();
401
- const stampIds = "" === val ? void 0 : val.split(/\s*,\s*/);
402
- onChange({
403
- ...condition,
404
- stampIds
405
- });
406
- },
407
- placeholder: "stamp-1, stamp-2, ..."
408
- }),
409
- /*#__PURE__*/ jsx(FieldDescription, {
410
- children: "Comma-separated stamp identifiers"
411
- })
412
- ]
413
- });
414
- $[69] = condition;
415
- $[70] = onChange;
416
- $[71] = t40;
417
- } else t40 = $[71];
418
- let t41;
419
- if ($[72] !== condition || $[73] !== onChange) {
420
- t41 = "rule" === condition.source && /*#__PURE__*/ jsxs(Field, {
421
- children: [
422
- /*#__PURE__*/ jsx(FieldLabel, {
423
- children: "Rule IDs"
424
- }),
425
- /*#__PURE__*/ jsx(Input, {
426
- value: Array.isArray(condition.ruleIds) ? condition.ruleIds.join(", ") : condition.ruleIds ?? "",
427
- onChange: (e_2)=>{
428
- const val_0 = e_2.target.value.trim();
429
- const ruleIds = "" === val_0 ? void 0 : val_0.split(/\s*,\s*/);
430
- onChange({
431
- ...condition,
432
- ruleIds
433
- });
434
- },
435
- placeholder: "rule-uuid-1, rule-uuid-2, ..."
436
- }),
437
- /*#__PURE__*/ jsx(FieldDescription, {
438
- children: "Comma-separated rule identifiers"
439
- })
440
- ]
441
- });
442
- $[72] = condition;
443
- $[73] = onChange;
444
- $[74] = t41;
445
- } else t41 = $[74];
446
- let t42;
447
- if ($[75] !== condition || $[76] !== onChange) {
448
- t42 = "xml" === condition.source && /*#__PURE__*/ jsxs(Fragment, {
449
- children: [
450
- /*#__PURE__*/ jsxs(Field, {
451
- children: [
452
- /*#__PURE__*/ jsx(FieldLabel, {
453
- children: "XML Property"
454
- }),
455
- /*#__PURE__*/ jsxs(Select, {
456
- collection: xmlPropertyCollection,
457
- value: Array.isArray(condition.property) ? condition.property : condition.property ? [
458
- condition.property
459
- ] : [],
460
- onValueChange: (details_1)=>{
461
- const property = 0 === details_1.value.length ? void 0 : 1 === details_1.value.length ? details_1.value[0] : details_1.value;
462
- onChange({
463
- ...condition,
464
- property
465
- });
466
- },
467
- multiple: true,
468
- children: [
469
- /*#__PURE__*/ jsx(SelectButton, {
470
- placeholder: "Any property"
471
- }),
472
- /*#__PURE__*/ jsx(SelectPositioner, {
473
- children: /*#__PURE__*/ jsx(SelectContent, {
474
- children: xmlPropertyCollection.items.map(_temp3)
475
- })
476
- })
477
- ]
478
- }),
479
- /*#__PURE__*/ jsx(FieldDescription, {
480
- children: "Filter by XML property type (dtd, xinclude, etc.)"
481
- })
482
- ]
483
- }),
484
- /*#__PURE__*/ jsxs(Field, {
485
- children: [
486
- /*#__PURE__*/ jsx(FieldLabel, {
487
- children: "Reference operator (optional)"
488
- }),
489
- /*#__PURE__*/ jsxs(Select, {
490
- collection: xmlRefOperatorCollection,
491
- value: condition.reference?.operator ? [
492
- condition.reference.operator
493
- ] : [],
494
- onValueChange: (details_2)=>{
495
- const operator = details_2.value[0];
496
- operator ? onChange({
497
- ...condition,
498
- reference: {
499
- operator,
500
- value: condition.reference?.value ?? ""
501
- }
502
- }) : onChange({
503
- ...condition,
504
- reference: void 0
505
- });
506
- },
507
- children: [
508
- /*#__PURE__*/ jsx(SelectButton, {
509
- placeholder: "No reference filter"
510
- }),
511
- /*#__PURE__*/ jsx(SelectPositioner, {
512
- children: /*#__PURE__*/ jsx(SelectContent, {
513
- children: [
514
- {
515
- value: "equal",
516
- label: "Equal",
517
- description: "Exact match (full or relative URL)"
518
- },
519
- {
520
- value: "startswith",
521
- label: "Starts with",
522
- description: "Full http:// or https:// URL prefix"
523
- },
524
- {
525
- value: "regex",
526
- label: "Regex",
527
- description: "Regular expression (must start with http:// or https://)"
528
- }
529
- ].map(_temp4)
530
- })
531
- })
532
- ]
533
- }),
534
- /*#__PURE__*/ jsx(FieldDescription, {
535
- children: "Filter by external reference URI (format 0.10.3). Only matches xxe attacks with a target."
536
- })
537
- ]
538
- }),
539
- condition.reference?.operator && /*#__PURE__*/ jsxs(Field, {
540
- children: [
541
- /*#__PURE__*/ jsx(FieldLabel, {
542
- children: "Reference value(s)"
543
- }),
544
- /*#__PURE__*/ jsx(Input, {
545
- value: Array.isArray(condition.reference.value) ? condition.reference.value.join(", ") : condition.reference.value ?? "",
546
- onChange: (e_3)=>{
547
- const val_1 = e_3.target.value.trim();
548
- const value = "" === val_1 ? "" : val_1.includes(",") ? val_1.split(/\s*,\s*/) : val_1;
549
- onChange({
550
- ...condition,
551
- reference: condition.reference ? {
552
- ...condition.reference,
553
- value
554
- } : void 0
555
- });
556
- },
557
- placeholder: "http://example.com/schema.dtd (comma-separate for OR)",
558
- className: "font-mono text-sm"
559
- }),
560
- /*#__PURE__*/ jsxs(FieldDescription, {
561
- children: [
562
- "equal" === condition.reference.operator && "Full or relative URL(s) to match",
563
- "startswith" === condition.reference.operator && "Full URL(s) with scheme, authority, and trailing / (e.g., http://www.w3.org/)",
564
- "regex" === condition.reference.operator && "Regex pattern(s) - must start with ^http:// or ^https://"
565
- ]
566
- })
567
- ]
568
- })
569
- ]
570
- });
571
- $[75] = condition;
572
- $[76] = onChange;
573
- $[77] = t42;
574
- } else t42 = $[77];
575
- let t43;
576
- if ($[78] !== t39 || $[79] !== t40 || $[80] !== t41 || $[81] !== t42) {
577
- t43 = /*#__PURE__*/ jsxs("div", {
578
- className: "rounded-8 border border-border-primary-light bg-bg-surface-2 p-12",
579
- children: [
580
- t32,
581
- t39,
582
- t40,
583
- t41,
584
- t42
585
- ]
586
- });
587
- $[78] = t39;
588
- $[79] = t40;
589
- $[80] = t41;
590
- $[81] = t42;
591
- $[82] = t43;
592
- } else t43 = $[82];
593
- let t44;
594
- if ($[83] !== onRemove || $[84] !== t16 || $[85] !== t21 || $[86] !== t25 || $[87] !== t31 || $[88] !== t43) {
595
- t44 = /*#__PURE__*/ jsxs(ConditionCard, {
596
- onRemove: onRemove,
597
- removeLabel: "Remove attack condition",
598
- children: [
599
- t16,
600
- t21,
601
- t25,
602
- t31,
603
- t43
604
- ]
605
- });
606
- $[83] = onRemove;
607
- $[84] = t16;
608
- $[85] = t21;
609
- $[86] = t25;
610
- $[87] = t31;
611
- $[88] = t43;
612
- $[89] = t44;
613
- } else t44 = $[89];
614
- return t44;
615
- };
616
- AttackCondition.displayName = "AttackCondition";
617
- function _temp(choice) {
618
- return /*#__PURE__*/ jsxs(SelectOption, {
619
- item: choice,
620
- children: [
621
- /*#__PURE__*/ jsx(SelectOptionText, {
622
- children: choice.label
623
- }),
624
- /*#__PURE__*/ jsx(SelectOptionIndicator, {})
625
- ]
626
- }, choice.value);
627
- }
628
- function _temp2(choice_0) {
629
- return /*#__PURE__*/ jsxs(SelectOption, {
630
- item: choice_0,
631
- children: [
632
- /*#__PURE__*/ jsxs("div", {
633
- className: "flex flex-col",
634
- children: [
635
- /*#__PURE__*/ jsx(SelectOptionText, {
636
- children: choice_0.label
637
- }),
638
- choice_0.description && /*#__PURE__*/ jsx(Text, {
639
- size: "xs",
640
- color: "secondary",
641
- children: choice_0.description
642
- })
643
- ]
644
- }),
645
- /*#__PURE__*/ jsx(SelectOptionIndicator, {})
646
- ]
647
- }, choice_0.value);
648
- }
649
- function _temp3(choice_1) {
650
- return /*#__PURE__*/ jsxs(SelectOption, {
651
- item: choice_1,
652
- children: [
653
- /*#__PURE__*/ jsxs("div", {
654
- className: "flex flex-col",
655
- children: [
656
- /*#__PURE__*/ jsx(SelectOptionText, {
657
- children: choice_1.label
658
- }),
659
- choice_1.description && /*#__PURE__*/ jsx(Text, {
660
- size: "xs",
661
- color: "secondary",
662
- children: choice_1.description
663
- })
664
- ]
665
- }),
666
- /*#__PURE__*/ jsx(SelectOptionIndicator, {})
667
- ]
668
- }, choice_1.value);
669
- }
670
- function _temp4(choice_2) {
671
- return /*#__PURE__*/ jsxs(SelectOption, {
672
- item: choice_2,
673
- children: [
674
- /*#__PURE__*/ jsxs("div", {
675
- className: "flex flex-col",
676
- children: [
677
- /*#__PURE__*/ jsx(SelectOptionText, {
678
- children: choice_2.label
679
- }),
680
- /*#__PURE__*/ jsx(Text, {
681
- size: "xs",
682
- color: "secondary",
683
- children: choice_2.description
684
- })
685
- ]
686
- }),
687
- /*#__PURE__*/ jsx(SelectOptionIndicator, {})
688
- ]
689
- }, choice_2.value);
690
- }
691
- export { AttackCondition };