@bikdotai/bik-widgets 1.0.0
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/.eslintrc +22 -0
- package/.eslintrc.js +19 -0
- package/.github/workflows/main.yml +293 -0
- package/.prettierignore +13 -0
- package/.prettierrc +10 -0
- package/README.md +128 -0
- package/cypress/apiHelper/endpoints.ts +21 -0
- package/cypress/apiHelper/executor.ts +42 -0
- package/cypress/e2e/bottomDrawer.cy.ts +49 -0
- package/cypress/e2e/directReward.cy.ts +67 -0
- package/cypress/e2e/scratchTheCard.cy.ts +68 -0
- package/cypress/e2e/stw.cy.ts +82 -0
- package/cypress/e2e/waRedirection.cy.ts +46 -0
- package/cypress/fixtures/payloads.ts +330 -0
- package/cypress/support/commands.ts +37 -0
- package/cypress/support/e2e.ts +20 -0
- package/cypress.staging.config.ts +23 -0
- package/jsconfig.json +6 -0
- package/localtest.sh +10 -0
- package/log-server.js +86 -0
- package/package.json +79 -0
- package/postcss.config.js +8 -0
- package/src/Globals.d.ts +2 -0
- package/src/assets/lottie/santa.json +11722 -0
- package/src/assets/svg/CalendarClockIcon.tsx +30 -0
- package/src/assets/svg/CalendarIcon.tsx +24 -0
- package/src/assets/svg/CheckIcon.tsx +17 -0
- package/src/assets/svg/ChevronIcon.tsx +21 -0
- package/src/assets/svg/Close.tsx +39 -0
- package/src/assets/svg/Confetti.tsx +140 -0
- package/src/assets/svg/Copy.tsx +26 -0
- package/src/assets/svg/DropdownCheckIcon.tsx +35 -0
- package/src/assets/svg/ErrorIcon.tsx +27 -0
- package/src/assets/svg/RadioIcon.tsx +25 -0
- package/src/assets/svg/UncheckedCheckboxIcon.tsx +28 -0
- package/src/assets/svg/UncheckedRadioIcon.tsx +26 -0
- package/src/assets/svg/info.tsx +30 -0
- package/src/assets/svg/qrcode.svg +14 -0
- package/src/bootstrap.tsx +8 -0
- package/src/components/CtaCard/index.tsx +37 -0
- package/src/components/CtaCard/preview.module.css +32 -0
- package/src/components/CtaCard/style.module.css +32 -0
- package/src/components/EmailInput/emailInputBox.tsx +95 -0
- package/src/components/Fab/index.tsx +224 -0
- package/src/components/Fab/preview.module.css +28 -0
- package/src/components/Fab/style.module.css +37 -0
- package/src/components/Icons/Call.tsx +26 -0
- package/src/components/Icons/Cross.tsx +24 -0
- package/src/components/Icons/Gmail.tsx +61 -0
- package/src/components/Icons/Instagram.tsx +60 -0
- package/src/components/Icons/LiveChat.tsx +43 -0
- package/src/components/Icons/Messenger.tsx +57 -0
- package/src/components/Icons/Send.tsx +22 -0
- package/src/components/Icons/Whatsapp.tsx +24 -0
- package/src/components/Shimmer/index.tsx +12 -0
- package/src/components/Shimmer/style.module.css +37 -0
- package/src/components/SmsInput/smsInputBox.tsx +135 -0
- package/src/components/UserDetailsV2/userDetailsV2.desktop.module.css +52 -0
- package/src/components/UserDetailsV2/userDetailsV2.mobile.module.css +52 -0
- package/src/components/UserDetailsV2/userDetailsV2.module.css +81 -0
- package/src/components/UserDetailsV2/userDetailsV2.tsx +527 -0
- package/src/components/WhatsappInput/Spinner.tsx +26 -0
- package/src/components/WhatsappInput/whatsappInput.module.css +106 -0
- package/src/components/WhatsappInput/whatsappInputBox.tsx +155 -0
- package/src/components/WhatsappInput/whatsappInputPreviewDesktop.module.css +71 -0
- package/src/components/WhatsappInput/whatsappInputPreviewMobile.module.css +65 -0
- package/src/components/checkbox/checkbox.module.css +19 -0
- package/src/components/checkbox/checkbox.tsx +88 -0
- package/src/components/countryCodePicker/countriesDropdown.module.css +77 -0
- package/src/components/countryCodePicker/countriesDropdown.tsx +81 -0
- package/src/components/couponDetails/coupon.module.css +208 -0
- package/src/components/couponDetails/coupon.tsx +210 -0
- package/src/components/couponDetails/couponPreviewDesktop.module.css +158 -0
- package/src/components/couponDetails/couponPreviewMobile.module.css +164 -0
- package/src/components/index.ts +3 -0
- package/src/components/inputComponents/Checkbox.module.css +197 -0
- package/src/components/inputComponents/Checkbox.tsx +85 -0
- package/src/components/inputComponents/DatePicker.module.css +565 -0
- package/src/components/inputComponents/DatePicker.tsx +278 -0
- package/src/components/inputComponents/Dropdown.module.css +796 -0
- package/src/components/inputComponents/Dropdown.tsx +630 -0
- package/src/components/inputComponents/InputBox.module.css +401 -0
- package/src/components/inputComponents/InputBox.tsx +209 -0
- package/src/components/selectedCountry/selectedCountry.module.css +76 -0
- package/src/components/selectedCountry/selectedCountry.tsx +76 -0
- package/src/components/selectedCountry/selectedCountryPreviewDesktop.module.css +56 -0
- package/src/components/selectedCountry/selectedCountryPreviewMobile.module.css +57 -0
- package/src/components/userDetailsForm/RenderCustomFields.tsx +333 -0
- package/src/components/userDetailsForm/userDetailsForm.tsx +675 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useExitIntent.ts +452 -0
- package/src/hooks/useIsMobile.tsx +21 -0
- package/src/hooks/useMessageEvent.ts +8 -0
- package/src/hooks/useTriggeredIntentDetails.ts +43 -0
- package/src/hooks/useUrlListerner.ts +30 -0
- package/src/hooks/useWebSocketLogger.ts +59 -0
- package/src/hooks/useWindowEvent.ts +8 -0
- package/src/icons/copyIcon.tsx +26 -0
- package/src/icons/crossIconDesktop.tsx +20 -0
- package/src/icons/crossIconMobile.tsx +20 -0
- package/src/index.html +30 -0
- package/src/index.ts +32 -0
- package/src/index.tsx +1 -0
- package/src/repo/widgetRepo.ts +21 -0
- package/src/types/customFields.ts +73 -0
- package/src/utilities/cookie.ts +70 -0
- package/src/utilities/customFieldTypeMapping.ts +67 -0
- package/src/utilities/customFieldValidation.ts +201 -0
- package/src/utilities/encryption.ts +21 -0
- package/src/utilities/exitIntentUtils.ts +31 -0
- package/src/utilities/global.css +11 -0
- package/src/utilities/languageUtilities.ts +235 -0
- package/src/utilities/localRunner.js +26 -0
- package/src/utilities/localRunner.ts +27 -0
- package/src/utilities/localStorage.ts +40 -0
- package/src/utilities/script.tsx +15 -0
- package/src/utilities/stringUtils.ts +5 -0
- package/src/utilities/styleUtils.ts +134 -0
- package/src/utilities/variables.ts +11 -0
- package/src/utilities/widgetUtils.js +342 -0
- package/src/utilities/widgetUtils.ts +313 -0
- package/src/widgets/BottomDrawer/config.ts +41 -0
- package/src/widgets/BottomDrawer/index.tsx +116 -0
- package/src/widgets/BottomDrawer/modal.tsx +286 -0
- package/src/widgets/BottomDrawer/preview.module.css +122 -0
- package/src/widgets/BottomDrawer/previewMobile.module.css +124 -0
- package/src/widgets/BottomDrawer/style.module.css +279 -0
- package/src/widgets/CaptivateBanner/captivateBanner.tsx +200 -0
- package/src/widgets/CaptivateBanner/config.ts +72 -0
- package/src/widgets/CaptivateBanner/index.tsx +204 -0
- package/src/widgets/CaptivateBanner/previewDesktop.module.css +51 -0
- package/src/widgets/CaptivateBanner/previewMobile.module.css +51 -0
- package/src/widgets/CaptivateBanner/style.module.css +77 -0
- package/src/widgets/CaptivateBanner/utils.ts +104 -0
- package/src/widgets/CentrallyAlignedPopup/config.ts +42 -0
- package/src/widgets/CentrallyAlignedPopup/index.tsx +109 -0
- package/src/widgets/CentrallyAlignedPopup/modal.tsx +269 -0
- package/src/widgets/CentrallyAlignedPopup/preview.module.css +153 -0
- package/src/widgets/CentrallyAlignedPopup/previewMobile.module.css +153 -0
- package/src/widgets/CentrallyAlignedPopup/style.module.css +283 -0
- package/src/widgets/DirectReward/components/couponDetails.tsx +265 -0
- package/src/widgets/DirectReward/components/userDetails.tsx +117 -0
- package/src/widgets/DirectReward/config.ts +186 -0
- package/src/widgets/DirectReward/directReward.tsx +350 -0
- package/src/widgets/DirectReward/index.tsx +579 -0
- package/src/widgets/DirectReward/previewStyles/thankYouPreviewDesktop.module.css +276 -0
- package/src/widgets/DirectReward/previewStyles/thankYouPreviewMobile.module.css +303 -0
- package/src/widgets/DirectReward/previewStyles/userDetailsPreviewDesktop.module.css +511 -0
- package/src/widgets/DirectReward/previewStyles/userDetailsPreviewMobile.module.css +462 -0
- package/src/widgets/DirectReward/style.module.css +836 -0
- package/src/widgets/ExitIntentHook.tsx +28 -0
- package/src/widgets/STW/api.ts +70 -0
- package/src/widgets/STW/components/svgFactory.tsx +44 -0
- package/src/widgets/STW/config.ts +193 -0
- package/src/widgets/STW/context.ts +7 -0
- package/src/widgets/STW/couponDetails.tsx +121 -0
- package/src/widgets/STW/index.tsx +733 -0
- package/src/widgets/STW/previewStyles/thankyouPreviewDesktop.module.css +215 -0
- package/src/widgets/STW/previewStyles/thankyouPreviewMobile.module.css +205 -0
- package/src/widgets/STW/previewStyles/userInputsPreviewDesktop.module.css +732 -0
- package/src/widgets/STW/previewStyles/userInputsPreviewMobile.module.css +661 -0
- package/src/widgets/STW/previewStyles/wheelPreviewDesktop.module.css +498 -0
- package/src/widgets/STW/previewStyles/wheelPreviewMobile.module.css +497 -0
- package/src/widgets/STW/stw1.tsx +119 -0
- package/src/widgets/STW/stw2Components/wheelDesign.tsx +183 -0
- package/src/widgets/STW/stw2Pages/couponDetails.tsx +72 -0
- package/src/widgets/STW/stw2Pages/stw2.tsx +212 -0
- package/src/widgets/STW/stw2Pages/style.module.css +1226 -0
- package/src/widgets/STW/stw2Pages/userDetails.tsx +86 -0
- package/src/widgets/STW/stw2Pages/wheel.tsx +117 -0
- package/src/widgets/STW/stw2PreviewStyles/thankyouPreviewDesktop.module.css +835 -0
- package/src/widgets/STW/stw2PreviewStyles/thankyouPreviewMobile.module.css +787 -0
- package/src/widgets/STW/stw2PreviewStyles/userInputsPreviewDesktop.module.css +867 -0
- package/src/widgets/STW/stw2PreviewStyles/userInputsPreviewMobile.module.css +798 -0
- package/src/widgets/STW/stw2PreviewStyles/wheelPreviewDesktop.module.css +572 -0
- package/src/widgets/STW/stw2PreviewStyles/wheelPreviewMobile.module.css +559 -0
- package/src/widgets/STW/style.module.css +901 -0
- package/src/widgets/STW/userDetails.tsx +150 -0
- package/src/widgets/STW/utility.ts +664 -0
- package/src/widgets/STW/wheel.tsx +304 -0
- package/src/widgets/ScratchCard/ScratchOff/scratchOff.tsx +157 -0
- package/src/widgets/ScratchCard/config.ts +152 -0
- package/src/widgets/ScratchCard/globalStyle.module.css +931 -0
- package/src/widgets/ScratchCard/index.tsx +546 -0
- package/src/widgets/ScratchCard/modal.tsx +225 -0
- package/src/widgets/ScratchCard/preview.module.css +250 -0
- package/src/widgets/ScratchCard/previewMobile.module.css +247 -0
- package/src/widgets/ScratchCard/previewStyles/userDetailsPreviewDesktop.module.css +537 -0
- package/src/widgets/ScratchCard/previewStyles/userDetailsPreviewMobile.module.css +463 -0
- package/src/widgets/ScratchCard/style.module.css +220 -0
- package/src/widgets/ShopifyForm/config.ts +168 -0
- package/src/widgets/ShopifyForm/index.tsx +214 -0
- package/src/widgets/ShopifyForm/previewDesktop.module.css +117 -0
- package/src/widgets/ShopifyForm/previewMobile.module.css +131 -0
- package/src/widgets/ShopifyForm/shopifyForm.tsx +445 -0
- package/src/widgets/ShopifyForm/style.module.css +161 -0
- package/src/widgets/SingleButtonRedirection/config.ts +47 -0
- package/src/widgets/SingleButtonRedirection/index.tsx +121 -0
- package/src/widgets/WebStories/config.ts +105 -0
- package/src/widgets/WebStories/index.css +3 -0
- package/src/widgets/WebStories/index.tsx +282 -0
- package/src/widgets/WebStories/style.module.css +26 -0
- package/src/widgets/index.tsx +3 -0
- package/src/widgets/utility.ts +31 -0
- package/tsconfig.json +12 -0
- package/webpack.config.js +239 -0
|
@@ -0,0 +1,664 @@
|
|
|
1
|
+
import { sendWidgetEvent } from './api';
|
|
2
|
+
import { WIDGET_NAME } from '@bikdotai/bik-models/dm';
|
|
3
|
+
|
|
4
|
+
export const generateRotationValues = (
|
|
5
|
+
spikesCount: number,
|
|
6
|
+
templateName: WIDGET_NAME,
|
|
7
|
+
) => {
|
|
8
|
+
return templateName === WIDGET_NAME.STW1
|
|
9
|
+
? getRotationValuesSTW1(spikesCount)
|
|
10
|
+
: document.body.clientWidth < 450
|
|
11
|
+
? getRotationValuesMobileSTW2(spikesCount)
|
|
12
|
+
: getRotationValuesDesktopSTW2(spikesCount);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const getRotationValuesSTW1 = (spikesCount: number) => {
|
|
16
|
+
const rotationValuesTemp = [];
|
|
17
|
+
const segmentAngle = 360 / spikesCount;
|
|
18
|
+
const firstHalfSegement = {
|
|
19
|
+
minDegree: 0,
|
|
20
|
+
maxDegree: segmentAngle / 2,
|
|
21
|
+
value: 1,
|
|
22
|
+
};
|
|
23
|
+
rotationValuesTemp.push(firstHalfSegement);
|
|
24
|
+
for (let i = spikesCount; i >= 2; i--) {
|
|
25
|
+
const lastValue = rotationValuesTemp[rotationValuesTemp.length - 1];
|
|
26
|
+
const currentSegmentValue = {
|
|
27
|
+
minDegree: lastValue.maxDegree + 1,
|
|
28
|
+
maxDegree: lastValue.maxDegree + segmentAngle,
|
|
29
|
+
value: i,
|
|
30
|
+
};
|
|
31
|
+
rotationValuesTemp.push(currentSegmentValue);
|
|
32
|
+
}
|
|
33
|
+
const lastValue = rotationValuesTemp[rotationValuesTemp.length - 1];
|
|
34
|
+
const secondHalfSegement = {
|
|
35
|
+
minDegree: lastValue.maxDegree + 1,
|
|
36
|
+
maxDegree: lastValue.maxDegree + segmentAngle / 2,
|
|
37
|
+
value: 1,
|
|
38
|
+
};
|
|
39
|
+
rotationValuesTemp.push(secondHalfSegement);
|
|
40
|
+
return rotationValuesTemp;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const getStartSectorDesktop = (spikesCount: number) => {
|
|
44
|
+
const halfSectorsCount = spikesCount / 2;
|
|
45
|
+
const sectorsInBtw = Math.ceil((halfSectorsCount - 1) / 2);
|
|
46
|
+
const startSector = 1 + sectorsInBtw;
|
|
47
|
+
return startSector;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const getRotationValuesDesktopSTW2 = (spikesCount: number) => {
|
|
51
|
+
let rotationValuesTemp = [];
|
|
52
|
+
let segmentAngle = 360 / spikesCount;
|
|
53
|
+
const startSector = getStartSectorDesktop(spikesCount);
|
|
54
|
+
const startingPoint =
|
|
55
|
+
spikesCount % 4 === 0
|
|
56
|
+
? {
|
|
57
|
+
minDegree: 0,
|
|
58
|
+
maxDegree: segmentAngle / 2,
|
|
59
|
+
value: startSector,
|
|
60
|
+
}
|
|
61
|
+
: {
|
|
62
|
+
minDegree: 0,
|
|
63
|
+
maxDegree: segmentAngle,
|
|
64
|
+
value: startSector,
|
|
65
|
+
};
|
|
66
|
+
rotationValuesTemp.push(startingPoint);
|
|
67
|
+
let lastPoint = startingPoint;
|
|
68
|
+
for (let i = startSector - 1; i >= 1; i--) {
|
|
69
|
+
let currentSector = {
|
|
70
|
+
minDegree: lastPoint.maxDegree + 1,
|
|
71
|
+
maxDegree: lastPoint.maxDegree + segmentAngle,
|
|
72
|
+
value: i,
|
|
73
|
+
};
|
|
74
|
+
rotationValuesTemp.push(currentSector);
|
|
75
|
+
lastPoint = currentSector;
|
|
76
|
+
}
|
|
77
|
+
let lastValue = rotationValuesTemp[rotationValuesTemp.length - 1];
|
|
78
|
+
let i;
|
|
79
|
+
for (i = spikesCount; i > startSector; i--) {
|
|
80
|
+
const currentSegmentValue = {
|
|
81
|
+
minDegree: lastValue.maxDegree + 1,
|
|
82
|
+
maxDegree: lastValue.maxDegree + segmentAngle,
|
|
83
|
+
value: i,
|
|
84
|
+
};
|
|
85
|
+
rotationValuesTemp.push(currentSegmentValue);
|
|
86
|
+
lastValue = currentSegmentValue;
|
|
87
|
+
}
|
|
88
|
+
if (spikesCount % 4 === 0) {
|
|
89
|
+
let secondHalfSegement = {
|
|
90
|
+
minDegree: lastValue.maxDegree + 1,
|
|
91
|
+
maxDegree: lastValue.maxDegree + segmentAngle / 2,
|
|
92
|
+
value: i,
|
|
93
|
+
};
|
|
94
|
+
rotationValuesTemp.push(secondHalfSegement);
|
|
95
|
+
}
|
|
96
|
+
return rotationValuesTemp;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const getRotationValuesMobileSTW2 = (spikesCount: number) => {
|
|
100
|
+
let rotationValuesTemp = [];
|
|
101
|
+
let segmentAngle = 360 / spikesCount;
|
|
102
|
+
let firstHalfSegement = {
|
|
103
|
+
minDegree: 0,
|
|
104
|
+
maxDegree: segmentAngle / 2,
|
|
105
|
+
value: 1,
|
|
106
|
+
};
|
|
107
|
+
rotationValuesTemp.push(firstHalfSegement);
|
|
108
|
+
for (let i = spikesCount; i >= 2; i--) {
|
|
109
|
+
const lastValue = rotationValuesTemp[rotationValuesTemp.length - 1];
|
|
110
|
+
const currentSegmentValue = {
|
|
111
|
+
minDegree: lastValue.maxDegree + 1,
|
|
112
|
+
maxDegree: lastValue.maxDegree + segmentAngle,
|
|
113
|
+
value: i,
|
|
114
|
+
};
|
|
115
|
+
rotationValuesTemp.push(currentSegmentValue);
|
|
116
|
+
}
|
|
117
|
+
const lastValue = rotationValuesTemp[rotationValuesTemp.length - 1];
|
|
118
|
+
let secondHalfSegement = {
|
|
119
|
+
minDegree: lastValue.maxDegree + 1,
|
|
120
|
+
maxDegree: lastValue.maxDegree + segmentAngle / 2,
|
|
121
|
+
value: 1,
|
|
122
|
+
};
|
|
123
|
+
rotationValuesTemp.push(secondHalfSegement);
|
|
124
|
+
return rotationValuesTemp;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const colorLuminance = (hex, lum) => {
|
|
128
|
+
hex = String(hex).replace(/[^0-9a-f]/gi, '');
|
|
129
|
+
if (hex.length < 6) {
|
|
130
|
+
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
131
|
+
}
|
|
132
|
+
lum = lum || 0;
|
|
133
|
+
let rgb = '#',
|
|
134
|
+
c,
|
|
135
|
+
i;
|
|
136
|
+
for (i = 0; i < 3; i++) {
|
|
137
|
+
c = parseInt(hex.substr(i * 2, 2), 16);
|
|
138
|
+
c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16);
|
|
139
|
+
rgb += ('00' + c).substr(c.length);
|
|
140
|
+
}
|
|
141
|
+
return rgb;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const getRgbColor = (color: string) => {
|
|
145
|
+
// Convert the color to an RGB color using a temporary DOM element
|
|
146
|
+
const tempElem = document.createElement('div');
|
|
147
|
+
tempElem.style.color = color;
|
|
148
|
+
document.body.appendChild(tempElem);
|
|
149
|
+
const rgbColor = window.getComputedStyle(tempElem).color;
|
|
150
|
+
document.body.removeChild(tempElem);
|
|
151
|
+
|
|
152
|
+
// Parse the RGB values from the color string
|
|
153
|
+
const match = rgbColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
|
154
|
+
return match
|
|
155
|
+
? { r: +match[1], g: +match[2], b: +match[3] }
|
|
156
|
+
: { r: 0, g: 0, b: 0 };
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const getContrastColor = (bgColor: string) => {
|
|
160
|
+
// Convert the background color to an RGB color
|
|
161
|
+
const color = getRgbColor(bgColor);
|
|
162
|
+
|
|
163
|
+
// Calculate the relative luminance of the color using the sRGB color space formula
|
|
164
|
+
const luminance = 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b;
|
|
165
|
+
// Choose white or black as the text color based on the luminance value
|
|
166
|
+
if (luminance > 100) {
|
|
167
|
+
return '#212121';
|
|
168
|
+
} else {
|
|
169
|
+
return '#FFFFFF';
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const getCookie = name => {
|
|
174
|
+
const cookies = document.cookie
|
|
175
|
+
.split(';')
|
|
176
|
+
.map(cookie => cookie.split('='))
|
|
177
|
+
.reduce(
|
|
178
|
+
(accumulator, [key, value]) => ({
|
|
179
|
+
...accumulator,
|
|
180
|
+
[key.trim()]: decodeURIComponent(value),
|
|
181
|
+
}),
|
|
182
|
+
{},
|
|
183
|
+
);
|
|
184
|
+
return cookies[name];
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export const setCookie = (cname, cvalue, exdays) => {
|
|
188
|
+
const d = new Date();
|
|
189
|
+
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
|
|
190
|
+
let expires = 'expires=' + d.toUTCString();
|
|
191
|
+
document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/';
|
|
192
|
+
};
|
|
193
|
+
export const cookieProcessor = (
|
|
194
|
+
cookieName,
|
|
195
|
+
cookieValue,
|
|
196
|
+
eventName,
|
|
197
|
+
exday,
|
|
198
|
+
widgetId,
|
|
199
|
+
env,
|
|
200
|
+
) => {
|
|
201
|
+
setCookie(cookieName, cookieValue, exday);
|
|
202
|
+
sendWidgetEvent(eventName, widgetId, env);
|
|
203
|
+
};
|
|
204
|
+
export const cookieClickHandler = (
|
|
205
|
+
cookieName,
|
|
206
|
+
cookieValue,
|
|
207
|
+
event,
|
|
208
|
+
exDay,
|
|
209
|
+
widgetId,
|
|
210
|
+
env,
|
|
211
|
+
) => {
|
|
212
|
+
if (getCookie(cookieName) !== cookieValue) {
|
|
213
|
+
cookieProcessor(cookieName, cookieValue, event, exDay, widgetId, env);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export const getScrollPercent = () => {
|
|
218
|
+
var winHeight = window.innerHeight;
|
|
219
|
+
var docHeight = document.body.clientHeight;
|
|
220
|
+
var scrollTop = window.scrollY;
|
|
221
|
+
var trackLength = docHeight - winHeight;
|
|
222
|
+
var pctScrolled = Math.floor((scrollTop / trackLength) * 100);
|
|
223
|
+
return pctScrolled;
|
|
224
|
+
};
|
|
225
|
+
export const segmentHeightMap = {
|
|
226
|
+
'Spin the wheel popup 2': {
|
|
227
|
+
previewMobile: 108,
|
|
228
|
+
previewDesktop: 88,
|
|
229
|
+
defaultHeightDesktop: 180,
|
|
230
|
+
defaultHeightMobile: 195,
|
|
231
|
+
},
|
|
232
|
+
'Spin the wheel popup': {
|
|
233
|
+
previewMobile: 87,
|
|
234
|
+
previewDesktop: 62,
|
|
235
|
+
defaultHeightDesktop: 180,
|
|
236
|
+
defaultHeightMobile: 148,
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
export const updateSegmentWidth = (
|
|
240
|
+
spikesCount: number,
|
|
241
|
+
preview: boolean,
|
|
242
|
+
isMobile: boolean,
|
|
243
|
+
templateName: WIDGET_NAME,
|
|
244
|
+
) => {
|
|
245
|
+
let segmentHeight = null;
|
|
246
|
+
if (preview) {
|
|
247
|
+
if (isMobile) {
|
|
248
|
+
segmentHeight = segmentHeightMap[templateName].previewMobile;
|
|
249
|
+
} else {
|
|
250
|
+
segmentHeight = segmentHeightMap[templateName].previewDesktop;
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
if (window.screen.width > 768) {
|
|
254
|
+
segmentHeight = segmentHeightMap[templateName].defaultHeightDesktop;
|
|
255
|
+
} else {
|
|
256
|
+
segmentHeight = segmentHeightMap[templateName].defaultHeightMobile;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
const width =
|
|
260
|
+
Math.tan(((360 / (spikesCount * 2)) * Math.PI) / 180) * segmentHeight * 2;
|
|
261
|
+
return width;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export const getSegmentDetails = (
|
|
265
|
+
spikesCount: number,
|
|
266
|
+
segmentColor1: string,
|
|
267
|
+
segmentColor2: string,
|
|
268
|
+
discountCodeTitle,
|
|
269
|
+
) => {
|
|
270
|
+
const segmentDegree = 360 / spikesCount;
|
|
271
|
+
let wheelDetails = [];
|
|
272
|
+
for (let i = 0; i < spikesCount; i++) {
|
|
273
|
+
wheelDetails = [
|
|
274
|
+
...wheelDetails,
|
|
275
|
+
getRotationValues(i, segmentDegree, discountCodeTitle),
|
|
276
|
+
];
|
|
277
|
+
}
|
|
278
|
+
for (let i = 0; i < spikesCount; i = i + 2) {
|
|
279
|
+
wheelDetails[i] = {
|
|
280
|
+
...wheelDetails[i],
|
|
281
|
+
color: segmentColor1,
|
|
282
|
+
};
|
|
283
|
+
wheelDetails[i + 1] = {
|
|
284
|
+
...wheelDetails[i + 1],
|
|
285
|
+
color: segmentColor2,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
return wheelDetails;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
export const getRotationValues = (
|
|
292
|
+
idx: number,
|
|
293
|
+
segmentDegree: number,
|
|
294
|
+
discountCodeTitle,
|
|
295
|
+
) => {
|
|
296
|
+
let obj = {};
|
|
297
|
+
switch (idx) {
|
|
298
|
+
case 0:
|
|
299
|
+
return (obj = {
|
|
300
|
+
class: 'one',
|
|
301
|
+
text:
|
|
302
|
+
discountCodeTitle && discountCodeTitle[1]
|
|
303
|
+
? discountCodeTitle[1]
|
|
304
|
+
: 'Flat 10% off',
|
|
305
|
+
rotationValue: segmentDegree * idx,
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
case 1:
|
|
309
|
+
return (obj = {
|
|
310
|
+
class: 'two',
|
|
311
|
+
text:
|
|
312
|
+
discountCodeTitle && discountCodeTitle[2]
|
|
313
|
+
? discountCodeTitle[2]
|
|
314
|
+
: 'Flat 20% off',
|
|
315
|
+
rotationValue: segmentDegree * idx,
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
case 2:
|
|
319
|
+
return (obj = {
|
|
320
|
+
class: 'three',
|
|
321
|
+
text:
|
|
322
|
+
discountCodeTitle && discountCodeTitle[3]
|
|
323
|
+
? discountCodeTitle[3]
|
|
324
|
+
: 'Flat 30% off',
|
|
325
|
+
rotationValue: segmentDegree * idx,
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
case 3:
|
|
329
|
+
return (obj = {
|
|
330
|
+
class: 'four',
|
|
331
|
+
text:
|
|
332
|
+
discountCodeTitle && discountCodeTitle[4]
|
|
333
|
+
? discountCodeTitle[4]
|
|
334
|
+
: 'Flat 40% off',
|
|
335
|
+
rotationValue: segmentDegree * idx,
|
|
336
|
+
});
|
|
337
|
+
case 4:
|
|
338
|
+
return (obj = {
|
|
339
|
+
class: 'five',
|
|
340
|
+
text:
|
|
341
|
+
discountCodeTitle && discountCodeTitle[5]
|
|
342
|
+
? discountCodeTitle[5]
|
|
343
|
+
: 'Flat 50% off',
|
|
344
|
+
rotationValue: segmentDegree * idx,
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
case 5:
|
|
348
|
+
return (obj = {
|
|
349
|
+
class: 'six',
|
|
350
|
+
text:
|
|
351
|
+
discountCodeTitle && discountCodeTitle[6]
|
|
352
|
+
? discountCodeTitle[6]
|
|
353
|
+
: 'Flat 60% off',
|
|
354
|
+
rotationValue: segmentDegree * idx,
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
case 6:
|
|
358
|
+
return (obj = {
|
|
359
|
+
class: 'seven',
|
|
360
|
+
text:
|
|
361
|
+
discountCodeTitle && discountCodeTitle[7]
|
|
362
|
+
? discountCodeTitle[7]
|
|
363
|
+
: 'Flat 70% off',
|
|
364
|
+
rotationValue: segmentDegree * idx,
|
|
365
|
+
});
|
|
366
|
+
case 7:
|
|
367
|
+
return (obj = {
|
|
368
|
+
class: 'eight',
|
|
369
|
+
text:
|
|
370
|
+
discountCodeTitle && discountCodeTitle[8]
|
|
371
|
+
? discountCodeTitle[8]
|
|
372
|
+
: 'Flat 80% off',
|
|
373
|
+
rotationValue: segmentDegree * idx,
|
|
374
|
+
});
|
|
375
|
+
case 8:
|
|
376
|
+
return (obj = {
|
|
377
|
+
class: 'nine',
|
|
378
|
+
text:
|
|
379
|
+
discountCodeTitle && discountCodeTitle[9]
|
|
380
|
+
? discountCodeTitle[9]
|
|
381
|
+
: 'Flat 90% off',
|
|
382
|
+
rotationValue: segmentDegree * idx,
|
|
383
|
+
});
|
|
384
|
+
case 9:
|
|
385
|
+
return (obj = {
|
|
386
|
+
class: 'ten',
|
|
387
|
+
text:
|
|
388
|
+
discountCodeTitle && discountCodeTitle[10]
|
|
389
|
+
? discountCodeTitle[10]
|
|
390
|
+
: 'Flat 100% off',
|
|
391
|
+
rotationValue: segmentDegree * idx,
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
export const addDiscountText = (discountCodeTitle, segmentDetails) => {
|
|
397
|
+
let wheelDetails = [...segmentDetails];
|
|
398
|
+
wheelDetails.map((desc, index) => {
|
|
399
|
+
const respectiveDiscountCodeDataKey = Object.keys(discountCodeTitle).filter(
|
|
400
|
+
key => key === (index + 1).toString(),
|
|
401
|
+
);
|
|
402
|
+
if (respectiveDiscountCodeDataKey) {
|
|
403
|
+
wheelDetails[index] = {
|
|
404
|
+
...wheelDetails[index],
|
|
405
|
+
text: discountCodeTitle[respectiveDiscountCodeDataKey[0]],
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
return wheelDetails;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
export const CountriesData = [
|
|
413
|
+
{ name: 'United Kingdom', dial: '+44', code: 'GB', code3: 'GBR' },
|
|
414
|
+
{ name: 'United States', dial: '+1', code: 'US', code3: 'USA' },
|
|
415
|
+
{ name: 'Germany', dial: '+49', code: 'DE', code3: 'DEU' },
|
|
416
|
+
{ name: 'Australia', dial: '+61', code: 'AU', code3: 'AUS' },
|
|
417
|
+
{ name: 'Singapore', dial: '+65', code: 'SG', code3: 'SGP' },
|
|
418
|
+
{ name: 'United Arab Emirates', dial: '+971', code: 'AE', code3: 'ARE' },
|
|
419
|
+
{ name: 'France', dial: '+33', code: 'FR', code3: 'FRA' },
|
|
420
|
+
{ name: 'India', dial: '+91', code: 'IN', code3: 'IND' },
|
|
421
|
+
{ name: 'Italy', dial: '+39', code: 'IT', code3: 'ITA' },
|
|
422
|
+
{ name: 'Japan', dial: '+81', code: 'JP', code3: 'JPN' },
|
|
423
|
+
{ name: 'Afghanistan', dial: '+93', code: 'AF', code3: 'AFG' },
|
|
424
|
+
{ name: 'Albania', dial: '+355', code: 'AL', code3: 'ALB' },
|
|
425
|
+
{ name: 'Algeria', dial: '+213', code: 'DZ', code3: 'DZA' },
|
|
426
|
+
{ name: 'Andorra', dial: '+376', code: 'AD', code3: 'AND' },
|
|
427
|
+
{ name: 'Angola', dial: '+244', code: 'AO', code3: 'AGO' },
|
|
428
|
+
{ name: 'Anguilla', dial: '+1264', code: 'AI', code3: 'AIA' },
|
|
429
|
+
{ name: 'Antarctica', dial: '+672', code: 'AQ', code3: 'ATA' },
|
|
430
|
+
{ name: 'Antigua and Barbuda', dial: '+1268', code: 'AG', code3: 'ATG' },
|
|
431
|
+
{ name: 'Argentina', dial: '+54', code: 'AR', code3: 'ARG' },
|
|
432
|
+
{ name: 'Armenia', dial: '+374', code: 'AM', code3: 'ARM' },
|
|
433
|
+
{ name: 'Aruba', dial: '+297', code: 'AW', code3: 'ABW' },
|
|
434
|
+
{ name: 'Austria', dial: '+43', code: 'AT', code3: 'AUT' },
|
|
435
|
+
{ name: 'Azerbaijan', dial: '+994', code: 'AZ', code3: 'AZE' },
|
|
436
|
+
{ name: 'Bahamas', dial: '+1242', code: 'BS', code3: 'BHS' },
|
|
437
|
+
{ name: 'Bahrain', dial: '+973', code: 'BH', code3: 'BHR' },
|
|
438
|
+
{ name: 'Bangladesh', dial: '+880', code: 'BD', code3: 'BGD' },
|
|
439
|
+
{ name: 'Barbados', dial: '+1246', code: 'BB', code3: 'BRB' },
|
|
440
|
+
{ name: 'Belarus', dial: '+375', code: 'BY', code3: 'BLR' },
|
|
441
|
+
{ name: 'Belgium', dial: '+32', code: 'BE', code3: 'BEL' },
|
|
442
|
+
{ name: 'Belize', dial: '+501', code: 'BZ', code3: 'BLZ' },
|
|
443
|
+
{ name: 'Benin', dial: '+229', code: 'BJ', code3: 'BEN' },
|
|
444
|
+
{ name: 'Bermuda', dial: '+1441', code: 'BM', code3: 'BMU' },
|
|
445
|
+
{ name: 'Bhutan', dial: '+975', code: 'BT', code3: 'BTN' },
|
|
446
|
+
{ name: 'Bosnia and Herzegovina', dial: '+387', code: 'BA', code3: 'BIH' },
|
|
447
|
+
{ name: 'Botswana', dial: '+267', code: 'BW', code3: 'BWA' },
|
|
448
|
+
{ name: 'Brazil', dial: '+55', code: 'BR', code3: 'BRA' },
|
|
449
|
+
{
|
|
450
|
+
name: 'British Indian Ocean Territory',
|
|
451
|
+
dial: '+246',
|
|
452
|
+
code: 'IO',
|
|
453
|
+
code3: 'IOT',
|
|
454
|
+
},
|
|
455
|
+
{ name: 'Bulgaria', dial: '+359', code: 'BG', code3: 'BGR' },
|
|
456
|
+
{ name: 'Burkina Faso', dial: '+226', code: 'BF', code3: 'BFA' },
|
|
457
|
+
{ name: 'Burundi', dial: '+257', code: 'BI', code3: 'BDI' },
|
|
458
|
+
{ name: 'Cambodia', dial: '+855', code: 'KH', code3: 'KHM' },
|
|
459
|
+
{ name: 'Cameroon', dial: '+237', code: 'CM', code3: 'CMR' },
|
|
460
|
+
{ name: 'Canada', dial: '+1', code: 'CA', code3: 'CAN' },
|
|
461
|
+
{ name: 'Cape Verde', dial: '+238', code: 'CV', code3: 'CPV' },
|
|
462
|
+
{ name: 'Central African Republic', dial: '+236', code: 'CF', code3: 'CAF' },
|
|
463
|
+
{ name: 'Chad', dial: '+235', code: 'TD', code3: 'TCD' },
|
|
464
|
+
{ name: 'Chile', dial: '+56', code: 'CL', code3: 'CHL' },
|
|
465
|
+
{ name: 'China', dial: '+86', code: 'CN', code3: 'CHN' },
|
|
466
|
+
{ name: 'Christmas Island', dial: '+61', code: 'CX', code3: 'CXR' },
|
|
467
|
+
{ name: 'Colombia', dial: '+57', code: 'CO', code3: 'COL' },
|
|
468
|
+
{ name: 'Comoros', dial: '+269', code: 'KM', code3: 'COM' },
|
|
469
|
+
{ name: 'Cook Islands', dial: '+682', code: 'CK', code3: 'COK' },
|
|
470
|
+
{ name: 'Costa Rica', dial: '+506', code: 'CR', code3: 'CRI' },
|
|
471
|
+
{ name: 'Croatia', dial: '+385', code: 'HR', code3: 'HRV' },
|
|
472
|
+
{ name: 'Cuba', dial: '+53', code: 'CU', code3: 'CUB' },
|
|
473
|
+
{ name: 'Cyprus', dial: '+357', code: 'CY', code3: 'CYP' },
|
|
474
|
+
{ name: 'Czech Republic', dial: '+420', code: 'CZ', code3: 'CZE' },
|
|
475
|
+
{ name: 'Denmark', dial: '+45', code: 'DK', code3: 'DNK' },
|
|
476
|
+
{ name: 'Djibouti', dial: '+253', code: 'DJ', code3: 'DJI' },
|
|
477
|
+
{ name: 'Dominica', dial: '+1767', code: 'DM', code3: 'DMA' },
|
|
478
|
+
{ name: 'Ecuador', dial: '+593', code: 'EC', code3: 'ECU' },
|
|
479
|
+
{ name: 'Egypt', dial: '+20', code: 'EG', code3: 'EGY' },
|
|
480
|
+
{ name: 'El Salvador', dial: '+503', code: 'SV', code3: 'SLV' },
|
|
481
|
+
{ name: 'Equatorial Guinea', dial: '+240', code: 'GQ', code3: 'GNQ' },
|
|
482
|
+
{ name: 'Eritrea', dial: '+291', code: 'ER', code3: 'ERI' },
|
|
483
|
+
{ name: 'Estonia', dial: '+372', code: 'EE', code3: 'EST' },
|
|
484
|
+
{ name: 'Ethiopia', dial: '+251', code: 'ET', code3: 'ETH' },
|
|
485
|
+
{ name: 'Faroe Islands', dial: '+298', code: 'FO', code3: 'FRO' },
|
|
486
|
+
{ name: 'Fiji', dial: '+679', code: 'FJ', code3: 'FJI' },
|
|
487
|
+
{ name: 'Finland', dial: '+358', code: 'FI', code3: 'FIN' },
|
|
488
|
+
{ name: 'French Polynesia', dial: '+689', code: 'PF', code3: 'PYF' },
|
|
489
|
+
{ name: 'Gabon', dial: '+241', code: 'GA', code3: 'GAB' },
|
|
490
|
+
{ name: 'Gambia', dial: '+220', code: 'GM', code3: 'GMB' },
|
|
491
|
+
{ name: 'Georgia', dial: '+995', code: 'GE', code3: 'GEO' },
|
|
492
|
+
{ name: 'Ghana', dial: '+233', code: 'GH', code3: 'GHA' },
|
|
493
|
+
{ name: 'Gibraltar', dial: '+350', code: 'GI', code3: 'GIB' },
|
|
494
|
+
{ name: 'Greece', dial: '+30', code: 'GR', code3: 'GRC' },
|
|
495
|
+
{ name: 'Greenland', dial: '+299', code: 'GL', code3: 'GRL' },
|
|
496
|
+
{ name: 'Grenada', dial: '+1473', code: 'GD', code3: 'GRD' },
|
|
497
|
+
{ name: 'Guam', dial: '+1671', code: 'GU', code3: 'GUM' },
|
|
498
|
+
{ name: 'Guatemala', dial: '+502', code: 'GT', code3: 'GTM' },
|
|
499
|
+
{ name: 'Guinea', dial: '+224', code: 'GN', code3: 'GIN' },
|
|
500
|
+
{ name: 'Guinea-Bissau', dial: '+245', code: 'GW', code3: 'GNB' },
|
|
501
|
+
{ name: 'Haiti', dial: '+509', code: 'HT', code3: 'HTI' },
|
|
502
|
+
{ name: 'Honduras', dial: '+504', code: 'HN', code3: 'HND' },
|
|
503
|
+
{ name: 'Hong Kong', dial: '+852', code: 'HK', code3: 'HKG' },
|
|
504
|
+
{ name: 'Hungary', dial: '+36', code: 'HU', code3: 'HUN' },
|
|
505
|
+
{ name: 'Iceland', dial: '+354', code: 'IS', code3: 'ISL' },
|
|
506
|
+
{ name: 'Indonesia', dial: '+62', code: 'ID', code3: 'IDN' },
|
|
507
|
+
{ name: 'Iraq', dial: '+964', code: 'IQ', code3: 'IRQ' },
|
|
508
|
+
{ name: 'Ireland', dial: '+353', code: 'IE', code3: 'IRL' },
|
|
509
|
+
{ name: 'Israel', dial: '+972', code: 'IL', code3: 'ISR' },
|
|
510
|
+
{ name: 'Jamaica', dial: '+1876', code: 'JM', code3: 'JAM' },
|
|
511
|
+
{ name: 'Jordan', dial: '+962', code: 'JO', code3: 'JOR' },
|
|
512
|
+
{ name: 'Kenya', dial: '+254', code: 'KE', code3: 'KEN' },
|
|
513
|
+
{ name: 'Kiribati', dial: '+686', code: 'KI', code3: 'KIR' },
|
|
514
|
+
{ name: 'Kuwait', dial: '+965', code: 'KW', code3: 'KWT' },
|
|
515
|
+
{ name: 'Kyrgyzstan', dial: '+996', code: 'KG', code3: 'KGZ' },
|
|
516
|
+
{ name: 'Laos', dial: '+856', code: 'LA', code3: 'LAO' },
|
|
517
|
+
{ name: 'Latvia', dial: '+371', code: 'LV', code3: 'LVA' },
|
|
518
|
+
{ name: 'Lebanon', dial: '+961', code: 'LB', code3: 'LBN' },
|
|
519
|
+
{ name: 'Lesotho', dial: '+266', code: 'LS', code3: 'LSO' },
|
|
520
|
+
{ name: 'Liberia', dial: '+231', code: 'LR', code3: 'LBR' },
|
|
521
|
+
{ name: 'Liechtenstein', dial: '+423', code: 'LI', code3: 'LIE' },
|
|
522
|
+
{ name: 'Lithuania', dial: '+370', code: 'LT', code3: 'LTU' },
|
|
523
|
+
{ name: 'Luxembourg', dial: '+352', code: 'LU', code3: 'LUX' },
|
|
524
|
+
{ name: 'Macao', dial: '+853', code: 'MO', code3: 'MAC' },
|
|
525
|
+
{ name: 'Macedonia', dial: '+389', code: 'MK', code3: 'MKD' },
|
|
526
|
+
{ name: 'Madagascar', dial: '+261', code: 'MG', code3: 'MDG' },
|
|
527
|
+
{ name: 'Malawi', dial: '+265', code: 'MW', code3: 'MWI' },
|
|
528
|
+
{ name: 'Malaysia', dial: '+60', code: 'MY', code3: 'MYS' },
|
|
529
|
+
{ name: 'Maldives', dial: '+960', code: 'MV', code3: 'MDV' },
|
|
530
|
+
{ name: 'Mali', dial: '+223', code: 'ML', code3: 'MLI' },
|
|
531
|
+
{ name: 'Malta', dial: '+356', code: 'MT', code3: 'MLT' },
|
|
532
|
+
{ name: 'Marshall Islands', dial: '+692', code: 'MH', code3: 'MHL' },
|
|
533
|
+
{ name: 'Mauritania', dial: '+222', code: 'MR', code3: 'MRT' },
|
|
534
|
+
{ name: 'Mauritius', dial: '+230', code: 'MU', code3: 'MUS' },
|
|
535
|
+
{ name: 'Mayotte', dial: '+262', code: 'YT', code3: 'MYT' },
|
|
536
|
+
{ name: 'Mexico', dial: '+52', code: 'MX', code3: 'MEX' },
|
|
537
|
+
{ name: 'Moldova', dial: '+373', code: 'MD', code3: 'MDA' },
|
|
538
|
+
{ name: 'Monaco', dial: '+377', code: 'MC', code3: 'MCO' },
|
|
539
|
+
{ name: 'Mongolia', dial: '+976', code: 'MN', code3: 'MNG' },
|
|
540
|
+
{ name: 'Montenegro', dial: '+382', code: 'ME', code3: 'MNE' },
|
|
541
|
+
{ name: 'Montserrat', dial: '+1664', code: 'MS', code3: 'MSR' },
|
|
542
|
+
{ name: 'Morocco', dial: '+212', code: 'MA', code3: 'MAR' },
|
|
543
|
+
{ name: 'Mozambique', dial: '+258', code: 'MZ', code3: 'MOZ' },
|
|
544
|
+
{ name: 'Myanmar', dial: '+95', code: 'MM', code3: 'MMR' },
|
|
545
|
+
{ name: 'Namibia', dial: '+264', code: 'NA', code3: 'NAM' },
|
|
546
|
+
{ name: 'Nauru', dial: '+674', code: 'NR', code3: 'NRU' },
|
|
547
|
+
{ name: 'Nepal', dial: '+977', code: 'NP', code3: 'NPL' },
|
|
548
|
+
{ name: 'Netherlands', dial: '+31', code: 'NL', code3: 'NLD' },
|
|
549
|
+
{ name: 'Netherlands Antilles', dial: '+599', code: 'AN', code3: 'ANT' },
|
|
550
|
+
{ name: 'New Caledonia', dial: '+687', code: 'NC', code3: 'NCL' },
|
|
551
|
+
{ name: 'New Zealand', dial: '+64', code: 'NZ', code3: 'NZL' },
|
|
552
|
+
{ name: 'Nicaragua', dial: '+505', code: 'NI', code3: 'NIC' },
|
|
553
|
+
{ name: 'Niger', dial: '+227', code: 'NE', code3: 'NER' },
|
|
554
|
+
{ name: 'Nigeria', dial: '+234', code: 'NG', code3: 'NGA' },
|
|
555
|
+
{ name: 'Niue', dial: '+683', code: 'NU', code3: 'NIU' },
|
|
556
|
+
{ name: 'Norfolk Island', dial: '+672', code: 'NF', code3: 'NFK' },
|
|
557
|
+
{ name: 'Northern Mariana Islands', dial: '+1670', code: 'MP', code3: 'MNP' },
|
|
558
|
+
{ name: 'Norway', dial: '+47', code: 'NO', code3: 'NOR' },
|
|
559
|
+
{ name: 'Oman', dial: '+968', code: 'OM', code3: 'OMN' },
|
|
560
|
+
{ name: 'Pakistan', dial: '+92', code: 'PK', code3: 'PAK' },
|
|
561
|
+
{ name: 'Palau', dial: '+680', code: 'PW', code3: 'PLW' },
|
|
562
|
+
{ name: 'Panama', dial: '+507', code: 'PA', code3: 'PAN' },
|
|
563
|
+
{ name: 'Papua New Guinea', dial: '+675', code: 'PG', code3: 'PNG' },
|
|
564
|
+
{ name: 'Paraguay', dial: '+595', code: 'PY', code3: 'PRY' },
|
|
565
|
+
{ name: 'Peru', dial: '+51', code: 'PE', code3: 'PER' },
|
|
566
|
+
{ name: 'Philippines', dial: '+63', code: 'PH', code3: 'PHL' },
|
|
567
|
+
{ name: 'Poland', dial: '+48', code: 'PL', code3: 'POL' },
|
|
568
|
+
{ name: 'Portugal', dial: '+351', code: 'PT', code3: 'PRT' },
|
|
569
|
+
{ name: 'Romania', dial: '+40', code: 'RO', code3: 'ROU' },
|
|
570
|
+
{ name: 'Russia', dial: '+7', code: 'RU', code3: 'RUS' },
|
|
571
|
+
{ name: 'Rwanda', dial: '+250', code: 'RW', code3: 'RWA' },
|
|
572
|
+
{ name: 'Saint Kitts and Nevis', dial: '+1869', code: 'KN', code3: 'KNA' },
|
|
573
|
+
{ name: 'Saint Lucia', dial: '+1758', code: 'LC', code3: 'LCA' },
|
|
574
|
+
{ name: 'Saint Pierre and Miquelon', dial: '+508', code: 'PM', code3: 'SPM' },
|
|
575
|
+
{
|
|
576
|
+
name: 'Saint Vincent and the Grenadines',
|
|
577
|
+
dial: '+1784',
|
|
578
|
+
code: 'VC',
|
|
579
|
+
code3: 'VCT',
|
|
580
|
+
},
|
|
581
|
+
{ name: 'Samoa', dial: '+685', code: 'WS', code3: 'WSM' },
|
|
582
|
+
{ name: 'San Marino', dial: '+378', code: 'SM', code3: 'SMR' },
|
|
583
|
+
{ name: 'Sao Tome and Principe', dial: '+239', code: 'ST', code3: 'STP' },
|
|
584
|
+
{ name: 'Saudi Arabia', dial: '+966', code: 'SA', code3: 'SAU' },
|
|
585
|
+
{ name: 'Senegal', dial: '+221', code: 'SN', code3: 'SEN' },
|
|
586
|
+
{ name: 'Serbia', dial: '+381', code: 'RS', code3: 'SRB' },
|
|
587
|
+
{ name: 'Seychelles', dial: '+248', code: 'SC', code3: 'SYC' },
|
|
588
|
+
{ name: 'Sierra Leone', dial: '+232', code: 'SL', code3: 'SLE' },
|
|
589
|
+
{ name: 'Slovakia', dial: '+421', code: 'SK', code3: 'SVK' },
|
|
590
|
+
{ name: 'Slovenia', dial: '+386', code: 'SI', code3: 'SVN' },
|
|
591
|
+
{ name: 'Solomon Islands', dial: '+677', code: 'SB', code3: 'SLB' },
|
|
592
|
+
{ name: 'Somalia', dial: '+252', code: 'SO', code3: 'SOM' },
|
|
593
|
+
{ name: 'South Africa', dial: '+27', code: 'ZA', code3: 'ZAF' },
|
|
594
|
+
{ name: 'South Sudan', dial: '+211', code: 'SS', code3: 'SSD' },
|
|
595
|
+
{
|
|
596
|
+
name: 'South Georgia and the South Sandwich Islands',
|
|
597
|
+
dial: '+500',
|
|
598
|
+
code: 'GS',
|
|
599
|
+
code3: 'SGS',
|
|
600
|
+
},
|
|
601
|
+
{ name: 'Spain', dial: '+34', code: 'ES', code3: 'ESP' },
|
|
602
|
+
{ name: 'Sri Lanka', dial: '+94', code: 'LK', code3: 'LKA' },
|
|
603
|
+
{ name: 'Sudan', dial: '+249', code: 'SD', code3: 'SDN' },
|
|
604
|
+
{ name: 'Suriname', dial: '+597', code: 'SR', code3: 'SUR' },
|
|
605
|
+
{ name: 'Svalbard and Jan Mayen', dial: '+47', code: 'SJ', code3: 'SJM' },
|
|
606
|
+
{ name: 'Sweden', dial: '+46', code: 'SE', code3: 'SWE' },
|
|
607
|
+
{ name: 'Switzerland', dial: '+41', code: 'CH', code3: 'CHE' },
|
|
608
|
+
{ name: 'Syrian Arab Republic', dial: '+963', code: 'SY', code3: 'SYR' },
|
|
609
|
+
{ name: 'Taiwan', dial: '+886', code: 'TW', code3: 'TWN' },
|
|
610
|
+
{ name: 'Tajikistan', dial: '+992', code: 'TJ', code3: 'TJK' },
|
|
611
|
+
{ name: 'Thailand', dial: '+66', code: 'TH', code3: 'THA' },
|
|
612
|
+
{ name: 'Timor-Leste', dial: '+670', code: 'TL', code3: 'TLS' },
|
|
613
|
+
{ name: 'Togo', dial: '+228', code: 'TG', code3: 'TGO' },
|
|
614
|
+
{ name: 'Tokelau', dial: '+690', code: 'TK', code3: 'TKL' },
|
|
615
|
+
{ name: 'Tonga', dial: '+676', code: 'TO', code3: 'TON' },
|
|
616
|
+
{ name: 'Trinidad and Tobago', dial: '+1868', code: 'TT', code3: 'TTO' },
|
|
617
|
+
{ name: 'Tunisia', dial: '+216', code: 'TN', code3: 'TUN' },
|
|
618
|
+
{ name: 'Turkey', dial: '+90', code: 'TR', code3: 'TUR' },
|
|
619
|
+
{ name: 'Turkmenistan', dial: '+993', code: 'TM', code3: 'TKM' },
|
|
620
|
+
{ name: 'Turks and Caicos Islands', dial: '+1649', code: 'TC', code3: 'TCA' },
|
|
621
|
+
{ name: 'Tuvalu', dial: '+688', code: 'TV', code3: 'TUV' },
|
|
622
|
+
{ name: 'Uganda', dial: '+256', code: 'UG', code3: 'UGA' },
|
|
623
|
+
{ name: 'Ukraine', dial: '+380', code: 'UA', code3: 'UKR' },
|
|
624
|
+
{ name: 'Uruguay', dial: '+598', code: 'UY', code3: 'URY' },
|
|
625
|
+
{ name: 'Uzbekistan', dial: '+998', code: 'UZ', code3: 'UZB' },
|
|
626
|
+
{ name: 'Vanuatu', dial: '+678', code: 'VU', code3: 'VUT' },
|
|
627
|
+
{ name: 'Vietnam', dial: '+84', code: 'VN', code3: 'VNM' },
|
|
628
|
+
{ name: 'Virgin Islands, British', dial: '+1284', code: 'VG', code3: 'VGB' },
|
|
629
|
+
{ name: 'Virgin Islands, U.S.', dial: '+1340', code: 'VI', code3: 'VIR' },
|
|
630
|
+
{ name: 'Wallis and Futuna', dial: '+681', code: 'WF', code3: 'WLF' },
|
|
631
|
+
{ name: 'Yemen', dial: '+967', code: 'YE', code3: 'YEM' },
|
|
632
|
+
{ name: 'Zambia', dial: '+260', code: 'ZM', code3: 'ZMB' },
|
|
633
|
+
{ name: 'Zimbabwe', dial: '+263', code: 'ZW', code3: 'ZWE' },
|
|
634
|
+
{
|
|
635
|
+
name: 'Korea, Republic of South Korea',
|
|
636
|
+
dial: '+82',
|
|
637
|
+
code: 'KR',
|
|
638
|
+
code3: 'KOR',
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
name: 'AmericanSamoa',
|
|
642
|
+
dial: '+1684',
|
|
643
|
+
code: 'AS',
|
|
644
|
+
code3: 'ASM',
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
name: "Korea, Democratic People's Republic of Korea",
|
|
648
|
+
dial: '+850',
|
|
649
|
+
code: 'KP',
|
|
650
|
+
code3: 'PRK',
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
name: 'Venezuela, Bolivarian Republic of Venezuela',
|
|
654
|
+
dial: '+58',
|
|
655
|
+
code: 'VE',
|
|
656
|
+
code3: 'VEN',
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
name: 'Virgin Islands, British',
|
|
660
|
+
dial: '+1284',
|
|
661
|
+
code: 'VG',
|
|
662
|
+
code3: 'VGB',
|
|
663
|
+
},
|
|
664
|
+
];
|