@bigbinary/neeto-thank-you-frontend 1.1.3 → 1.1.5

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.cjs.js CHANGED
@@ -6,8 +6,6 @@ var React = require('react');
6
6
  var neetoCist = require('@bigbinary/neeto-cist');
7
7
  var Scrollable = require('@bigbinary/neeto-molecules/Scrollable');
8
8
  var i18next = require('i18next');
9
- var neetoEditor = require('@bigbinary/neeto-editor');
10
- var yup = require('yup');
11
9
  var classNames = require('classnames');
12
10
  var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
13
11
  var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
@@ -19,17 +17,20 @@ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
19
17
  var reactQuery = require('react-query');
20
18
  var axios = require('axios');
21
19
  var formik = require('formik');
20
+ var neetoEditor = require('@bigbinary/neeto-editor');
22
21
  var Label$1 = require('@bigbinary/neetoui/Label');
23
22
  var Input = require('@bigbinary/neetoui/formik/Input');
24
23
  var Switch = require('@bigbinary/neetoui/formik/Switch');
25
24
  var reactI18next = require('react-i18next');
26
25
  var neetoImageUploaderFrontend = require('@bigbinary/neeto-image-uploader-frontend');
26
+ var jsxRuntime = require('react/jsx-runtime');
27
27
  var Button = require('@bigbinary/neetoui/Button');
28
28
  var Typography = require('@bigbinary/neetoui/Typography');
29
29
  var Modal = require('@bigbinary/neetoui/Modal');
30
30
  var utils = require('@bigbinary/neeto-commons-frontend/utils');
31
31
  var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
32
32
  var neetoIcons = require('@bigbinary/neeto-icons');
33
+ var yup = require('yup');
33
34
  var NeetoUIHeader = require('@bigbinary/neeto-molecules/Header');
34
35
 
35
36
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -52,10 +53,9 @@ function _interopNamespace(e) {
52
53
  return Object.freeze(n);
53
54
  }
54
55
 
55
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
56
56
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
57
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
57
58
  var Scrollable__default = /*#__PURE__*/_interopDefaultLegacy(Scrollable);
58
- var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
59
59
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
60
60
  var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
61
61
  var ActionBlock__default = /*#__PURE__*/_interopDefaultLegacy(ActionBlock);
@@ -69,6 +69,7 @@ var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
69
69
  var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
70
70
  var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
71
71
  var Modal__default = /*#__PURE__*/_interopDefaultLegacy(Modal);
72
+ var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
72
73
  var NeetoUIHeader__default = /*#__PURE__*/_interopDefaultLegacy(NeetoUIHeader);
73
74
 
74
75
  var FORM_OPTIONS = {
@@ -87,25 +88,6 @@ var DEFAULT_IMAGE_PROPERTIES = {
87
88
  imageSignedId: null,
88
89
  imageUrl: ""
89
90
  };
90
- var VALIDATION_SCHEMA = yup__namespace.object().shape({
91
- kind: yup__namespace.string().required(),
92
- message: yup__namespace.string().test("message", i18next.t("neetoThankYou.thankYou.validations.messageRequired"), function (value) {
93
- return !neetoEditor.isEditorEmpty(value);
94
- }),
95
- socialSharingEnabled: yup__namespace.bool(),
96
- showResubmitLink: yup__namespace.bool(),
97
- resubmitLinkText: yup__namespace.string().when("showResubmitLink", {
98
- is: true,
99
- then: yup__namespace.string().required(i18next.t("neetoThankYou.thankYou.validations.resubmitLinkTextIsRequired"))
100
- }),
101
- redirectUrl: yup__namespace.string().when("kind", {
102
- is: FORM_OPTIONS.externalLink.kind,
103
- then: yup__namespace.string().url(i18next.t("neetoThankYou.thankYou.validations.invalidLink")).required(i18next.t("neetoThankYou.thankYou.validations.invalidLink")).when("kind", {
104
- is: FORM_OPTIONS.customize.kind,
105
- then: yup__namespace.string()
106
- })
107
- })
108
- });
109
91
  var EXTERNAL_URL_PREFIX = "https://";
110
92
  var THANK_YOU_TEXT_ALIGNMENTS = {
111
93
  left: "left",
@@ -181,8 +163,8 @@ var QUERY_KEYS = {
181
163
  THANK_YOU_PAGE: "thank-you-page"
182
164
  };
183
165
 
184
- function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
185
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
166
+ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
167
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
186
168
  var useShowThankYouConfiguration = function useShowThankYouConfiguration(_ref) {
187
169
  var entityId = _ref.entityId;
188
170
  return reactQuery.useQuery([QUERY_KEYS.THANK_YOU_CONFIGURATION, entityId], function () {
@@ -197,7 +179,7 @@ var useUpdateThankYouConfiguration = function useUpdateThankYouConfiguration(opt
197
179
  entityId: entityId,
198
180
  payload: payload
199
181
  });
200
- }, _objectSpread$2({
182
+ }, _objectSpread$3({
201
183
  keysToInvalidate: [QUERY_KEYS.THANK_YOU_CONFIGURATION]
202
184
  }, options));
203
185
  };
@@ -275,43 +257,50 @@ var Image = function Image() {
275
257
  setFieldValue("imageUrl", image.url);
276
258
  setFieldValue("imageSignedId", image.signedId);
277
259
  };
278
- return /*#__PURE__*/React__default["default"].createElement(neetoImageUploaderFrontend.ImageUploader, {
260
+ return /*#__PURE__*/jsxRuntime.jsx(neetoImageUploaderFrontend.ImageUploader, {
279
261
  className: "h-60",
280
- key: values.imageUrl,
281
262
  src: values.imageUrl,
282
263
  uploadConfig: IMAGE_UPLOADER_CONFIG,
283
264
  onUploadComplete: handleImageChange
284
- });
265
+ }, values.imageUrl);
285
266
  };
286
267
 
287
- var ResubmissionWarningModal = function ResubmissionWarningModal(_ref) {
288
- var isOpen = _ref.isOpen,
268
+ var ResubmissionWarningModal = reactUtils.withT(function (_ref) {
269
+ var t = _ref.t,
270
+ isOpen = _ref.isOpen,
289
271
  setIsOpen = _ref.setIsOpen,
290
272
  uniqueSubmissionLink = _ref.uniqueSubmissionLink;
291
- var _useTranslation = reactI18next.useTranslation(),
292
- t = _useTranslation.t;
293
- return /*#__PURE__*/React__default["default"].createElement(Modal__default["default"], {
273
+ return /*#__PURE__*/jsxRuntime.jsxs(Modal__default["default"], {
294
274
  isOpen: isOpen,
295
275
  onClose: function onClose() {
296
276
  return setIsOpen(false);
297
- }
298
- }, /*#__PURE__*/React__default["default"].createElement(Modal__default["default"].Header, null, /*#__PURE__*/React__default["default"].createElement(Typography__default["default"], {
299
- style: "h3",
300
- weight: "semibold"
301
- }, t("neetoThankYou.common.alert"), "!")), /*#__PURE__*/React__default["default"].createElement(Modal__default["default"].Body, null, t("neetoThankYou.thankYou.resubmissionWarning")), /*#__PURE__*/React__default["default"].createElement(Modal__default["default"].Footer, {
302
- className: "space-x-2"
303
- }, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
304
- label: t("neetoThankYou.thankYou.uniqueSubmissionLinkText"),
305
- to: uniqueSubmissionLink
306
- }), /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
307
- label: t("neetoThankYou.common.ok"),
308
- style: "text",
309
- onClick: function onClick() {
310
- return setIsOpen(false);
311
- }
312
- })));
313
- };
277
+ },
278
+ children: [/*#__PURE__*/jsxRuntime.jsx(Modal__default["default"].Header, {
279
+ children: /*#__PURE__*/jsxRuntime.jsxs(Typography__default["default"], {
280
+ style: "h3",
281
+ weight: "semibold",
282
+ children: [t("neetoThankYou.common.alert"), "!"]
283
+ })
284
+ }), /*#__PURE__*/jsxRuntime.jsx(Modal__default["default"].Body, {
285
+ children: t("neetoThankYou.thankYou.resubmissionWarning")
286
+ }), /*#__PURE__*/jsxRuntime.jsxs(Modal__default["default"].Footer, {
287
+ className: "space-x-2",
288
+ children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
289
+ label: t("neetoThankYou.common.ok"),
290
+ style: "tertiary",
291
+ onClick: function onClick() {
292
+ return setIsOpen(false);
293
+ }
294
+ }), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
295
+ label: t("neetoThankYou.thankYou.uniqueSubmissionLinkText"),
296
+ to: uniqueSubmissionLink
297
+ })]
298
+ })]
299
+ });
300
+ });
314
301
 
