@sparrowengg/integrations-templates-frontend 1.9.84-beta.6 → 1.9.84-beta.8

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.
@@ -3,6 +3,7 @@ import Arrow from '../commons/icons/arrow.js';
3
3
  import { Mapping as Mapping$1 } from './components/mapping.js';
4
4
  import { surveySparrowURL } from '../commons/constants/index.js';
5
5
  import DraftModal from '../commons/components/draftModal.js';
6
+ import '../node_modules/dayjs/dayjs.min.js';
6
7
  import { ThemeProvider } from '../node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js';
7
8
  import { Box } from '../node_modules/@sparrowengg/twigs-react/dist/es/box/box.js';
8
9
  import { Flex } from '../node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js';
@@ -14,7 +15,34 @@ import { Button } from '../node_modules/@sparrowengg/twigs-react/dist/es/button/
14
15
  import { ChevronRightIcon } from '../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/chevron-right.js';
15
16
  import { IconButton } from '../node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js';
16
17
  import { ArrowLeftIcon } from '../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/arrow-left.js';
18
+ import { Tooltip } from '../node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js';
19
+ import { FormInput } from '../node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js';
20
+ import { Checkbox } from '../node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js';
21
+ import { Switch } from '../node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js';
22
+ import { c as components } from '../node_modules/react-select/dist/index-a301f526.esm.js';
23
+ import { PlusIcon } from '../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/plus.js';
24
+ import { Chip } from '../node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js';
25
+ import { TickCircleFillIcon } from '../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/tick-circle-fill.js';
17
26
 
