@uniformdev/context-ui 19.62.0 → 19.62.1-alpha.127

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/dist/index.js CHANGED
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/index.ts
32
32
  var src_exports = {};
33
33
  __export(src_exports, {
34
+ AbTestSelector: () => AbTestSelector,
34
35
  ContextData: () => ContextData,
35
36
  CriteriaMatchMenu: () => CriteriaMatchMenu,
36
37
  CriteriaOperatorMenu: () => CriteriaOperatorMenu,
@@ -41,6 +42,7 @@ __export(src_exports, {
41
42
  PersonalizationCriteria: () => PersonalizationCriteria,
42
43
  PersonalizationCriteriaStatic: () => PersonalizationCriteriaStatic,
43
44
  ProjectUIVersion: () => ProjectUIVersion,
45
+ addAbTestLink: () => addAbTestLink,
44
46
  addEnrichmentLink: () => addEnrichmentLink,
45
47
  contextCriteriaMenuOperators: () => contextCriteriaMenuOperators,
46
48
  convertErrorsToObj: () => convertErrorsToObj,
@@ -61,18 +63,179 @@ module.exports = __toCommonJS(src_exports);
61
63
  var import_react = require("@emotion/react");
62
64
  var React = __toESM(require("react"));
63
65
 
64
- // src/components/CriteriaOperatorMenu/CriteriaOperatorMenu.tsx
66
+ // src/components/AbTestSelector/AbTestSelector.tsx
67
+ var import_react3 = require("@emotion/react");
65
68
  var import_design_system = require("@uniformdev/design-system");
69
+ var import_react4 = require("react");
66
70
 
67
- // src/components/CriteriaOperatorMenu/OperatorBubble.tsx
68
- var import_react2 = require("@emotion/react");
71
+ // src/hooks/useABTests.ts
72
+ var import_api = require("@uniformdev/context/api");
73
+ var import_react2 = require("react");
74
+ function useABTests({ apiHost, apiKey, projectId }) {
75
+ const [reload, setReload] = (0, import_react2.useState)(true);
76
+ const [state, setState] = (0, import_react2.useState)({
77
+ loading: false,
78
+ notConfigured: false,
79
+ error: null,
80
+ result: null
81
+ });
82
+ (0, import_react2.useEffect)(() => {
83
+ if (!projectId || !apiKey || !apiHost) {
84
+ setState({ notConfigured: true, loading: false, error: null, result: null });
85
+ return;
86
+ }
87
+ const runEffect = async () => {
88
+ setState({ notConfigured: false, loading: true, error: null, result: null });
89
+ try {
90
+ const client = new import_api.CachedTestClient({
91
+ projectId,
92
+ apiKey,
93
+ apiHost
94
+ });
95
+ const { tests } = await client.get();
96
+ setState({ notConfigured: false, loading: false, error: null, result: tests });
97
+ } catch (e) {
98
+ let message;
99
+ if (e instanceof import_api.ApiClientError) {
100
+ message = e.message;
101
+ } else {
102
+ message = e.toString();
103
+ }
104
+ setState({ notConfigured: false, loading: false, error: message, result: null });
105
+ return;
106
+ }
107
+ };
108
+ if (reload) {
109
+ runEffect().then(() => {
110
+ setReload(false);
111
+ });
112
+ }
113
+ }, [apiHost, apiKey, projectId, reload]);
114
+ return {
115
+ result: state.result,
116
+ error: state.error,
117
+ loading: state.loading,
118
+ notConfigured: state.notConfigured,
119
+ doReload: () => setReload(true)
120
+ };
121
+ }
122
+
123
+ // src/components/AbTestSelector/AbTestSelector.tsx
69
124
  var import_jsx_runtime = require("@emotion/react/jsx-runtime");
125
+ var addAbTestLink = import_react3.css`
126
+ flex: 2;
127
+ display: flex;
128
+ width: 50%;
129
+ align-items: center;
130
+ font-weight: var(--fw-bold);
131
+ color: var(--brand-primary-1);
132
+ &:hover,
133
+ &:focus {
134
+ text-decoration-line: underline;
135
+ }
136
+ `;
137
+ var AbTestList = ({ contextConfig, onSelect, value }) => {
138
+ const { loading, result, doReload = () => {
139
+ } } = useABTests(contextConfig);
140
+ if (loading) {
141
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.LoadingIndicator, {});
142
+ }
143
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
144
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Link, { text: "Refresh A/B Test list", style: { marginRight: "10px" }, onClick: () => doReload() }) }),
145
+ !result || result.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NoAbTestsView, { contextConfig }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { marginTop: "10px" }, children: [
146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.ScrollableList, { children: result.map((abTest) => {
147
+ const { id, name } = abTest;
148
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
+ import_design_system.ScrollableListItem,
150
+ {
151
+ buttonText: name,
152
+ active: id === (value == null ? void 0 : value.id),
153
+ onClick: () => onSelect(abTest)
154
+ },
155
+ id
156
+ );
157
+ }) }),
158
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
159
+ import_design_system.AddListButton,
160
+ {
161
+ className: "add-more",
162
+ onButtonClick: () => {
163
+ window.open(
164
+ `${contextConfig.apiHost}/projects/${encodeURIComponent(contextConfig.projectId)}/testing`,
165
+ "_blank"
166
+ );
167
+ },
168
+ buttonText: "Add new A/B Test"
169
+ }
170
+ )
171
+ ] })
172
+ ] });
173
+ };
174
+ var AbTestSelector = ({ value, setValue, contextConfig, loading }) => {
175
+ var _a;
176
+ const [showAbTests, setShowAbTests] = (0, import_react4.useState)(false);
177
+ if (loading) {
178
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.LoadingIndicator, {});
179
+ }
180
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("fieldset", { className: "ab-test", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
181
+ !showAbTests && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
182
+ value && Object.keys(value).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Heading, { level: 4, style: { marginBottom: "10px" }, children: (_a = value == null ? void 0 : value.name) != null ? _a : "Unknown test" }),
183
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Button, { buttonType: "primary", style: { marginRight: "10px" }, onClick: () => setShowAbTests(true), children: "Select A/B Test" })
184
+ ] }),
185
+ showAbTests && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
186
+ AbTestList,
187
+ {
188
+ contextConfig,
189
+ onSelect: (abTest) => {
190
+ if ((value == null ? void 0 : value.id) === abTest.id) {
191
+ setValue(void 0);
192
+ setShowAbTests(true);
193
+ return;
194
+ }
195
+ setValue(abTest);
196
+ setShowAbTests(false);
197
+ },
198
+ value
199
+ }
200
+ )
201
+ ] }) });
202
+ };
203
+ var NoAbTestsView = ({ contextConfig }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
204
+ import_design_system.Callout,
205
+ {
206
+ title: "No A/B tests found in your Uniform project.",
207
+ type: "caution",
208
+ css: { marginBlock: "var(--spacing-base)" },
209
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
210
+ "Looks like you do not have any A/B tests created in your connected Uniform project. Start by creating your first test",
211
+ " ",
212
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
213
+ "a",
214
+ {
215
+ href: `${contextConfig.apiHost}/projects/${encodeURIComponent(contextConfig.projectId)}/testing`,
216
+ target: "_blank",
217
+ rel: "noopener noreferrer",
218
+ css: { ":hover": { textDecorationLine: "underline" } },
219
+ children: "here"
220
+ }
221
+ ),
222
+ "."
223
+ ] })
224
+ }
225
+ );
226
+
227
+ // src/components/CriteriaOperatorMenu/CriteriaOperatorMenu.tsx
228
+ var import_design_system2 = require("@uniformdev/design-system");
229
+
230
+ // src/components/CriteriaOperatorMenu/OperatorBubble.tsx
231
+ var import_react5 = require("@emotion/react");
232
+ var import_jsx_runtime2 = require("@emotion/react/jsx-runtime");
70
233
  function OperatorBubble({ op }) {
71
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
234
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
72
235
  "div",
73
236
  {
74
237
  className: "operation-bubble",
75
- css: import_react2.css`
238
+ css: import_react5.css`
76
239
  align-items: center;
77
240
  background: var(--gray-700);
78
241
  border-radius: var(--rounded-full);
@@ -89,12 +252,12 @@ function OperatorBubble({ op }) {
89
252
  }
90
253
 
91
254
  // src/components/CriteriaOperatorMenu/CriteriaOperatorOption.tsx
92
- var import_jsx_runtime2 = require("@emotion/react/jsx-runtime");
255
+ var import_jsx_runtime3 = require("@emotion/react/jsx-runtime");
93
256
  var CriteriaOperatorOption = (props) => {
94
257
  var _a, _b;
95
258
  const { data, getStyles, isDisabled, innerRef, innerProps } = props;
96
259
  const [name, description] = (_b = (_a = data.label) == null ? void 0 : _a.split(":")) != null ? _b : [];
97
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
260
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
98
261
  "div",
99
262
  {
100
263
  css: {
@@ -107,7 +270,7 @@ var CriteriaOperatorOption = (props) => {
107
270
  "aria-disabled": isDisabled,
108
271
  ...innerProps,
109
272
  children: [
110
- description ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OperatorBubble, { op: name }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
273
+ description ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(OperatorBubble, { op: name }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
111
274
  "div",
112
275
  {
113
276
  css: {
@@ -116,30 +279,30 @@ var CriteriaOperatorOption = (props) => {
116
279
  }
117
280
  }
118
281
  ),
119
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: description != null ? description : name })
282
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: description != null ? description : name })
120
283
  ]
121
284
  }
122
285
  );
123
286
  };