302
+ function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
303
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
315
304
  var Customize = function Customize(_ref) {
316
305
  var editorRef = _ref.editorRef,
317
306
  uniqueSubmissionEnabled = _ref.uniqueSubmissionEnabled,
@@ -319,7 +308,8 @@ var Customize = function Customize(_ref) {
319
308
  uniqueSubmissionLink = _ref.uniqueSubmissionLink,
320
309
  entityId = _ref.entityId,
321
310
  disableSocialShare = _ref.disableSocialShare,
322
- disableSubmitAnotherResponse = _ref.disableSubmitAnotherResponse;
311
+ disableSubmitAnotherResponse = _ref.disableSubmitAnotherResponse,
312
+ editorProps = _ref.editorProps;
323
313
  var _useState = React.useState(false),
324
314
  _useState2 = _slicedToArray(_useState, 2),
325
315
  isUniqueSubmissionWarningModalOpen = _useState2[0],
@@ -345,37 +335,44 @@ var Customize = function Customize(_ref) {
345
335
  var handleResubmitLinkChange = function handleResubmitLinkChange(event) {
346
336
  uniqueSubmissionEnabled ? setIsUniqueSubmissionWarningModalOpen(true) : setFieldValue("showResubmitLink", event.target.checked);
347
337
  };
348
- return /*#__PURE__*/React__default["default"].createElement("div", {
349
- className: "flex flex-col gap-4"
350
- }, hasImageUploader && /*#__PURE__*/React__default["default"].createElement("div", {
351
- className: "flex flex-col gap-2"
352
- }, /*#__PURE__*/React__default["default"].createElement(Label__default["default"], null, t("neetoThankYou.thankYou.imageLabel")), /*#__PURE__*/React__default["default"].createElement(Image, null)), /*#__PURE__*/React__default["default"].createElement("div", {
353
- className: "flex flex-col gap-2"
354
- }, /*#__PURE__*/React__default["default"].createElement(neetoEditor.FormikEditor, {
355
- required: true,
356
- "data-cy": "thank-you-message-editor",
357
- label: t("neetoThankYou.thankYou.messageLabel"),
358
- name: "message",
359
- ref: editorRef
360
- })), !disableSocialShare && /*#__PURE__*/React__default["default"].createElement(Switch__default["default"], {
361
- label: t("neetoThankYou.thankYou.socialShareIcons"),
362
- name: "socialSharingEnabled"
363
- }), !disableSubmitAnotherResponse && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Switch__default["default"], {
364
- label: t("neetoThankYou.thankYou.showResubmitLink"),
365
- name: "showResubmitLink",
366
- className: classNames__default["default"]({
367
- "neeto-ui-switch--disabled": uniqueSubmissionEnabled
368
- }),
369
- onChange: handleResubmitLinkChange
370
- }), values.showResubmitLink && /*#__PURE__*/React__default["default"].createElement(Input__default["default"], {
371
- required: true,
372
- label: t("neetoThankYou.thankYou.resubmitLinkText"),
373
- name: "resubmitLinkText"
374
- })), /*#__PURE__*/React__default["default"].createElement(ResubmissionWarningModal, {
375
- uniqueSubmissionLink: uniqueSubmissionLink,
376
- isOpen: isUniqueSubmissionWarningModalOpen,
377
- setIsOpen: setIsUniqueSubmissionWarningModalOpen
378
- }));
338
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
339
+ className: "flex flex-col gap-4",
340
+ children: [hasImageUploader && /*#__PURE__*/jsxRuntime.jsxs("div", {
341
+ className: "flex flex-col gap-2",
342
+ children: [/*#__PURE__*/jsxRuntime.jsx(Label__default["default"], {
343
+ children: t("neetoThankYou.thankYou.imageLabel")
344
+ }), /*#__PURE__*/jsxRuntime.jsx(Image, {})]
345
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
346
+ className: "flex flex-col gap-2",
347
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoEditor.FormikEditor, _objectSpread$2({
348
+ required: true,
349
+ "data-cy": "thank-you-message-editor",
350
+ label: t("neetoThankYou.thankYou.messageLabel"),
351
+ name: "message",
352
+ ref: editorRef
353
+ }, editorProps))
354
+ }), !disableSocialShare && /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], {
355
+ label: t("neetoThankYou.thankYou.socialShareIcons"),
356
+ name: "socialSharingEnabled"
357
+ }), !disableSubmitAnotherResponse && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
358
+ children: [/*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], {
359
+ label: t("neetoThankYou.thankYou.showResubmitLink"),
360
+ name: "showResubmitLink",
361
+ className: classNames__default["default"]({
362
+ "neeto-ui-switch--disabled": uniqueSubmissionEnabled
363
+ }),
364
+ onChange: handleResubmitLinkChange
365
+ }), values.showResubmitLink && /*#__PURE__*/jsxRuntime.jsx(Input__default["default"], {
366
+ required: true,
367
+ label: t("neetoThankYou.thankYou.resubmitLinkText"),
368
+ name: "resubmitLinkText"
369
+ })]
370
+ }), /*#__PURE__*/jsxRuntime.jsx(ResubmissionWarningModal, {
371
+ uniqueSubmissionLink: uniqueSubmissionLink,
372
+ isOpen: isUniqueSubmissionWarningModalOpen,
373
+ setIsOpen: setIsUniqueSubmissionWarningModalOpen
374
+ })]
375
+ });
379
376
  };