27
+ var __defProp = Object.defineProperty;
28
+ var __defProps = Object.defineProperties;
29
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
30
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
31
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
32
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
33
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34
+ var __spreadValues = (a, b) => {
35
+ for (var prop in b || (b = {}))
36
+ if (__hasOwnProp.call(b, prop))
37
+ __defNormalProp(a, prop, b[prop]);
38
+ if (__getOwnPropSymbols)
39
+ for (var prop of __getOwnPropSymbols(b)) {
40
+ if (__propIsEnum.call(b, prop))
41
+ __defNormalProp(a, prop, b[prop]);
42
+ }
43
+ return a;
44
+ };
45
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
18
46
  const Mapping = ({
19
47
  havingTypeDropdown,
20
48
  onSaveMappingLoader,
@@ -41,7 +69,9 @@ const Mapping = ({
41
69
  draftHandler,
42
70
  configuration
43
71
  }) => {
44
- const [previousMapping, setPreviousMapping] = useState(hasPreviousMapping != null ? hasPreviousMapping : false);
72
+ const [previousMapping, setPreviousMapping] = useState(
73
+ hasPreviousMapping != null ? hasPreviousMapping : false
74
+ );
45
75
  useEffect(() => {
46
76
  if (!!(editField == null ? void 0 : editField.id)) {
47
77
  setFields(editField.fieldValues);
@@ -84,7 +114,8 @@ const Mapping = ({
84
114
  events,
85
115
  actions,
86
116
  navigateMappingPage,
87
- configuration
117
+ configuration,
118
+ editFieldId: editField == null ? void 0 : editField.id
88
119
  }
89
120
  ) : /* @__PURE__ */ React__default.createElement(
90
121
  Mapping$1,
@@ -112,9 +143,9 @@ const EventSetup = ({
112
143
  events,
113
144
  actions,
114
145
  navigateMappingPage,
115
- configuration
146
+ configuration,
147
+ editFieldId
116
148
  }) => {
117
- console.log("configuration", configuration);
118
149
  useEffect(() => {
119
150
  if (actions == null ? void 0 : actions.value) {
120
151
  actions == null ? void 0 : actions.onChangeHandler(actions == null ? void 0 : actions.value);
@@ -130,13 +161,22 @@ const EventSetup = ({
130
161
  alignItems: "center",
131
162
  justifyContent: "center"
132
163
  },
133
- /* @__PURE__ */ React__default.createElement(Box, { css: { width: 488 } }, /* @__PURE__ */ React__default.createElement(Heading, { size: "h5" }, "Account Details"), /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", css: { marginTop: "$4" } }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm", css: { color: "$neutral500" } }, "Survey Name:"), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "medium", css: { color: "$neutral800" } }, surveyDetails.surveyName)), /* @__PURE__ */ React__default.createElement(Flex, { flexDirection: "column", gap: "$8", css: { marginTop: "$16" } }, (accounts == null ? void 0 : accounts.hasAccounts) && /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Account"), /* @__PURE__ */ React__default.createElement(
164
+ /* @__PURE__ */ React__default.createElement(Box, { css: { width: 488 } }, configuration.hasConfiguration ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
165
+ ConfigurationSetup,
166
+ {
167
+ configuration,
168
+ surveyName: surveyDetails.surveyName,
169
+ editField: editFieldId
170
+ }
171
+ )) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Heading, { size: "h5" }, configuration == null ? void 0 : configuration.title), /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", css: { marginTop: "$4" } }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm", css: { color: "$neutral500" } }, "Survey Name:"), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "medium", css: { color: "$neutral800" } }, surveyDetails.surveyName)), /* @__PURE__ */ React__default.createElement(Flex, { flexDirection: "column", gap: "$8", css: { marginTop: "$16" } }, (accounts == null ? void 0 : accounts.hasAccounts) && /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Account"), /* @__PURE__ */ React__default.createElement(
134
172
  Select,
135
173
  {
136
174
  value: accounts.value,
137
175
  options: accounts.options,
138
176
  placeholder: "",
139
- onChange: (value) => accounts.onChangeHandler(value),
177
+ onChange: (value) => accounts.onChangeHandler(
178
+ value
179
+ ),
140
180
  size: "lg"
141
181
  }
142
182
  )), (events == null ? void 0 : events.hasEvents) && /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Object"), /* @__PURE__ */ React__default.createElement(
@@ -145,7 +185,9 @@ const EventSetup = ({
145
185
  options: events.options,
146
186
  value: events == null ? void 0 : events.value,
147
187
  placeholder: "",
148
- onChange: (value) => events.onChangeHandler(value),
188
+ onChange: (value) => events.onChangeHandler(
189
+ value
190
+ ),
149
191
  size: "lg"
150
192
  }
151
193
  )), (actions == null ? void 0 : actions.hasActions) && /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Action"), /* @__PURE__ */ React__default.createElement(