124
287
 
125
288
  // src/components/CriteriaOperatorMenu/CriteriaOperatorSingleValue.tsx
126
- var import_jsx_runtime3 = require("@emotion/react/jsx-runtime");
289
+ var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
127
290
  var CriteriaOperatorSingleValue = (props) => {
128
291
  const { data, getStyles } = props;
129
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
292
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
130
293
  "div",
131
294
  {
132
295
  css: {
133
296
  ...getStyles("singleValue", props),
134
297
  width: "max-content"
135
298
  },
136
- children: data.label.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(OperatorBubble, { op: data.label }) : data.label
299
+ children: data.label.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(OperatorBubble, { op: data.label }) : data.label
137
300
  }
138
301
  );
139
302
  };
140
303
 
141
304
  // src/components/CriteriaOperatorMenu/CriteriaOperatorMenu.tsx
142
- var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
305
+ var import_jsx_runtime5 = require("@emotion/react/jsx-runtime");
143
306
  var contextCriteriaMenuOperators = [
144
307
  {
145
308
  name: "=",
@@ -172,18 +335,22 @@ var contextCriteriaMenuOperators = [
172
335
  value: "<="
173
336
  },
174
337
  {
175
- name: "has the strongest score",
338
+ name: "has strongest score across all categories",
176
339
  value: "+"
177
340
  },
178
341
  {
179
342
  name: "has the weakest score",
180
343
  value: "-"
344
+ },
345
+ {
346
+ name: "has strongest category score",
347
+ value: "^"
181
348
  }
182
349
  ];
183
350
  function CriteriaOperatorMenu({ onChange, value, ...props }) {
184
351
  var _a, _b;
185
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
186
- import_design_system.InputComboBox,
352
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
353
+ import_design_system2.InputComboBox,
187
354
  {
188
355
  ...props,
189
356
  value: {
@@ -244,20 +411,20 @@ function CriteriaOperatorMenu({ onChange, value, ...props }) {
244
411
  }
245
412
 
246
413
  // src/components/DataContext/DataContext.tsx
247
- var import_design_system2 = require("@uniformdev/design-system");
248
- var import_react5 = require("react");
414
+ var import_design_system3 = require("@uniformdev/design-system");
415
+ var import_react8 = require("react");
249
416
 
250
417
  // src/hooks/useContextData.ts
251
- var import_api = require("@uniformdev/context/api");
252
- var import_react3 = require("react");
418
+ var import_api2 = require("@uniformdev/context/api");
419
+ var import_react6 = require("react");
253
420
  function useContextData({ apiHost, apiKey, projectId }) {
254
- const [state, setState] = (0, import_react3.useState)({
421
+ const [state, setState] = (0, import_react6.useState)({
255
422
  loading: false,
256
423
  notConfigured: false,
257
424
  error: null,
258
425
  result: null
259
426
  });
260
- (0, import_react3.useEffect)(() => {
427
+ (0, import_react6.useEffect)(() => {
261
428
  if (!projectId || !apiKey || !apiHost) {
262
429
  setState({ notConfigured: true, loading: false, error: null, result: null });
263
430
  return;
@@ -265,7 +432,7 @@ function useContextData({ apiHost, apiKey, projectId }) {
265
432
  const runEffect = async () => {
266
433
  setState({ notConfigured: false, loading: true, error: null, result: null });
267
434
  try {
268
- const client = new import_api.CachedManifestClient({
435
+ const client = new import_api2.CachedManifestClient({
269
436
  projectId,
270
437
  apiKey,
271
438
  apiHost
@@ -274,7 +441,7 @@ function useContextData({ apiHost, apiKey, projectId }) {
274
441
  setState({ notConfigured: false, loading: false, error: null, result });
275
442
  } catch (e) {
276
443
  let message;
277
- if (e instanceof import_api.ApiClientError) {
444
+ if (e instanceof import_api2.ApiClientError) {
278
445
  if (e.statusCode === 403) {
279
446
  message = `The API key ${apiKey} did not have permissions to fetch the manifest. Ensure Context > Read Drafts permissions are granted.`;
280
447
  }
@@ -297,8 +464,8 @@ function useContextData({ apiHost, apiKey, projectId }) {
297
464
  }
298
465
 
299
466
  // src/hooks/useDimensions.ts
300
- var import_api2 = require("@uniformdev/context/api");
301
- var import_react4 = require("react");
467
+ var import_api3 = require("@uniformdev/context/api");
468
+ var import_react7 = require("react");
302
469
 
303
470
  // src/utils/objectify.ts
304
471
  function objectify(array2, keySelector, valueSelector) {
@@ -314,13 +481,13 @@ function objectify(array2, keySelector, valueSelector) {
314
481
 
315
482
  // src/hooks/useDimensions.ts
316
483
  function useDimensions({ apiHost, apiKey, projectId }) {
317
- const [state, setState] = (0, import_react4.useState)({
484
+ const [state, setState] = (0, import_react7.useState)({
318
485
  loading: false,
319
486
  notConfigured: false,
320
487
  error: null,
321
488
  result: null
322
489
  });
323
- (0, import_react4.useEffect)(() => {
490
+ (0, import_react7.useEffect)(() => {
324
491
  if (!projectId || !apiKey || !apiHost) {
325
492
  setState({ notConfigured: true, loading: false, error: null, result: null });
326
493
  return;
@@ -328,14 +495,14 @@ function useDimensions({ apiHost, apiKey, projectId }) {
328
495
  const runEffect = async () => {
329
496
  setState({ notConfigured: false, loading: true, error: null, result: null });
330
497
  try {
331
- const client = new import_api2.CachedDimensionClient({
498
+ const client = new import_api3.CachedDimensionClient({
332
499
  projectId,
333
500
  apiKey,
334
501
  apiHost
335
502
  });
336
503
  const dimensions = (await client.get()).dimensions.map((dim) => ({
337
504
  ...dim,
338
- displayName: (0, import_api2.computeDimensionDisplayName)(dim)
505
+ displayName: (0, import_api3.computeDimensionDisplayName)(dim)
339
506
  }));
340
507
  const result = {
341
508
  dimensions,
@@ -348,7 +515,7 @@ function useDimensions({ apiHost, apiKey, projectId }) {
348
515
  setState({ notConfigured: false, loading: false, error: null, result });
349
516
  } catch (e) {
350
517
  let message;
351
- if (e instanceof import_api2.ApiClientError) {
518
+ if (e instanceof import_api3.ApiClientError) {
352
519
  message = e.message;
353
520
  } else {
354
521
  message = e.toString();
@@ -368,8 +535,8 @@ function useDimensions({ apiHost, apiKey, projectId }) {
368
535
  }
369
536
 
370
537
  // src/components/DataContext/DataContext.tsx
371
- var import_jsx_runtime5 = require("@emotion/react/jsx-runtime");
372
- var ContextDataContext = (0, import_react5.createContext)(null);
538
+ var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
539
+ var ContextDataContext = (0, import_react8.createContext)(null);
373
540
  var ContextData = ({
374
541
  loadingComponent: LoadingComponent,
375
542
  errorComponent: ErrorComponent,
@@ -380,23 +547,23 @@ var ContextData = ({
380
547
  const dimensionsData = useDimensions(contextConfig);
381
548
  if (contextData.error || contextData.notConfigured) {
382
549
  if (ErrorComponent)
383
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ErrorComponent, { contextConfig, result: contextData });
550
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ErrorComponent, { contextConfig, result: contextData });
384
551
  else
385
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: "ErrorComponent is not configured" });
552
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: "ErrorComponent is not configured" });
386
553
  }
387
554
  if (dimensionsData.error || dimensionsData.notConfigured) {
388
555
  if (ErrorComponent)
389
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ErrorComponent, { contextConfig, result: dimensionsData });
556
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ErrorComponent, { contextConfig, result: dimensionsData });
390
557
  else
391
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: "ErrorComponent is not configured" });
558
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: "ErrorComponent is not configured" });
392
559
  }
393
560
  if (contextData.loading || dimensionsData.loading) {
394
561
  if (LoadingComponent)
395
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoadingComponent, {});
562
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LoadingComponent, {});
396
563
  else
397
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system2.LoadingIndicator, {});
564
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system3.LoadingIndicator, {});
398
565
  }
399
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
566
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
400
567
  ContextDataContext.Provider,
401
568
  {
402
569
  value: { manifest: contextData.result, dimensions: dimensionsData.result, contextConfig },
@@ -405,21 +572,21 @@ var ContextData = ({
405
572
  );
406
573
  };
407
574
  function useContextConfig() {
408
- const context = (0, import_react5.useContext)(ContextDataContext);
575
+ const context = (0, import_react8.useContext)(ContextDataContext);
409
576
  if (!(context == null ? void 0 : context.contextConfig)) {
410
577
  throw new Error("Not within DataContext! Configuration data is not exist.");
411
578
  }
412
579
  return context.contextConfig;
413
580
  }
414
581
  function useManifest() {
415
- const context = (0, import_react5.useContext)(ContextDataContext);
582
+ const context = (0, import_react8.useContext)(ContextDataContext);
416
583
  if (!(context == null ? void 0 : context.manifest)) {
417
584
  throw new Error("Not within DataContext! Manifest data is not exist.");
418
585
  }
419
586
  return context.manifest;
420
587
  }
421
588
  function useDimensionsDataContext() {
422
- const context = (0, import_react5.useContext)(ContextDataContext);
589
+ const context = (0, import_react8.useContext)(ContextDataContext);
423
590
  if (!(context == null ? void 0 : context.dimensions)) {
424
591
  throw new Error("Not within DataContext! Dimensions data is not exist.");
425
592
  }
@@ -427,11 +594,11 @@ function useDimensionsDataContext() {
427
594
  }
428
595
 
429
596
  // src/components/DimensionMenu/CriteriaMatchMenu.tsx
430
- var import_design_system5 = require("@uniformdev/design-system");
431
- var import_react7 = require("react");
597
+ var import_design_system6 = require("@uniformdev/design-system");
598
+ var import_react10 = require("react");
432
599
 
433
600
  // src/components/DimensionMenu/DimensionGroupHeading.tsx
434
- var import_design_system3 = require("@uniformdev/design-system");
601
+ var import_design_system4 = require("@uniformdev/design-system");
435
602
 
436
603
  // src/components/DimensionMenu/utils.ts
437
604
  function dimensionToMenuOption(dimension) {
@@ -472,11 +639,11 @@ function groupDimensions(dimensions) {
472
639
  }
473
640
 
474
641
  // src/components/DimensionMenu/DimensionGroupHeading.tsx
475
- var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
642
+ var import_jsx_runtime7 = require("@emotion/react/jsx-runtime");
476
643
  var DimensionGroupHeading = (props) => {
477
644
  var _a;
478
645
  const { data, getStyles, className } = props;
479
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
646
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
480
647
  "div",
481
648
  {
482
649
  css: {
@@ -485,13 +652,13 @@ var DimensionGroupHeading = (props) => {
485
652
  fontSize: "var(--font-size-sm)"
486
653
  },
487
654
  className,
488
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
655
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
489
656
  "small",
490
657
  {
491
658
  css: { color: "var(--gray-500)", display: "flex", alignItems: "center", gap: "var(--spacing-xs)" },
492
659
  children: [
493
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system3.Icon, { icon: dimensionIcon((_a = data.label) != null ? _a : ""), iconColor: "currentColor", size: 16 }),
494
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: data.label })
660
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system4.Icon, { icon: dimensionIcon((_a = data.label) != null ? _a : ""), iconColor: "currentColor", size: 16 }),
661
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: data.label })
495
662
  ]
496
663
  }
497
664
  )
@@ -500,15 +667,15 @@ var DimensionGroupHeading = (props) => {
500
667
  };
501
668
 
502
669
  // src/components/DimensionMenu/DimensionMenuErrorMessage.tsx
503
- var import_react6 = require("@emotion/react");
504
- var import_jsx_runtime7 = require("@emotion/react/jsx-runtime");
670
+ var import_react9 = require("@emotion/react");
671
+ var import_jsx_runtime8 = require("@emotion/react/jsx-runtime");
505
672
  function DimensionMenuErrorMessage({ message }) {
506
673
  if (!message)
507
674
  return null;
508
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
675
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
509
676
  "div",
510
677
  {
511
- css: import_react6.css`
678
+ css: import_react9.css`
512
679
  color: var(--brand-primary-2);
513
680
  font-size: var(--fs-xs);
514
681
  position: absolute;
@@ -520,12 +687,12 @@ function DimensionMenuErrorMessage({ message }) {
520
687
  }
521
688
 
522
689
  // src/components/DimensionMenu/DimensionOption.tsx
523
- var import_jsx_runtime8 = require("@emotion/react/jsx-runtime");
690
+ var import_jsx_runtime9 = require("@emotion/react/jsx-runtime");
524
691
  var DimensionOption = (props) => {
525
692
  var _a, _b;
526
693
  const { data, getStyles, cx, isDisabled, isFocused, isSelected, className, innerRef, innerProps } = props;
527
694
  const [, value] = (_b = (_a = data.label) == null ? void 0 : _a.split(":")) != null ? _b : [];
528
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
695
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
529
696
  "div",
530
697
  {
531
698
  css: getStyles("option", props),
@@ -541,17 +708,17 @@ var DimensionOption = (props) => {
541
708
  ref: innerRef,
542
709
  "aria-disabled": isDisabled,
543
710
  ...innerProps,
544
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { css: { color: "var(--gray-700)" }, children: value != null ? value : data.label })
711
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { css: { color: "var(--gray-700)" }, children: value != null ? value : data.label })
545
712
  }
546
713
  );
547
714
  };
548
715
 
549
716
  // src/components/DimensionMenu/DimensionValue.tsx
550
- var import_design_system4 = require("@uniformdev/design-system");
551
- var import_jsx_runtime9 = require("@emotion/react/jsx-runtime");
717
+ var import_design_system5 = require("@uniformdev/design-system");
718
+ var import_jsx_runtime10 = require("@emotion/react/jsx-runtime");
552
719
  function DimensionValue({ displayName }) {
553
720
  const [type, name] = displayName.split(":");
554
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
721
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
555
722
  "div",
556
723
  {
557
724
  css: {
@@ -559,31 +726,31 @@ function DimensionValue({ displayName }) {
559
726
  overflow: "hidden"
560
727
  },
561
728
  children: [
562
- name ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
729
+ name ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
563
730
  "small",
564
731
  {
565
732
  css: { color: "var(--gray-500)", display: "flex", alignItems: "center", gap: "var(--spacing-xs)" },
566
733
  children: [
567
- type ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_design_system4.Icon, { icon: dimensionIcon(type), iconColor: "currentColor", size: 16 }) : null,
568
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { "data-testid": "dimension-name", children: type })
734
+ type ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_design_system5.Icon, { icon: dimensionIcon(type), iconColor: "currentColor", size: 16 }) : null,
735
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "data-testid": "dimension-name", children: type })
569
736
  ]
570
737
  }
571
738
  ) : null,
572
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { css: { color: "var(--gray-700)" }, "data-testid": "dimension-value", children: name != null ? name : type })
739
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { css: { color: "var(--gray-700)" }, "data-testid": "dimension-value", children: name != null ? name : type })
573
740
  ]
574
741
  }
575
742
  );
576
743
  }
577
744
 
578
745
  // src/components/DimensionMenu/DimensionSingleValue.tsx
579
- var import_jsx_runtime10 = require("@emotion/react/jsx-runtime");
746
+ var import_jsx_runtime11 = require("@emotion/react/jsx-runtime");
580
747
  var DimensionSingleValue = (props) => {
581
748
  const { data, getStyles } = props;
582
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { css: getStyles("singleValue", props), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DimensionValue, { displayName: data.label }) });
749
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { css: getStyles("singleValue", props), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DimensionValue, { displayName: data.label }) });
583
750
  };
584
751
 
585
752
  // src/components/DimensionMenu/CriteriaMatchMenu.tsx
586
- var import_jsx_runtime11 = require("@emotion/react/jsx-runtime");
753
+ var import_jsx_runtime12 = require("@emotion/react/jsx-runtime");
587
754
  function CriteriaMatchMenu({
588
755
  onChange,
589
756
  criteriaMatch,
@@ -592,14 +759,14 @@ function CriteriaMatchMenu({
592
759
  ...props
593
760
  }) {
594
761
  var _a, _b;
595
- const [inputValue, setInputValue] = (0, import_react7.useState)(
762
+ const [inputValue, setInputValue] = (0, import_react10.useState)(
596
763
  typeof criteriaMatch.r !== "undefined" && isInt(criteriaMatch.r) !== null ? criteriaMatch.r.toString(10) : ""
597
764
  );
598
765
  const rDim = criteriaMatch.rDim;
599
766
  const targetDim = criteriaMatch.rDim ? dimensions.dimIndex[criteriaMatch.rDim] : void 0;
600
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
601
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
602
- import_design_system5.InputComboBox,
767
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
768
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
769
+ import_design_system6.InputComboBox,
603
770
  {
604
771
  ...props,
605
772
  inputValue,
@@ -665,26 +832,26 @@ function CriteriaMatchMenu({
665
832
  },
666
833
  noOptionsMessage: ({ inputValue: inputValue2 }) => {
667
834
  if (isInt(inputValue2)) {
668
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
669
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
835
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
836
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
670
837
  "Score: ",
671
838
  inputValue2
672
839
  ] }),
673
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: "If you want to match on another dimension\u2019s score instead, clear the score value to search for a dimension." })
840
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "If you want to match on another dimension\u2019s score instead, clear the score value to search for a dimension." })
674
841
  ] });
675
842
  }
676
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
677
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
843
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
844
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
678
845
  "No dimensions match your search \u201C",
679
846
  inputValue2,
680
847
  "\u201D"
681
848
  ] }),
682
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: "If you want to match a literal score, enter a numeric value." })
849
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "If you want to match a literal score, enter a numeric value." })
683
850
  ] });
684
851
  }
685
852
  }
686
853
  ),