380
377
 
381
378
  var ENVIRONMENTS = {
@@ -405,24 +402,27 @@ var BrandingInfo = function BrandingInfo(_ref) {
405
402
  var _brandingInfo$additio;
406
403
  var brandingInfo = _ref.brandingInfo,
407
404
  appName = _ref.appName;
408
- return /*#__PURE__*/React__default["default"].createElement("div", {
409
- className: "neeto-thank-you-configuration__branding-wrap"
410
- }, /*#__PURE__*/React__default["default"].createElement("div", {
411
- className: "neeto-thank-you-configuration__nav"
412
- }, /*#__PURE__*/React__default["default"].createElement("div", {
413
- className: "neeto-thank-you-configuration__nav-footer"
414
- }, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
415
- i18nKey: brandingInfo.displayText,
416
- components: _objectSpread$1({
417
- signUpLink: /*#__PURE__*/React__default["default"].createElement("a", {
418
- className: "neeto-thank-you-configuration__link",
419
- href: buildSignUpUrl(appName),
420
- rel: "noreferrer",
421
- target: "_blank"
422
- }),
423
- span: /*#__PURE__*/React__default["default"].createElement("span", null)
424
- }, (_brandingInfo$additio = brandingInfo.additionalComponents) !== null && _brandingInfo$additio !== void 0 ? _brandingInfo$additio : {})
425
- }))));
405
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
406
+ className: "neeto-thank-you-configuration__branding-wrap",
407
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
408
+ className: "neeto-thank-you-configuration__nav",
409
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
410
+ className: "neeto-thank-you-configuration__nav-footer",
411
+ children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
412
+ i18nKey: brandingInfo.displayText,
413
+ components: _objectSpread$1({
414
+ signUpLink: /*#__PURE__*/jsxRuntime.jsx("a", {
415
+ className: "neeto-thank-you-configuration__link",
416
+ href: buildSignUpUrl(appName),
417
+ rel: "noreferrer",
418
+ target: "_blank"
419
+ }),
420
+ span: /*#__PURE__*/jsxRuntime.jsx("span", {})
421
+ }, (_brandingInfo$additio = brandingInfo.additionalComponents) !== null && _brandingInfo$additio !== void 0 ? _brandingInfo$additio : {})
422
+ })
423
+ })
424
+ })
425
+ });
426
426
  };
427
427
 
428
428
  var _ellipse, _ellipse2, _ellipse3;
@@ -457,24 +457,28 @@ var SocialShare = function SocialShare(_ref) {
457
457
  publicLinkId = _ref.publicLinkId;
458
458
  var _useTranslation = reactI18next.useTranslation(),
459
459
  t = _useTranslation.t;
460
- return /*#__PURE__*/React__default["default"].createElement("div", {
461
- className: "neeto-thank-you-configuration__social-share"
462
- }, /*#__PURE__*/React__default["default"].createElement("h3", {
463
- className: "neeto-thank-you-configuration__social-share-title"
464
- }, t("neetoThankYou.thankYou.socialShareHeading")), /*#__PURE__*/React__default["default"].createElement("div", {
465
- className: "neeto-thank-you-configuration-social-follow"
466
- }, socialHandles === null || socialHandles === void 0 ? void 0 : socialHandles.map(function (data, idx) {
467
- var Icon = data.icon,
468
- generateShareUrl = data.generateShareUrl;
469
- return /*#__PURE__*/React__default["default"].createElement("div", {
470
- className: "neeto-thank-you-configuration-social-follow__item",
471
- key: idx
472
- }, /*#__PURE__*/React__default["default"].createElement("a", {
473
- href: generateShareUrl(publicLinkId),
474
- rel: "noreferrer",
475
- target: "_blank"
476
- }, /*#__PURE__*/React__default["default"].createElement(Icon, null)));
477
- })));
460
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
461
+ className: "neeto-thank-you-configuration__social-share",
462
+ children: [/*#__PURE__*/jsxRuntime.jsx("h3", {
463
+ className: "neeto-thank-you-configuration__social-share-title",
464
+ children: t("neetoThankYou.thankYou.socialShareHeading")
465
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
466
+ className: "neeto-thank-you-configuration-social-follow",
467
+ children: socialHandles === null || socialHandles === void 0 ? void 0 : socialHandles.map(function (data, idx) {
468
+ var Icon = data.icon,
469
+ generateShareUrl = data.generateShareUrl;
470
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
471
+ className: "neeto-thank-you-configuration-social-follow__item",
472
+ children: /*#__PURE__*/jsxRuntime.jsx("a", {
473
+ href: generateShareUrl(publicLinkId),
474
+ rel: "noreferrer",
475
+ target: "_blank",
476
+ children: /*#__PURE__*/jsxRuntime.jsx(Icon, {})
477
+ })
478
+ }, idx);
479
+ })
480
+ })]
481
+ });
478
482
  };
