diy-template-components 0.2.22 → 0.2.24
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.es.js +144 -239
- package/build/index.es.js.map +1 -1
- package/build/index.js +144 -239
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/build/650233e8e2d7dfee.png +0 -0
- package/build/d15660fcfffcc0c8.png +0 -0
package/build/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
function ___$insertStyle(css) {
|
|
2
|
-
if (!css ||
|
|
3
|
-
return;
|
|
4
|
-
}
|
|
5
|
-
const style = document.createElement('style');
|
|
6
|
-
style.setAttribute('type', 'text/css');
|
|
7
|
-
style.innerHTML = css;
|
|
8
|
-
document.head.appendChild(style);
|
|
9
|
-
return css;
|
|
1
|
+
function ___$insertStyle(css) {
|
|
2
|
+
if (!css || typeof window === 'undefined') {
|
|
3
|
+
return;
|
|
4
|
+
}
|
|
5
|
+
const style = document.createElement('style');
|
|
6
|
+
style.setAttribute('type', 'text/css');
|
|
7
|
+
style.innerHTML = css;
|
|
8
|
+
document.head.appendChild(style);
|
|
9
|
+
return css;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
import React, { createContext, useContext, forwardRef, useRef, useEffect, useState, useMemo, useLayoutEffect, Suspense, memo, lazy, Fragment } from 'react';
|
|
@@ -18,20 +18,17 @@ import ReactDOMServer from 'react-dom/server';
|
|
|
18
18
|
import { createTheming, createUseStyles as createUseStyles$1, useTheme as useTheme$1 } from 'react-jss';
|
|
19
19
|
|
|
20
20
|
function _extends() {
|
|
21
|
-
_extends = Object.assign
|
|
21
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
22
22
|
for (var i = 1; i < arguments.length; i++) {
|
|
23
23
|
var source = arguments[i];
|
|
24
|
-
|
|
25
24
|
for (var key in source) {
|
|
26
25
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
27
26
|
target[key] = source[key];
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
|
|
32
30
|
return target;
|
|
33
31
|
};
|
|
34
|
-
|
|
35
32
|
return _extends.apply(this, arguments);
|
|
36
33
|
}
|
|
37
34
|
|
|
@@ -287,21 +284,17 @@ const alpha = {
|
|
|
287
284
|
seventyPercent: 0.7,
|
|
288
285
|
eightyPercent: 0.8
|
|
289
286
|
};
|
|
290
|
-
|
|
291
287
|
const getRGBFromHex = hex => {
|
|
292
288
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
293
289
|
const g = parseInt(hex.slice(3, 5), 16);
|
|
294
290
|
const b = parseInt(hex.slice(5, 7), 16);
|
|
295
291
|
return [r, g, b];
|
|
296
292
|
};
|
|
297
|
-
|
|
298
293
|
const hexToRgbA = (hex, alpha = null) => {
|
|
299
294
|
const values = getRGBFromHex(hex);
|
|
300
|
-
|
|
301
295
|
if (alpha !== null) {
|
|
302
296
|
values.push(alpha);
|
|
303
297
|
}
|
|
304
|
-
|
|
305
298
|
return `rgba(${values.join(',')})`;
|
|
306
299
|
};
|
|
307
300
|
const colorMixer = (hex1, weightage = 1, hex2 = colors.white) => {
|
|
@@ -441,29 +434,24 @@ function useLinkBuilder(data) {
|
|
|
441
434
|
basePath,
|
|
442
435
|
isMasterTemplate
|
|
443
436
|
} = useContext(PageContext);
|
|
444
|
-
|
|
445
437
|
if (isEdit || !data.isLink) {
|
|
446
438
|
return null;
|
|
447
439
|
}
|
|
448
|
-
|
|
449
440
|
if (data?.isExistingLink === false) {
|
|
450
441
|
return data.link;
|
|
451
442
|
}
|
|
452
|
-
|
|
453
443
|
if (data?.isExternal) {
|
|
454
444
|
return data.link;
|
|
455
445
|
}
|
|
456
|
-
|
|
457
446
|
if (!isPreview) {
|
|
458
447
|
const link = data.link === '/' ? '' : '/' + data.link;
|
|
459
448
|
return basePath ? `//${basePath}${link}` : null;
|
|
460
|
-
}
|
|
461
|
-
|
|
449
|
+
}
|
|
462
450
|
|
|
451
|
+
// courses in preview: special case
|
|
463
452
|
if (data.link === 'courses') {
|
|
464
453
|
return `//${basePath}/courses`;
|
|
465
454
|
}
|
|
466
|
-
|
|
467
455
|
const {
|
|
468
456
|
pageId
|
|
469
457
|
} = navList.find(el => el.slug === data?.link) || {};
|
|
@@ -639,14 +627,12 @@ var calendar$1 = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%
|
|
|
639
627
|
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";
|
|
640
628
|
|
|
641
629
|
/** @returns {import('./types').IconData} */
|
|
642
|
-
|
|
643
630
|
const getConfiguredIcon1 = url => ({
|
|
644
631
|
url,
|
|
645
632
|
svgChildrenConfigs: []
|
|
646
633
|
});
|
|
647
|
-
/** @returns {import('./types').IconData} */
|
|
648
|
-
|
|
649
634
|
|
|
635
|
+
/** @returns {import('./types').IconData} */
|
|
650
636
|
const getConfiguredIcon2 = (url, stroke, fill) => ({
|
|
651
637
|
url,
|
|
652
638
|
svgChildrenConfigs: [{
|
|
@@ -655,7 +641,6 @@ const getConfiguredIcon2 = (url, stroke, fill) => ({
|
|
|
655
641
|
fill
|
|
656
642
|
}]
|
|
657
643
|
});
|
|
658
|
-
|
|
659
644
|
const icons = {
|
|
660
645
|
'Live class': getConfiguredIcon2(liveTv, false, true),
|
|
661
646
|
'Recorded videos': getConfiguredIcon2(liveTv2, false, true),
|
|
@@ -688,41 +673,51 @@ const icons = {
|
|
|
688
673
|
'Video Play': getConfiguredIcon2(videoPlay, false, true),
|
|
689
674
|
Quote: getConfiguredIcon2(quote, false, true),
|
|
690
675
|
// Stock
|
|
676
|
+
|
|
691
677
|
'Stock Growth': getConfiguredIcon2(stockGrowth, false, true),
|
|
692
678
|
Money: getConfiguredIcon2(money, false, true),
|
|
693
679
|
Split: getConfiguredIcon2(split, false, true),
|
|
694
680
|
Chart: getConfiguredIcon2(chart, false, true),
|
|
695
681
|
// Personality Development
|
|
682
|
+
|
|
696
683
|
Leaders: getConfiguredIcon2(leaders, false, true),
|
|
697
684
|
Women: getConfiguredIcon2(women, false, true),
|
|
698
685
|
Program: getConfiguredIcon2(program, false, true),
|
|
699
686
|
// Photography
|
|
687
|
+
|
|
700
688
|
'Video Editing': getConfiguredIcon2(videoEditing, false, true),
|
|
701
689
|
Editing: getConfiguredIcon2(editing, false, true),
|
|
702
690
|
Camera: getConfiguredIcon2(camera, false, true),
|
|
703
691
|
Sessions: getConfiguredIcon2(sessions, false, true),
|
|
704
692
|
// Computer
|
|
693
|
+
|
|
705
694
|
'Regular Batches': getConfiguredIcon2(regularBatches, false, true),
|
|
706
695
|
'Alternate Batches': getConfiguredIcon2(alternateBatches, false, true),
|
|
707
696
|
'Weekend Batches': getConfiguredIcon2(weekendBatches, false, true),
|
|
708
697
|
// Life Coach
|
|
698
|
+
|
|
709
699
|
Girl: getConfiguredIcon2(girl, false, true),
|
|
710
700
|
Smile: getConfiguredIcon2(smile, false, true),
|
|
711
701
|
Relationships: getConfiguredIcon2(relationships, false, true),
|
|
712
702
|
// Music
|
|
703
|
+
|
|
713
704
|
Vocal: getConfiguredIcon2(vocal, false, true),
|
|
714
705
|
Instrument: getConfiguredIcon2(instrument, false, true),
|
|
715
706
|
Music: getConfiguredIcon2(music, false, true),
|
|
716
707
|
// Fitness
|
|
708
|
+
|
|
717
709
|
Workout: getConfiguredIcon2(workout, false, true),
|
|
718
710
|
Barbell: getConfiguredIcon2(barbell, false, true),
|
|
719
711
|
Trainer: getConfiguredIcon2(trainer, false, true),
|
|
720
712
|
Report: getConfiguredIcon2(report, false, true),
|
|
721
713
|
// Govt Exam
|
|
714
|
+
|
|
722
715
|
'Govt Exam': getConfiguredIcon2(govtExam, false, true),
|
|
723
716
|
// IIT JEE
|
|
717
|
+
|
|
724
718
|
College: getConfiguredIcon2(college, false, true),
|
|
725
719
|
// Others
|
|
720
|
+
|
|
726
721
|
Teachers: getConfiguredIcon2(teachers, false, true),
|
|
727
722
|
Learning: getConfiguredIcon2(learning, false, true),
|
|
728
723
|
Success: getConfiguredIcon2(success, false, true),
|
|
@@ -734,12 +729,9 @@ const icons = {
|
|
|
734
729
|
Video: getConfiguredIcon2(video, false, true)
|
|
735
730
|
};
|
|
736
731
|
|
|
737
|
-
const someMethod1 = (
|
|
738
|
-
/** @type {import('./types').IconData["svgChildrenConfigs"]} */
|
|
739
|
-
svgChildrenConfigs, color, hoverColor) => {
|
|
732
|
+
const someMethod1 = ( /** @type {import('./types').IconData["svgChildrenConfigs"]} */svgChildrenConfigs, color, hoverColor) => {
|
|
740
733
|
/** @type {{ [k:string]:React.CSSProperties; }} */
|
|
741
734
|
const obj = {};
|
|
742
|
-
|
|
743
735
|
for (const svgChildConfig of svgChildrenConfigs) {
|
|
744
736
|
if (color) obj['& ' + svgChildConfig.selector] = {
|
|
745
737
|
fill: svgChildConfig.fill ? color : undefined,
|
|
@@ -750,10 +742,8 @@ svgChildrenConfigs, color, hoverColor) => {
|
|
|
750
742
|
stroke: svgChildConfig.stroke ? hoverColor : undefined
|
|
751
743
|
};
|
|
752
744
|
}
|
|
753
|
-
|
|
754
745
|
return obj;
|
|
755
746
|
};
|
|
756
|
-
|
|
757
747
|
const useStyles$1 = createUseStyles$1({
|
|
758
748
|
'@keyframes slideRight': {
|
|
759
749
|
to: {
|
|
@@ -797,8 +787,8 @@ const defaultSvgState = {
|
|
|
797
787
|
childrenConfigs: [],
|
|
798
788
|
attributes: defaultAttributes
|
|
799
789
|
};
|
|
800
|
-
/** @type {import('./props.type').IconProps} */
|
|
801
790
|
|
|
791
|
+
/** @type {import('./props.type').IconProps} */
|
|
802
792
|
const iconDefaultProps = {
|
|
803
793
|
name: undefined,
|
|
804
794
|
width: 'auto',
|
|
@@ -808,8 +798,8 @@ const iconDefaultProps = {
|
|
|
808
798
|
opacity: undefined,
|
|
809
799
|
className: undefined
|
|
810
800
|
};
|
|
811
|
-
/** @type {import("react").FC<import('./props.type').IconProps>} */
|
|
812
801
|
|
|
802
|
+
/** @type {import("react").FC<import('./props.type').IconProps>} */
|
|
813
803
|
const Icon = ({
|
|
814
804
|
name,
|
|
815
805
|
width,
|
|
@@ -828,10 +818,8 @@ const Icon = ({
|
|
|
828
818
|
}, []);
|
|
829
819
|
/** */
|
|
830
820
|
|
|
831
|
-
const rootRef = useRef(
|
|
832
|
-
|
|
833
|
-
null); // this ref is used to cancel the fetch promise success callback in case name prop changed
|
|
834
|
-
|
|
821
|
+
const rootRef = useRef( /** @type {HTMLElement} */null);
|
|
822
|
+
// this ref is used to cancel the fetch promise success callback in case name prop changed
|
|
835
823
|
const currentName = useRef(name);
|
|
836
824
|
const [svgState, setSvgState] = useState(defaultSvgState);
|
|
837
825
|
const styles = useStyles$1({
|
|
@@ -842,46 +830,41 @@ const Icon = ({
|
|
|
842
830
|
opacity,
|
|
843
831
|
hoverColor
|
|
844
832
|
});
|
|
845
|
-
|
|
846
833
|
const _className = useMemo(() => `${styles.root} ${className || ''}`, [className]);
|
|
847
|
-
|
|
848
834
|
useEffect(() => {
|
|
849
835
|
// reset
|
|
850
836
|
currentName.current = name;
|
|
851
837
|
setSvgState(defaultSvgState);
|
|
852
838
|
const icon = icons[name];
|
|
853
|
-
|
|
854
839
|
if (icon) {
|
|
855
840
|
/**
|
|
856
841
|
* retrieve from cache
|
|
857
842
|
* @type {Promise<string>}
|
|
858
843
|
*/
|
|
859
844
|
let svgProm = Icon.getCachedSvgPromise(name);
|
|
860
|
-
|
|
861
845
|
if (!svgProm) {
|
|
862
846
|
svgProm = fetch(icon.url).then(r => r.text()).catch(() => {
|
|
863
847
|
// unset in cache
|
|
864
848
|
Icon.setCachedSvgPromise(name, undefined);
|
|
865
849
|
return null;
|
|
866
|
-
});
|
|
867
|
-
|
|
850
|
+
});
|
|
851
|
+
//save in cache
|
|
868
852
|
Icon.setCachedSvgPromise(name, svgProm);
|
|
869
853
|
}
|
|
870
|
-
|
|
871
854
|
svgProm.then(svg => {
|
|
872
855
|
if (svg && isMounted.current && name === currentName.current) {
|
|
873
856
|
const div = document.createElement('div');
|
|
874
|
-
div.innerHTML = svg;
|
|
857
|
+
div.innerHTML = svg;
|
|
875
858
|
|
|
859
|
+
// set the new attributes
|
|
876
860
|
const newAttributes = {};
|
|
877
|
-
|
|
878
861
|
for (const ob of div.firstElementChild.attributes) {
|
|
879
862
|
const camelCased = ob.name.replace(/(-|:)([a-z])/g, g => g[1].toUpperCase());
|
|
880
863
|
newAttributes[camelCased] = ob.value;
|
|
881
|
-
}
|
|
882
|
-
// Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
|
|
883
|
-
|
|
864
|
+
}
|
|
884
865
|
|
|
866
|
+
// setting the state in last.
|
|
867
|
+
// Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
|
|
885
868
|
setSvgState({
|
|
886
869
|
innerHtml: div.firstElementChild.innerHTML,
|
|
887
870
|
childrenConfigs: icon.svgChildrenConfigs,
|
|
@@ -901,14 +884,11 @@ const Icon = ({
|
|
|
901
884
|
onClick: onClick
|
|
902
885
|
}));
|
|
903
886
|
};
|
|
904
|
-
|
|
905
887
|
Icon.defaultProps = iconDefaultProps;
|
|
906
|
-
/** static properties for caching */
|
|
907
888
|
|
|
889
|
+
/** static properties for caching */
|
|
908
890
|
Icon.cacheStore = {};
|
|
909
|
-
|
|
910
891
|
Icon.getCachedSvgPromise = name => Icon.cacheStore[name];
|
|
911
|
-
|
|
912
892
|
Icon.setCachedSvgPromise = (name, prom) => Icon.cacheStore[name] = prom;
|
|
913
893
|
|
|
914
894
|
const useDropdownStyles = createUseStyles(theme => ({
|
|
@@ -1020,7 +1000,6 @@ function OptionList({
|
|
|
1020
1000
|
isLandingPages
|
|
1021
1001
|
}) {
|
|
1022
1002
|
useContext(PageContext);
|
|
1023
|
-
|
|
1024
1003
|
const tabsDataModifier = () => {
|
|
1025
1004
|
return optionsData?.map(dt => {
|
|
1026
1005
|
return {
|
|
@@ -1032,7 +1011,6 @@ function OptionList({
|
|
|
1032
1011
|
};
|
|
1033
1012
|
});
|
|
1034
1013
|
};
|
|
1035
|
-
|
|
1036
1014
|
const tabData = tabsDataModifier();
|
|
1037
1015
|
const classes = useSectionStyles$a();
|
|
1038
1016
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1121,31 +1099,24 @@ function DesktopHeader({
|
|
|
1121
1099
|
const classes = useSectionStyles$a({
|
|
1122
1100
|
isFixed
|
|
1123
1101
|
});
|
|
1124
|
-
|
|
1125
1102
|
const optionDataFn = () => {
|
|
1126
1103
|
let optionsArr = navData;
|
|
1127
1104
|
let optionsData = [];
|
|
1128
|
-
|
|
1129
1105
|
if (optionsArr?.length > 5) {
|
|
1130
1106
|
optionsData = optionsArr?.slice(0, 4);
|
|
1131
1107
|
} else {
|
|
1132
1108
|
optionsData = optionsArr;
|
|
1133
1109
|
}
|
|
1134
|
-
|
|
1135
1110
|
return optionsData;
|
|
1136
1111
|
};
|
|
1137
|
-
|
|
1138
1112
|
const moreContentFn = () => {
|
|
1139
1113
|
let optionsArr = navData;
|
|
1140
1114
|
let moreContent = [];
|
|
1141
|
-
|
|
1142
1115
|
if (optionsArr?.length > 5) {
|
|
1143
1116
|
moreContent = optionsArr?.slice(4);
|
|
1144
1117
|
}
|
|
1145
|
-
|
|
1146
1118
|
return moreContent;
|
|
1147
1119
|
};
|
|
1148
|
-
|
|
1149
1120
|
return /*#__PURE__*/React.createElement("nav", {
|
|
1150
1121
|
className: classes.section
|
|
1151
1122
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1203,7 +1174,6 @@ function MobileHeader({
|
|
|
1203
1174
|
const navEl = useRef(null);
|
|
1204
1175
|
useLayoutEffect(() => {
|
|
1205
1176
|
const body = navEl?.current?.ownerDocument?.body;
|
|
1206
|
-
|
|
1207
1177
|
if (sideMenu) {
|
|
1208
1178
|
body?.setAttribute('style', 'overflow: hidden;');
|
|
1209
1179
|
} else {
|
|
@@ -1213,7 +1183,6 @@ function MobileHeader({
|
|
|
1213
1183
|
let iosUrl = null;
|
|
1214
1184
|
let androidUrl = null;
|
|
1215
1185
|
let downloadLink = null;
|
|
1216
|
-
|
|
1217
1186
|
if (isTutorWebsite) {
|
|
1218
1187
|
if (header?.iosUrl) {
|
|
1219
1188
|
iosUrl = /*#__PURE__*/React.createElement(Button, {
|
|
@@ -1236,7 +1205,6 @@ function MobileHeader({
|
|
|
1236
1205
|
}
|
|
1237
1206
|
});
|
|
1238
1207
|
}
|
|
1239
|
-
|
|
1240
1208
|
if (header?.androidURL) {
|
|
1241
1209
|
androidUrl = /*#__PURE__*/React.createElement(Button, {
|
|
1242
1210
|
data: {
|
|
@@ -1257,7 +1225,6 @@ function MobileHeader({
|
|
|
1257
1225
|
}
|
|
1258
1226
|
});
|
|
1259
1227
|
}
|
|
1260
|
-
|
|
1261
1228
|
if (iosUrl && androidUrl) {
|
|
1262
1229
|
downloadLink = /*#__PURE__*/React.createElement("div", null, iosUrl, androidUrl);
|
|
1263
1230
|
} else if (header?.iosUrl) {
|
|
@@ -1307,7 +1274,6 @@ function MobileHeader({
|
|
|
1307
1274
|
downloadLink = null;
|
|
1308
1275
|
}
|
|
1309
1276
|
}
|
|
1310
|
-
|
|
1311
1277
|
return /*#__PURE__*/React.createElement("nav", {
|
|
1312
1278
|
ref: navEl,
|
|
1313
1279
|
className: classes.section
|
|
@@ -1364,11 +1330,9 @@ function Header({
|
|
|
1364
1330
|
isMobile,
|
|
1365
1331
|
isTutorWebsite
|
|
1366
1332
|
} = useContext(PageContext);
|
|
1367
|
-
|
|
1368
1333
|
const filterHiddenNavs = () => {
|
|
1369
1334
|
return data?.navs?.filter(dt => !dt.isHiddenNav);
|
|
1370
1335
|
};
|
|
1371
|
-
|
|
1372
1336
|
return isMobile ? /*#__PURE__*/React.createElement(MobileHeader, {
|
|
1373
1337
|
navData: filterHiddenNavs(),
|
|
1374
1338
|
header: data,
|
|
@@ -1409,8 +1373,7 @@ const useSectionStyles$9 = createUseStyles(theme => ({
|
|
|
1409
1373
|
display: 'flex',
|
|
1410
1374
|
justifyContent: 'flex-start',
|
|
1411
1375
|
'& img': {
|
|
1412
|
-
|
|
1413
|
-
height: '30px'
|
|
1376
|
+
maxHeight: '55px'
|
|
1414
1377
|
}
|
|
1415
1378
|
},
|
|
1416
1379
|
upperContainerItem2: {
|
|
@@ -1724,7 +1687,6 @@ const rustTheme = {
|
|
|
1724
1687
|
light: colors.lightRust,
|
|
1725
1688
|
lightest: colors.lightestRust
|
|
1726
1689
|
};
|
|
1727
|
-
|
|
1728
1690
|
const generateThemePalette = themeColors => ({
|
|
1729
1691
|
primary: themeColors,
|
|
1730
1692
|
background: {
|
|
@@ -1747,7 +1709,6 @@ const generateThemePalette = themeColors => ({
|
|
|
1747
1709
|
tertiary: colors.blueGrey
|
|
1748
1710
|
}
|
|
1749
1711
|
});
|
|
1750
|
-
|
|
1751
1712
|
const bluePalette = generateThemePalette(blueTheme);
|
|
1752
1713
|
const redPalette = generateThemePalette(redTheme);
|
|
1753
1714
|
const orangePalette = generateThemePalette(orangeTheme);
|
|
@@ -1788,9 +1749,7 @@ const fontComponents = {
|
|
|
1788
1749
|
'Merriweather Sans': MerriweatherSans,
|
|
1789
1750
|
'Arima Madurai': ArimaMadurai
|
|
1790
1751
|
};
|
|
1791
|
-
|
|
1792
1752
|
const getFontComponent = font => fontComponents[font] || (() => null);
|
|
1793
|
-
|
|
1794
1753
|
function FontSeeder({
|
|
1795
1754
|
fontFamily
|
|
1796
1755
|
}) {
|
|
@@ -1800,37 +1759,30 @@ function FontSeeder({
|
|
|
1800
1759
|
const useRubikFont = createUseStyles$1({
|
|
1801
1760
|
'@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')`
|
|
1802
1761
|
});
|
|
1803
|
-
|
|
1804
1762
|
function Rubik() {
|
|
1805
1763
|
// to import "Rubik" font css
|
|
1806
1764
|
useRubikFont();
|
|
1807
1765
|
return null;
|
|
1808
1766
|
}
|
|
1809
|
-
|
|
1810
1767
|
const useIbmPlexSansFont = createUseStyles$1({
|
|
1811
1768
|
'@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)'
|
|
1812
1769
|
});
|
|
1813
|
-
|
|
1814
1770
|
function IbmPlexSans() {
|
|
1815
1771
|
// to import "Ibm Plex Sans" font css
|
|
1816
1772
|
useIbmPlexSansFont();
|
|
1817
1773
|
return null;
|
|
1818
1774
|
}
|
|
1819
|
-
|
|
1820
1775
|
const useMerriweatherSansFont = createUseStyles$1({
|
|
1821
1776
|
'@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)'
|
|
1822
1777
|
});
|
|
1823
|
-
|
|
1824
1778
|
function MerriweatherSans() {
|
|
1825
1779
|
// to import "Merriweather Sans" font css
|
|
1826
1780
|
useMerriweatherSansFont();
|
|
1827
1781
|
return null;
|
|
1828
1782
|
}
|
|
1829
|
-
|
|
1830
1783
|
const useArimaMaduraiFont = createUseStyles$1({
|
|
1831
1784
|
'@import': 'url(https://fonts.googleapis.com/css2?family=Arima+Madurai:wght@400;500;700&display=swap)'
|
|
1832
1785
|
});
|
|
1833
|
-
|
|
1834
1786
|
function ArimaMadurai() {
|
|
1835
1787
|
// to import "Arima Madurai" font css
|
|
1836
1788
|
useArimaMaduraiFont();
|
|
@@ -1861,9 +1813,7 @@ const TYPE_TO_COMPONENT_MAP$1 = {
|
|
|
1861
1813
|
TILES_SECTION: /*#__PURE__*/lazy(() => Promise.resolve().then(function () { return index$1; })),
|
|
1862
1814
|
EMAIL_DRIP_MARKET: /*#__PURE__*/lazy(() => Promise.resolve().then(function () { return index; }))
|
|
1863
1815
|
};
|
|
1864
|
-
|
|
1865
1816
|
const getCompToRender$1 = type => TYPE_TO_COMPONENT_MAP$1[type] || (() => null);
|
|
1866
|
-
|
|
1867
1817
|
const MemoisedSection$1 = /*#__PURE__*/memo(({
|
|
1868
1818
|
sectionData,
|
|
1869
1819
|
extraProps
|
|
@@ -1880,9 +1830,7 @@ function SectionRenderer$1({
|
|
|
1880
1830
|
extraProps
|
|
1881
1831
|
}) {
|
|
1882
1832
|
return /*#__PURE__*/React.createElement(Suspense, {
|
|
1883
|
-
fallback: null
|
|
1884
|
-
/*GIF maybe*/
|
|
1885
|
-
|
|
1833
|
+
fallback: null /*GIF maybe*/
|
|
1886
1834
|
}, /*#__PURE__*/React.createElement(MemoisedSection$1, {
|
|
1887
1835
|
sectionData: sectionData,
|
|
1888
1836
|
extraProps: extraProps
|
|
@@ -2166,23 +2114,18 @@ const getArrowRotationAngle = props => {
|
|
|
2166
2114
|
switch (true) {
|
|
2167
2115
|
case props.left:
|
|
2168
2116
|
return 180;
|
|
2169
|
-
|
|
2170
2117
|
case props.up:
|
|
2171
2118
|
return 270;
|
|
2172
|
-
|
|
2173
2119
|
case props.down:
|
|
2174
2120
|
return 90;
|
|
2175
|
-
|
|
2176
2121
|
case props.right:
|
|
2177
2122
|
default:
|
|
2178
2123
|
return 0;
|
|
2179
2124
|
}
|
|
2180
2125
|
};
|
|
2181
|
-
|
|
2182
2126
|
const sizeHandler = ({
|
|
2183
2127
|
size
|
|
2184
2128
|
}) => size === 'small' ? '32px' : '48px';
|
|
2185
|
-
|
|
2186
2129
|
const useArrowButtonStyles = createUseStyles(theme => ({
|
|
2187
2130
|
arrowButtonContainer: {
|
|
2188
2131
|
cursor: 'pointer',
|
|
@@ -2222,7 +2165,6 @@ function dotsToShow(i, n) {
|
|
|
2222
2165
|
const leftToShow = i < elementsToShow / 2;
|
|
2223
2166
|
const rightToShow = n - i - 1 < elementsToShow / 2;
|
|
2224
2167
|
let leftCount, rightCount;
|
|
2225
|
-
|
|
2226
2168
|
if (leftToShow) {
|
|
2227
2169
|
leftCount = i;
|
|
2228
2170
|
rightCount = elementsToShow - i - 1;
|
|
@@ -2233,13 +2175,11 @@ function dotsToShow(i, n) {
|
|
|
2233
2175
|
leftCount = 2;
|
|
2234
2176
|
rightCount = 2;
|
|
2235
2177
|
}
|
|
2236
|
-
|
|
2237
2178
|
return {
|
|
2238
2179
|
leftCount,
|
|
2239
2180
|
rightCount
|
|
2240
2181
|
};
|
|
2241
2182
|
}
|
|
2242
|
-
|
|
2243
2183
|
function Carousel({
|
|
2244
2184
|
settings,
|
|
2245
2185
|
children,
|
|
@@ -2293,15 +2233,12 @@ function Carousel({
|
|
|
2293
2233
|
...settings,
|
|
2294
2234
|
className: settings?.className ? settings?.className + ' ' + classes.sliderClass : classes.sliderClass
|
|
2295
2235
|
};
|
|
2296
|
-
|
|
2297
2236
|
const nextClick = () => {
|
|
2298
2237
|
sliderRef.current.slickNext();
|
|
2299
2238
|
};
|
|
2300
|
-
|
|
2301
2239
|
const previousClick = () => {
|
|
2302
2240
|
sliderRef.current.slickPrev();
|
|
2303
2241
|
};
|
|
2304
|
-
|
|
2305
2242
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Slider, _extends({
|
|
2306
2243
|
ref: sliderRef
|
|
2307
2244
|
}, sliderSettings), children), hideArrow || isMobile ? null : /*#__PURE__*/React.createElement("div", {
|
|
@@ -2366,7 +2303,6 @@ function Section$4({
|
|
|
2366
2303
|
src: nodeData.image.metadata.value
|
|
2367
2304
|
})));
|
|
2368
2305
|
}
|
|
2369
|
-
|
|
2370
2306
|
function BannerCarouselRight({
|
|
2371
2307
|
sectionData
|
|
2372
2308
|
}) {
|
|
@@ -2392,9 +2328,7 @@ function BannerCarouselRight({
|
|
|
2392
2328
|
className: classes.sectionContainer
|
|
2393
2329
|
}, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$4, {
|
|
2394
2330
|
nodeData: node,
|
|
2395
|
-
key: idx
|
|
2396
|
-
/* or some other unique property */
|
|
2397
|
-
|
|
2331
|
+
key: idx /* or some other unique property */
|
|
2398
2332
|
})))));
|
|
2399
2333
|
}
|
|
2400
2334
|
|
|
@@ -2601,11 +2535,9 @@ function List({
|
|
|
2601
2535
|
containerWidth
|
|
2602
2536
|
});
|
|
2603
2537
|
const [nodeData] = sectionData.components;
|
|
2604
|
-
|
|
2605
2538
|
const getNumber = val => {
|
|
2606
2539
|
return val.toString().length == 1 ? '0' + val : val;
|
|
2607
2540
|
};
|
|
2608
|
-
|
|
2609
2541
|
return /*#__PURE__*/React.createElement("section", {
|
|
2610
2542
|
className: classes.section
|
|
2611
2543
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2797,7 +2729,6 @@ const Section$3 = ({
|
|
|
2797
2729
|
size: isMobile ? 'small' : 'medium'
|
|
2798
2730
|
})))));
|
|
2799
2731
|
};
|
|
2800
|
-
|
|
2801
2732
|
function BannerCarouselCenter({
|
|
2802
2733
|
sectionData
|
|
2803
2734
|
}) {
|
|
@@ -2814,9 +2745,7 @@ function BannerCarouselCenter({
|
|
|
2814
2745
|
className: classes.bannerCarouselCenterSection
|
|
2815
2746
|
}, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$3, {
|
|
2816
2747
|
nodeData: node,
|
|
2817
|
-
key: idx
|
|
2818
|
-
/* or some other unique property */
|
|
2819
|
-
|
|
2748
|
+
key: idx /* or some other unique property */
|
|
2820
2749
|
}))));
|
|
2821
2750
|
}
|
|
2822
2751
|
|
|
@@ -2983,7 +2912,6 @@ function Section$2({
|
|
|
2983
2912
|
size: isMobile ? 'small' : 'medium'
|
|
2984
2913
|
})));
|
|
2985
2914
|
}
|
|
2986
|
-
|
|
2987
2915
|
function BannerCarouselLeft({
|
|
2988
2916
|
sectionData
|
|
2989
2917
|
}) {
|
|
@@ -3005,9 +2933,7 @@ function BannerCarouselLeft({
|
|
|
3005
2933
|
className: classes.sectionContainer
|
|
3006
2934
|
}, /*#__PURE__*/React.createElement(Wrapper, null, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$2, {
|
|
3007
2935
|
nodeData: node,
|
|
3008
|
-
key: idx
|
|
3009
|
-
/* or some other unique property */
|
|
3010
|
-
|
|
2936
|
+
key: idx /* or some other unique property */
|
|
3011
2937
|
})))));
|
|
3012
2938
|
}
|
|
3013
2939
|
|
|
@@ -3162,7 +3088,6 @@ async function postApiCall(baseURLs, data) {
|
|
|
3162
3088
|
},
|
|
3163
3089
|
data
|
|
3164
3090
|
});
|
|
3165
|
-
|
|
3166
3091
|
if (res) {
|
|
3167
3092
|
return res.data;
|
|
3168
3093
|
}
|
|
@@ -3187,7 +3112,6 @@ async function postApiCallForm(baseURLs, data, extraProps) {
|
|
|
3187
3112
|
if (extraProps && extraProps.formSubmitSuccess) {
|
|
3188
3113
|
extraProps.formSubmitSuccess();
|
|
3189
3114
|
}
|
|
3190
|
-
|
|
3191
3115
|
return res.data;
|
|
3192
3116
|
});
|
|
3193
3117
|
} catch (err) {
|
|
@@ -3300,7 +3224,6 @@ function SubscribeToNewsletter({
|
|
|
3300
3224
|
const [inputVal, setInputVal] = useState(formInitialValue);
|
|
3301
3225
|
let [isValid, setIsValid] = useState(true);
|
|
3302
3226
|
let [btnDisabled, setBtnDisabled] = useState(false);
|
|
3303
|
-
|
|
3304
3227
|
const handleSubmit = () => {
|
|
3305
3228
|
let data = {
|
|
3306
3229
|
sectionId: sectionData.sectionId,
|
|
@@ -3316,11 +3239,9 @@ function SubscribeToNewsletter({
|
|
|
3316
3239
|
setBtnDisabled(true);
|
|
3317
3240
|
setInputVal(formInitialValue);
|
|
3318
3241
|
};
|
|
3319
|
-
|
|
3320
3242
|
const checkValidity = () => {
|
|
3321
3243
|
if (validations?.[nodeData?.inputField?.metadata?.validationType]?.length) {
|
|
3322
3244
|
let regex = new RegExp(validations[nodeData?.inputField?.metadata?.validationType]);
|
|
3323
|
-
|
|
3324
3245
|
if (regex?.test(inputVal)) {
|
|
3325
3246
|
setIsValid(true);
|
|
3326
3247
|
} else {
|
|
@@ -3328,7 +3249,6 @@ function SubscribeToNewsletter({
|
|
|
3328
3249
|
}
|
|
3329
3250
|
}
|
|
3330
3251
|
};
|
|
3331
|
-
|
|
3332
3252
|
useEffect(() => {
|
|
3333
3253
|
if (!isValid) {
|
|
3334
3254
|
setBtnDisabled(true);
|
|
@@ -3656,7 +3576,6 @@ function Section$1({
|
|
|
3656
3576
|
className: classes.contentRow
|
|
3657
3577
|
}, carouselContent))));
|
|
3658
3578
|
}
|
|
3659
|
-
|
|
3660
3579
|
function Testimonials({
|
|
3661
3580
|
sectionData
|
|
3662
3581
|
}) {
|
|
@@ -3721,7 +3640,6 @@ const loaderStyle = theme => ({
|
|
|
3721
3640
|
});
|
|
3722
3641
|
|
|
3723
3642
|
const useStyles = createUseStyles$1(loaderStyle);
|
|
3724
|
-
|
|
3725
3643
|
function Loader({
|
|
3726
3644
|
texts
|
|
3727
3645
|
}) {
|
|
@@ -3733,13 +3651,11 @@ function Loader({
|
|
|
3733
3651
|
useEffect(() => {
|
|
3734
3652
|
if (texts && texts.length) {
|
|
3735
3653
|
let textID = '';
|
|
3736
|
-
|
|
3737
3654
|
for (let i = 0; i < texts.length; i++) {
|
|
3738
3655
|
textID = setTimeout(() => {
|
|
3739
3656
|
setLoaderText(texts[i]);
|
|
3740
3657
|
}, 2000 * i);
|
|
3741
3658
|
}
|
|
3742
|
-
|
|
3743
3659
|
return () => {
|
|
3744
3660
|
clearTimeout(textID);
|
|
3745
3661
|
};
|
|
@@ -3807,18 +3723,15 @@ function VideoPlayer(props) {
|
|
|
3807
3723
|
imageUrl: imageUrl
|
|
3808
3724
|
});
|
|
3809
3725
|
const theme = useTheme();
|
|
3810
|
-
|
|
3811
3726
|
function getId(url) {
|
|
3812
3727
|
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
|
|
3813
3728
|
var match = url?.match(regExp);
|
|
3814
|
-
|
|
3815
3729
|
if (match?.[2].length == 11) {
|
|
3816
3730
|
return 'https://www.youtube.com/embed/' + match[2];
|
|
3817
3731
|
} else {
|
|
3818
3732
|
return url;
|
|
3819
3733
|
}
|
|
3820
3734
|
}
|
|
3821
|
-
|
|
3822
3735
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !isLoaded && /*#__PURE__*/React.createElement("div", {
|
|
3823
3736
|
className: classes.imgContainer
|
|
3824
3737
|
}, isEnabled ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, props.onlyThumbnail ? null : /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -4661,8 +4574,8 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
|
|
|
4661
4574
|
width: 'calc(100% - 2px)',
|
|
4662
4575
|
position: 'relative',
|
|
4663
4576
|
paddingBottom: '59.83%' // keeping aspect ratio 585x350
|
|
4664
|
-
|
|
4665
4577
|
},
|
|
4578
|
+
|
|
4666
4579
|
contentRow: {
|
|
4667
4580
|
display: 'grid',
|
|
4668
4581
|
gridTemplateColumns: ({
|
|
@@ -4921,7 +4834,6 @@ const FAQListing = ({
|
|
|
4921
4834
|
isSelected: selectedIndex === index
|
|
4922
4835
|
})))));
|
|
4923
4836
|
};
|
|
4924
|
-
|
|
4925
4837
|
const Accordion = ({
|
|
4926
4838
|
item,
|
|
4927
4839
|
isSelected,
|
|
@@ -5206,9 +5118,10 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5206
5118
|
flexGrow: 1,
|
|
5207
5119
|
display: 'flex',
|
|
5208
5120
|
flexDirection: 'column',
|
|
5209
|
-
justifyContent: 'space-between'
|
|
5210
|
-
|
|
5121
|
+
justifyContent: 'space-between'
|
|
5122
|
+
//alignItems: 'center',
|
|
5211
5123
|
},
|
|
5124
|
+
|
|
5212
5125
|
courseCardTags: {
|
|
5213
5126
|
display: 'flex',
|
|
5214
5127
|
justifyContent: 'flex-start',
|
|
@@ -5234,11 +5147,12 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5234
5147
|
wordBreak: 'break-word',
|
|
5235
5148
|
padding: '12px 0px',
|
|
5236
5149
|
textAlign: 'left',
|
|
5237
|
-
display: 'inline-block'
|
|
5150
|
+
display: 'inline-block'
|
|
5151
|
+
// overflow: 'hidden',
|
|
5238
5152
|
// whiteSpace: 'nowrap',
|
|
5239
5153
|
// textOverflow: 'ellipsis'
|
|
5240
|
-
|
|
5241
5154
|
},
|
|
5155
|
+
|
|
5242
5156
|
courseCardDiscount: {
|
|
5243
5157
|
display: 'flex',
|
|
5244
5158
|
justifyContent: 'flex-start',
|
|
@@ -5320,7 +5234,8 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5320
5234
|
}
|
|
5321
5235
|
},
|
|
5322
5236
|
'@media (max-width: 768px)': {
|
|
5323
|
-
coursesContainer: {
|
|
5237
|
+
coursesContainer: {
|
|
5238
|
+
//background: theme?.palette?.background?.primary
|
|
5324
5239
|
},
|
|
5325
5240
|
coursesCardAndText: {
|
|
5326
5241
|
padding: '70px 30px'
|
|
@@ -5352,7 +5267,6 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5352
5267
|
if (!hashToken) {
|
|
5353
5268
|
throw 'Missing hash token';
|
|
5354
5269
|
}
|
|
5355
|
-
|
|
5356
5270
|
const res = await axios({
|
|
5357
5271
|
method: 'get',
|
|
5358
5272
|
baseURL: baseURLs?.API_COURSE_URL,
|
|
@@ -5364,7 +5278,6 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5364
5278
|
requiredFilters: '[10]'
|
|
5365
5279
|
}
|
|
5366
5280
|
});
|
|
5367
|
-
|
|
5368
5281
|
if (res) {
|
|
5369
5282
|
return res.data;
|
|
5370
5283
|
}
|
|
@@ -5376,7 +5289,6 @@ function getShortenedSubstring(name, length, allowDots = true) {
|
|
|
5376
5289
|
if (name) {
|
|
5377
5290
|
return name.length < length ? name : `${name.substr(0, length)}${allowDots && '...'}`;
|
|
5378
5291
|
}
|
|
5379
|
-
|
|
5380
5292
|
return '';
|
|
5381
5293
|
}
|
|
5382
5294
|
|
|
@@ -5456,13 +5368,11 @@ function courses({
|
|
|
5456
5368
|
containerWidth
|
|
5457
5369
|
});
|
|
5458
5370
|
const [nodeData] = sectionData?.components;
|
|
5459
|
-
|
|
5460
5371
|
const handleApiCall = () => {
|
|
5461
5372
|
if (baseURLs) {
|
|
5462
5373
|
getCourseList(baseURLs, hashToken).then(response => {
|
|
5463
5374
|
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5464
5375
|
const coursesData = response?.data?.coursesData;
|
|
5465
|
-
|
|
5466
5376
|
if (coursesData && coursesData.length) {
|
|
5467
5377
|
setCardList(response?.data?.coursesData);
|
|
5468
5378
|
setShowShimmer(false);
|
|
@@ -5473,12 +5383,12 @@ function courses({
|
|
|
5473
5383
|
setShowShimmer(false);
|
|
5474
5384
|
setFallbackImages(placeholders);
|
|
5475
5385
|
}
|
|
5476
|
-
}
|
|
5386
|
+
}
|
|
5387
|
+
// For User Website & Draft Preview: If no data found, hide section.
|
|
5477
5388
|
else setErrored(true);
|
|
5478
5389
|
}
|
|
5479
5390
|
}).catch(err => {
|
|
5480
5391
|
const errMsg = err?.response?.data?.data?.message;
|
|
5481
|
-
|
|
5482
5392
|
if (errMsg === 'NOT_FOUND') {
|
|
5483
5393
|
if (nodeData?.cardCarousel?.metadata?.placeholders?.length && isEdit) {
|
|
5484
5394
|
setShowShimmer(false);
|
|
@@ -5490,16 +5400,16 @@ function courses({
|
|
|
5490
5400
|
});
|
|
5491
5401
|
}
|
|
5492
5402
|
};
|
|
5493
|
-
|
|
5494
5403
|
useEffect(() => {
|
|
5495
|
-
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5496
|
-
|
|
5404
|
+
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5405
|
+
// For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
|
|
5497
5406
|
if (isMasterTemplate) {
|
|
5498
5407
|
if (placeholders && placeholders.length) {
|
|
5499
5408
|
setShowShimmer(false);
|
|
5500
5409
|
setFallbackImages(placeholders);
|
|
5501
5410
|
}
|
|
5502
|
-
}
|
|
5411
|
+
}
|
|
5412
|
+
// other
|
|
5503
5413
|
else {
|
|
5504
5414
|
handleApiCall();
|
|
5505
5415
|
}
|
|
@@ -5564,7 +5474,6 @@ function courses({
|
|
|
5564
5474
|
});
|
|
5565
5475
|
})))));
|
|
5566
5476
|
}
|
|
5567
|
-
|
|
5568
5477
|
function SimpleCardsContainer({
|
|
5569
5478
|
children,
|
|
5570
5479
|
classes
|
|
@@ -5980,7 +5889,6 @@ function FormEnquiry({
|
|
|
5980
5889
|
setBtnDisabled(true);
|
|
5981
5890
|
}
|
|
5982
5891
|
}, [validData]);
|
|
5983
|
-
|
|
5984
5892
|
const handleSubmit = () => {
|
|
5985
5893
|
let data = {
|
|
5986
5894
|
sectionId: sectionData?._id || null,
|
|
@@ -5991,23 +5899,22 @@ function FormEnquiry({
|
|
|
5991
5899
|
setBtnDisabled(true);
|
|
5992
5900
|
setInputVal(formInitialValue);
|
|
5993
5901
|
};
|
|
5994
|
-
|
|
5995
5902
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
5996
5903
|
if (validations?.[regexField]?.length) {
|
|
5997
5904
|
let regex = new RegExp(validations[regexField]);
|
|
5998
|
-
|
|
5999
5905
|
if (regex?.test(inputVal[fieldname])) {
|
|
6000
|
-
setValidData({
|
|
5906
|
+
setValidData({
|
|
5907
|
+
...validData,
|
|
6001
5908
|
[fieldValidity]: 1
|
|
6002
5909
|
});
|
|
6003
5910
|
} else {
|
|
6004
|
-
setValidData({
|
|
5911
|
+
setValidData({
|
|
5912
|
+
...validData,
|
|
6005
5913
|
[fieldValidity]: 0
|
|
6006
5914
|
});
|
|
6007
5915
|
}
|
|
6008
5916
|
}
|
|
6009
5917
|
};
|
|
6010
|
-
|
|
6011
5918
|
return /*#__PURE__*/React.createElement("section", {
|
|
6012
5919
|
className: classes.section
|
|
6013
5920
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -6087,7 +5994,8 @@ function FormEnquiry({
|
|
|
6087
5994
|
isValid: validData.nameValid,
|
|
6088
5995
|
inputType: 'input',
|
|
6089
5996
|
onChange: e => {
|
|
6090
|
-
setInputVal({
|
|
5997
|
+
setInputVal({
|
|
5998
|
+
...inputVal,
|
|
6091
5999
|
name: e.target.value
|
|
6092
6000
|
});
|
|
6093
6001
|
},
|
|
@@ -6095,7 +6003,8 @@ function FormEnquiry({
|
|
|
6095
6003
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6096
6004
|
},
|
|
6097
6005
|
onFocus: () => {
|
|
6098
|
-
setValidData({
|
|
6006
|
+
setValidData({
|
|
6007
|
+
...validData,
|
|
6099
6008
|
nameValid: 1
|
|
6100
6009
|
});
|
|
6101
6010
|
}
|
|
@@ -6107,7 +6016,8 @@ function FormEnquiry({
|
|
|
6107
6016
|
isValid: validData.phoneValid,
|
|
6108
6017
|
inputType: 'input',
|
|
6109
6018
|
onChange: e => {
|
|
6110
|
-
setInputVal({
|
|
6019
|
+
setInputVal({
|
|
6020
|
+
...inputVal,
|
|
6111
6021
|
phone: e.target.value
|
|
6112
6022
|
});
|
|
6113
6023
|
},
|
|
@@ -6115,7 +6025,8 @@ function FormEnquiry({
|
|
|
6115
6025
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6116
6026
|
},
|
|
6117
6027
|
onFocus: () => {
|
|
6118
|
-
setValidData({
|
|
6028
|
+
setValidData({
|
|
6029
|
+
...validData,
|
|
6119
6030
|
phoneValid: 1
|
|
6120
6031
|
});
|
|
6121
6032
|
}
|
|
@@ -6127,7 +6038,8 @@ function FormEnquiry({
|
|
|
6127
6038
|
isValid: validData.emailValid,
|
|
6128
6039
|
inputType: 'input',
|
|
6129
6040
|
onChange: e => {
|
|
6130
|
-
setInputVal({
|
|
6041
|
+
setInputVal({
|
|
6042
|
+
...inputVal,
|
|
6131
6043
|
email: e.target.value
|
|
6132
6044
|
});
|
|
6133
6045
|
},
|
|
@@ -6135,7 +6047,8 @@ function FormEnquiry({
|
|
|
6135
6047
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6136
6048
|
},
|
|
6137
6049
|
onFocus: () => {
|
|
6138
|
-
setValidData({
|
|
6050
|
+
setValidData({
|
|
6051
|
+
...validData,
|
|
6139
6052
|
emailValid: 1
|
|
6140
6053
|
});
|
|
6141
6054
|
}
|
|
@@ -6147,7 +6060,8 @@ function FormEnquiry({
|
|
|
6147
6060
|
isValid: validData.messageValid,
|
|
6148
6061
|
inputType: 'textarea',
|
|
6149
6062
|
onChange: e => {
|
|
6150
|
-
setInputVal({
|
|
6063
|
+
setInputVal({
|
|
6064
|
+
...inputVal,
|
|
6151
6065
|
message: e.target.value
|
|
6152
6066
|
});
|
|
6153
6067
|
},
|
|
@@ -6155,7 +6069,8 @@ function FormEnquiry({
|
|
|
6155
6069
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6156
6070
|
},
|
|
6157
6071
|
onFocus: () => {
|
|
6158
|
-
setValidData({
|
|
6072
|
+
setValidData({
|
|
6073
|
+
...validData,
|
|
6159
6074
|
messageValid: 1
|
|
6160
6075
|
});
|
|
6161
6076
|
}
|
|
@@ -6386,7 +6301,6 @@ function Contact({
|
|
|
6386
6301
|
phoneValid: 1,
|
|
6387
6302
|
messageValid: 1
|
|
6388
6303
|
});
|
|
6389
|
-
|
|
6390
6304
|
const handleSubmit = () => {
|
|
6391
6305
|
const data = {
|
|
6392
6306
|
sectionId: sectionData?._id || null,
|
|
@@ -6397,7 +6311,6 @@ function Contact({
|
|
|
6397
6311
|
setBtnDisabled(true);
|
|
6398
6312
|
setInputVal(formInitialValue);
|
|
6399
6313
|
};
|
|
6400
|
-
|
|
6401
6314
|
useEffect(() => {
|
|
6402
6315
|
if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
|
|
6403
6316
|
setBtnDisabled(false);
|
|
@@ -6405,23 +6318,22 @@ function Contact({
|
|
|
6405
6318
|
setBtnDisabled(true);
|
|
6406
6319
|
}
|
|
6407
6320
|
}, [validData]);
|
|
6408
|
-
|
|
6409
6321
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
6410
6322
|
if (validations?.[regexField]?.length) {
|
|
6411
6323
|
let regex = new RegExp(validations[regexField]);
|
|
6412
|
-
|
|
6413
6324
|
if (regex?.test(inputVal[fieldname])) {
|
|
6414
|
-
setValidData({
|
|
6325
|
+
setValidData({
|
|
6326
|
+
...validData,
|
|
6415
6327
|
[fieldValidity]: 1
|
|
6416
6328
|
});
|
|
6417
6329
|
} else {
|
|
6418
|
-
setValidData({
|
|
6330
|
+
setValidData({
|
|
6331
|
+
...validData,
|
|
6419
6332
|
[fieldValidity]: 0
|
|
6420
6333
|
});
|
|
6421
6334
|
}
|
|
6422
6335
|
}
|
|
6423
6336
|
};
|
|
6424
|
-
|
|
6425
6337
|
return /*#__PURE__*/React.createElement("section", {
|
|
6426
6338
|
className: classes.section
|
|
6427
6339
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -6463,7 +6375,8 @@ function Contact({
|
|
|
6463
6375
|
isValid: validData.nameValid,
|
|
6464
6376
|
inputType: 'input',
|
|
6465
6377
|
onChange: e => {
|
|
6466
|
-
setInputVal({
|
|
6378
|
+
setInputVal({
|
|
6379
|
+
...inputVal,
|
|
6467
6380
|
name: e.target.value
|
|
6468
6381
|
});
|
|
6469
6382
|
},
|
|
@@ -6471,7 +6384,8 @@ function Contact({
|
|
|
6471
6384
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6472
6385
|
},
|
|
6473
6386
|
onFocus: () => {
|
|
6474
|
-
setValidData({
|
|
6387
|
+
setValidData({
|
|
6388
|
+
...validData,
|
|
6475
6389
|
nameValid: 1
|
|
6476
6390
|
});
|
|
6477
6391
|
}
|
|
@@ -6483,7 +6397,8 @@ function Contact({
|
|
|
6483
6397
|
isValid: validData.phoneValid,
|
|
6484
6398
|
inputType: 'input',
|
|
6485
6399
|
onChange: e => {
|
|
6486
|
-
setInputVal({
|
|
6400
|
+
setInputVal({
|
|
6401
|
+
...inputVal,
|
|
6487
6402
|
phone: e.target.value
|
|
6488
6403
|
});
|
|
6489
6404
|
},
|
|
@@ -6491,7 +6406,8 @@ function Contact({
|
|
|
6491
6406
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6492
6407
|
},
|
|
6493
6408
|
onFocus: () => {
|
|
6494
|
-
setValidData({
|
|
6409
|
+
setValidData({
|
|
6410
|
+
...validData,
|
|
6495
6411
|
phoneValid: 1
|
|
6496
6412
|
});
|
|
6497
6413
|
}
|
|
@@ -6503,7 +6419,8 @@ function Contact({
|
|
|
6503
6419
|
isValid: validData.emailValid,
|
|
6504
6420
|
inputType: 'input',
|
|
6505
6421
|
onChange: e => {
|
|
6506
|
-
setInputVal({
|
|
6422
|
+
setInputVal({
|
|
6423
|
+
...inputVal,
|
|
6507
6424
|
email: e.target.value
|
|
6508
6425
|
});
|
|
6509
6426
|
},
|
|
@@ -6511,7 +6428,8 @@ function Contact({
|
|
|
6511
6428
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6512
6429
|
},
|
|
6513
6430
|
onFocus: () => {
|
|
6514
|
-
setValidData({
|
|
6431
|
+
setValidData({
|
|
6432
|
+
...validData,
|
|
6515
6433
|
emailValid: 1
|
|
6516
6434
|
});
|
|
6517
6435
|
}
|
|
@@ -6523,7 +6441,8 @@ function Contact({
|
|
|
6523
6441
|
isValid: validData.messageValid,
|
|
6524
6442
|
inputType: 'textarea',
|
|
6525
6443
|
onChange: e => {
|
|
6526
|
-
setInputVal({
|
|
6444
|
+
setInputVal({
|
|
6445
|
+
...inputVal,
|
|
6527
6446
|
message: e.target.value
|
|
6528
6447
|
});
|
|
6529
6448
|
},
|
|
@@ -6531,7 +6450,8 @@ function Contact({
|
|
|
6531
6450
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6532
6451
|
},
|
|
6533
6452
|
onFocus: () => {
|
|
6534
|
-
setValidData({
|
|
6453
|
+
setValidData({
|
|
6454
|
+
...validData,
|
|
6535
6455
|
messageValid: 1
|
|
6536
6456
|
});
|
|
6537
6457
|
}
|
|
@@ -6792,7 +6712,8 @@ const useWebinarPromotionPage = createUseStyles(theme => {
|
|
|
6792
6712
|
const SingleVideoSlide$1 = props => {
|
|
6793
6713
|
const [isReadMore, setIsReadMore] = useState(false);
|
|
6794
6714
|
const theme = useTheme();
|
|
6795
|
-
useEffect(() => {
|
|
6715
|
+
useEffect(() => {
|
|
6716
|
+
// remaining days epoch
|
|
6796
6717
|
// current date epoch
|
|
6797
6718
|
// subtract remaining days from current day epoch
|
|
6798
6719
|
// moment the result - and see if there are days
|
|
@@ -6804,7 +6725,6 @@ const SingleVideoSlide$1 = props => {
|
|
|
6804
6725
|
webinarCtaClick,
|
|
6805
6726
|
conversions = 0
|
|
6806
6727
|
} = props;
|
|
6807
|
-
|
|
6808
6728
|
const renderer = ({
|
|
6809
6729
|
days,
|
|
6810
6730
|
hours,
|
|
@@ -6820,9 +6740,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6820
6740
|
return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
|
|
6821
6741
|
}
|
|
6822
6742
|
};
|
|
6823
|
-
|
|
6824
6743
|
const checkIfOfferIsValid = () => moment().diff(moment(props.data.offerPriceEndDate)) < 0;
|
|
6825
|
-
|
|
6826
6744
|
const checkForShowDiscount = () => {
|
|
6827
6745
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
6828
6746
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -6834,19 +6752,16 @@ const SingleVideoSlide$1 = props => {
|
|
|
6834
6752
|
if (data.offerPriceValidFor <= conversions) {
|
|
6835
6753
|
return false;
|
|
6836
6754
|
}
|
|
6837
|
-
|
|
6838
6755
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
6839
6756
|
return false;
|
|
6840
6757
|
} else {
|
|
6841
6758
|
return true;
|
|
6842
6759
|
}
|
|
6843
6760
|
}
|
|
6844
|
-
|
|
6845
6761
|
if (data.discount > 0) {
|
|
6846
6762
|
return true;
|
|
6847
6763
|
}
|
|
6848
6764
|
};
|
|
6849
|
-
|
|
6850
6765
|
const discount = ({
|
|
6851
6766
|
price,
|
|
6852
6767
|
discount
|
|
@@ -6854,7 +6769,6 @@ const SingleVideoSlide$1 = props => {
|
|
|
6854
6769
|
console.log('discountxx', props.data.price, props.data.discount);
|
|
6855
6770
|
return (discount / price * 100).toFixed(2);
|
|
6856
6771
|
};
|
|
6857
|
-
|
|
6858
6772
|
const classes = useWebinarPromotionPage();
|
|
6859
6773
|
return /*#__PURE__*/React.createElement("div", {
|
|
6860
6774
|
className: classes.videoCarouselContainer
|
|
@@ -6866,7 +6780,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6866
6780
|
className: classes.videoDetails
|
|
6867
6781
|
}, data?.isPaid !== 0 && (checkIfOfferIsValid() || data.offerPriceValidFor > 0) && data.offerPriceValidFor > conversions && /*#__PURE__*/React.createElement("div", null, data.offerPriceValidFor - conversions > 0 && data.discount && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) ? /*#__PURE__*/React.createElement("h3", {
|
|
6868
6782
|
className: classes.bannerContainer
|
|
6869
|
-
}, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions,
|
|
6783
|
+
}, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions, ' ', data.offerPriceValidFor - conversions > 1 ? 'users now' : 'user only') : checkIfOfferIsValid() && /*#__PURE__*/React.createElement("h3", {
|
|
6870
6784
|
className: classes.bannerContainer
|
|
6871
6785
|
}, "Hurry up! Offer for limited period only")), /*#__PURE__*/React.createElement("h3", {
|
|
6872
6786
|
ref: data?.videoTextHeading?.refSetter,
|
|
@@ -6950,9 +6864,10 @@ const SingleVideoSlide$1 = props => {
|
|
|
6950
6864
|
data: {
|
|
6951
6865
|
// link: 'headerData?.loginCtaLink',
|
|
6952
6866
|
// isLink: 1,
|
|
6953
|
-
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
|
|
6954
|
-
|
|
6867
|
+
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
|
|
6868
|
+
// isExternal: 1
|
|
6955
6869
|
},
|
|
6870
|
+
|
|
6956
6871
|
onClick: webinarCtaClick,
|
|
6957
6872
|
type: 'primary',
|
|
6958
6873
|
size: 'medium',
|
|
@@ -7286,14 +7201,14 @@ const SingleVideoSlide = props => {
|
|
|
7286
7201
|
isEdit
|
|
7287
7202
|
} = useContext(PageContext);
|
|
7288
7203
|
console.log(isEdit, 'isEdit');
|
|
7289
|
-
useEffect(() => {
|
|
7204
|
+
useEffect(() => {
|
|
7205
|
+
// remaining days epoch
|
|
7290
7206
|
// current date epoch
|
|
7291
7207
|
// subtract remaining days from current day epoch
|
|
7292
7208
|
// moment the result - and see if there are days
|
|
7293
7209
|
// days is present show days
|
|
7294
7210
|
// else start reverse timer
|
|
7295
7211
|
}, []);
|
|
7296
|
-
|
|
7297
7212
|
const renderer = ({
|
|
7298
7213
|
days,
|
|
7299
7214
|
hours,
|
|
@@ -7309,7 +7224,6 @@ const SingleVideoSlide = props => {
|
|
|
7309
7224
|
return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
|
|
7310
7225
|
}
|
|
7311
7226
|
};
|
|
7312
|
-
|
|
7313
7227
|
const {
|
|
7314
7228
|
data,
|
|
7315
7229
|
courseBuyNow,
|
|
@@ -7318,9 +7232,7 @@ const SingleVideoSlide = props => {
|
|
|
7318
7232
|
} = props;
|
|
7319
7233
|
const showCourseInstallmentData = data?.courseOverviewData;
|
|
7320
7234
|
const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
|
|
7321
|
-
|
|
7322
7235
|
const checkIfOfferIsValid = () => moment().diff(moment(props?.data?.endDate || 0)) < 0;
|
|
7323
|
-
|
|
7324
7236
|
const checkForShowDiscount = () => {
|
|
7325
7237
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
7326
7238
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -7332,28 +7244,23 @@ const SingleVideoSlide = props => {
|
|
|
7332
7244
|
if (data.offerPriceValidFor <= conversions) {
|
|
7333
7245
|
return false;
|
|
7334
7246
|
}
|
|
7335
|
-
|
|
7336
7247
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
7337
7248
|
return false;
|
|
7338
7249
|
} else {
|
|
7339
7250
|
return true;
|
|
7340
7251
|
}
|
|
7341
7252
|
}
|
|
7342
|
-
|
|
7343
7253
|
if (data.discount > 0) {
|
|
7344
7254
|
return true;
|
|
7345
7255
|
}
|
|
7346
7256
|
};
|
|
7347
|
-
|
|
7348
7257
|
const classes = useCoursePromotionPage();
|
|
7349
|
-
|
|
7350
7258
|
const discount = ({
|
|
7351
7259
|
price,
|
|
7352
7260
|
discount
|
|
7353
7261
|
}) => {
|
|
7354
7262
|
return (discount / price * 100).toFixed(2);
|
|
7355
7263
|
};
|
|
7356
|
-
|
|
7357
7264
|
return /*#__PURE__*/React.createElement("div", {
|
|
7358
7265
|
className: classes.videoCarouselContainer
|
|
7359
7266
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -7467,15 +7374,16 @@ const SingleVideoSlide = props => {
|
|
|
7467
7374
|
data: {
|
|
7468
7375
|
// link: 'headerData?.loginCtaLink',
|
|
7469
7376
|
// isLink: 1,
|
|
7470
|
-
value: 'BUY NOW'
|
|
7471
|
-
|
|
7377
|
+
value: 'BUY NOW'
|
|
7378
|
+
// isExternal: 1
|
|
7472
7379
|
},
|
|
7380
|
+
|
|
7473
7381
|
onClick: courseBuyNow,
|
|
7474
7382
|
type: 'primary',
|
|
7475
7383
|
size: 'medium',
|
|
7476
7384
|
target: null,
|
|
7477
|
-
rel: null
|
|
7478
|
-
|
|
7385
|
+
rel: null
|
|
7386
|
+
// styling={isMobile ? { margin: '0 40px' } : {}}
|
|
7479
7387
|
})))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React.createElement("div", {
|
|
7480
7388
|
className: classes.payInstallmentContainer,
|
|
7481
7389
|
onClick: showCourseInstallment
|
|
@@ -7680,18 +7588,15 @@ const FormPage = ({
|
|
|
7680
7588
|
_id,
|
|
7681
7589
|
baseURLs
|
|
7682
7590
|
} = useContext(PageContext);
|
|
7683
|
-
|
|
7684
7591
|
const handleSubmit = async e => {
|
|
7685
7592
|
e.preventDefault();
|
|
7686
7593
|
let formResponse = [];
|
|
7687
|
-
|
|
7688
7594
|
for (const [key, value] of Object.entries(formData)) {
|
|
7689
7595
|
if (value.questionType === 'MC') {
|
|
7690
7596
|
if (value.solutionArray.length > 1) {
|
|
7691
7597
|
value.solutionArray.shift();
|
|
7692
7598
|
}
|
|
7693
7599
|
}
|
|
7694
|
-
|
|
7695
7600
|
formResponse.push({
|
|
7696
7601
|
questionId: key,
|
|
7697
7602
|
questionName: value.questionName,
|
|
@@ -7699,7 +7604,6 @@ const FormPage = ({
|
|
|
7699
7604
|
solutionArray: value.solutionArray
|
|
7700
7605
|
});
|
|
7701
7606
|
}
|
|
7702
|
-
|
|
7703
7607
|
const data = {
|
|
7704
7608
|
sectionId: sectionData?.components?.[0]?._id || null,
|
|
7705
7609
|
landingPageId: _id || null,
|
|
@@ -7709,7 +7613,6 @@ const FormPage = ({
|
|
|
7709
7613
|
setFormData({});
|
|
7710
7614
|
setformSubmitted(!formSubmitted);
|
|
7711
7615
|
};
|
|
7712
|
-
|
|
7713
7616
|
useEffect(() => {
|
|
7714
7617
|
//add all questions to formData
|
|
7715
7618
|
let formData = {};
|
|
@@ -7722,23 +7625,26 @@ const FormPage = ({
|
|
|
7722
7625
|
});
|
|
7723
7626
|
setFormData(formData);
|
|
7724
7627
|
}, [metadata, formSubmitted]);
|
|
7725
|
-
|
|
7726
7628
|
const handleOnClick = (e, item, option) => {
|
|
7727
7629
|
// if the checkbox is checked
|
|
7728
7630
|
if (!e.target.checked) {
|
|
7729
7631
|
// if the checkbox is checked and the solution array is empty
|
|
7730
7632
|
if (!formData[item._id]?.solutionArray?.length) {
|
|
7731
|
-
setFormData({
|
|
7633
|
+
setFormData({
|
|
7634
|
+
...formData,
|
|
7732
7635
|
[item._id]: {
|
|
7733
7636
|
questionName: item.text,
|
|
7734
7637
|
solutionArray: [option.value],
|
|
7735
7638
|
questionType: 'MC'
|
|
7736
7639
|
}
|
|
7737
7640
|
});
|
|
7738
|
-
}
|
|
7641
|
+
}
|
|
7642
|
+
// if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
|
|
7739
7643
|
else if (formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7740
7644
|
// if only one value is in the array remove it
|
|
7741
|
-
|
|
7645
|
+
|
|
7646
|
+
setFormData({
|
|
7647
|
+
...formData,
|
|
7742
7648
|
[item._id]: {
|
|
7743
7649
|
questionName: item.text,
|
|
7744
7650
|
solutionArray: formData[item._id]?.solutionArray?.filter(item => item !== option.value),
|
|
@@ -7746,20 +7652,24 @@ const FormPage = ({
|
|
|
7746
7652
|
}
|
|
7747
7653
|
});
|
|
7748
7654
|
}
|
|
7749
|
-
}
|
|
7655
|
+
}
|
|
7656
|
+
// if the checkbox is unchecked
|
|
7750
7657
|
else {
|
|
7751
7658
|
// if the checkbox is unchecked and the solution array is empty
|
|
7752
7659
|
if (typeof formData[item._id]?.solutionArray?.length === 'undefined') {
|
|
7753
|
-
setFormData({
|
|
7660
|
+
setFormData({
|
|
7661
|
+
...formData,
|
|
7754
7662
|
[item._id]: {
|
|
7755
7663
|
questionName: item.text,
|
|
7756
7664
|
solutionArray: [option.value],
|
|
7757
7665
|
questionType: 'MC'
|
|
7758
7666
|
}
|
|
7759
7667
|
});
|
|
7760
|
-
}
|
|
7668
|
+
}
|
|
7669
|
+
// if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
|
|
7761
7670
|
else if (!formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7762
|
-
setFormData({
|
|
7671
|
+
setFormData({
|
|
7672
|
+
...formData,
|
|
7763
7673
|
[item._id]: {
|
|
7764
7674
|
questionName: item.text,
|
|
7765
7675
|
solutionArray: [...formData[item._id]?.solutionArray, option.value],
|
|
@@ -7769,7 +7679,6 @@ const FormPage = ({
|
|
|
7769
7679
|
}
|
|
7770
7680
|
}
|
|
7771
7681
|
};
|
|
7772
|
-
|
|
7773
7682
|
return /*#__PURE__*/React.createElement("section", {
|
|
7774
7683
|
className: classes.formPageSection
|
|
7775
7684
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -7796,7 +7705,8 @@ const FormPage = ({
|
|
|
7796
7705
|
placeholder: "Short answer",
|
|
7797
7706
|
name: item._id,
|
|
7798
7707
|
onChange: e => {
|
|
7799
|
-
setFormData({
|
|
7708
|
+
setFormData({
|
|
7709
|
+
...formData,
|
|
7800
7710
|
[item._id]: {
|
|
7801
7711
|
index,
|
|
7802
7712
|
questionName: item.text,
|
|
@@ -7836,11 +7746,13 @@ const FormPage = ({
|
|
|
7836
7746
|
name: "text",
|
|
7837
7747
|
required: item.isRequired,
|
|
7838
7748
|
value: option.value,
|
|
7839
|
-
checked: formData[item._id]?.solutionArray?.[0] === option.value
|
|
7749
|
+
checked: formData[item._id]?.solutionArray?.[0] === option.value
|
|
7750
|
+
// name={option.value}
|
|
7840
7751
|
// id={option.value}
|
|
7841
7752
|
,
|
|
7842
7753
|
onClick: e => {
|
|
7843
|
-
setFormData({
|
|
7754
|
+
setFormData({
|
|
7755
|
+
...formData,
|
|
7844
7756
|
[item._id]: {
|
|
7845
7757
|
questionName: item.text,
|
|
7846
7758
|
solutionArray: [option.value],
|
|
@@ -7856,9 +7768,10 @@ const FormPage = ({
|
|
|
7856
7768
|
data: {
|
|
7857
7769
|
// link: 'headerData?.loginCtaLink',
|
|
7858
7770
|
// isLink: 1,
|
|
7859
|
-
value: 'SUBMIT'
|
|
7860
|
-
|
|
7771
|
+
value: 'SUBMIT'
|
|
7772
|
+
// isExternal: 1
|
|
7861
7773
|
},
|
|
7774
|
+
|
|
7862
7775
|
type: 'primary',
|
|
7863
7776
|
size: 'medium',
|
|
7864
7777
|
target: null,
|
|
@@ -7952,7 +7865,6 @@ function Tiles({
|
|
|
7952
7865
|
const nodeData = sectionData.components;
|
|
7953
7866
|
console.log(nodeData);
|
|
7954
7867
|
const tilesList = nodeData[0]?.tilesList.components;
|
|
7955
|
-
|
|
7956
7868
|
const handleClick = value => {
|
|
7957
7869
|
if (!isEdit && value) {
|
|
7958
7870
|
if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
|
|
@@ -7962,7 +7874,6 @@ function Tiles({
|
|
|
7962
7874
|
}
|
|
7963
7875
|
}
|
|
7964
7876
|
};
|
|
7965
|
-
|
|
7966
7877
|
const TileDiv = tilesList?.map((tile, i) => {
|
|
7967
7878
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
7968
7879
|
key: i
|
|
@@ -8025,8 +7936,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8025
7936
|
width: 'auto',
|
|
8026
7937
|
height: '48px'
|
|
8027
7938
|
/* margin: 18px 0px; */
|
|
8028
|
-
|
|
8029
7939
|
},
|
|
7940
|
+
|
|
8030
7941
|
'p-young-guru-title': {
|
|
8031
7942
|
fontFamily: theme?.typography?.fontFamily,
|
|
8032
7943
|
fontStyle: 'normal',
|
|
@@ -8053,8 +7964,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8053
7964
|
fontSize: '0',
|
|
8054
7965
|
textAlign: 'center'
|
|
8055
7966
|
/* padding:35px 0 40px */
|
|
8056
|
-
|
|
8057
7967
|
},
|
|
7968
|
+
|
|
8058
7969
|
'two-columns .column': {
|
|
8059
7970
|
width: '100%',
|
|
8060
7971
|
maxWidth: '275px',
|
|
@@ -8070,9 +7981,10 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8070
7981
|
color: '#030a21',
|
|
8071
7982
|
marginBottom: '5px',
|
|
8072
7983
|
textAlign: 'left'
|
|
8073
|
-
}
|
|
8074
|
-
// }
|
|
7984
|
+
}
|
|
8075
7985
|
|
|
7986
|
+
// @media screen and (max-width: 600px) {
|
|
7987
|
+
// }
|
|
8076
7988
|
}));
|
|
8077
7989
|
|
|
8078
7990
|
function Section({
|
|
@@ -8101,8 +8013,8 @@ function Section({
|
|
|
8101
8013
|
}, /*#__PURE__*/React.createElement("tbody", null, customHtmlData?.isCustomHtml ? /*#__PURE__*/React.createElement("div", {
|
|
8102
8014
|
className: classes.email_description_para,
|
|
8103
8015
|
dangerouslySetInnerHTML: {
|
|
8104
|
-
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
|
|
8105
|
-
|
|
8016
|
+
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
|
|
8017
|
+
// __html: '<div>sdnfksdnflksdnfklsndk</div>'
|
|
8106
8018
|
}
|
|
8107
8019
|
}) : /*#__PURE__*/React.createElement(React.Fragment, null, header?.isActive ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("table", {
|
|
8108
8020
|
style: {
|
|
@@ -8135,7 +8047,8 @@ function Section({
|
|
|
8135
8047
|
textAlign: 'center'
|
|
8136
8048
|
}
|
|
8137
8049
|
}, header?.components[1]?.metadata?.image?.length ? /*#__PURE__*/React.createElement("img", {
|
|
8138
|
-
src: header?.components[1]?.metadata?.image
|
|
8050
|
+
src: header?.components[1]?.metadata?.image
|
|
8051
|
+
// width={600}
|
|
8139
8052
|
,
|
|
8140
8053
|
alt: "",
|
|
8141
8054
|
style: {
|
|
@@ -8418,14 +8331,12 @@ function Section({
|
|
|
8418
8331
|
}
|
|
8419
8332
|
}, "All rights reserved.")))))))))))))) : null)))));
|
|
8420
8333
|
}
|
|
8421
|
-
|
|
8422
8334
|
function EmailDripMarket({
|
|
8423
8335
|
sectionData,
|
|
8424
8336
|
extraProps = {}
|
|
8425
8337
|
}) {
|
|
8426
8338
|
console.log('extrapropstemplate', extraProps);
|
|
8427
8339
|
const isInitialMount = useRef(true);
|
|
8428
|
-
|
|
8429
8340
|
const convertToHtml = sectionData => {
|
|
8430
8341
|
const html = ReactDOMServer.renderToStaticMarkup( /*#__PURE__*/React.createElement(Section, {
|
|
8431
8342
|
nodeData: sectionData,
|
|
@@ -8435,15 +8346,15 @@ function EmailDripMarket({
|
|
|
8435
8346
|
}));
|
|
8436
8347
|
return html;
|
|
8437
8348
|
};
|
|
8438
|
-
|
|
8439
8349
|
useEffect(() => {
|
|
8440
8350
|
if (isInitialMount.current) {
|
|
8441
8351
|
isInitialMount.current = false;
|
|
8442
8352
|
} else {
|
|
8443
8353
|
extraProps?.callbackHtml(convertToHtml(sectionData));
|
|
8444
8354
|
}
|
|
8445
|
-
}, [extraProps?.convertedHtml]);
|
|
8355
|
+
}, [extraProps?.convertedHtml]);
|
|
8446
8356
|
|
|
8357
|
+
// const mockData = sectionData?.sections[0];
|
|
8447
8358
|
const emailRef = useRef(null);
|
|
8448
8359
|
return /*#__PURE__*/React.createElement("section", {
|
|
8449
8360
|
style: {
|
|
@@ -8453,7 +8364,6 @@ function EmailDripMarket({
|
|
|
8453
8364
|
}, /*#__PURE__*/React.createElement("div", {
|
|
8454
8365
|
onClick: e => {
|
|
8455
8366
|
e.stopPropagation(); // prevent the click from event Capturing, in email onClick events do not work
|
|
8456
|
-
|
|
8457
8367
|
e.preventDefault();
|
|
8458
8368
|
}
|
|
8459
8369
|
}, /*#__PURE__*/React.createElement(Section, {
|
|
@@ -8492,9 +8402,7 @@ const TYPE_TO_COMPONENT_MAP = {
|
|
|
8492
8402
|
TILES_SECTION: Tiles,
|
|
8493
8403
|
EMAIL_DRIP_MARKET: EmailDripMarket
|
|
8494
8404
|
};
|
|
8495
|
-
|
|
8496
8405
|
const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
|
|
8497
|
-
|
|
8498
8406
|
const MemoisedSection = /*#__PURE__*/memo(({
|
|
8499
8407
|
sectionData,
|
|
8500
8408
|
extraProps
|
|
@@ -8607,11 +8515,9 @@ const componentParser = compObj => {
|
|
|
8607
8515
|
});
|
|
8608
8516
|
return component;
|
|
8609
8517
|
}
|
|
8610
|
-
|
|
8611
8518
|
if (Array.isArray(compObj.components)) {
|
|
8612
8519
|
compObj.components = compObj.components.map(componentParser);
|
|
8613
8520
|
}
|
|
8614
|
-
|
|
8615
8521
|
return compObj;
|
|
8616
8522
|
};
|
|
8617
8523
|
const inverseComponentParser = compObj => {
|
|
@@ -8636,7 +8542,6 @@ const inverseComponentParser = compObj => {
|
|
|
8636
8542
|
if (compObj.components) {
|
|
8637
8543
|
compObj.components = compObj.components.map(inverseComponentParser);
|
|
8638
8544
|
}
|
|
8639
|
-
|
|
8640
8545
|
return compObj;
|
|
8641
8546
|
}
|
|
8642
8547
|
};
|