687
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DimensionMenuErrorMessage, { message: errorMessage })
854
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DimensionMenuErrorMessage, { message: errorMessage })
688
855
  ] });
689
856
  }
690
857
  function isInt(value) {
@@ -692,12 +859,12 @@ function isInt(value) {
692
859
  }
693
860
 
694
861
  // src/components/DimensionMenu/DimensionMenu.tsx
695
- var import_design_system6 = require("@uniformdev/design-system");
696
- var import_jsx_runtime12 = require("@emotion/react/jsx-runtime");
862
+ var import_design_system7 = require("@uniformdev/design-system");
863
+ var import_jsx_runtime13 = require("@emotion/react/jsx-runtime");
697
864
  function DimensionMenu({ onChange, value, dimensions, errorMessage, ...props }) {
698
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
699
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
700
- import_design_system6.InputComboBox,
865
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
866
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
867
+ import_design_system7.InputComboBox,
701
868
  {
702
869
  ...props,
703
870
  value: value ? dimensionToMenuOption(value) : void 0,
@@ -726,17 +893,17 @@ function DimensionMenu({ onChange, value, dimensions, errorMessage, ...props })
726
893
  }
727
894
  }
728
895
  ),
729
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DimensionMenuErrorMessage, { message: errorMessage })
896
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DimensionMenuErrorMessage, { message: errorMessage })
730
897
  ] });