479
483
 
480
484
  var MemoizedEditorContent = /*#__PURE__*/React__default["default"].memo(neetoEditor.EditorContent);
@@ -491,59 +495,69 @@ var Preview = function Preview(_ref) {
491
495
  values = _useFormikContext.values;
492
496
  var _useTranslation = reactI18next.useTranslation(),
493
497
  t = _useTranslation.t;
494
- return /*#__PURE__*/React__default["default"].createElement("div", {
495
- className: "flex flex-col"
496
- }, /*#__PURE__*/React__default["default"].createElement(Typography__default["default"], {
497
- className: "mb-3 block md:hidden",
498
- lineHeight: "normal",
499
- style: "h3",
500
- weight: "semibold"
501
- }, t("neetoThankYou.thankYou.preview")), /*#__PURE__*/React__default["default"].createElement("div", {
502
- className: classNames__default["default"]("neeto-thank-you-configuration-preview", {
503
- "neeto-thank-you-configuration-alignment--left": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.left,
504
- "neeto-thank-you-configuration-alignment--center": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.center,
505
- "pointer-events-none": !isPublished
506
- })
507
- }, /*#__PURE__*/React__default["default"].createElement("div", {
508
- className: "neeto-thank-you-configuration-preview__browser-header"
509
- }, /*#__PURE__*/React__default["default"].createElement(SvgBrowserControls, null)), /*#__PURE__*/React__default["default"].createElement("div", {
510
- className: "neeto-thank-you-configuration"
511
- }, /*#__PURE__*/React__default["default"].createElement("main", {
512
- className: "neeto-thank-you-configuration__main"
513
- }, /*#__PURE__*/React__default["default"].createElement("div", {
514
- className: "neeto-thank-you-configuration__box"
515
- }, !ramda.isEmpty(values === null || values === void 0 ? void 0 : values.imageUrl) && /*#__PURE__*/React__default["default"].createElement("div", {
516
- className: "neeto-thank-you-configuration__img"
517
- }, /*#__PURE__*/React__default["default"].createElement("img", {
518
- alt: "",
519
- src: values.imageUrl
520
- })), (values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/React__default["default"].createElement("div", {
521
- className: "neeto-thank-you-configuration__description"
522
- }, /*#__PURE__*/React__default["default"].createElement(MemoizedEditorContent, {
523
- content: values.message,
524
- "data-cy": "preview-editor-content"
525
- })), (values === null || values === void 0 ? void 0 : values.showResubmitLink) && /*#__PURE__*/React__default["default"].createElement("a", {
526
- className: "neeto-thank-you-configuration__resubmit",
527
- href: resubmitLink
528
- }, (_values$resubmitLinkT = values === null || values === void 0 ? void 0 : values.resubmitLinkText) !== null && _values$resubmitLinkT !== void 0 ? _values$resubmitLinkT : t("neetoThankYou.thankYou.resubmit")), (values === null || values === void 0 ? void 0 : values.socialSharingEnabled) && /*#__PURE__*/React__default["default"].createElement(SocialShare, {
529
- publicLinkId: publicLinkId,
530
- socialHandles: socialHandles
531
- })))), (values === null || values === void 0 ? void 0 : values.brandingEnabled) && neetoCist.isPresent(brandingInfo) && /*#__PURE__*/React__default["default"].createElement(BrandingInfo, {
532
- appName: appName,
533
- brandingInfo: brandingInfo
534
- })));
498
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
499
+ className: "flex flex-col",
500
+ children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
501
+ className: "mb-3 block md:hidden",
502
+ lineHeight: "normal",
503
+ style: "h3",
504
+ weight: "semibold",
505
+ children: t("neetoThankYou.thankYou.preview")
506
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
507
+ className: classNames__default["default"]("neeto-thank-you-configuration-preview", {
508
+ "neeto-thank-you-configuration-alignment--left": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.left,
509
+ "neeto-thank-you-configuration-alignment--center": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.center,
510
+ "pointer-events-none": !isPublished
511
+ }),
512
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
513
+ className: "neeto-thank-you-configuration-preview__browser-header",
514
+ children: /*#__PURE__*/jsxRuntime.jsx(SvgBrowserControls, {})
515
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
516
+ className: "neeto-thank-you-configuration",
517
+ children: /*#__PURE__*/jsxRuntime.jsx("main", {
518
+ className: "neeto-thank-you-configuration__main",
519
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
520
+ className: "neeto-thank-you-configuration__box",
521
+ children: [!ramda.isEmpty(values === null || values === void 0 ? void 0 : values.imageUrl) && /*#__PURE__*/jsxRuntime.jsx("div", {
522
+ className: "neeto-thank-you-configuration__img",
523
+ children: /*#__PURE__*/jsxRuntime.jsx("img", {
524
+ alt: "",
525
+ src: values.imageUrl
526
+ })
527
+ }), (values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/jsxRuntime.jsx("div", {
528
+ className: "neeto-thank-you-configuration__description",
529
+ children: /*#__PURE__*/jsxRuntime.jsx(MemoizedEditorContent, {
530
+ content: values.message,
531
+ "data-cy": "preview-editor-content"
532
+ })
533
+ }), (values === null || values === void 0 ? void 0 : values.showResubmitLink) && /*#__PURE__*/jsxRuntime.jsx("a", {
534
+ className: "neeto-thank-you-configuration__resubmit",
535
+ href: resubmitLink,
536
+ children: (_values$resubmitLinkT = values === null || values === void 0 ? void 0 : values.resubmitLinkText) !== null && _values$resubmitLinkT !== void 0 ? _values$resubmitLinkT : t("neetoThankYou.thankYou.resubmit")
537
+ }), (values === null || values === void 0 ? void 0 : values.socialSharingEnabled) && /*#__PURE__*/jsxRuntime.jsx(SocialShare, {
538
+ publicLinkId: publicLinkId,
539
+ socialHandles: socialHandles
540
+ })]
541
+ })
542
+ })
543
+ }), (values === null || values === void 0 ? void 0 : values.brandingEnabled) && /*#__PURE__*/jsxRuntime.jsx(BrandingInfo, {
544
+ appName: appName,
545
+ brandingInfo: brandingInfo
546
+ })]
547
+ })]
548
+ });
535
549
  };