@@ -155,13 +197,15 @@ const EventSetup = ({
155
197
  options: actions.options,
156
198
  value: actions == null ? void 0 : actions.value,
157
199
  placeholder: "",
158
- onChange: (value) => actions.onChangeHandler(value)
200
+ onChange: (value) => actions.onChangeHandler(
201
+ value
202
+ )
159
203
  }
160
- ))), /* @__PURE__ */ React__default.createElement(
204
+ )))), /* @__PURE__ */ React__default.createElement(
161
205
  Button,
162
206
  {
163
207
  size: "lg",
164
- disabled: !actions.value || !events.value,
208
+ disabled: configuration.hasConfiguration ? false : !(actions == null ? void 0 : actions.value) || !(events == null ? void 0 : events.value),
165
209
  rightIcon: /* @__PURE__ */ React__default.createElement(ChevronRightIcon, null),
166
210
  css: { marginTop: "$16" },
167
211
  onClick: () => navigateMappingPage()
@@ -186,7 +230,7 @@ const MappingHeader = ({
186
230
  editFieldId,
187
231
  draftHandler
188
232
  }) => {
189
- const isDisabled = !actions.value || !events.value;
233
+ const isDisabled = !(actions == null ? void 0 : actions.value) || !(events == null ? void 0 : events.value);
190
234
  const [isDraftModalOpen, setIsDraftModalOpen] = useState(false);
191
235
  const isAllEssentialMapped = (fields2) => {
192
236
  let status = true;
@@ -219,14 +263,21 @@ const MappingHeader = ({
219
263
  padding: "$8 $12"
220
264
  }
221
265
  },
222
- isDraftModalOpen && /* @__PURE__ */ React__default.createElement(DraftModal, { onSaveHandler: async () => {
223
- await draftHandler("MAPPING", editFieldId == null ? void 0 : editFieldId.toString());
224
- setIsDraftModalOpen(false);
225
- await previousMappingHandler();
226
- }, onCloseHandler: () => setIsDraftModalOpen(false), onCancel: async () => {
227
- await previousMappingHandler();
228
- setIsDraftModalOpen(false);
229
- } }),
266
+ isDraftModalOpen && /* @__PURE__ */ React__default.createElement(
267
+ DraftModal,
268
+ {
269
+ onSaveHandler: async () => {
270
+ await draftHandler("MAPPING", editFieldId == null ? void 0 : editFieldId.toString());
271
+ setIsDraftModalOpen(false);
272
+ await previousMappingHandler();
273
+ },
274
+ onCloseHandler: () => setIsDraftModalOpen(false),
275
+ onCancel: async () => {
276
+ await previousMappingHandler();
277
+ setIsDraftModalOpen(false);
278
+ }
279
+ }
280
+ ),
230
281
  /* @__PURE__ */ React__default.createElement(
231
282
  Flex,
232
283
  {
@@ -234,7 +285,15 @@ const MappingHeader = ({
234
285
  alignItems: "center",
235
286
  css: { visibility: hasPreviousMapping ? "visible" : "hidden" }
236
287
  },
237
- /* @__PURE__ */ React__default.createElement(IconButton, { onClick: () => previousMappingHandler(), color: "default", icon: /* @__PURE__ */ React__default.createElement(ArrowLeftIcon, null), size: "lg" }),
288
+ /* @__PURE__ */ React__default.createElement(
289
+ IconButton,
290
+ {
291
+ onClick: () => previousMappingHandler(),
292
+ color: "default",
293
+ icon: /* @__PURE__ */ React__default.createElement(ArrowLeftIcon, null),
294
+ size: "lg"
295
+ }
296
+ ),
238
297
  /* @__PURE__ */ React__default.createElement(Heading, { size: "h6" }, editFieldId ? "Edit Mapping" : "New Mapping")
239
298
  ),
240
299
  /* @__PURE__ */ React__default.createElement(
@@ -284,6 +343,345 @@ const MappingHeader = ({
284
343
  )
285
344
  );
286
345
  };
346
+ const ConfigurationSetup = ({
347
+ configuration,
348
+ surveyName,
349
+ editField
350
+ }) => {
351
+ var _a;
352
+ return /* @__PURE__ */ React__default.createElement(Box, { css: { maxWidth: 488, width: "100%" } }, /* @__PURE__ */ React__default.createElement(Heading, { size: "h5" }, configuration == null ? void 0 : configuration.title), /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", css: { marginTop: "$4" } }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm", css: { color: "$neutral500" } }, "Survey Name:"), /* @__PURE__ */ React__default.createElement(
353
+ Tooltip,
354
+ {
355
+ content: (surveyName == null ? void 0 : surveyName.length) > 25 ? surveyName : "",
356
+ css: {
357
+ zIndex: "9999999 !important",
358
+ fontFamily: "DM Sans !important"
359
+ }
360
+ },
361
+ /* @__PURE__ */ React__default.createElement(Box, null, /* @__PURE__ */ React__default.createElement(
362
+ Text,
363
+ {
364
+ size: "sm",
365
+ weight: "medium",
366
+ truncate: true,
367
+ css: { color: "$neutral800", maxWidth: "270px" }
368
+ },
369
+ surveyName
370
+ ))
371
+ )), /* @__PURE__ */ React__default.createElement(
372
+ Flex,
373
+ {
374
+ flexDirection: "column",
375
+ gap: "$8",
376
+ css: {
377
+ marginTop: "$12",
378
+ "& label": {
379
+ color: "$neutral800"
380
+ }
381
+ }
382
+ },
383
+ (_a = configuration.configurationFields) == null ? void 0 : _a.map((field) => {
384
+ return /* @__PURE__ */ React__default.createElement(
385
+ Configuration,
386
+ {
387
+ field,
388
+ configuredFields: configuration.configuredFields
389
+ }
390
+ );
391
+ })
392
+ ));
393
+ };
394
+ const Configuration = ({
395
+ field,
396
+ configuredFields,
397
+ responseImportType = null
398
+ }) => {
399
+ var _a, _b, _c, _d;
400
+ let fieldValue = null;
401
+ fieldValue = (_b = (_a = configuredFields == null ? void 0 : configuredFields[field.id]) == null ? void 0 : _a.value) != null ? _b : null;
402
+ const [error, setError] = useState({
403
+ errorMessage: "",
404
+ error: false,
405
+ id: null
406
+ });
407
+ switch (field.fieldType) {
408
+ case "switch":
409
+ return /* @__PURE__ */ React__default.createElement(
410
+ Flex,
411
+ {
412
+ gap: "$4",
413
+ alignItems: "center",
414
+ css: {
415
+ marginBlockStart: "$12",
416
+ borderTop: "$borderWidths$xs solid $neutral200",
417
+ paddingTop: "$16"
418
+ }
419
+ },
420
+ /* @__PURE__ */ React__default.createElement(
421
+ Switch,
422
+ {
423
+ disabled: field == null ? void 0 : field.disabled,
424
+ size: "sm",
425
+ checked: field == null ? void 0 : field.value,
426
+ onChange: (value) => field.onChangeHandler({
427
+ id: field.id,
428
+ value
429
+ })
430
+ }
431
+ ),
432
+ /* @__PURE__ */ React__default.createElement(Text, { size: "md", weight: "regular", css: { color: "$neutral900" } }, field.label)
433
+ );
434
+ case "checkbox":
435
+ return /* @__PURE__ */ React__default.createElement(Flex, { flexDirection: "column", alignItems: "start", gap: "$4" }, /* @__PURE__ */ React__default.createElement(Flex, { gap: "$4", alignItems: "center" }, /* @__PURE__ */ React__default.createElement(
436
+ Checkbox,
437
+ {
438
+ disabled: field == null ? void 0 : field.disabled,
439
+ checked: !!fieldValue,
440
+ onChange: (value) => field.onChangeHandler({
441
+ id: field.id,
442
+ value
443
+ })
444
+ }
445
+ ), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "regular", css: { color: "$neutral900" } }, field.label)), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "regular", css: { color: "$neutral500" } }, field.value ? field.ifChecked() : field.ifUnchecked(responseImportType)));
446
+ case "input":
447
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, (field == null ? void 0 : field.id) === "spreadsheet" ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ((_c = configuredFields == null ? void 0 : configuredFields.action) == null ? void 0 : _c.value) ? /* @__PURE__ */ React__default.createElement(
448
+ Box,
449
+ {
450
+ className: "dm-sans",
451
+ css: {
452
+ label: {
453
+ fontSize: "$xs !important"
454
+ }
455
+ }
456
+ },
457
+ /* @__PURE__ */ React__default.createElement(
458
+ FormInput,
459
+ __spreadProps(__spreadValues(__spreadProps(__spreadValues({
460
+ disabled: field == null ? void 0 : field.disabled
461
+ }, error.id === field.id && {
462
+ error: error.errorMessage,
463
+ errorBorder: error.error
464
+ }), {
465
+ label: field.label,
466
+ value: typeof fieldValue === "object" ? "" : fieldValue || "",
467
+ size: "lg"
468
+ }), field.pattern && {
469
+ pattern: field.pattern
470
+ }), {
471
+ onChange: (event) => {
472
+ if (field == null ? void 0 : field.pattern) {
473
+ const pattern = new RegExp(field.pattern);
474
+ if (!pattern.test(event.currentTarget.value) && event.currentTarget.value !== "") {
475
+ setError({
476
+ errorMessage: field.errorMessage,
477
+ error: true,
478
+ id: field.id
479
+ });
480
+ } else {
481
+ setError({
482
+ errorMessage: "",
483
+ error: false,
484
+ id: null
485
+ });
486
+ }
487
+ field.onChangeHandler({
488
+ id: field.id,
489
+ value: event.currentTarget.value
490
+ });
491
+ } else {
492
+ field.onChangeHandler({
493
+ id: field.id,
494
+ value: event.currentTarget.value
495
+ });
496
+ }
497
+ }
498
+ })
499
+ )
500
+ ) : null) : /* @__PURE__ */ React__default.createElement(
501
+ Box,
502
+ {
503
+ className: "dm-sans",
504
+ css: {
505
+ label: {
506
+ fontSize: "$xs !important"
507
+ }
508
+ }
509
+ },
510
+ /* @__PURE__ */ React__default.createElement(
511
+ FormInput,
512
+ __spreadProps(__spreadValues(__spreadProps(__spreadValues({
513
+ disabled: field == null ? void 0 : field.disabled
514
+ }, error.id === field.id && {
515
+ error: error.errorMessage,
516
+ errorBorder: error.error
517
+ }), {
518
+ label: field.label,
519
+ value: typeof fieldValue === "object" ? "" : fieldValue || "",
520
+ size: "lg"
521
+ }), field.pattern && {
522
+ pattern: field.pattern
523
+ }), {
524
+ onChange: (event) => {
525
+ if (field == null ? void 0 : field.pattern) {
526
+ const pattern = new RegExp(field.pattern);
527
+ if (!pattern.test(event.currentTarget.value) && event.currentTarget.value !== "") {
528
+ setError({
529
+ errorMessage: field.errorMessage,
530
+ error: true,
531
+ id: field.id
532
+ });
533
+ } else {
534
+ setError({
535
+ errorMessage: "",
536
+ error: false,
537
+ id: null
538
+ });
539
+ }
540
+ field.onChangeHandler({
541
+ id: field.id,
542
+ value: event.currentTarget.value
543
+ });
544
+ } else {
545
+ field.onChangeHandler({
546
+ id: field.id,
547
+ value: event.currentTarget.value
548
+ });
549
+ }
550
+ }
551
+ })
552
+ )
553
+ ));
554
+ default:
555
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, field.id === "spreadsheet" ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ((_d = configuredFields == null ? void 0 : configuredFields.action) == null ? void 0 : _d.value) ? /* @__PURE__ */ React__default.createElement(
556
+ Flex,
557
+ {
558
+ gap: "$2",
559
+ flexDirection: "column",
560
+ css: {
561
+ cursor: "pointer !important",
562
+ ".twigs-select__indicator": {
563
+ width: "14px !important",
564
+ color: "#848484 !important"
565
+ }
566
+ }
567
+ },
568
+ /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, field.label),
569
+ /* @__PURE__ */ React__default.createElement(CustomAddNewSelect, { field })
570
+ ) : null) : /* @__PURE__ */ React__default.createElement(
571
+ Flex,
572
+ {
573
+ gap: "$2",
574
+ flexDirection: "column",
575
+ css: {
576
+ cursor: "pointer !important",
577
+ ".twigs-select__indicator": {
578
+ width: "14px !important",
579
+ color: "#848484 !important"
580
+ }
581
+ }
582
+ },
583
+ /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, field.label),
584
+ /* @__PURE__ */ React__default.createElement(CustomAddNewSelect, { field })
585
+ ));
586
+ }
587
+ };
588
+ const CustomAddNewSelect = ({ field }) => {
589
+ return /* @__PURE__ */ React__default.createElement(
590
+ Select,
591
+ {
592
+ isDisabled: field == null ? void 0 : field.disabled,
593
+ placeholder: "",
594
+ size: "lg",
595
+ css: {
596
+ cursor: "pointer"
597
+ },
598
+ components: {
599
+ Option: CustomShareOption,
600
+ SingleValue: CustomSingleValue
601
+ },
602
+ styles: {
603
+ singleValue: (provided, state) => __spreadProps(__spreadValues({}, provided), {
604
+ display: "flex",
605
+ alignItems: "center",
606
+ cursor: "pointer"
607
+ })
608
+ },
609
+ value: field.value,
610
+ onChange: (value) => {
611
+ var _a;
612
+ field.onChangeHandler({
613
+ id: (_a = field == null ? void 0 : field.id) != null ? _a : field == null ? void 0 : field.label,
614
+ value
615
+ });
616
+ },
617
+ options: field.options
618
+ }
619
+ );
620
+ };
621
+ const CustomShareOption = (props) => {
622
+ if (props.data.value === "ADD_NEW") {
623
+ return /* @__PURE__ */ React__default.createElement(
624
+ Tooltip,
625
+ {
626
+ content: props.data.tooltip || "",
627
+ css: {
628
+ zIndex: 999999999,
629
+ fontFamily: "DM Sans !important"
630
+ }
631
+ },
632
+ /* @__PURE__ */ React__default.createElement(Box, null, /* @__PURE__ */ React__default.createElement(components.Option, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(
633
+ Flex,
634
+ {
635
+ justifyContent: "center",
636
+ alignItems: "center",
637
+ css: { cursor: "pointer", zIndex: 999999999 }
638
+ },
639
+ /* @__PURE__ */ React__default.createElement(
640
+ Flex,
641
+ {
642
+ gap: "$2",
643
+ alignItems: "center",
644
+ css: {
645
+ color: "$primary500",
646
+ fontSize: "$sm",
647
+ fontWeight: "$7"
648
+ }
649
+ },
650
+ /* @__PURE__ */ React__default.createElement(PlusIcon, { size: 16, color: "#4A9CA6" }),
651
+ "Add Account"
652
+ )
653
+ )))
654
+ );
655
+ } else {
656
+ return /* @__PURE__ */ React__default.createElement(components.Option, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(
657
+ Flex,
658
+ {
659
+ css: { cursor: "pointer", zIndex: 999999999 },
660
+ alignItems: "center",
661
+ justifyContent: "space-between",
662
+ gap: "$2"
663
+ },
664
+ /* @__PURE__ */ React__default.createElement(Text, { size: "sm" }, props.label),
665
+ " ",
666
+ props.data.isAddonAccount && /* @__PURE__ */ React__default.createElement(
667
+ Chip,
668
+ {
669
+ color: "primary",
670
+ size: "sm",
671
+ leftElement: /* @__PURE__ */ React__default.createElement(TickCircleFillIcon, null)
672
+ },
673
+ "In Use (Add-on)"
674
+ )
675
+ ));
676
+ }
677
+ };
678
+ const CustomSingleValue = (props) => {
679
+ if (props.data.value === "ADD_NEW") {
680
+ return /* @__PURE__ */ React__default.createElement(components.SingleValue, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(Flex, { css: { cursor: "pointer" }, alignItems: "center", gap: "$2" }, /* @__PURE__ */ React__default.createElement(PlusIcon, { size: 16 }), /* @__PURE__ */ React__default.createElement(Text, { size: "sm" }, props.data.label)));
681
+ } else {
682
+ return /* @__PURE__ */ React__default.createElement(components.SingleValue, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(Flex, { css: { cursor: "pointer" }, alignItems: "center", gap: "$2" }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm" }, props.data.label)));
683
+ }
684
+ };
287
685
 
288
686
  export { Mapping };
289
687
  //# sourceMappingURL=index.js.map