731
898
  }
732
899
 
733
900
  // src/components/EditLink/EditLink.tsx
734
901
  var import_CgChevronRight = require("@react-icons/all-files/cg/CgChevronRight");
735
- var import_design_system7 = require("@uniformdev/design-system");
902
+ var import_design_system8 = require("@uniformdev/design-system");
736
903
 
737
904
  // src/components/EditLink/EditLink.styles.ts
738
- var import_react8 = require("@emotion/react");
739
- var editLink = import_react8.css`
905
+ var import_react11 = require("@emotion/react");
906
+ var editLink = import_react11.css`
740
907
  display: flex;
741
908
  align-items: center;
742
909
  font-weight: var(--fw-bold);
@@ -750,9 +917,9 @@ var editLink = import_react8.css`
750
917
  `;
751
918
 
752
919
  // src/components/EditLink/EditLink.tsx
753
- var import_jsx_runtime13 = require("@emotion/react/jsx-runtime");
920
+ var import_jsx_runtime14 = require("@emotion/react/jsx-runtime");
754
921
  var EditLink = ({ linkTo, name, linkText = `Edit ${name} Component` }) => {
755
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
922
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
756
923
  "a",
757
924
  {
758
925
  css: editLink,
@@ -762,23 +929,23 @@ var EditLink = ({ linkTo, name, linkText = `Edit ${name} Component` }) => {
762
929
  href: linkTo,
763
930
  children: [
764
931
  linkText,
765
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system7.Icon, { icon: import_CgChevronRight.CgChevronRight, iconColor: "currentColor", size: "1.5rem" })
932
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Icon, { icon: import_CgChevronRight.CgChevronRight, iconColor: "currentColor", size: "1.5rem" })
766
933
  ]
767
934
  }
768
935
  );
769
936
  };
770
937
 
771
938
  // src/components/EnrichmentTag/EnrichmentTag.tsx
772
- var import_react9 = require("@emotion/react");
939
+ var import_react12 = require("@emotion/react");
773
940
  var import_CgCloseO = require("@react-icons/all-files/cg/CgCloseO");
774
941
  var import_CgMathMinus = require("@react-icons/all-files/cg/CgMathMinus");
775
942
  var import_CgMathPlus = require("@react-icons/all-files/cg/CgMathPlus");
776
943
  var import_context = require("@uniformdev/context");