536
550
 
537
551
  var ExternalLink = function ExternalLink() {
538
552
  var _useTranslation = reactI18next.useTranslation(),
539
553
  t = _useTranslation.t;
540
- return /*#__PURE__*/React__default["default"].createElement(Input__default["default"], {
554
+ return /*#__PURE__*/jsxRuntime.jsx(Input__default["default"], {
541
555
  autoFocus: true,
542
556
  required: true,
543
557
  label: t("neetoThankYou.thankYou.link"),
544
558
  name: "redirectUrl",
545
559
  placeholder: EXTERNAL_URL_PREFIX,
546
- prefix: /*#__PURE__*/React__default["default"].createElement(neetoIcons.Link, null)
560
+ prefix: /*#__PURE__*/jsxRuntime.jsx(neetoIcons.Link, {})
547
561
  });
548
562
  };
549
563
 
@@ -551,15 +565,40 @@ var Label = function Label(_ref) {
551
565
  var label = _ref.label,
552
566
  description = _ref.description,
553
567
  kind = _ref.kind;
554
- return /*#__PURE__*/React__default["default"].createElement(Typography__default["default"], {
568
+ return /*#__PURE__*/jsxRuntime.jsxs(Typography__default["default"], {
555
569
  className: "neeto-ui-text-gray-700",
556
570
  "data-cy": "neeto-thank-you-configuration-".concat(neetoCist.hyphenate(kind), "-label"),
557
571
  style: "body2",
558
- weight: "semibold"
559
- }, label, /*#__PURE__*/React__default["default"].createElement("span", {
560
- className: "block text-xs font-normal leading-snug",
561
- "data-cy": "neeto-thank-you-configuration-".concat(neetoCist.hyphenate(kind), "-description")
562
- }, description));
572
+ weight: "semibold",
573
+ children: [label, /*#__PURE__*/jsxRuntime.jsx("span", {
574
+ className: "block text-xs font-normal leading-snug",
575
+ "data-cy": "neeto-thank-you-configuration-".concat(neetoCist.hyphenate(kind), "-description"),
576
+ children: description
577
+ })]
578
+ });
579
+ };
580
+
581
+ var buildValidationSchema = function buildValidationSchema() {
582
+ var allowEmptyCustomMessage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
583
+ return yup__namespace.object().shape({
584
+ kind: yup__namespace.string().required(),
585
+ message: yup__namespace.string().test("message", i18next.t("neetoThankYou.thankYou.validations.messageRequired"), function (value) {
586
+ return allowEmptyCustomMessage || !neetoEditor.isEditorEmpty(value);
587
+ }),
588
+ socialSharingEnabled: yup__namespace.bool(),
589
+ showResubmitLink: yup__namespace.bool(),
590
+ resubmitLinkText: yup__namespace.string().when("showResubmitLink", {
591
+ is: true,
592
+ then: yup__namespace.string().required(i18next.t("neetoThankYou.thankYou.validations.resubmitLinkTextIsRequired"))
593
+ }),
594
+ redirectUrl: yup__namespace.string().when("kind", {
595
+ is: FORM_OPTIONS.externalLink.kind,
596
+ then: yup__namespace.string().url(i18next.t("neetoThankYou.thankYou.validations.invalidLink")).required(i18next.t("neetoThankYou.thankYou.validations.invalidLink")).when("kind", {
597
+ is: FORM_OPTIONS.customize.kind,
598
+ then: yup__namespace.string()
599
+ })
600
+ })
601
+ });
563
602
  };
564
603
 
565
604
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -580,7 +619,10 @@ var Form = function Form(_ref) {
580
619
  appName = _ref.appName,
581
620
  blockNavigation = _ref.blockNavigation,
582
621
  onConfigUpdateSuccess = _ref.onConfigUpdateSuccess,
583
- brandingInfo = _ref.brandingInfo;
622
+ brandingInfo = _ref.brandingInfo,
623
+ editorProps = _ref.editorProps,
624
+ CustomPreview = _ref.preview,
625
+ allowEmptyCustomMessage = _ref.allowEmptyCustomMessage;
584
626
  var _useShowThankYouConfi = useShowThankYouConfiguration({
585
627
  entityId: entityId
586
628
  }),
@@ -595,19 +637,20 @@ var Form = function Form(_ref) {
595
637
  editor: {}
596
638
  });
597
639
  if (isLoading) {
598
- return /*#__PURE__*/React__default["default"].createElement("div", {
599
- className: "flex h-full w-full items-center justify-center"
600
- }, /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null));
640
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
641
+ className: "flex h-full w-full items-center justify-center",
642
+ children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
643
+ });
601
644
  }
