diy-template-components 0.2.32 → 0.2.34

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/build/index.js CHANGED
@@ -17,6 +17,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
17
17
 
18
18
  var React = require('react');
19
19
  var Slider = require('react-slick');
20
+ var Image = require('next/image');
20
21
  var axios = require('axios');
21
22
  var moment = require('moment');
22
23
  var Countdown = require('react-countdown');
@@ -27,26 +28,24 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
27
28
 
28
29
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
30
  var Slider__default = /*#__PURE__*/_interopDefaultLegacy(Slider);
31
+ var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image);
30
32
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
31
33
  var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
32
34
  var Countdown__default = /*#__PURE__*/_interopDefaultLegacy(Countdown);
33
35
  var ReactDOMServer__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOMServer);
34
36
 
35
37
  function _extends() {
36
- _extends = Object.assign || function (target) {
38
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
37
39
  for (var i = 1; i < arguments.length; i++) {
38
40
  var source = arguments[i];
39
-
40
41
  for (var key in source) {
41
42
  if (Object.prototype.hasOwnProperty.call(source, key)) {
42
43
  target[key] = source[key];
43
44
  }
44
45
  }
45
46
  }
46
-
47
47
  return target;
48
48
  };
49
-
50
49
  return _extends.apply(this, arguments);
51
50
  }
52
51
 
@@ -302,21 +301,17 @@ const alpha = {
302
301
  seventyPercent: 0.7,
303
302
  eightyPercent: 0.8
304
303
  };
305
-
306
304
  const getRGBFromHex = hex => {
307
305
  const r = parseInt(hex.slice(1, 3), 16);
308
306
  const g = parseInt(hex.slice(3, 5), 16);
309
307
  const b = parseInt(hex.slice(5, 7), 16);
310
308
  return [r, g, b];
311
309
  };
312
-
313
310
  const hexToRgbA = (hex, alpha = null) => {
314
311
  const values = getRGBFromHex(hex);
315
-
316
312
  if (alpha !== null) {
317
313
  values.push(alpha);
318
314
  }
319
-
320
315
  return `rgba(${values.join(',')})`;
321
316
  };
322
317
  const colorMixer = (hex1, weightage = 1, hex2 = colors.white) => {
@@ -456,29 +451,24 @@ function useLinkBuilder(data) {
456
451
  basePath,
457
452
  isMasterTemplate
458
453
  } = React.useContext(PageContext);
459
-
460
454
  if (isEdit || !data.isLink) {
461
455
  return null;
462
456
  }
463
-
464
457
  if (data?.isExistingLink === false) {
465
458
  return data.link;
466
459
  }
467
-
468
460
  if (data?.isExternal) {
469
461
  return data.link;
470
462
  }
471
-
472
463
  if (!isPreview) {
473
464
  const link = data.link === '/' ? '' : '/' + data.link;
474
465
  return basePath ? `//${basePath}${link}` : null;
475
- } // courses in preview: special case
476
-
466
+ }
477
467
 
468
+ // courses in preview: special case
478
469
  if (data.link === 'courses') {
479
470
  return `//${basePath}/courses`;
480
471
  }
481
-
482
472
  const {
483
473
  pageId
484
474
  } = navList.find(el => el.slug === data?.link) || {};
@@ -654,14 +644,12 @@ var calendar$1 = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%
654
644
  var video = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2219%22%20viewBox%3D%220%200%2018%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M15.8625%205.1275C15.555%204.9625%2014.91%204.79%2014.0325%205.405L12.93%206.185C12.8475%203.8525%2011.835%202.9375%209.375%202.9375H4.875C2.31%202.9375%201.3125%203.935%201.3125%206.5V12.5C1.3125%2014.225%202.25%2016.0625%204.875%2016.0625H9.375C11.835%2016.0625%2012.8475%2015.1475%2012.93%2012.815L14.0325%2013.595C14.4975%2013.925%2014.9025%2014.03%2015.225%2014.03C15.5025%2014.03%2015.72%2013.9475%2015.8625%2013.8725C16.17%2013.715%2016.6875%2013.2875%2016.6875%2012.215V6.785C16.6875%205.7125%2016.17%205.285%2015.8625%205.1275ZM8.25%209.035C7.4775%209.035%206.84%208.405%206.84%207.625C6.84%206.845%207.4775%206.215%208.25%206.215C9.0225%206.215%209.66%206.845%209.66%207.625C9.66%208.405%209.0225%209.035%208.25%209.035Z%22%20fill%3D%22%23589DF5%22%2F%3E%3C%2Fsvg%3E";
655
645
 
656
646
  /** @returns {import('./types').IconData} */
657
-
658
647
  const getConfiguredIcon1 = url => ({
659
648
  url,
660
649
  svgChildrenConfigs: []
661
650
  });
662
- /** @returns {import('./types').IconData} */
663
-
664
651
 