777
- var import_design_system8 = require("@uniformdev/design-system");
778
- var import_immer = __toESM(require("immer"));
779
- var import_react10 = require("react");
780
- var import_jsx_runtime14 = require("@emotion/react/jsx-runtime");
781
- var addEnrichmentLink = import_react9.css`
944
+ var import_design_system9 = require("@uniformdev/design-system");
945
+ var import_immer = require("immer");
946
+ var import_react13 = require("react");
947
+ var import_jsx_runtime15 = require("@emotion/react/jsx-runtime");
948
+ var addEnrichmentLink = import_react12.css`
782
949
  flex: 2;
783
950
  display: flex;
784
951
  width: 50%;
@@ -797,11 +964,11 @@ var EnrichmentTag = ({
797
964
  displayTitle = true
798
965
  }) => {
799
966
  const { loading, result: dimensions, error } = useDimensions(contextConfig);
800
- const allEnrichments = (0, import_react10.useMemo)(() => {
967
+ const allEnrichments = (0, import_react13.useMemo)(() => {
801
968
  if (dimensions)
802
969
  return dimensions.dimensions.filter((dimension) => dimension.category === "ENR");
803
970
  }, [dimensions]);
804
- const remainingEnrichments = (0, import_react10.useMemo)(() => {
971
+ const remainingEnrichments = (0, import_react13.useMemo)(() => {
805
972
  if (!value)
806
973
  return allEnrichments;
807
974
  if (allEnrichments)
@@ -809,9 +976,9 @@ var EnrichmentTag = ({
809
976
  (enr) => !value.some((val) => (0, import_context.getEnrichmentVectorKey)(val.cat, val.key) === enr.dim)
810
977
  );
811
978
  }, [allEnrichments, value]);
812
- const [selectValue, setSelectValue] = (0, import_react10.useState)("");
813
- const [score, setScore] = (0, import_react10.useState)(50);
814
- const [showAddNewEnrichmentTagPanel, setShowAddNewEnrichmentTagPanel] = (0, import_react10.useState)(false);
979
+ const [selectValue, setSelectValue] = (0, import_react13.useState)("");
980
+ const [score, setScore] = (0, import_react13.useState)(50);
981
+ const [showAddNewEnrichmentTagPanel, setShowAddNewEnrichmentTagPanel] = (0, import_react13.useState)(false);
815
982
  const selectedEnrichment = allEnrichments == null ? void 0 : allEnrichments.find((dimension) => dimension.dim === selectValue);
816
983
  const addEnrichment = () => {
817
984
  const [cat, key] = selectValue.split("_");
@@ -834,21 +1001,21 @@ var EnrichmentTag = ({
834
1001
  setValue(finalValue);
835
1002
  };
836
1003
  if (error)
837
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Callout, { type: "danger", children: error });
1004
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Callout, { type: "danger", children: error });
838
1005
  if (loading || dimensions === null)
839
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.LoadingIndicator, {});
840
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("fieldset", { className: "enrichment-tag", children: [
841
- displayTitle ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { css: { display: "flex", justifyContent: "space-between", marginBottom: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("legend", { css: { fontSize: "var(--fs-md)", fontWeight: "var(--fw-bold)" }, children: "Enrichment Tags" }) }) : null,
842
- !(allEnrichments == null ? void 0 : allEnrichments.length) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(NoEnrichmentsView, { contextConfig }) : !showAddNewEnrichmentTagPanel && !value ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
843
- import_design_system8.Callout,
1006
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.LoadingIndicator, {});
1007
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("fieldset", { className: "enrichment-tag", children: [
1008
+ displayTitle ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { css: { display: "flex", justifyContent: "space-between", marginBottom: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("legend", { css: { fontSize: "var(--fs-md)", fontWeight: "var(--fw-bold)" }, children: "Enrichment Tags" }) }) : null,
1009
+ !(allEnrichments == null ? void 0 : allEnrichments.length) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(NoEnrichmentsView, { contextConfig }) : !showAddNewEnrichmentTagPanel && !value ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1010
+ import_design_system9.Callout,
844
1011
  {
845
1012
  title: "No enrichment tags assigned.",
846
1013
  type: "info",
847
1014
  css: { marginBlock: "var(--spacing-base)" },
848
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
1015
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { children: [
849
1016
  "Click",
850
1017
  " ",
851
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1018
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
852
1019
  "a",
853
1020
  {
854
1021
  onClick: () => setShowAddNewEnrichmentTagPanel(true),
@@ -862,9 +1029,9 @@ var EnrichmentTag = ({
862
1029
  "to assign your first enrichment tag."
863
1030
  ] })
864
1031
  }
865
- ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
866
- dimensions && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectedEnrichments, { list: value != null ? value : [], setList: update, dimIndex: dimensions.dimIndex }),
867
- showAddNewEnrichmentTagPanel && remainingEnrichments && remainingEnrichments.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1032
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
1033
+ dimensions && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectedEnrichments, { list: value != null ? value : [], setList: update, dimIndex: dimensions.dimIndex }),
1034
+ showAddNewEnrichmentTagPanel && remainingEnrichments && remainingEnrichments.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
868
1035
  "div",
869
1036
  {
870
1037
  className: "add-enrichment-tag",
@@ -876,8 +1043,8 @@ var EnrichmentTag = ({
876
1043
  alignItems: "center"
877
1044
  },
878
1045
  children: [
879
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { css: { flexGrow: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
880
- import_design_system8.InputSelect,
1046
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { css: { flexGrow: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1047
+ import_design_system9.InputSelect,
881
1048
  {
882
1049
  name: `enrichment-type`,
883
1050
  label: "Enrichment Tag",
@@ -893,7 +1060,7 @@ var EnrichmentTag = ({
893
1060
  onChange: (e) => setSelectValue(e.currentTarget.value)
894
1061
  }
895
1062
  ) }),
896
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1063
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
897
1064
  ScoreCounter,
898
1065
  {
899
1066
  score,
@@ -902,8 +1069,8 @@ var EnrichmentTag = ({
902
1069
  css: { flexBasis: "9rem" }
903
1070
  }
904
1071
  ),
905
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
906
- import_design_system8.Button,
1072
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1073
+ import_design_system9.Button,
907
1074
  {
908
1075
  buttonType: "tertiary",
909
1076
  size: "xl",
@@ -921,21 +1088,21 @@ var EnrichmentTag = ({
921
1088
  ]
922
1089
  }
923
1090
  ) : null,
924
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1091
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
925
1092
  "div",
926
1093
  {
927
1094
  className: "enrichment-cta",
928
1095
  style: { paddingTop: "10px", display: "flex", justifyContent: "space-between" },
929
1096
  children: [
930
- !showAddNewEnrichmentTagPanel && remainingEnrichments && remainingEnrichments.length > 0 && value ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
931
- import_design_system8.AddListButton,
1097
+ !showAddNewEnrichmentTagPanel && remainingEnrichments && remainingEnrichments.length > 0 && value ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1098
+ import_design_system9.AddListButton,
932
1099
  {
933
1100
  className: "add-more",
934
1101
  buttonText: "Add More",
935
1102
  onButtonClick: () => setShowAddNewEnrichmentTagPanel(true)
936
1103
  }
937
- ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { css: addEnrichmentLink, title: `none`, href: "#" }),
938
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1104
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("a", { css: addEnrichmentLink, title: `none`, href: "#" }),
1105
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
939
1106
  EditLink,
940
1107
  {
941
1108
  name: "Enrichments",
@@ -951,10 +1118,10 @@ var EnrichmentTag = ({
951
1118
  ] })
952
1119
  ] });
953
1120
  };
954
- var NoEnrichmentsView = ({ contextConfig }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Callout, { title: "No enrichments found.", type: "caution", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
1121
+ var NoEnrichmentsView = ({ contextConfig }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Callout, { title: "No enrichments found.", type: "caution", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { children: [
955
1122
  "Looks like you do not have any enrichment created in your connected Uniform project. Start by creating your first enrichment",
956
1123
  " ",
957
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1124
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
958
1125
  "a",
959
1126
  {
960
1127
  href: `${contextConfig.apiHost}/projects/${encodeURIComponent(
@@ -971,7 +1138,7 @@ var NoEnrichmentsView = ({ contextConfig }) => /* @__PURE__ */ (0, import_jsx_ru
971
1138
  var getCappedValue = (value, maxCap = 100, minCap = 0) => {
972
1139
  return Math.max(Math.min(value, maxCap), minCap);
973
1140
  };
974
- var scoreCounterMinusButtonStyles = import_react9.css`
1141
+ var scoreCounterMinusButtonStyles = import_react12.css`
975
1142
  position: absolute;
976
1143
  bottom: 0.875rem;
977
1144
  left: var(--spacing-sm);
@@ -984,7 +1151,7 @@ var scoreCounterMinusButtonStyles = import_react9.css`
984
1151
  border: 1px solid var(--gray-300);
985
1152
  border-radius: var(--rounded-full);
986
1153
  `;
987
- var scoreCounterPlusButtonStyles = import_react9.css`
1154
+ var scoreCounterPlusButtonStyles = import_react12.css`
988
1155
  ${scoreCounterMinusButtonStyles}
989
1156
  left: auto;
990
1157
  right: var(--spacing-sm);
@@ -1005,9 +1172,9 @@ var ScoreCounter = ({
1005
1172
  }
1006
1173
  setValue(newScore);
1007
1174
  };
1008
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { css: { position: "relative" }, ...otherProps, children: [
1009
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1010
- import_design_system8.Input,
1175
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: { position: "relative" }, ...otherProps, children: [
1176
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1177
+ import_design_system9.Input,
1011
1178
  {
1012
1179
  label: "Strength",
1013
1180
  id: "enrichment-score",
@@ -1019,7 +1186,7 @@ var ScoreCounter = ({
1019
1186
  css: { textAlign: "center", boxSizing: "border-box" }
1020
1187
  }
1021
1188
  ),
1022
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1189
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1023
1190
  "button",
1024
1191
  {
1025
1192
  type: "button",
@@ -1028,10 +1195,10 @@ var ScoreCounter = ({
1028
1195
  disabled: score === 0,
1029
1196
  className: "scoreCounterButton",
1030
1197
  css: scoreCounterMinusButtonStyles,
1031
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Icon, { icon: import_CgMathMinus.CgMathMinus, iconColor: "gray", size: "1.5rem" })
1198
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Icon, { icon: import_CgMathMinus.CgMathMinus, iconColor: "gray", size: "1.5rem" })
1032
1199
  }
1033
1200
  ),
1034
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1201
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1035
1202
  "button",
1036
1203
  {
1037
1204
  type: "button",
@@ -1039,7 +1206,7 @@ var ScoreCounter = ({
1039
1206
  onClick: () => handleCounter("increment"),
1040
1207
  className: "scoreCounterButton",
1041
1208
  css: scoreCounterPlusButtonStyles,
1042
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Icon, { icon: import_CgMathPlus.CgMathPlus, iconColor: "gray", size: "1.5rem" })
1209
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Icon, { icon: import_CgMathPlus.CgMathPlus, iconColor: "gray", size: "1.5rem" })
1043
1210
  }
1044
1211
  )
1045
1212
  ] });
@@ -1047,7 +1214,7 @@ var ScoreCounter = ({
1047
1214
  var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1048
1215
  const removeEnrichment = (index) => {
1049
1216
  setList(
1050
- (0, import_immer.default)(list, (draft) => {
1217
+ (0, import_immer.produce)(list, (draft) => {
1051
1218
  draft.splice(index, 1);
1052
1219
  })
1053
1220
  );
@@ -1056,16 +1223,16 @@ var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1056
1223
  var _a;
1057
1224
  const cap = (_a = dimIndex[`${list[index].cat}_${list[index].key}`]) == null ? void 0 : _a.cap;
1058
1225
  setList(
1059
- (0, import_immer.default)(list, (draft) => {
1226
+ (0, import_immer.produce)(list, (draft) => {
1060
1227
  draft[index].str = getCappedValue(Number(value) || 0, cap);
1061
1228
  })
1062
1229
  );
1063
1230
  };
1064
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: list.map((enrichment, index) => {
1231
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: list.map((enrichment, index) => {
1065
1232
  const dimData = dimIndex[(0, import_context.getEnrichmentVectorKey)(enrichment.cat, enrichment.key)];
1066
1233
  if (!dimData)
1067
1234
  return;
1068
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1235
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1069
1236
  "div",
1070
1237
  {
1071
1238
  css: {
@@ -1080,14 +1247,14 @@ var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1080
1247
  },
1081
1248
  className: "selected-enrichments",
1082
1249
  children: [
1083
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1250
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1084
1251
  "span",
1085
1252
  {
1086
1253
  css: { fontWeight: "var(--fw-bold)", color: dimData ? void 0 : "var(--brand-secondary-5)" },
1087
1254
  children: dimData ? dimData.displayName : `Enrichment '${enrichment.cat}_${enrichment.key}' is unknown`
1088
1255
  }
1089
1256
  ),
1090
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1257
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1091
1258
  "div",
1092
1259
  {
1093
1260
  css: {
@@ -1100,8 +1267,8 @@ var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1100
1267
  padding: "var(--spacing-sm) var(--spacing-base)",
1101
1268
  flexBasis: "9rem"
1102
1269
  },
1103
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1104
- import_design_system8.Input,
1270
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1271
+ import_design_system9.Input,
1105
1272
  {
1106
1273
  type: "text",
1107
1274
  min: 0,
@@ -1114,14 +1281,14 @@ var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1114
1281
  )
1115
1282
  }
1116
1283
  ),
1117
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1284
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1118
1285
  "button",
1119
1286
  {
1120
1287
  type: "button",
1121
1288
  title: `Delete enrichment`,
1122
1289
  onClick: () => removeEnrichment(index),
1123
1290
  css: { border: 0 },
1124
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Icon, { icon: import_CgCloseO.CgCloseO, iconColor: "red", size: "1.5rem" })
1291
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Icon, { icon: import_CgCloseO.CgCloseO, iconColor: "red", size: "1.5rem" })
1125
1292
  }
1126
1293
  )
1127
1294
  ]
@@ -1132,8 +1299,8 @@ var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1132
1299
  };
1133
1300
 
1134
1301
  // src/components/PersonalizationCriteria/PersonalizationCriteria.tsx
1135
- var import_design_system10 = require("@uniformdev/design-system");
1136
- var import_react13 = require("react");
1302
+ var import_design_system11 = require("@uniformdev/design-system");
1303
+ var import_react16 = require("react");
1137
1304
  var import_react_use = require("react-use");
1138
1305
  var yup = __toESM(require("yup"));
1139
1306
 
@@ -1145,19 +1312,19 @@ function isPersonalizationCriteriaData(obj) {
1145
1312
  return obj.crit !== void 0;
1146
1313
  }
1147
1314
  function opHasRhs(op) {
1148
- return op !== "+" && op !== "-";
1315
+ return op !== "+" && op !== "-" && op !== "^";
1149
1316
  }
1150
1317
 
1151
1318
  // src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.tsx
1152
- var import_react12 = require("@emotion/react");
1319
+ var import_react15 = require("@emotion/react");
1153
1320
  var import_CgCloseO2 = require("@react-icons/all-files/cg/CgCloseO");
1154
- var import_design_system9 = require("@uniformdev/design-system");
1155
- var import_immer2 = __toESM(require("immer"));
1321
+ var import_design_system10 = require("@uniformdev/design-system");
1322
+ var import_immer2 = require("immer");
1156
1323
 
1157
1324
  // src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.styles.ts
1158
- var import_react11 = require("@emotion/react");
1325
+ var import_react14 = require("@emotion/react");
1159
1326
  var spaceBetweenCriteriaItems = "6rem";
1160
- var criteriaItem = import_react11.css`
1327
+ var criteriaItem = import_react14.css`
1161
1328
  position: relative;
1162
1329
  padding: var(--spacing-md) var(--spacing-base);
1163
1330
  border: 1px solid var(--gray-300);
@@ -1185,35 +1352,35 @@ var criteriaItem = import_react11.css`
1185
1352
  }
1186
1353
  }
1187
1354
  `;
1188
- var criteriaItemInner = import_react11.css`
1355
+ var criteriaItemInner = import_react14.css`
1189
1356
  display: flex;
1190
1357
  gap: var(--spacing-base);
1191
1358
  flex-grow: 1;
1192
1359
  flex-wrap: wrap;
1193
1360
  margin-right: var(--spacing-base);
1194
1361
  `;
1195
- var criteriaWrapper = import_react11.css`
1362
+ var criteriaWrapper = import_react14.css`
1196
1363
  width: 100%;
1197
1364
  display: flex;
1198
1365
  align-items: stretch;
1199
1366
  position: relative;
1200
1367
  `;
1201
- var criteriaOperandWrapper = import_react11.css`
1368
+ var criteriaOperandWrapper = import_react14.css`
1202
1369
  flex: 2;
1203
1370
  height: 52px;
1204
1371
  min-width: 200px;
1205
1372
  `;
1206
- var criteriaOperatorWrapper = import_react11.css`
1373
+ var criteriaOperatorWrapper = import_react14.css`
1207
1374
  flex: 1;
1208
1375
  min-width: 80px;
1209
1376
  `;
1210
- var expand = import_react11.css`
1377
+ var expand = import_react14.css`
1211
1378
  height: 100%;
1212
1379
  width: 100%;
1213
1380
  `;
1214
1381
 
1215
1382
  // src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.tsx
1216
- var import_jsx_runtime15 = require("@emotion/react/jsx-runtime");
1383
+ var import_jsx_runtime16 = require("@emotion/react/jsx-runtime");
1217
1384
  var PersonalizationCriteriaStatic = ({
1218
1385
  value,
1219
1386
  setValue,
@@ -1246,21 +1413,21 @@ var PersonalizationCriteriaStatic = ({
1246
1413
  };
1247
1414
  const update = (crit, index) => {
1248
1415
  setValue(
1249
- (0, import_immer2.default)(currentValue, (draft) => {
1416
+ (0, import_immer2.produce)(currentValue, (draft) => {
1250
1417
  draft.crit[index] = crit;
1251
1418
  })
1252
1419
  );
1253
1420
  };
1254
1421
  const removeFromList = (index) => {
1255
- const newValue = (0, import_immer2.default)(currentValue, (draft) => {
1422
+ const newValue = (0, import_immer2.produce)(currentValue, (draft) => {
1256
1423
  draft.crit.splice(index, 1);
1257
1424
  });
1258
1425
  const finalValue = newValue.crit.length === 0 ? null : newValue;
1259
1426
  setValue(finalValue);
1260
1427
  onRemoveCriteria == null ? void 0 : onRemoveCriteria(finalValue);
1261
1428
  };
1262
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("fieldset", { className: "personalization-criteria", children: [
1263
- displayTitle ? (components == null ? void 0 : components.Title) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(components.Title, {}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1429
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("fieldset", { className: "personalization-criteria", "data-testid": "personalization-panel", children: [
1430
+ displayTitle ? (components == null ? void 0 : components.Title) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(components.Title, {}) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1264
1431
  "legend",
1265
1432
  {
1266
1433
  css: {
@@ -1270,27 +1437,28 @@ var PersonalizationCriteriaStatic = ({
1270
1437
  children: "Personalize This"
1271
1438
  }
1272
1439
  ) : null,
1273
- (components == null ? void 0 : components.CustomVariantName) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(components.CustomVariantName, {}) : null,
1274
- !currentValue.crit.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Callout, { title: "Default variant", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Paragraph, { children: 'This personalized variant has no match criteria and will be shown to any visitor that does not match any preceding variants. Ensure that default variants come last in the variant list. Personalize this variant by clicking "Add Criteria" to get started.' }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: currentValue.crit.map((currentCriteria, index) => {
1440
+ (components == null ? void 0 : components.CustomVariantName) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(components.CustomVariantName, {}) : null,
1441
+ (components == null ? void 0 : components.ControlPercentage) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(components.ControlPercentage, {}) : null,
1442
+ !currentValue.crit.length ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Callout, { title: "Default variant", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Paragraph, { children: 'This personalized variant has no match criteria and will be shown to any visitor that does not match any preceding variants. Ensure that default variants come last in the variant list. Personalize this variant by clicking "Add Criteria" to get started.' }) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: currentValue.crit.map((currentCriteria, index) => {
1275
1443
  var _a2, _b, _c, _d;
1276
1444
  const critHasLhs = ((_a2 = currentCriteria.l) == null ? void 0 : _a2.length) > 0;
1277
- const critHasRhs = currentCriteria.op !== "+" && currentCriteria.op !== "-";
1278
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: criteriaItem, "data-testid": "criteria-container", children: [
1279
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1445
+ const critHasRhs = opHasRhs(currentCriteria.op);
1446
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { css: criteriaItem, "data-testid": "criteria-container", children: [
1447
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1280
1448
  "div",
1281
1449
  {
1282
- css: import_react12.css`
1450
+ css: import_react15.css`
1283
1451
  ${criteriaItemInner}/* grid-template-columns: minmax(0, 1fr) ${critHasRhs ? "minmax(0, 79px) minmax(0, 1fr)" : "minmax(0, 1fr)"} */
1284
1452
  `,
1285
1453
  className: "criteriaItemInner",
1286
1454
  children: [
1287
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1455
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1288
1456
  "div",
1289
1457
  {
1290
1458
  css: [criteriaWrapper, criteriaOperandWrapper],
1291
1459
  className: "criteria-wrapper",
1292
1460
  "data-testid": "select-criteria",
1293
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1461
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1294
1462
  DimensionMenu,
1295
1463
  {
1296
1464
  errorMessage: (_b = errors.lhs) == null ? void 0 : _b[index],
@@ -1307,13 +1475,13 @@ var PersonalizationCriteriaStatic = ({
1307
1475
  )
1308
1476
  }
1309
1477
  ),
1310
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1478
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1311
1479
  "div",
1312
1480
  {
1313
1481
  css: [criteriaWrapper, criteriaOperatorWrapper],
1314
1482
  className: "criteria-wrapper",
1315
1483
  "data-testid": "select-operator",
1316
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1484
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1317
1485
  CriteriaOperatorMenu,
1318
1486
  {
1319
1487
  name: `op-${index}`,
@@ -1333,13 +1501,13 @@ var PersonalizationCriteriaStatic = ({
1333
1501
  )
1334
1502
  }
1335
1503
  ),
1336
- critHasRhs ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1504
+ critHasRhs ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1337
1505
  "div",
1338
1506
  {
1339
1507
  css: [criteriaWrapper, criteriaOperandWrapper],
1340
1508
  className: "criteria-wrapper",
1341
1509
  "data-testid": "select-match-criteria",
1342
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1510
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1343
1511
  CriteriaMatchMenu,
1344
1512
  {
1345
1513
  errorMessage: (_c = errors.rhs) == null ? void 0 : _c[index],
@@ -1360,7 +1528,7 @@ var PersonalizationCriteriaStatic = ({
1360
1528
  ]
1361
1529
  }
1362
1530
  ),
1363
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1531
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1364
1532
  "button",
1365
1533
  {
1366
1534
  type: "button",
@@ -1368,10 +1536,10 @@ var PersonalizationCriteriaStatic = ({
1368
1536
  title: `Delete Personalization`,
1369
1537
  css: { backgroundColor: "transparent", backgroundImage: "none", borderWidth: 0 },
1370
1538
  "data-testid": "button-delete",
1371
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Icon, { icon: import_CgCloseO2.CgCloseO, iconColor: "red", size: "1.5rem" })
1539
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Icon, { icon: import_CgCloseO2.CgCloseO, iconColor: "red", size: "1.5rem" })
1372
1540
  }
1373
1541
  ),
1374
- index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1542
+ index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1375
1543
  "div",
1376
1544
  {
1377
1545
  className: "criteria-group-operation",
@@ -1380,8 +1548,8 @@ var PersonalizationCriteriaStatic = ({
1380
1548
  top: "-4rem",
1381
1549
  transform: "translateX(calc(1.5rem - 50%))"
1382
1550
  },
1383
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1384
- import_design_system9.InputInlineSelect,
1551
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1552
+ import_design_system10.InputInlineSelect,
1385
1553
  {
1386
1554
  "data-testid": "dropdown-button-combine",
1387
1555
  disabled: index > 1,
@@ -1399,8 +1567,8 @@ var PersonalizationCriteriaStatic = ({
1399
1567
  ) : null
1400
1568
  ] }, index);
1401
1569
  }) }),
1402
- dimensions.dimensions.length === 0 ? (components == null ? void 0 : components.NoDimensionsDefined) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(components.NoDimensionsDefined, {}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Callout, { title: "Dimensions", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "You do not have any dimensions configured." }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1403
- import_design_system9.AddListButton,
1570
+ dimensions.dimensions.length === 0 ? (components == null ? void 0 : components.NoDimensionsDefined) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(components.NoDimensionsDefined, {}) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Callout, { title: "Dimensions", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: "You do not have any dimensions configured." }) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1571
+ import_design_system10.AddListButton,
1404
1572
  {
1405
1573
  "data-testid": "button-add-criteria",
1406
1574
  className: "add-more",
@@ -1412,7 +1580,7 @@ var PersonalizationCriteriaStatic = ({
1412
1580
  };
1413
1581
 
1414
1582
  // src/components/PersonalizationCriteria/PersonalizationCriteria.tsx
1415
- var import_jsx_runtime16 = require("@emotion/react/jsx-runtime");
1583
+ var import_jsx_runtime17 = require("@emotion/react/jsx-runtime");
1416
1584
  function convertErrorsToObj(errors) {
1417
1585
  const result = { crit: [] };
1418
1586
  errors.forEach((err) => {
@@ -1473,7 +1641,7 @@ var PersonalizationCriteria = ({
1473
1641
  ...staticProps
1474
1642
  }) => {
1475
1643
  var _a, _b;
1476
- const [validationError, setValidationError] = (0, import_react13.useState)(void 0);
1644
+ const [validationError, setValidationError] = (0, import_react16.useState)(void 0);
1477
1645
  const { loading, result: dimensions, error } = useDimensions(contextConfig);
1478
1646
  (0, import_react_use.useAsync)(async () => {
1479
1647
  if (value && dimensions) {
@@ -1482,15 +1650,15 @@ var PersonalizationCriteria = ({
1482
1650
  }
1483
1651
  }, [value, dimensions, validate]);
1484
1652
  if (error)
1485
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Callout, { type: "danger", children: error });
1653
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system11.Callout, { type: "danger", children: error });
1486
1654
  if (loading || dimensions === null)
1487
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.LoadingIndicator, {});
1655
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system11.LoadingIndicator, {});
1488
1656
  const handleSetValue = async (value2) => {
1489
1657
  const err = await validate(value2, dimensions);
1490
1658
  setValidationError(err);
1491
1659
  setValue(value2);
1492
1660
  };
1493
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1661
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1494
1662
  PersonalizationCriteriaStatic,
1495
1663
  {
1496
1664
  ...staticProps,
@@ -1502,10 +1670,10 @@ var PersonalizationCriteria = ({
1502
1670
  },
1503
1671
  dimensions,
1504
1672
  components: {
1505
- NoDimensionsDefined: () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Callout, { title: "Dimensions", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { children: [
1673
+ NoDimensionsDefined: () => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system11.Callout, { title: "Dimensions", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { children: [
1506
1674
  "You do not have any dimensions configured. Create your first",
1507
1675
  " ",
1508
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1676
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1509
1677
  "a",
1510
1678
  {
1511
1679
  href: `${contextConfig.apiHost}/projects/${encodeURIComponent(
@@ -1524,26 +1692,26 @@ var PersonalizationCriteria = ({
1524
1692
  };
1525
1693
 
1526
1694
  // src/components/ProjectUIVersion/ProjectUIVersion.tsx
1527
- var import_design_system11 = require("@uniformdev/design-system");
1528
- var import_jsx_runtime17 = require("@emotion/react/jsx-runtime");
1695
+ var import_design_system12 = require("@uniformdev/design-system");
1696
+ var import_jsx_runtime18 = require("@emotion/react/jsx-runtime");
1529
1697
  function ProjectUIVersion({ children, versionMap, contextConfig }) {
1530
1698
  const { loading, result: data } = useContextData(contextConfig);
1531
1699
  if (loading)
1532
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system11.LoadingIndicator, {});
1700
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system12.LoadingIndicator, {});
1533
1701
  if (data) {
1534
1702
  const Component = versionMap[data.project.ui_version];
1535
1703
  if (Component) {
1536
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Component, {});
1704
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Component, {});
1537
1705
  }
1538
1706
  }
1539
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children });
1707
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children });
1540
1708
  }
1541
1709
 
1542
1710
  // src/hooks/useValidateContextConfig.ts
1543
- var import_react14 = require("react");
1711
+ var import_react17 = require("react");
1544
1712
 
1545
1713
  // src/utils/validateContextConfig.ts
1546
- var import_api3 = require("@uniformdev/context/api");
1714
+ var import_api4 = require("@uniformdev/context/api");
1547
1715
  var import_uuid = require("uuid");
1548
1716
  var validateContextConfig = async (contextConfig) => {
1549
1717
  if (!contextConfig) {
@@ -1558,7 +1726,7 @@ var validateContextConfig = async (contextConfig) => {
1558
1726
  if (!(0, import_uuid.validate)(contextConfig.apiKey) && !contextConfig.projectId) {
1559
1727
  return { valid: false, error: new Error("projectId is required when using a modern API key.") };
1560
1728
  }
1561
- const client = new import_api3.UncachedManifestClient({
1729
+ const client = new import_api4.UncachedManifestClient({
1562
1730
  projectId: contextConfig.projectId,
1563
1731
  apiKey: contextConfig.apiKey,
1564
1732
  apiHost: contextConfig.apiHost
@@ -1576,12 +1744,12 @@ var validateContextConfig = async (contextConfig) => {
1576
1744
 
1577
1745
  // src/hooks/useValidateContextConfig.ts
1578
1746
  var useValidateContextConfig = (contextConfig) => {
1579
- const [state, setState] = (0, import_react14.useState)({
1747
+ const [state, setState] = (0, import_react17.useState)({
1580
1748
  validating: false,
1581
1749
  error: void 0
1582
1750
  });
1583
1751
  const { apiKey, apiHost, projectId } = contextConfig || {};
1584
- (0, import_react14.useEffect)(() => {
1752
+ (0, import_react17.useEffect)(() => {
1585
1753
  if (!apiKey || !apiHost) {
1586
1754
  return;
1587
1755
  }
@@ -1607,6 +1775,7 @@ var useValidateContextConfig = (contextConfig) => {
1607
1775
  __reExport(src_exports, require("@uniformdev/design-system"), module.exports);
1608
1776
  // Annotate the CommonJS export names for ESM import in node:
1609
1777
  0 && (module.exports = {
1778
+ AbTestSelector,
1610
1779
  ContextData,
1611
1780
  CriteriaMatchMenu,
1612
1781
  CriteriaOperatorMenu,
@@ -1617,6 +1786,7 @@ __reExport(src_exports, require("@uniformdev/design-system"), module.exports);
1617
1786
  PersonalizationCriteria,
1618
1787
  PersonalizationCriteriaStatic,
1619
1788
  ProjectUIVersion,
1789
+ addAbTestLink,
1620
1790
  addEnrichmentLink,
1621
1791
  contextCriteriaMenuOperators,
1622
1792
  convertErrorsToObj,