602
645
  var resetEditor = function resetEditor() {
603
646
  var _editorRef$current$ed;
604
647
  return (_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0 ? void 0 : _editorRef$current$ed.commands.setContent(thankYouConfiguration.message);
605
648
  };
606
- return /*#__PURE__*/React__default["default"].createElement(NeetoUIForm__default["default"], {
649
+ return /*#__PURE__*/jsxRuntime.jsx(NeetoUIForm__default["default"], {
607
650
  formikProps: {
608
651
  enableReinitialize: true,
609
652
  initialValues: _objectSpread(_objectSpread({}, DEFAULT_IMAGE_PROPERTIES), thankYouConfiguration),
610
- validationSchema: VALIDATION_SCHEMA,
653
+ validationSchema: buildValidationSchema(allowEmptyCustomMessage),
611
654
  onSubmit: function onSubmit(values) {
612
655
  return updateThankYouConfiguration({
613
656
  entityId: entityId,
@@ -623,60 +666,67 @@ var Form = function Form(_ref) {
623
666
  }
624
667
  });
625
668
  }
626
- }
627
- }, function (_ref2) {
628
- var values = _ref2.values;
629
- return /*#__PURE__*/React__default["default"].createElement("div", {
630
- className: "grid grid-cols-1 gap-10 pb-6 md:grid-cols-2 md:gap-6"
631
- }, /*#__PURE__*/React__default["default"].createElement("div", {
632
- className: "flex flex-col"
633
- }, blockNavigation && /*#__PURE__*/React__default["default"].createElement(BlockNavigation__default["default"], null), !disableRadioSelection && /*#__PURE__*/React__default["default"].createElement("div", {
634
- className: "mb-6 w-full"
635
- }, /*#__PURE__*/React__default["default"].createElement(Radio__default["default"], {
636
- containerClassName: "grid grid-cols-1 sm:grid-cols-2 gap-6 items-stretch w-full",
637
- name: "kind"
638
- }, Object.values(FORM_OPTIONS).map(function (option) {
639
- return /*#__PURE__*/React__default["default"].createElement(Radio__default["default"].Item, {
640
- key: option.kind,
641
- label: /*#__PURE__*/React__default["default"].createElement(Label, option),
642
- name: "kind",
643
- value: option.kind,
644
- className: classNames__default["default"]("neeto-thank-you-configuration-radio__item", {
645
- active: values.kind === option.kind
646
- })
669
+ },
670
+ children: function children(_ref2) {
671
+ var values = _ref2.values;
672
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
673
+ className: "grid grid-cols-1 gap-10 pb-6 md:grid-cols-2 md:gap-6",
674
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
675
+ className: "flex flex-col",
676
+ children: [blockNavigation && /*#__PURE__*/jsxRuntime.jsx(BlockNavigation__default["default"], {}), !disableRadioSelection && /*#__PURE__*/jsxRuntime.jsx("div", {
677
+ className: "mb-6 w-full",
678
+ children: /*#__PURE__*/jsxRuntime.jsx(Radio__default["default"], {
679
+ containerClassName: "grid grid-cols-1 sm:grid-cols-2 gap-6 items-stretch w-full",
680
+ name: "kind",
681
+ children: Object.values(FORM_OPTIONS).map(function (option) {
682
+ return /*#__PURE__*/jsxRuntime.jsx(Radio__default["default"].Item, {
683
+ label: /*#__PURE__*/jsxRuntime.jsx(Label, _objectSpread({}, option)),
684
+ name: "kind",
685
+ value: option.kind,
686
+ className: classNames__default["default"]("neeto-thank-you-configuration-radio__item", {
687
+ active: values.kind === option.kind
688
+ })
689
+ }, option.kind);
690
+ })
691
+ })
692
+ }), values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/jsxRuntime.jsx(Customize, {
693
+ disableSubmitAnotherResponse: disableSubmitAnotherResponse,
694
+ editorProps: editorProps,
695
+ editorRef: editorRef,
696
+ entityId: entityId,
697
+ hasImageUploader: hasImageUploader,
698
+ uniqueSubmissionEnabled: uniqueSubmissionEnabled,
699
+ uniqueSubmissionLink: uniqueSubmissionLink,
700
+ disableSocialShare: ramda.isEmpty(socialHandles)
701
+ }) : /*#__PURE__*/jsxRuntime.jsx(ExternalLink, {}), /*#__PURE__*/jsxRuntime.jsx(ActionBlock__default["default"], {
702
+ className: "mt-6",
703
+ isSubmitting: isUpdatingForm,
704
+ cancelButtonProps: _objectSpread({
705
+ "data-cy": "neeto-thank-you-configuration-cancel-button"
706
+ }, redirectToOnCancel ? {
707
+ to: redirectToOnCancel,
708
+ onClick: neetoCist.noop
709
+ } : {
710
+ type: "reset",
711
+ onClick: resetEditor
712
+ }),
713
+ submitButtonProps: {
714
+ "data-cy": "neeto-thank-you-configuration-save-button"
715
+ }
716
+ })]
717
+ }), values.kind === FORM_OPTIONS.customize.kind && (CustomPreview ? /*#__PURE__*/jsxRuntime.jsx(CustomPreview, {
718
+ values: values
719
+ }) : /*#__PURE__*/jsxRuntime.jsx(Preview, {
720
+ appName: appName,
721
+ brandingInfo: brandingInfo,
722
+ isPublished: isPublished,
723
+ publicLinkId: publicLinkId,
724
+ resubmitLink: resubmitLink,
725
+ socialHandles: socialHandles,
726
+ thankYouTextAlignment: thankYouTextAlignment
727
+ }))]
647
728
  });
648
- }))), values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/React__default["default"].createElement(Customize, {
649
- disableSubmitAnotherResponse: disableSubmitAnotherResponse,
650
- editorRef: editorRef,
651
- entityId: entityId,
652
- hasImageUploader: hasImageUploader,
653
- uniqueSubmissionEnabled: uniqueSubmissionEnabled,
654
- uniqueSubmissionLink: uniqueSubmissionLink,
655
- disableSocialShare: ramda.isEmpty(socialHandles)
656
- }) : /*#__PURE__*/React__default["default"].createElement(ExternalLink, null), /*#__PURE__*/React__default["default"].createElement(ActionBlock__default["default"], {
657
- className: "mt-6",
658
- isSubmitting: isUpdatingForm,
659
- cancelButtonProps: _objectSpread({
660
- "data-cy": "neeto-thank-you-configuration-cancel-button"
661
- }, redirectToOnCancel ? {
662
- to: redirectToOnCancel,
663
- onClick: neetoCist.noop
664
- } : {
665
- type: "reset",
666
- onClick: resetEditor
667
- }),
668
- submitButtonProps: {
669
- "data-cy": "neeto-thank-you-configuration-save-button"
670
- }
671
- })), values.kind === FORM_OPTIONS.customize.kind && /*#__PURE__*/React__default["default"].createElement(Preview, {
672
- appName: appName,
673
- brandingInfo: brandingInfo,
674
- isPublished: isPublished,
675
- publicLinkId: publicLinkId,
676
- resubmitLink: resubmitLink,
677
- socialHandles: socialHandles,
678
- thankYouTextAlignment: thankYouTextAlignment
679
- }));
729
+ }
680
730
  });