652
+ /** @returns {import('./types').IconData} */
665
653
  const getConfiguredIcon2 = (url, stroke, fill) => ({
666
654
  url,
667
655
  svgChildrenConfigs: [{
@@ -670,7 +658,6 @@ const getConfiguredIcon2 = (url, stroke, fill) => ({
670
658
  fill
671
659
  }]
672
660
  });
673
-
674
661
  const icons = {
675
662
  'Live class': getConfiguredIcon2(liveTv, false, true),
676
663
  'Recorded videos': getConfiguredIcon2(liveTv2, false, true),
@@ -703,41 +690,51 @@ const icons = {
703
690
  'Video Play': getConfiguredIcon2(videoPlay, false, true),
704
691
  Quote: getConfiguredIcon2(quote, false, true),
705
692
  // Stock
693
+
706
694
  'Stock Growth': getConfiguredIcon2(stockGrowth, false, true),
707
695
  Money: getConfiguredIcon2(money, false, true),
708
696
  Split: getConfiguredIcon2(split, false, true),
709
697
  Chart: getConfiguredIcon2(chart, false, true),
710
698
  // Personality Development
699
+
711
700
  Leaders: getConfiguredIcon2(leaders, false, true),
712
701
  Women: getConfiguredIcon2(women, false, true),
713
702
  Program: getConfiguredIcon2(program, false, true),
714
703
  // Photography
704
+
715
705
  'Video Editing': getConfiguredIcon2(videoEditing, false, true),
716
706
  Editing: getConfiguredIcon2(editing, false, true),
717
707
  Camera: getConfiguredIcon2(camera, false, true),
718
708
  Sessions: getConfiguredIcon2(sessions, false, true),
719
709
  // Computer
710
+
720
711
  'Regular Batches': getConfiguredIcon2(regularBatches, false, true),
721
712
  'Alternate Batches': getConfiguredIcon2(alternateBatches, false, true),
722
713
  'Weekend Batches': getConfiguredIcon2(weekendBatches, false, true),
723
714
  // Life Coach
715
+
724
716
  Girl: getConfiguredIcon2(girl, false, true),
725
717
  Smile: getConfiguredIcon2(smile, false, true),
726
718
  Relationships: getConfiguredIcon2(relationships, false, true),
727
719
  // Music
720
+
728
721
  Vocal: getConfiguredIcon2(vocal, false, true),
729
722
  Instrument: getConfiguredIcon2(instrument, false, true),
730
723
  Music: getConfiguredIcon2(music, false, true),
731
724
  // Fitness
725
+
732
726
  Workout: getConfiguredIcon2(workout, false, true),
733
727
  Barbell: getConfiguredIcon2(barbell, false, true),
734
728
  Trainer: getConfiguredIcon2(trainer, false, true),
735
729
  Report: getConfiguredIcon2(report, false, true),
736
730
  // Govt Exam
731
+
737
732
  'Govt Exam': getConfiguredIcon2(govtExam, false, true),
738
733
  // IIT JEE
734
+
739
735
  College: getConfiguredIcon2(college, false, true),
740
736
  // Others
737
+
741
738
  Teachers: getConfiguredIcon2(teachers, false, true),
742
739
  Learning: getConfiguredIcon2(learning, false, true),
743
740
  Success: getConfiguredIcon2(success, false, true),
@@ -749,12 +746,9 @@ const icons = {
749
746
  Video: getConfiguredIcon2(video, false, true)
750
747
  };
751
748
 
752
- const someMethod1 = (
753
- /** @type {import('./types').IconData["svgChildrenConfigs"]} */
754
- svgChildrenConfigs, color, hoverColor) => {
749
+ const someMethod1 = ( /** @type {import('./types').IconData["svgChildrenConfigs"]} */svgChildrenConfigs, color, hoverColor) => {
755
750
  /** @type {{ [k:string]:React.CSSProperties; }} */
756
751
  const obj = {};
757
-
758
752
  for (const svgChildConfig of svgChildrenConfigs) {
759
753
  if (color) obj['& ' + svgChildConfig.selector] = {
760
754
  fill: svgChildConfig.fill ? color : undefined,
@@ -765,10 +759,8 @@ svgChildrenConfigs, color, hoverColor) => {
765
759
  stroke: svgChildConfig.stroke ? hoverColor : undefined
766
760
  };
767
761
  }
768
-
769
762
  return obj;
770
763
  };
771
-
772
764
  const useStyles$1 = reactJss.createUseStyles({
773
765
  '@keyframes slideRight': {
774
766
  to: {
@@ -812,8 +804,8 @@ const defaultSvgState = {
812
804
  childrenConfigs: [],
813
805
  attributes: defaultAttributes
814
806
  };
815
- /** @type {import('./props.type').IconProps} */
816
807
 
808
+ /** @type {import('./props.type').IconProps} */
817
809
  const iconDefaultProps = {
818
810
  name: undefined,
819
811
  width: 'auto',
@@ -823,8 +815,8 @@ const iconDefaultProps = {
823
815
  opacity: undefined,
824
816
  className: undefined
825
817
  };
826
- /** @type {import("react").FC<import('./props.type').IconProps>} */
827
818
 
819
+ /** @type {import("react").FC<import('./props.type').IconProps>} */
828
820
  const Icon = ({
829
821
  name,
830
822
  width,
@@ -843,10 +835,8 @@ const Icon = ({
843
835
  }, []);
844
836
  /** */
845
837
 
846
- const rootRef = React.useRef(
847
- /** @type {HTMLElement} */
848
- null); // this ref is used to cancel the fetch promise success callback in case name prop changed
849
-
838
+ const rootRef = React.useRef( /** @type {HTMLElement} */null);
839
+ // this ref is used to cancel the fetch promise success callback in case name prop changed
850
840
  const currentName = React.useRef(name);
851
841
  const [svgState, setSvgState] = React.useState(defaultSvgState);
852
842
  const styles = useStyles$1({
@@ -857,46 +847,41 @@ const Icon = ({
857
847
  opacity,
858
848
  hoverColor
859
849
  });
860
-
861
850
  const _className = React.useMemo(() => `${styles.root} ${className || ''}`, [className]);
862
-
863
851
  React.useEffect(() => {
864
852
  // reset
865
853
  currentName.current = name;
866
854
  setSvgState(defaultSvgState);
867
855
  const icon = icons[name];
868
-
869
856
  if (icon) {
870
857
  /**
871
858
  * retrieve from cache
872
859
  * @type {Promise<string>}
873
860
  */
874
861
  let svgProm = Icon.getCachedSvgPromise(name);
875
-
876
862
  if (!svgProm) {
877
863
  svgProm = fetch(icon.url).then(r => r.text()).catch(() => {
878
864
  // unset in cache
879
865
  Icon.setCachedSvgPromise(name, undefined);
880
866
  return null;
881
- }); //save in cache
882
-
867
+ });
868
+ //save in cache
883
869
  Icon.setCachedSvgPromise(name, svgProm);
884
870
  }
885
-
886
871
  svgProm.then(svg => {
887
872
  if (svg && isMounted.current && name === currentName.current) {
888
873
  const div = document.createElement('div');
889
- div.innerHTML = svg; // set the new attributes
874
+ div.innerHTML = svg;
890
875
 
876
+ // set the new attributes
891
877
  const newAttributes = {};
892
-
893
878
  for (const ob of div.firstElementChild.attributes) {
894
879
  const camelCased = ob.name.replace(/(-|:)([a-z])/g, g => g[1].toUpperCase());
895
880
  newAttributes[camelCased] = ob.value;
896
- } // setting the state in last.
897
- // Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
898
-
881
+ }
899
882
 
883
+ // setting the state in last.
884
+ // Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
900
885
  setSvgState({
901
886
  innerHtml: div.firstElementChild.innerHTML,
902
887
  childrenConfigs: icon.svgChildrenConfigs,
@@ -916,14 +901,11 @@ const Icon = ({
916
901
  onClick: onClick
917
902
  }));
918
903
  };
919
-
920
904
  Icon.defaultProps = iconDefaultProps;
921
- /** static properties for caching */
922
905
 
906
+ /** static properties for caching */
923
907
  Icon.cacheStore = {};
924
-
925
908
  Icon.getCachedSvgPromise = name => Icon.cacheStore[name];
926
-
927
909
  Icon.setCachedSvgPromise = (name, prom) => Icon.cacheStore[name] = prom;
928
910
 
929
911
  const useDropdownStyles = createUseStyles(theme => ({
@@ -1035,7 +1017,6 @@ function OptionList({
1035
1017
  isLandingPages
1036
1018
  }) {
1037
1019
  React.useContext(PageContext);
1038
-
1039
1020
  const tabsDataModifier = () => {
1040
1021
  return optionsData?.map(dt => {
1041
1022
  return {
@@ -1047,7 +1028,6 @@ function OptionList({
1047
1028
  };
1048
1029
  });
1049
1030
  };
1050
-
1051
1031
  const tabData = tabsDataModifier();
1052
1032
  const classes = useSectionStyles$a();
1053
1033
  return /*#__PURE__*/React__default["default"].createElement("div", {
@@ -1136,31 +1116,24 @@ function DesktopHeader({
1136
1116
  const classes = useSectionStyles$a({
1137
1117
  isFixed
1138
1118
  });
1139
-
1140
1119
  const optionDataFn = () => {
1141
1120
  let optionsArr = navData;
1142
1121
  let optionsData = [];
1143
-
1144
1122
  if (optionsArr?.length > 5) {
1145
1123
  optionsData = optionsArr?.slice(0, 4);
1146
1124
  } else {
1147
1125
  optionsData = optionsArr;
1148
1126
  }
1149
-
1150
1127
  return optionsData;
1151
1128
  };
1152
-
1153
1129
  const moreContentFn = () => {
1154
1130
  let optionsArr = navData;
1155
1131
  let moreContent = [];
1156
-
1157
1132
  if (optionsArr?.length > 5) {
1158
1133
  moreContent = optionsArr?.slice(4);
1159
1134
  }
1160
-
1161
1135
  return moreContent;
1162
1136
  };
1163
-
1164
1137
  return /*#__PURE__*/React__default["default"].createElement("nav", {
1165
1138
  className: classes.section
1166
1139
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -1218,7 +1191,6 @@ function MobileHeader({
1218
1191
  const navEl = React.useRef(null);
1219
1192
  React.useLayoutEffect(() => {
1220
1193
  const body = navEl?.current?.ownerDocument?.body;
1221
-
1222
1194
  if (sideMenu) {
1223
1195
  body?.setAttribute('style', 'overflow: hidden;');
1224
1196
  } else {
@@ -1228,7 +1200,6 @@ function MobileHeader({
1228
1200
  let iosUrl = null;
1229
1201
  let androidUrl = null;
1230
1202
  let downloadLink = null;
1231
-
1232
1203
  if (isTutorWebsite) {
1233
1204
  if (header?.iosUrl) {
1234
1205
  iosUrl = /*#__PURE__*/React__default["default"].createElement(Button, {
@@ -1251,7 +1222,6 @@ function MobileHeader({
1251
1222
  }
1252
1223
  });
1253
1224
  }
1254
-
1255
1225
  if (header?.androidURL) {
1256
1226
  androidUrl = /*#__PURE__*/React__default["default"].createElement(Button, {
1257
1227
  data: {
@@ -1272,7 +1242,6 @@ function MobileHeader({
1272
1242
  }
1273
1243
  });
1274
1244
  }
1275
-
1276
1245
  if (iosUrl && androidUrl) {
1277
1246
  downloadLink = /*#__PURE__*/React__default["default"].createElement("div", null, iosUrl, androidUrl);
1278
1247
  } else if (header?.iosUrl) {
@@ -1322,7 +1291,6 @@ function MobileHeader({
1322
1291
  downloadLink = null;
1323
1292
  }
1324
1293
  }
1325
-
1326
1294
  return /*#__PURE__*/React__default["default"].createElement("nav", {
1327
1295
  ref: navEl,
1328
1296
  className: classes.section
@@ -1379,11 +1347,9 @@ function Header({
1379
1347
  isMobile,
1380
1348
  isTutorWebsite
1381
1349
  } = React.useContext(PageContext);
1382
-
1383
1350
  const filterHiddenNavs = () => {
1384
1351
  return data?.navs?.filter(dt => !dt.isHiddenNav);
1385
1352
  };
1386
-
1387
1353
  return isMobile ? /*#__PURE__*/React__default["default"].createElement(MobileHeader, {
1388
1354
  navData: filterHiddenNavs(),
1389
1355
  header: data,
@@ -1739,7 +1705,6 @@ const rustTheme = {
1739
1705
  light: colors.lightRust,
1740
1706
  lightest: colors.lightestRust
1741
1707
  };
1742
-
1743
1708
  const generateThemePalette = themeColors => ({
1744
1709
  primary: themeColors,
1745
1710
  background: {
@@ -1762,7 +1727,6 @@ const generateThemePalette = themeColors => ({
1762
1727
  tertiary: colors.blueGrey
1763
1728
  }
1764
1729
  });
1765
-
1766
1730
  const bluePalette = generateThemePalette(blueTheme);
1767
1731
  const redPalette = generateThemePalette(redTheme);
1768
1732
  const orangePalette = generateThemePalette(orangeTheme);
@@ -1803,9 +1767,7 @@ const fontComponents = {
1803
1767
  'Merriweather Sans': MerriweatherSans,
1804
1768
  'Arima Madurai': ArimaMadurai
1805
1769
  };
1806
-
1807
1770
  const getFontComponent = font => fontComponents[font] || (() => null);
1808
-
1809
1771
  function FontSeeder({
1810
1772
  fontFamily
1811
1773
  }) {
@@ -1815,37 +1777,30 @@ function FontSeeder({
1815
1777
  const useRubikFont = reactJss.createUseStyles({
1816
1778
  '@import': `url('https://fonts.googleapis.com/css2?family=Lato&family=Rubik:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap')`
1817
1779
  });
1818
-
1819
1780
  function Rubik() {
1820
1781
  // to import "Rubik" font css
1821
1782
  useRubikFont();
1822
1783
  return null;
1823
1784
  }
1824
-
1825
1785
  const useIbmPlexSansFont = reactJss.createUseStyles({
1826
1786
  '@import': 'url(https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap)'
1827
1787
  });
1828
-
1829
1788
  function IbmPlexSans() {
1830
1789
  // to import "Ibm Plex Sans" font css
1831
1790
  useIbmPlexSansFont();
1832
1791
  return null;
1833
1792
  }
1834
-
1835
1793
  const useMerriweatherSansFont = reactJss.createUseStyles({
1836
1794
  '@import': 'url(https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap)'
1837
1795
  });
1838
-
1839
1796
  function MerriweatherSans() {
1840
1797
  // to import "Merriweather Sans" font css
1841
1798
  useMerriweatherSansFont();
1842
1799
  return null;
1843
1800
  }
1844
-
1845
1801
  const useArimaMaduraiFont = reactJss.createUseStyles({
1846
1802
  '@import': 'url(https://fonts.googleapis.com/css2?family=Arima+Madurai:wght@400;500;700&display=swap)'
1847
1803
  });
1848
-
1849
1804
  function ArimaMadurai() {
1850
1805
  // to import "Arima Madurai" font css
1851
1806
  useArimaMaduraiFont();
@@ -1876,9 +1831,7 @@ const TYPE_TO_COMPONENT_MAP$1 = {
1876
1831
  TILES_SECTION: /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return index$1; })),
1877
1832
  EMAIL_DRIP_MARKET: /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return index; }))
1878
1833
  };
1879
-
1880
1834
  const getCompToRender$1 = type => TYPE_TO_COMPONENT_MAP$1[type] || (() => null);
1881
-
1882
1835
  const MemoisedSection$1 = /*#__PURE__*/React.memo(({
1883
1836
  sectionData,
1884
1837
  extraProps
@@ -1895,9 +1848,7 @@ function SectionRenderer$1({
1895
1848
  extraProps
1896
1849
  }) {
1897
1850
  return /*#__PURE__*/React__default["default"].createElement(React.Suspense, {
1898
- fallback: null
1899
- /*GIF maybe*/
1900
-
1851
+ fallback: null /*GIF maybe*/
1901
1852
  }, /*#__PURE__*/React__default["default"].createElement(MemoisedSection$1, {
1902
1853
  sectionData: sectionData,
1903
1854
  extraProps: extraProps
@@ -1969,8 +1920,8 @@ function PageRenderer$1({
1969
1920
  isCustomWebsite,
1970
1921
  _id
1971
1922
  }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id]);
1972
- const Wrapper = SectionWrapper || React.Fragment; // console.log("CONTEXT______", context)
1973
-
1923
+ const Wrapper = SectionWrapper || React.Fragment;
1924
+ // console.log("CONTEXT______", context)
1974
1925
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
1975
1926
  theme: theme
1976
1927
  }, /*#__PURE__*/React__default["default"].createElement(PageContext.Provider, {
@@ -2193,23 +2144,18 @@ const getArrowRotationAngle = props => {
2193
2144
  switch (true) {
2194
2145
  case props.left:
2195
2146
  return 180;
2196
-
2197
2147
  case props.up:
2198
2148
  return 270;
2199
-
2200
2149
  case props.down:
2201
2150
  return 90;
2202
-
2203
2151
  case props.right:
2204
2152
  default:
2205
2153
  return 0;
2206
2154
  }
2207
2155
  };
2208
-
2209
2156
  const sizeHandler = ({
2210
2157
  size
2211
2158
  }) => size === 'small' ? '32px' : '48px';
2212
-
2213
2159
  const useArrowButtonStyles = createUseStyles(theme => ({
2214
2160
  arrowButtonContainer: {
2215
2161
  cursor: 'pointer',
@@ -2249,7 +2195,6 @@ function dotsToShow(i, n) {
2249
2195
  const leftToShow = i < elementsToShow / 2;
2250
2196
  const rightToShow = n - i - 1 < elementsToShow / 2;
2251
2197
  let leftCount, rightCount;
2252
-
2253
2198
  if (leftToShow) {
2254
2199
  leftCount = i;
2255
2200
  rightCount = elementsToShow - i - 1;
@@ -2260,13 +2205,11 @@ function dotsToShow(i, n) {
2260
2205
  leftCount = 2;
2261
2206
  rightCount = 2;
2262
2207
  }
2263
-
2264
2208
  return {
2265
2209
  leftCount,
2266
2210
  rightCount
2267
2211
  };
2268
2212
  }
2269
-
2270
2213
  function Carousel({
2271
2214
  settings,
2272
2215
  children,
@@ -2320,15 +2263,12 @@ function Carousel({
2320
2263
  ...settings,
2321
2264
  className: settings?.className ? settings?.className + ' ' + classes.sliderClass : classes.sliderClass
2322
2265
  };
2323
-
2324
2266
  const nextClick = () => {
2325
2267
  sliderRef.current.slickNext();
2326
2268
  };
2327
-
2328
2269
  const previousClick = () => {
2329
2270
  sliderRef.current.slickPrev();
2330
2271
  };
2331
-
2332
2272
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Slider__default["default"], _extends({
2333
2273
  ref: sliderRef
2334
2274
  }, sliderSettings), children), hideArrow || isMobile ? null : /*#__PURE__*/React__default["default"].createElement("div", {
@@ -2355,21 +2295,21 @@ const NextImageRenderer = ({
2355
2295
  refSetter,
2356
2296
  className
2357
2297
  } = props;
2358
-
2359
2298
  if (isCustomWebsite) {
2360
- return /*#__PURE__*/React__default["default"].createElement(require.resolve('next/image').default, {
2299
+ // return (React.createElement(require.resolve('next/image').default, {
2300
+ // src: src,
2301
+ // layout: 'fill',
2302
+ // ref: { refSetter },
2303
+ // className: { className },
2304
+ // ...props
2305
+ // });)
2306
+
2307
+ return /*#__PURE__*/React__default["default"].createElement(Image__default["default"], _extends({
2361
2308
  src: src,
2362
- // height: "640",
2363
- // width: "959",
2364
2309
  layout: 'fill',
2365
- ref: {
2366
- refSetter
2367
- },
2368
- className: {
2369
- className
2370
- },
2371
- ...props
2372
- });
2310
+ ref: refSetter,
2311
+ className: className
2312
+ }, props));
2373
2313
  } else {
2374
2314
  return /*#__PURE__*/React__default["default"].createElement("img", {
2375
2315
  ref: refSetter,
@@ -2430,7 +2370,6 @@ function Section$4({
2430
2370
  src: nodeData.image.metadata.value
2431
2371
  }))));
2432
2372
  }
2433
-
2434
2373
  function BannerCarouselRight({
2435
2374
  sectionData
2436
2375
  }) {
@@ -2456,9 +2395,7 @@ function BannerCarouselRight({
2456
2395
  className: classes.sectionContainer
2457
2396
  }, /*#__PURE__*/React__default["default"].createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$4, {
2458
2397
  nodeData: node,
2459
- key: idx
2460
- /* or some other unique property */
2461
-
2398
+ key: idx /* or some other unique property */
2462
2399
  })))));
2463
2400
  }
2464
2401
 
@@ -2665,11 +2602,9 @@ function List({
2665
2602
  containerWidth
2666
2603
  });
2667
2604
  const [nodeData] = sectionData.components;
2668
-
2669
2605
  const getNumber = val => {
2670
2606
  return val.toString().length == 1 ? '0' + val : val;
2671
2607
  };
2672
-
2673
2608
  return /*#__PURE__*/React__default["default"].createElement("section", {
2674
2609
  className: classes.section
2675
2610
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -2755,12 +2690,13 @@ const useSectionStyles$6 = createUseStyles(theme => ({
2755
2690
  padding: '100px 0',
2756
2691
  height: '100%',
2757
2692
  display: 'flex',
2758
- alignItems: 'center' // backgroundImage: ({ imageUrl } = {}) =>
2693
+ alignItems: 'center'
2694
+ // backgroundImage: ({ imageUrl } = {}) =>
2759
2695
  // `linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%), url("${imageUrl}")`,
2760
2696
  // backgroundPosition: 'center',
2761
2697
  // backgroundSize: 'cover'
2762
-
2763
2698
  },
2699
+
2764
2700
  centerBgImageContainer: {
2765
2701
  width: '100%',
2766
2702
  position: 'relative',
@@ -2890,7 +2826,6 @@ const Section$3 = ({
2890
2826
  className: classes?.centerBgImage
2891
2827
  }))));
2892
2828
  };
2893
-
2894
2829
  function BannerCarouselCenter({
2895
2830
  sectionData,
2896
2831
  isCustomWebsite
@@ -2910,9 +2845,7 @@ function BannerCarouselCenter({
2910
2845
  }, /*#__PURE__*/React__default["default"].createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$3, {
2911
2846
  nodeData: node,
2912
2847
  isCustomWebsite: isCustomWebsite,
2913
- key: idx
2914
- /* or some other unique property */
2915
-
2848
+ key: idx /* or some other unique property */
2916
2849
  }))));
2917
2850
  }
2918
2851
 
@@ -3082,7 +3015,6 @@ function Section$2({
3082
3015
  size: isMobile ? 'small' : 'medium'
3083
3016
  })));
3084
3017
  }
3085
-
3086
3018
  function BannerCarouselLeft({
3087
3019
  sectionData,
3088
3020
  isCustomWebsite
@@ -3106,9 +3038,7 @@ function BannerCarouselLeft({
3106
3038
  className: classes.sectionContainer
3107
3039
  }, /*#__PURE__*/React__default["default"].createElement(Wrapper, null, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$2, {
3108
3040
  nodeData: node,
3109
- key: idx
3110
- /* or some other unique property */
3111
-
3041
+ key: idx /* or some other unique property */
3112
3042
  })))));
3113
3043
  }
3114
3044
 
@@ -3263,7 +3193,6 @@ async function postApiCall(baseURLs, data) {
3263
3193
  },
3264
3194
  data
3265
3195
  });
3266
-
3267
3196
  if (res) {
3268
3197
  return res.data;
3269
3198
  }
@@ -3288,7 +3217,6 @@ async function postApiCallForm(baseURLs, data, extraProps) {
3288
3217
  if (extraProps && extraProps.formSubmitSuccess) {
3289
3218
  extraProps.formSubmitSuccess();
3290
3219
  }
3291
-
3292
3220
  return res.data;
3293
3221
  });
3294
3222
  } catch (err) {
@@ -3401,7 +3329,6 @@ function SubscribeToNewsletter({
3401
3329
  const [inputVal, setInputVal] = React.useState(formInitialValue);
3402
3330
  let [isValid, setIsValid] = React.useState(true);
3403
3331
  let [btnDisabled, setBtnDisabled] = React.useState(false);
3404
-
3405
3332
  const handleSubmit = () => {
3406
3333
  let data = {
3407
3334
  sectionId: sectionData.sectionId,
@@ -3417,11 +3344,9 @@ function SubscribeToNewsletter({
3417
3344
  setBtnDisabled(true);
3418
3345
  setInputVal(formInitialValue);
3419
3346
  };
3420
-
3421
3347
  const checkValidity = () => {
3422
3348
  if (validations?.[nodeData?.inputField?.metadata?.validationType]?.length) {
3423
3349
  let regex = new RegExp(validations[nodeData?.inputField?.metadata?.validationType]);
3424
-
3425
3350
  if (regex?.test(inputVal)) {
3426
3351
  setIsValid(true);
3427
3352
  } else {
@@ -3429,7 +3354,6 @@ function SubscribeToNewsletter({
3429
3354
  }
3430
3355
  }
3431
3356
  };
3432
-
3433
3357
  React.useEffect(() => {
3434
3358
  if (!isValid) {
3435
3359
  setBtnDisabled(true);
@@ -3779,7 +3703,6 @@ function Section$1({
3779
3703
  className: classes.contentRow
3780
3704
  }, carouselContent))));
3781
3705
  }
3782
-
3783
3706
  function Testimonials({
3784
3707
  sectionData
3785
3708
  }) {
@@ -3844,7 +3767,6 @@ const loaderStyle = theme => ({
3844
3767
  });
3845
3768
 
3846
3769
  const useStyles = reactJss.createUseStyles(loaderStyle);
3847
-
3848
3770
  function Loader({
3849
3771
  texts
3850
3772
  }) {
@@ -3856,13 +3778,11 @@ function Loader({
3856
3778
  React.useEffect(() => {
3857
3779
  if (texts && texts.length) {
3858
3780
  let textID = '';
3859
-
3860
3781
  for (let i = 0; i < texts.length; i++) {
3861
3782
  textID = setTimeout(() => {
3862
3783
  setLoaderText(texts[i]);
3863
3784
  }, 2000 * i);
3864
3785
  }
3865
-
3866
3786
  return () => {
3867
3787
  clearTimeout(textID);
3868
3788
  };
@@ -3932,18 +3852,15 @@ function VideoPlayer(props) {
3932
3852
  imageUrl: imageUrl
3933
3853
  });
3934
3854
  const theme = useTheme();
3935
-
3936
3855
  function getId(url) {
3937
3856
  var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
3938
3857
  var match = url?.match(regExp);
3939
-
3940
3858
  if (match?.[2].length == 11) {
3941
3859
  return 'https://www.youtube.com/embed/' + match[2];
3942
3860
  } else {
3943
3861
  return url;
3944
3862
  }
3945
3863
  }
3946
-
3947
3864
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isLoaded && /*#__PURE__*/React__default["default"].createElement("div", {
3948
3865
  className: classes.imgContainer
3949
3866
  }, /*#__PURE__*/React__default["default"].createElement(NextImageRenderer, {
@@ -4789,8 +4706,8 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
4789
4706
  width: 'calc(100% - 2px)',
4790
4707
  position: 'relative',
4791
4708
  paddingBottom: '59.83%' // keeping aspect ratio 585x350
4792
-
4793
4709
  },
4710
+
4794
4711
  contentRow: {
4795
4712
  display: 'grid',
4796
4713
  gridTemplateColumns: ({
@@ -5048,7 +4965,6 @@ const FAQListing = ({
5048
4965
  isSelected: selectedIndex === index
5049
4966
  })))));
5050
4967
  };
5051
-
5052
4968
  const Accordion = ({
5053
4969
  item,
5054
4970
  isSelected,
@@ -5335,9 +5251,10 @@ const useCourseStyles = createUseStyles(theme => {
5335
5251
  flexGrow: 1,
5336
5252
  display: 'flex',
5337
5253
  flexDirection: 'column',
5338
- justifyContent: 'space-between' //alignItems: 'center',
5339
-
5254
+ justifyContent: 'space-between'
5255
+ //alignItems: 'center',
5340
5256
  },
5257
+
5341
5258
  courseCardTags: {
5342
5259
  display: 'flex',
5343
5260
  justifyContent: 'flex-start',
@@ -5363,11 +5280,12 @@ const useCourseStyles = createUseStyles(theme => {
5363
5280
  wordBreak: 'break-word',
5364
5281
  padding: '12px 0px',
5365
5282
  textAlign: 'left',
5366
- display: 'inline-block' // overflow: 'hidden',
5283
+ display: 'inline-block'
5284
+ // overflow: 'hidden',
5367
5285
  // whiteSpace: 'nowrap',
5368
5286
  // textOverflow: 'ellipsis'
5369
-
5370
5287
  },
5288
+
5371
5289
  courseCardDiscount: {
5372
5290
  display: 'flex',
5373
5291
  justifyContent: 'flex-start',
@@ -5449,7 +5367,8 @@ const useCourseStyles = createUseStyles(theme => {
5449
5367
  }
5450
5368
  },
5451
5369
  '@media (max-width: 768px)': {
5452
- coursesContainer: {//background: theme?.palette?.background?.primary
5370
+ coursesContainer: {
5371
+ //background: theme?.palette?.background?.primary
5453
5372
  },
5454
5373
  coursesCardAndText: {
5455
5374
  padding: '70px 30px'
@@ -5481,7 +5400,6 @@ async function getCourseList(baseURLs, hashToken) {
5481
5400
  if (!hashToken) {
5482
5401
  throw 'Missing hash token';
5483
5402
  }
5484
-
5485
5403
  const res = await axios__default["default"]({
5486
5404
  method: 'get',
5487
5405
  baseURL: baseURLs?.API_COURSE_URL,
@@ -5493,7 +5411,6 @@ async function getCourseList(baseURLs, hashToken) {
5493
5411
  requiredFilters: '[10]'
5494
5412
  }
5495
5413
  });
5496
-
5497
5414
  if (res) {
5498
5415
  return res.data;
5499
5416
  }
@@ -5505,7 +5422,6 @@ function getShortenedSubstring(name, length, allowDots = true) {
5505
5422
  if (name) {
5506
5423
  return name.length < length ? name : `${name.substr(0, length)}${allowDots && '...'}`;
5507
5424
  }
5508
-
5509
5425
  return '';
5510
5426
  }
5511
5427
 
@@ -5583,13 +5499,11 @@ function courses({
5583
5499
  containerWidth
5584
5500
  });
5585
5501
  const [nodeData] = sectionData?.components;
5586
-
5587
5502
  const handleApiCall = () => {
5588
5503
  if (baseURLs) {
5589
5504
  getCourseList(baseURLs, hashToken).then(response => {
5590
5505
  const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
5591
5506
  const coursesData = response?.data?.coursesData;
5592
-
5593
5507
  if (coursesData && coursesData.length) {
5594
5508
  setCardList(response?.data?.coursesData);
5595
5509
  setShowShimmer(false);
@@ -5600,12 +5514,12 @@ function courses({
5600
5514
  setShowShimmer(false);
5601
5515
  setFallbackImages(placeholders);
5602
5516
  }
5603
- } // For User Website & Draft Preview: If no data found, hide section.
5517
+ }
5518
+ // For User Website & Draft Preview: If no data found, hide section.
5604
5519
  else setErrored(true);
5605
5520
  }
5606
5521
  }).catch(err => {
5607
5522
  const errMsg = err?.response?.data?.data?.message;
5608
-
5609
5523
  if (errMsg === 'NOT_FOUND') {
5610
5524
  if (nodeData?.cardCarousel?.metadata?.placeholders?.length && isEdit) {
5611
5525
  setShowShimmer(false);
@@ -5617,16 +5531,16 @@ function courses({
5617
5531
  });
5618
5532
  }
5619
5533
  };
5620
-
5621
5534
  React.useEffect(() => {
5622
- const placeholders = nodeData?.cardCarousel?.metadata?.placeholders; // For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
5623
-
5535
+ const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
5536
+ // For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
5624
5537
  if (isMasterTemplate) {
5625
5538
  if (placeholders && placeholders.length) {
5626
5539
  setShowShimmer(false);
5627
5540
  setFallbackImages(placeholders);
5628
5541
  }
5629
- } // other
5542
+ }
5543
+ // other
5630
5544
  else {
5631
5545
  handleApiCall();
5632
5546
  }
@@ -5691,7 +5605,6 @@ function courses({
5691
5605
  });
5692
5606
  })))));
5693
5607
  }
5694
-
5695
5608
  function SimpleCardsContainer({
5696
5609
  children,
5697
5610
  classes
@@ -6107,7 +6020,6 @@ function FormEnquiry({
6107
6020
  setBtnDisabled(true);
6108
6021
  }
6109
6022
  }, [validData]);
6110
-
6111
6023
  const handleSubmit = () => {
6112
6024
  let data = {
6113
6025
  sectionId: sectionData?._id || null,
@@ -6118,23 +6030,22 @@ function FormEnquiry({
6118
6030
  setBtnDisabled(true);
6119
6031
  setInputVal(formInitialValue);
6120
6032
  };
6121
-
6122
6033
  const checkValidity = (regexField, fieldname, fieldValidity) => {
6123
6034
  if (validations?.[regexField]?.length) {
6124
6035
  let regex = new RegExp(validations[regexField]);
6125
-
6126
6036
  if (regex?.test(inputVal[fieldname])) {
6127
- setValidData({ ...validData,
6037
+ setValidData({
6038
+ ...validData,
6128
6039
  [fieldValidity]: 1
6129
6040
  });
6130
6041
  } else {
6131
- setValidData({ ...validData,
6042
+ setValidData({
6043
+ ...validData,
6132
6044
  [fieldValidity]: 0
6133
6045
  });
6134
6046
  }
6135
6047
  }
6136
6048
  };
6137
-
6138
6049
  return /*#__PURE__*/React__default["default"].createElement("section", {
6139
6050
  className: classes.section
6140
6051
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -6214,7 +6125,8 @@ function FormEnquiry({
6214
6125
  isValid: validData.nameValid,
6215
6126
  inputType: 'input',
6216
6127
  onChange: e => {
6217
- setInputVal({ ...inputVal,
6128
+ setInputVal({
6129
+ ...inputVal,
6218
6130
  name: e.target.value
6219
6131
  });
6220
6132
  },
@@ -6222,7 +6134,8 @@ function FormEnquiry({
6222
6134
  checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
6223
6135
  },
6224
6136
  onFocus: () => {
6225
- setValidData({ ...validData,
6137
+ setValidData({
6138
+ ...validData,
6226
6139
  nameValid: 1
6227
6140
  });
6228
6141
  }
@@ -6234,7 +6147,8 @@ function FormEnquiry({
6234
6147
  isValid: validData.phoneValid,
6235
6148
  inputType: 'input',
6236
6149
  onChange: e => {
6237
- setInputVal({ ...inputVal,
6150
+ setInputVal({
6151
+ ...inputVal,
6238
6152
  phone: e.target.value
6239
6153
  });
6240
6154
  },
@@ -6242,7 +6156,8 @@ function FormEnquiry({
6242
6156
  checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
6243
6157
  },
6244
6158
  onFocus: () => {
6245
- setValidData({ ...validData,
6159
+ setValidData({
6160
+ ...validData,
6246
6161
  phoneValid: 1
6247
6162
  });
6248
6163
  }
@@ -6254,7 +6169,8 @@ function FormEnquiry({
6254
6169
  isValid: validData.emailValid,
6255
6170
  inputType: 'input',
6256
6171
  onChange: e => {
6257
- setInputVal({ ...inputVal,
6172
+ setInputVal({
6173
+ ...inputVal,
6258
6174
  email: e.target.value
6259
6175
  });
6260
6176
  },
@@ -6262,7 +6178,8 @@ function FormEnquiry({
6262
6178
  checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
6263
6179
  },
6264
6180
  onFocus: () => {
6265
- setValidData({ ...validData,
6181
+ setValidData({
6182
+ ...validData,
6266
6183
  emailValid: 1
6267
6184
  });
6268
6185
  }
@@ -6274,7 +6191,8 @@ function FormEnquiry({
6274
6191
  isValid: validData.messageValid,
6275
6192
  inputType: 'textarea',
6276
6193
  onChange: e => {
6277
- setInputVal({ ...inputVal,
6194
+ setInputVal({
6195
+ ...inputVal,
6278
6196
  message: e.target.value
6279
6197
  });
6280
6198
  },
@@ -6282,7 +6200,8 @@ function FormEnquiry({
6282
6200
  checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
6283
6201
  },
6284
6202
  onFocus: () => {
6285
- setValidData({ ...validData,
6203
+ setValidData({
6204
+ ...validData,
6286
6205
  messageValid: 1
6287
6206
  });
6288
6207
  }
@@ -6379,11 +6298,12 @@ const useSectionStyles = createUseStyles(theme => ({
6379
6298
  flexDirection: 'column',
6380
6299
  width: '85%',
6381
6300
  position: 'relative',
6382
- paddingBottom: '55%' // '& img': {
6301
+ paddingBottom: '55%'
6302
+ // '& img': {
6383
6303
  // width: '80%'
6384
6304
  // }
6385
-
6386
6305
  },
6306
+
6387
6307
  telephoneImage: {
6388
6308
  width: '80%'
6389
6309
  },
@@ -6522,7 +6442,6 @@ function Contact({
6522
6442
  phoneValid: 1,
6523
6443
  messageValid: 1
6524
6444
  });
6525
-
6526
6445
  const handleSubmit = () => {
6527
6446
  const data = {
6528
6447
  sectionId: sectionData?._id || null,
@@ -6533,7 +6452,6 @@ function Contact({
6533
6452
  setBtnDisabled(true);
6534
6453
  setInputVal(formInitialValue);
6535
6454
  };
6536
-
6537
6455
  React.useEffect(() => {
6538
6456
  if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
6539
6457
  setBtnDisabled(false);
@@ -6541,23 +6459,22 @@ function Contact({
6541
6459
  setBtnDisabled(true);
6542
6460
  }
6543
6461
  }, [validData]);
6544
-
6545
6462
  const checkValidity = (regexField, fieldname, fieldValidity) => {
6546
6463
  if (validations?.[regexField]?.length) {
6547
6464
  let regex = new RegExp(validations[regexField]);
6548
-
6549
6465
  if (regex?.test(inputVal[fieldname])) {
6550
- setValidData({ ...validData,
6466
+ setValidData({
6467
+ ...validData,
6551
6468
  [fieldValidity]: 1
6552
6469
  });
6553
6470
  } else {
6554
- setValidData({ ...validData,
6471
+ setValidData({
6472
+ ...validData,
6555
6473
  [fieldValidity]: 0
6556
6474
  });
6557
6475
  }
6558
6476
  }
6559
6477
  };
6560
-
6561
6478
  return /*#__PURE__*/React__default["default"].createElement("section", {
6562
6479
  className: classes.section
6563
6480
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -6599,7 +6516,8 @@ function Contact({
6599
6516
  isValid: validData.nameValid,
6600
6517
  inputType: 'input',
6601
6518
  onChange: e => {
6602
- setInputVal({ ...inputVal,
6519
+ setInputVal({
6520
+ ...inputVal,
6603
6521
  name: e.target.value
6604
6522
  });
6605
6523
  },
@@ -6607,7 +6525,8 @@ function Contact({
6607
6525
  checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
6608
6526
  },
6609
6527
  onFocus: () => {
6610
- setValidData({ ...validData,
6528
+ setValidData({
6529
+ ...validData,
6611
6530
  nameValid: 1
6612
6531
  });
6613
6532
  }
@@ -6619,7 +6538,8 @@ function Contact({
6619
6538
  isValid: validData.phoneValid,
6620
6539
  inputType: 'input',
6621
6540
  onChange: e => {
6622
- setInputVal({ ...inputVal,
6541
+ setInputVal({
6542
+ ...inputVal,
6623
6543
  phone: e.target.value
6624
6544
  });
6625
6545
  },
@@ -6627,7 +6547,8 @@ function Contact({
6627
6547
  checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
6628
6548
  },
6629
6549
  onFocus: () => {
6630
- setValidData({ ...validData,
6550
+ setValidData({
6551
+ ...validData,
6631
6552
  phoneValid: 1
6632
6553
  });
6633
6554
  }
@@ -6639,7 +6560,8 @@ function Contact({
6639
6560
  isValid: validData.emailValid,
6640
6561
  inputType: 'input',
6641
6562
  onChange: e => {
6642
- setInputVal({ ...inputVal,
6563
+ setInputVal({
6564
+ ...inputVal,
6643
6565
  email: e.target.value
6644
6566
  });
6645
6567
  },
@@ -6647,7 +6569,8 @@ function Contact({
6647
6569
  checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
6648
6570
  },
6649
6571
  onFocus: () => {
6650
- setValidData({ ...validData,
6572
+ setValidData({
6573
+ ...validData,
6651
6574
  emailValid: 1
6652
6575
  });
6653
6576
  }
@@ -6659,7 +6582,8 @@ function Contact({
6659
6582
  isValid: validData.messageValid,
6660
6583
  inputType: 'textarea',
6661
6584
  onChange: e => {
6662
- setInputVal({ ...inputVal,
6585
+ setInputVal({
6586
+ ...inputVal,
6663
6587
  message: e.target.value
6664
6588
  });
6665
6589
  },
@@ -6667,7 +6591,8 @@ function Contact({
6667
6591
  checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
6668
6592
  },
6669
6593
  onFocus: () => {
6670
- setValidData({ ...validData,
6594
+ setValidData({
6595
+ ...validData,
6671
6596
  messageValid: 1
6672
6597
  });
6673
6598
  }
@@ -6928,7 +6853,8 @@ const useWebinarPromotionPage = createUseStyles(theme => {
6928
6853
  const SingleVideoSlide$1 = props => {
6929
6854
  const [isReadMore, setIsReadMore] = React.useState(false);
6930
6855
  const theme = useTheme();
6931
- React.useEffect(() => {// remaining days epoch
6856
+ React.useEffect(() => {
6857
+ // remaining days epoch
6932
6858
  // current date epoch
6933
6859
  // subtract remaining days from current day epoch
6934
6860
  // moment the result - and see if there are days
@@ -6940,7 +6866,6 @@ const SingleVideoSlide$1 = props => {
6940
6866
  webinarCtaClick,
6941
6867
  conversions = 0
6942
6868
  } = props;
6943
-
6944
6869
  const renderer = ({
6945
6870
  days,
6946
6871
  hours,
@@ -6956,9 +6881,7 @@ const SingleVideoSlide$1 = props => {
6956
6881
  return /*#__PURE__*/React__default["default"].createElement("span", null, Math.floor(moment__default["default"].duration(given.diff(current)).asDays()), " day(s)");
6957
6882
  }
6958
6883
  };
6959
-
6960
6884
  const checkIfOfferIsValid = () => moment__default["default"]().diff(moment__default["default"](props.data.offerPriceEndDate)) < 0;
6961
-
6962
6885
  const checkForShowDiscount = () => {
6963
6886
  if (props.data.endDate === null || checkIfOfferIsValid()) {
6964
6887
  if (data.discount > 0 && data.offerPriceValidFor === 0) {
@@ -6970,19 +6893,16 @@ const SingleVideoSlide$1 = props => {
6970
6893
  if (data.offerPriceValidFor <= conversions) {
6971
6894
  return false;
6972
6895
  }
6973
-
6974
6896
  if (data.offerPriceValidFor - conversions < 0) {
6975
6897
  return false;
6976
6898
  } else {
6977
6899
  return true;
6978
6900
  }
6979
6901
  }
6980
-
6981
6902
  if (data.discount > 0) {
6982
6903
  return true;
6983
6904
  }
6984
6905
  };
6985
-
6986
6906
  const discount = ({
6987
6907
  price,
6988
6908
  discount
@@ -6990,7 +6910,6 @@ const SingleVideoSlide$1 = props => {
6990
6910
  console.log('discountxx', props.data.price, props.data.discount);
6991
6911
  return (discount / price * 100).toFixed(2);
6992
6912
  };
6993
-
6994
6913
  const classes = useWebinarPromotionPage();
6995
6914
  return /*#__PURE__*/React__default["default"].createElement("div", {
6996
6915
  className: classes.videoCarouselContainer
@@ -7086,9 +7005,10 @@ const SingleVideoSlide$1 = props => {
7086
7005
  data: {
7087
7006
  // link: 'headerData?.loginCtaLink',
7088
7007
  // isLink: 1,
7089
- value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW' // isExternal: 1
7090
-
7008
+ value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
7009
+ // isExternal: 1
7091
7010
  },
7011
+
7092
7012
  onClick: webinarCtaClick,
7093
7013
  type: 'primary',
7094
7014
  size: 'medium',
@@ -7422,14 +7342,14 @@ const SingleVideoSlide = props => {
7422
7342
  isEdit
7423
7343
  } = React.useContext(PageContext);
7424
7344
  console.log(isEdit, 'isEdit');
7425
- React.useEffect(() => {// remaining days epoch
7345
+ React.useEffect(() => {
7346
+ // remaining days epoch
7426
7347
  // current date epoch
7427
7348
  // subtract remaining days from current day epoch
7428
7349
  // moment the result - and see if there are days
7429
7350
  // days is present show days
7430
7351
  // else start reverse timer
7431
7352
  }, []);
7432
-
7433
7353
  const renderer = ({
7434
7354
  days,
7435
7355
  hours,
@@ -7445,7 +7365,6 @@ const SingleVideoSlide = props => {
7445
7365
  return /*#__PURE__*/React__default["default"].createElement("span", null, Math.floor(moment__default["default"].duration(given.diff(current)).asDays()), " day(s)");
7446
7366
  }
7447
7367
  };
7448
-
7449
7368
  const {
7450
7369
  data,
7451
7370
  courseBuyNow,
@@ -7454,9 +7373,7 @@ const SingleVideoSlide = props => {
7454
7373
  } = props;
7455
7374
  const showCourseInstallmentData = data?.courseOverviewData;
7456
7375
  const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
7457
-
7458
7376
  const checkIfOfferIsValid = () => moment__default["default"]().diff(moment__default["default"](props?.data?.endDate || 0)) < 0;
7459
-
7460
7377
  const checkForShowDiscount = () => {
7461
7378
  if (props.data.endDate === null || checkIfOfferIsValid()) {
7462
7379
  if (data.discount > 0 && data.offerPriceValidFor === 0) {
@@ -7468,28 +7385,23 @@ const SingleVideoSlide = props => {
7468
7385
  if (data.offerPriceValidFor <= conversions) {
7469
7386
  return false;
7470
7387
  }
7471
-
7472
7388
  if (data.offerPriceValidFor - conversions < 0) {
7473
7389
  return false;
7474
7390
  } else {
7475
7391
  return true;
7476
7392
  }
7477
7393
  }
7478
-
7479
7394
  if (data.discount > 0) {
7480
7395
  return true;
7481
7396
  }
7482
7397
  };
7483
-
7484
7398
  const classes = useCoursePromotionPage();
7485
-
7486
7399
  const discount = ({
7487
7400
  price,
7488
7401
  discount
7489
7402
  }) => {
7490
7403
  return (discount / price * 100).toFixed(2);
7491
7404
  };
7492
-
7493
7405
  return /*#__PURE__*/React__default["default"].createElement("div", {
7494
7406
  className: classes.videoCarouselContainer
7495
7407
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -7603,15 +7515,16 @@ const SingleVideoSlide = props => {
7603
7515
  data: {
7604
7516
  // link: 'headerData?.loginCtaLink',
7605
7517
  // isLink: 1,
7606
- value: 'BUY NOW' // isExternal: 1
7607
-
7518
+ value: 'BUY NOW'
7519
+ // isExternal: 1
7608
7520
  },
7521
+
7609
7522
  onClick: courseBuyNow,
7610
7523
  type: 'primary',
7611
7524
  size: 'medium',
7612
7525
  target: null,
7613
- rel: null // styling={isMobile ? { margin: '0 40px' } : {}}
7614
-
7526
+ rel: null
7527
+ // styling={isMobile ? { margin: '0 40px' } : {}}
7615
7528
  })))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React__default["default"].createElement("div", {
7616
7529
  className: classes.payInstallmentContainer,
7617
7530
  onClick: showCourseInstallment
@@ -7816,18 +7729,15 @@ const FormPage = ({
7816
7729
  _id,
7817
7730
  baseURLs
7818
7731
  } = React.useContext(PageContext);
7819
-
7820
7732
  const handleSubmit = async e => {
7821
7733
  e.preventDefault();
7822
7734
  let formResponse = [];
7823
-
7824
7735
  for (const [key, value] of Object.entries(formData)) {
7825
7736
  if (value.questionType === 'MC') {
7826
7737
  if (value.solutionArray.length > 1) {
7827
7738
  value.solutionArray.shift();
7828
7739
  }
7829
7740
  }
7830
-
7831
7741
  formResponse.push({
7832
7742
  questionId: key,
7833
7743
  questionName: value.questionName,
@@ -7835,7 +7745,6 @@ const FormPage = ({
7835
7745
  solutionArray: value.solutionArray
7836
7746
  });
7837
7747
  }
7838
-
7839
7748
  const data = {
7840
7749
  sectionId: sectionData?.components?.[0]?._id || null,
7841
7750
  landingPageId: _id || null,
@@ -7845,7 +7754,6 @@ const FormPage = ({
7845
7754
  setFormData({});
7846
7755
  setformSubmitted(!formSubmitted);
7847
7756
  };
7848
-
7849
7757
  React.useEffect(() => {
7850
7758
  //add all questions to formData
7851
7759
  let formData = {};
@@ -7858,23 +7766,26 @@ const FormPage = ({
7858
7766
  });
7859
7767
  setFormData(formData);
7860
7768
  }, [metadata, formSubmitted]);
7861
-
7862
7769
  const handleOnClick = (e, item, option) => {
7863
7770
  // if the checkbox is checked
7864
7771
  if (!e.target.checked) {
7865
7772
  // if the checkbox is checked and the solution array is empty
7866
7773
  if (!formData[item._id]?.solutionArray?.length) {
7867
- setFormData({ ...formData,
7774
+ setFormData({
7775
+ ...formData,
7868
7776
  [item._id]: {
7869
7777
  questionName: item.text,
7870
7778
  solutionArray: [option.value],
7871
7779
  questionType: 'MC'
7872
7780
  }
7873
7781
  });
7874
- } // if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
7782
+ }
7783
+ // if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
7875
7784
  else if (formData[item._id]?.solutionArray?.includes(option.value)) {
7876
7785
  // if only one value is in the array remove it
7877
- setFormData({ ...formData,
7786
+
7787
+ setFormData({
7788
+ ...formData,
7878
7789
  [item._id]: {
7879
7790
  questionName: item.text,
7880
7791
  solutionArray: formData[item._id]?.solutionArray?.filter(item => item !== option.value),
@@ -7882,20 +7793,24 @@ const FormPage = ({
7882
7793
  }
7883
7794
  });
7884
7795
  }
7885
- } // if the checkbox is unchecked
7796
+ }
7797
+ // if the checkbox is unchecked
7886
7798
  else {
7887
7799
  // if the checkbox is unchecked and the solution array is empty
7888
7800
  if (typeof formData[item._id]?.solutionArray?.length === 'undefined') {
7889
- setFormData({ ...formData,
7801
+ setFormData({
7802
+ ...formData,
7890
7803
  [item._id]: {
7891
7804
  questionName: item.text,
7892
7805
  solutionArray: [option.value],
7893
7806
  questionType: 'MC'
7894
7807
  }
7895
7808
  });
7896
- } // if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
7809
+ }
7810
+ // if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
7897
7811
  else if (!formData[item._id]?.solutionArray?.includes(option.value)) {
7898
- setFormData({ ...formData,
7812
+ setFormData({
7813
+ ...formData,
7899
7814
  [item._id]: {
7900
7815
  questionName: item.text,
7901
7816
  solutionArray: [...formData[item._id]?.solutionArray, option.value],
@@ -7905,7 +7820,6 @@ const FormPage = ({
7905
7820
  }
7906
7821
  }
7907
7822
  };
7908
-
7909
7823
  return /*#__PURE__*/React__default["default"].createElement("section", {
7910
7824
  className: classes.formPageSection
7911
7825
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -7932,7 +7846,8 @@ const FormPage = ({
7932
7846
  placeholder: "Short answer",
7933
7847
  name: item._id,
7934
7848
  onChange: e => {
7935
- setFormData({ ...formData,
7849
+ setFormData({
7850
+ ...formData,
7936
7851
  [item._id]: {
7937
7852
  index,
7938
7853
  questionName: item.text,
@@ -7972,11 +7887,13 @@ const FormPage = ({
7972
7887
  name: "text",
7973
7888
  required: item.isRequired,
7974
7889
  value: option.value,
7975
- checked: formData[item._id]?.solutionArray?.[0] === option.value // name={option.value}
7890
+ checked: formData[item._id]?.solutionArray?.[0] === option.value
7891
+ // name={option.value}
7976
7892
  // id={option.value}
7977
7893
  ,
7978
7894
  onClick: e => {
7979
- setFormData({ ...formData,
7895
+ setFormData({
7896
+ ...formData,
7980
7897
  [item._id]: {
7981
7898
  questionName: item.text,
7982
7899
  solutionArray: [option.value],
@@ -7992,9 +7909,10 @@ const FormPage = ({
7992
7909
  data: {
7993
7910
  // link: 'headerData?.loginCtaLink',
7994
7911
  // isLink: 1,
7995
- value: 'SUBMIT' // isExternal: 1
7996
-
7912
+ value: 'SUBMIT'
7913
+ // isExternal: 1
7997
7914
  },
7915
+
7998
7916
  type: 'primary',
7999
7917
  size: 'medium',
8000
7918
  target: null,
@@ -8088,7 +8006,6 @@ function Tiles({
8088
8006
  const nodeData = sectionData.components;
8089
8007
  console.log(nodeData);
8090
8008
  const tilesList = nodeData[0]?.tilesList.components;
8091
-
8092
8009
  const handleClick = value => {
8093
8010
  if (!isEdit && value) {
8094
8011
  if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
@@ -8098,7 +8015,6 @@ function Tiles({
8098
8015
  }
8099
8016
  }
8100
8017
  };
8101
-
8102
8018
  const TileDiv = tilesList?.map((tile, i) => {
8103
8019
  return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
8104
8020
  key: i
@@ -8161,8 +8077,8 @@ const useEmailStyles = createUseStyles(theme => ({
8161
8077
  width: 'auto',
8162
8078
  height: '48px'
8163
8079
  /* margin: 18px 0px; */
8164
-
8165
8080
  },
8081
+
8166
8082
  'p-young-guru-title': {
8167
8083
  fontFamily: theme?.typography?.fontFamily,
8168
8084
  fontStyle: 'normal',
@@ -8189,8 +8105,8 @@ const useEmailStyles = createUseStyles(theme => ({
8189
8105
  fontSize: '0',
8190
8106
  textAlign: 'center'
8191
8107
  /* padding:35px 0 40px */
8192
-
8193
8108
  },
8109
+
8194
8110
  'two-columns .column': {
8195
8111
  width: '100%',
8196
8112
  maxWidth: '275px',
@@ -8206,9 +8122,10 @@ const useEmailStyles = createUseStyles(theme => ({
8206
8122
  color: '#030a21',
8207
8123
  marginBottom: '5px',
8208
8124
  textAlign: 'left'
8209
- } // @media screen and (max-width: 600px) {
8210
- // }
8125
+ }
8211
8126
 
8127
+ // @media screen and (max-width: 600px) {
8128
+ // }
8212
8129
  }));
8213
8130
 
8214
8131
  function Section({
@@ -8237,8 +8154,8 @@ function Section({
8237
8154
  }, /*#__PURE__*/React__default["default"].createElement("tbody", null, customHtmlData?.isCustomHtml ? /*#__PURE__*/React__default["default"].createElement("div", {
8238
8155
  className: classes.email_description_para,
8239
8156
  dangerouslySetInnerHTML: {
8240
- __html: `${customHtmlData?.html ? customHtmlData?.html : ''}` // __html: '<div>sdnfksdnflksdnfklsndk</div>'
8241
-
8157
+ __html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
8158
+ // __html: '<div>sdnfksdnflksdnfklsndk</div>'
8242
8159
  }
8243
8160
  }) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, header?.isActive ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", null, /*#__PURE__*/React__default["default"].createElement("table", {
8244
8161
  style: {
@@ -8271,7 +8188,8 @@ function Section({
8271
8188
  textAlign: 'center'
8272
8189
  }
8273
8190
  }, header?.components[1]?.metadata?.image?.length ? /*#__PURE__*/React__default["default"].createElement("img", {
8274
- src: header?.components[1]?.metadata?.image // width={600}
8191
+ src: header?.components[1]?.metadata?.image
8192
+ // width={600}
8275
8193
  ,
8276
8194
  alt: "",
8277
8195
  style: {
@@ -8557,14 +8475,12 @@ function Section({
8557
8475
  }
8558
8476
  }, "All rights reserved.")))))))))))))) : null)))));
8559
8477
  }
8560
-
8561
8478
  function EmailDripMarket({
8562
8479
  sectionData,
8563
8480
  extraProps = {}
8564
8481
  }) {
8565
8482
  console.log('extrapropstemplate', extraProps);
8566
8483
  const isInitialMount = React.useRef(true);
8567
-
8568
8484
  const convertToHtml = sectionData => {
8569
8485
  const html = ReactDOMServer__default["default"].renderToStaticMarkup( /*#__PURE__*/React__default["default"].createElement(Section, {
8570
8486
  nodeData: sectionData,
@@ -8574,15 +8490,15 @@ function EmailDripMarket({
8574
8490
  }));
8575
8491
  return html;
8576
8492
  };
8577
-
8578
8493
  React.useEffect(() => {
8579
8494
  if (isInitialMount.current) {
8580
8495
  isInitialMount.current = false;
8581
8496
  } else {
8582
8497
  extraProps?.callbackHtml(convertToHtml(sectionData));
8583
8498
  }
8584
- }, [extraProps?.convertedHtml]); // const mockData = sectionData?.sections[0];
8499
+ }, [extraProps?.convertedHtml]);
8585
8500
 
8501
+ // const mockData = sectionData?.sections[0];
8586
8502
  const emailRef = React.useRef(null);
8587
8503
  return /*#__PURE__*/React__default["default"].createElement("section", {
8588
8504
  style: {
@@ -8592,7 +8508,6 @@ function EmailDripMarket({
8592
8508
  }, /*#__PURE__*/React__default["default"].createElement("div", {
8593
8509
  onClick: e => {
8594
8510
  e.stopPropagation(); // prevent the click from event Capturing, in email onClick events do not work
8595
-
8596
8511
  e.preventDefault();
8597
8512
  }
8598
8513
  }, /*#__PURE__*/React__default["default"].createElement(Section, {
@@ -8631,9 +8546,7 @@ const TYPE_TO_COMPONENT_MAP = {
8631
8546
  TILES_SECTION: Tiles,
8632
8547
  EMAIL_DRIP_MARKET: EmailDripMarket
8633
8548
  };
8634
-
8635
8549
  const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
8636
-
8637
8550
  const MemoisedSection = /*#__PURE__*/React.memo(({
8638
8551
  sectionData,
8639
8552
  extraProps,
@@ -8755,11 +8668,9 @@ const componentParser = compObj => {
8755
8668
  });
8756
8669
  return component;
8757
8670
  }
8758
-
8759
8671
  if (Array.isArray(compObj.components)) {
8760
8672
  compObj.components = compObj.components.map(componentParser);
8761
8673
  }
8762
-
8763
8674
  return compObj;
8764
8675
  };
8765
8676
  const inverseComponentParser = compObj => {
@@ -8784,7 +8695,6 @@ const inverseComponentParser = compObj => {
8784
8695
  if (compObj.components) {
8785
8696
  compObj.components = compObj.components.map(inverseComponentParser);
8786
8697
  }
8787
-
8788
8698
  return compObj;
8789
8699
  }
8790
8700
  };