681
731
  };
682
732
 
@@ -684,13 +734,14 @@ var Header = function Header(_ref) {
684
734
  var breadcrumbs = _ref.breadcrumbs;
685
735
  var _useTranslation = reactI18next.useTranslation(),
686
736
  t = _useTranslation.t;
687
- return /*#__PURE__*/React__default["default"].createElement("div", {
688
- className: "w-full px-6"
689
- }, /*#__PURE__*/React__default["default"].createElement(NeetoUIHeader__default["default"], {
690
- breadcrumbs: breadcrumbs,
691
- size: "small",
692
- title: t("neetoThankYou.common.thankYou")
693
- }));
737
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
738
+ className: "w-full px-6",
739
+ children: /*#__PURE__*/jsxRuntime.jsx(NeetoUIHeader__default["default"], {
740
+ breadcrumbs: breadcrumbs,
741
+ size: "small",
742
+ title: t("neetoThankYou.common.thankYou")
743
+ })
744
+ });
694
745
  };
695
746
 
696
747
  var ConfigureThankYou = function ConfigureThankYou(_ref) {
@@ -720,32 +771,43 @@ var ConfigureThankYou = function ConfigureThankYou(_ref) {
720
771
  blockNavigation = _ref$blockNavigation === void 0 ? false : _ref$blockNavigation,
721
772
  _ref$onConfigUpdateSu = _ref.onConfigUpdateSuccess,
722
773
  onConfigUpdateSuccess = _ref$onConfigUpdateSu === void 0 ? neetoCist.noop : _ref$onConfigUpdateSu,
723
- _ref$brandingInfo = _ref.brandingInfo,
724
- brandingInfo = _ref$brandingInfo === void 0 ? {} : _ref$brandingInfo;
725
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, customHeader || /*#__PURE__*/React__default["default"].createElement(Header, {
726
- breadcrumbs: breadcrumbs
727
- }), /*#__PURE__*/React__default["default"].createElement(Scrollable__default["default"], {
728
- className: "w-full p-6 pt-0"
729
- }, /*#__PURE__*/React__default["default"].createElement("div", {
730
- className: "mx-auto h-full max-w-7xl"
731
- }, /*#__PURE__*/React__default["default"].createElement(Form, {
732
- appName: appName,
733
- blockNavigation: blockNavigation,
734
- brandingInfo: brandingInfo,
735
- disableRadioSelection: disableRadioSelection,
736
- disableSubmitAnotherResponse: disableSubmitAnotherResponse,
737
- entityId: entityId,
738
- hasImageUploader: hasImageUploader,
739
- isPublished: isPublished,
740
- onConfigUpdateSuccess: onConfigUpdateSuccess,
741
- publicLinkId: publicLinkId,
742
- redirectToOnCancel: redirectToOnCancel,
743
- resubmitLink: resubmitLink,
744
- socialHandles: socialHandles,
745
- thankYouTextAlignment: thankYouTextAlignment,
746
- uniqueSubmissionEnabled: uniqueSubmissionEnabled,
747
- uniqueSubmissionLink: uniqueSubmissionLink
748
- }))));
774
+ brandingInfo = _ref.brandingInfo,
775
+ _ref$editorProps = _ref.editorProps,
776
+ editorProps = _ref$editorProps === void 0 ? {} : _ref$editorProps,
777
+ preview = _ref.preview,
778
+ _ref$allowEmptyCustom = _ref.allowEmptyCustomMessage,
779
+ allowEmptyCustomMessage = _ref$allowEmptyCustom === void 0 ? false : _ref$allowEmptyCustom;
780
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
781
+ children: [customHeader || /*#__PURE__*/jsxRuntime.jsx(Header, {
782
+ breadcrumbs: breadcrumbs
783
+ }), /*#__PURE__*/jsxRuntime.jsx(Scrollable__default["default"], {
784
+ className: "w-full p-6 pt-0",
785
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
786
+ className: "mx-auto h-full max-w-7xl",
787
+ children: /*#__PURE__*/jsxRuntime.jsx(Form, {
788
+ allowEmptyCustomMessage: allowEmptyCustomMessage,
789
+ appName: appName,
790
+ blockNavigation: blockNavigation,
791
+ brandingInfo: brandingInfo,
792
+ disableRadioSelection: disableRadioSelection,
793
+ disableSubmitAnotherResponse: disableSubmitAnotherResponse,
794
+ editorProps: editorProps,
795
+ entityId: entityId,
796
+ hasImageUploader: hasImageUploader,
797
+ isPublished: isPublished,
798
+ onConfigUpdateSuccess: onConfigUpdateSuccess,
799
+ preview: preview,
800
+ publicLinkId: publicLinkId,
801
+ redirectToOnCancel: redirectToOnCancel,
802
+ resubmitLink: resubmitLink,
803
+ socialHandles: socialHandles,
804
+ thankYouTextAlignment: thankYouTextAlignment,
805
+ uniqueSubmissionEnabled: uniqueSubmissionEnabled,
806
+ uniqueSubmissionLink: uniqueSubmissionLink
807
+ })
808
+ })
809
+ })]
810
+ });
749
811
  };
750
812
 
751
813
  var baseUrl = "".concat(THANK_YOU_ENGINE_BASE_URL, "/thank_you_page");
@@ -779,9 +841,10 @@ var buildDraftUrl = function buildDraftUrl(url) {
779
841
  };
780
842
 
781
843
  var DefaultPageLoader = function DefaultPageLoader() {
782
- return /*#__PURE__*/React__default["default"].createElement("div", {
783
- className: "neeto-thank-you-configuration"
784
- }, /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null));
844
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
845
+ className: "neeto-thank-you-configuration",
846
+ children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
847
+ });
785
848
  };
786
849
  var ShowThankYou = function ShowThankYou(_ref) {
787
850
  var _thankYouConfiguratio;
@@ -793,8 +856,7 @@ var ShowThankYou = function ShowThankYou(_ref) {
793
856
  publicLinkId = _ref.publicLinkId,
794
857
  appName = _ref.appName,
795
858
  CustomPageLoader = _ref.customPageLoader,
796
- _ref$brandingInfo = _ref.brandingInfo,
797
- brandingInfo = _ref$brandingInfo === void 0 ? {} : _ref$brandingInfo;
859
+ brandingInfo = _ref.brandingInfo;
798
860
  var _useTranslation = reactI18next.useTranslation(),
799
861
  t = _useTranslation.t;
800
862
  var _useShowThankYouPage = useShowThankYouPage({
@@ -806,35 +868,42 @@ var ShowThankYou = function ShowThankYou(_ref) {
806
868
  isLoading = _useShowThankYouPage.isLoading;
807
869
  var PageLoader = CustomPageLoader || DefaultPageLoader;
808
870
  if (isLoading && isThankYouPageLoading) {
809
- return /*#__PURE__*/React__default["default"].createElement(PageLoader, null);
871
+ return /*#__PURE__*/jsxRuntime.jsx(PageLoader, {});
810
872
  }
811
- return /*#__PURE__*/React__default["default"].createElement("div", {
812
- className: "neeto-thank-you-configuration"
813
- }, /*#__PURE__*/React__default["default"].createElement("main", {
814
- className: "neeto-thank-you-configuration__main"
815
- }, /*#__PURE__*/React__default["default"].createElement("div", {
816
- className: "neeto-thank-you-configuration__box"
817
- }, !ramda.isEmpty(thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl) && /*#__PURE__*/React__default["default"].createElement("div", {
818
- className: "neeto-thank-you-configuration__img"
819
- }, /*#__PURE__*/React__default["default"].createElement("img", {
820
- alt: "",
821
- src: thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl
822
- })), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.message) && /*#__PURE__*/React__default["default"].createElement("div", {
823
- className: "neeto-thank-you-configuration__description"
824
- }, /*#__PURE__*/React__default["default"].createElement(neetoEditor.EditorContent, {
825
- content: thankYouConfiguration.message
826
- })), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.showResubmitLink) && /*#__PURE__*/React__default["default"].createElement("a", {
827
- className: "neeto-thank-you-configuration__resubmit",
828
- href: isDraftPreview ? buildDraftUrl(resubmitLink) : resubmitLink
829
- }, (_thankYouConfiguratio = thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.resubmitLinkText) !== null && _thankYouConfiguratio !== void 0 ? _thankYouConfiguratio : t("neetoThankYou.common.resubmit")), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.socialSharingEnabled) && /*#__PURE__*/React__default["default"].createElement(SocialShare, {
830
- publicLinkId: publicLinkId,
831
- socialHandles: socialHandles
832
- }), isDraftPreview && /*#__PURE__*/React__default["default"].createElement(Typography__default["default"], {
833
- style: "body3"
834
- }, t("neetoThankYou.thankYou.draftVersionForm")))), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.brandingEnabled) && neetoCist.isPresent(brandingInfo) && /*#__PURE__*/React__default["default"].createElement(BrandingInfo, {
835
- appName: appName,
836
- brandingInfo: brandingInfo
837
- }));
873
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
874
+ className: "neeto-thank-you-configuration",
875
+ children: [/*#__PURE__*/jsxRuntime.jsx("main", {
876
+ className: "neeto-thank-you-configuration__main",
877
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
878
+ className: "neeto-thank-you-configuration__box",
879
+ children: [!ramda.isEmpty(thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl) && /*#__PURE__*/jsxRuntime.jsx("div", {
880
+ className: "neeto-thank-you-configuration__img",
881
+ children: /*#__PURE__*/jsxRuntime.jsx("img", {
882
+ alt: "",
883
+ src: thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl
884
+ })
885
+ }), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.message) && /*#__PURE__*/jsxRuntime.jsx("div", {
886
+ className: "neeto-thank-you-configuration__description",
887
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoEditor.EditorContent, {
888
+ content: thankYouConfiguration.message
889
+ })
890
+ }), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.showResubmitLink) && /*#__PURE__*/jsxRuntime.jsx("a", {
891
+ className: "neeto-thank-you-configuration__resubmit",
892
+ href: isDraftPreview ? buildDraftUrl(resubmitLink) : resubmitLink,
893
+ children: (_thankYouConfiguratio = thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.resubmitLinkText) !== null && _thankYouConfiguratio !== void 0 ? _thankYouConfiguratio : t("neetoThankYou.common.resubmit")
894
+ }), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.socialSharingEnabled) && /*#__PURE__*/jsxRuntime.jsx(SocialShare, {
895
+ publicLinkId: publicLinkId,
896
+ socialHandles: socialHandles
897
+ }), isDraftPreview && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
898
+ style: "body3",
899
+ children: t("neetoThankYou.thankYou.draftVersionForm")
900
+ })]
901
+ })
902
+ }), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.brandingEnabled) && /*#__PURE__*/jsxRuntime.jsx(BrandingInfo, {
903
+ appName: appName,
904
+ brandingInfo: brandingInfo
905
+ })]
906
+ });
838
907
  };
839
908
 
840
909
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}