ordering-ui-external 1.2.3 → 1.3.1
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/_bundles/{0.ordering-ui.fc62fe574704c7c4d033.js → 0.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
- package/_bundles/{1.ordering-ui.fc62fe574704c7c4d033.js → 1.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
- package/_bundles/{3.ordering-ui.fc62fe574704c7c4d033.js → 3.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
- package/_bundles/{4.ordering-ui.fc62fe574704c7c4d033.js → 4.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
- package/_bundles/5.ordering-ui.51c00e5a30bb4c51b2e4.js +1 -0
- package/_bundles/{6.ordering-ui.fc62fe574704c7c4d033.js → 6.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
- package/_bundles/7.ordering-ui.51c00e5a30bb4c51b2e4.js +2 -0
- package/_bundles/{7.ordering-ui.fc62fe574704c7c4d033.js.LICENSE.txt → 7.ordering-ui.51c00e5a30bb4c51b2e4.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.fc62fe574704c7c4d033.js → 8.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
- package/_bundles/{9.ordering-ui.fc62fe574704c7c4d033.js → 9.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
- package/_bundles/ordering-ui.51c00e5a30bb4c51b2e4.js +2 -0
- package/_bundles/{ordering-ui.fc62fe574704c7c4d033.js.LICENSE.txt → ordering-ui.51c00e5a30bb4c51b2e4.js.LICENSE.txt} +0 -0
- package/_modules/components/AutoScroll/styles.js +3 -3
- package/_modules/hooks/useIsMounted.js +24 -0
- package/_modules/index.js +8 -0
- package/_modules/themes/five/index.js +33 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +2 -2
- package/_modules/themes/five/src/components/BusinessController/styles.js +42 -42
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +12 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +5 -2
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +10 -3
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +7 -3
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -0
- package/_modules/themes/five/src/components/Checkout/index.js +1 -1
- package/_modules/themes/five/src/components/MultiCheckout/styles.js +1 -1
- package/_modules/themes/five/src/components/MyOrders/index.js +9 -3
- package/_modules/themes/five/src/components/NavigationBar/index.js +159 -0
- package/_modules/themes/five/src/components/NavigationBar/styles.js +33 -0
- package/_modules/themes/five/src/components/OrderDetails/index.js +71 -41
- package/_modules/themes/five/src/components/ProfessionalBusinessFilter/index.js +96 -0
- package/_modules/themes/five/src/components/ProfessionalBusinessFilter/styles.js +48 -0
- package/_modules/themes/five/src/components/ProfessionalFilter/index.js +35 -7
- package/_modules/themes/five/src/components/ProfessionalFilter/styles.js +10 -4
- package/_modules/themes/five/src/components/ProfessionalInfo/index.js +120 -0
- package/_modules/themes/five/src/components/ProfessionalInfo/styles.js +100 -0
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +36 -13
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +21 -18
- package/_modules/themes/five/src/components/ReviewProfessional/index.js +314 -0
- package/_modules/themes/five/src/components/ReviewProfessional/styles.js +137 -0
- package/_modules/themes/five/src/components/SignUpApproval/index.js +106 -0
- package/_modules/themes/five/src/components/SignUpApproval/styles.js +71 -0
- package/_modules/themes/five/src/components/SignUpBusiness/index.js +7 -383
- package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +405 -0
- package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/styles.js +110 -0
- package/_modules/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +400 -0
- package/_modules/themes/five/src/components/SignUpBusiness/{styles.js → layouts/OldSignUpBusiness/styles.js} +0 -0
- package/_modules/themes/five/src/components/SignUpDriver/index.js +7 -383
- package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +405 -0
- package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/styles.js +106 -0
- package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +400 -0
- package/_modules/themes/five/src/components/SignUpDriver/{styles.js → layouts/OldSignUpDriver/styles.js} +0 -0
- package/_modules/themes/five/src/components/SingleProductCard/styles.js +1 -1
- package/_modules/utils/index.js +103 -0
- package/package.json +2 -2
- package/src/components/AutoScroll/styles.js +11 -12
- package/src/hooks/useIsMounted.js +18 -0
- package/src/index.js +2 -0
- package/src/themes/five/index.js +9 -1
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +1 -1
- package/src/themes/five/src/components/BusinessController/styles.js +3 -6
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +10 -2
- package/src/themes/five/src/components/BusinessProductsCategories/styles.js +5 -0
- package/src/themes/five/src/components/BusinessProductsListing/index.js +8 -2
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -0
- package/src/themes/five/src/components/Checkout/index.js +1 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +1 -0
- package/src/themes/five/src/components/MultiCheckout/styles.js +1 -0
- package/src/themes/five/src/components/MyOrders/index.js +6 -3
- package/src/themes/five/src/components/NavigationBar/index.js +104 -0
- package/src/themes/five/src/components/NavigationBar/styles.js +44 -0
- package/src/themes/five/src/components/OrderDetails/index.js +19 -11
- package/src/themes/five/src/components/ProfessionalBusinessFilter/index.js +82 -0
- package/src/themes/five/src/components/ProfessionalBusinessFilter/styles.js +71 -0
- package/src/themes/five/src/components/ProfessionalFilter/index.js +30 -7
- package/src/themes/five/src/components/ProfessionalFilter/styles.js +15 -2
- package/src/themes/five/src/components/ProfessionalInfo/index.js +133 -0
- package/src/themes/five/src/components/ProfessionalInfo/styles.js +140 -0
- package/src/themes/five/src/components/RenderProductsLayout/index.js +37 -16
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +6 -1
- package/src/themes/five/src/components/ReviewProfessional/index.js +239 -0
- package/src/themes/five/src/components/ReviewProfessional/styles.js +233 -0
- package/src/themes/five/src/components/SignUpApproval/index.js +108 -0
- package/src/themes/five/src/components/SignUpApproval/styles.js +98 -0
- package/src/themes/five/src/components/SignUpBusiness/index.js +10 -374
- package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +382 -0
- package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/styles.js +256 -0
- package/src/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +378 -0
- package/src/themes/five/src/components/SignUpBusiness/{styles.js → layouts/OldSignUpBusiness/styles.js} +0 -0
- package/src/themes/five/src/components/SignUpDriver/index.js +10 -374
- package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +382 -0
- package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/styles.js +262 -0
- package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +378 -0
- package/src/themes/five/src/components/SignUpDriver/{styles.js → layouts/OldSignUpDriver/styles.js} +0 -0
- package/src/themes/five/src/components/SingleProductCard/styles.js +3 -1
- package/src/utils/index.js +54 -0
- package/_bundles/5.ordering-ui.fc62fe574704c7c4d033.js +0 -1
- package/_bundles/7.ordering-ui.fc62fe574704c7c4d033.js +0 -2
- package/_bundles/ordering-ui.fc62fe574704c7c4d033.js +0 -2
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react'
|
|
2
|
+
import { useForm } from 'react-hook-form'
|
|
3
|
+
import Skeleton from 'react-loading-skeleton'
|
|
4
|
+
import { Alert } from '../../../Confirm'
|
|
5
|
+
import { InputPhoneNumber } from '../../../../../../../components/InputPhoneNumber'
|
|
6
|
+
import parsePhoneNumber from 'libphonenumber-js'
|
|
7
|
+
import { useTheme } from 'styled-components'
|
|
8
|
+
import { Input } from '../../../../styles/Inputs'
|
|
9
|
+
import { Button } from '../../../../styles/Buttons'
|
|
10
|
+
import { Checkbox } from '../../../../../../../styles/Checkbox'
|
|
11
|
+
import { sortInputFields } from '../../../../../../../utils'
|
|
12
|
+
|
|
13
|
+
import AiOutlineEye from '@meronex/icons/ai/AiOutlineEye'
|
|
14
|
+
import AiOutlineEyeInvisible from '@meronex/icons/ai/AiOutlineEyeInvisible'
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
SignupForm as SignUpController,
|
|
18
|
+
useLanguage,
|
|
19
|
+
useConfig,
|
|
20
|
+
ReCaptcha
|
|
21
|
+
} from 'ordering-components-external'
|
|
22
|
+
|
|
23
|
+
import {
|
|
24
|
+
SignUpDriverContainer,
|
|
25
|
+
SignUpHeroWrapper,
|
|
26
|
+
SignUpHero,
|
|
27
|
+
FormInput,
|
|
28
|
+
WrapperPassword,
|
|
29
|
+
TogglePassword,
|
|
30
|
+
ReCaptchaWrapper,
|
|
31
|
+
TermsConditionWrapper,
|
|
32
|
+
SkeletonWrapper,
|
|
33
|
+
FormSide,
|
|
34
|
+
PhoneNumberWrapper
|
|
35
|
+
} from './styles'
|
|
36
|
+
|
|
37
|
+
const notValidationFields = ['coupon', 'driver_tip', 'mobile_phone', 'address', 'address_notes']
|
|
38
|
+
|
|
39
|
+
const SignUpDriverUI = (props) => {
|
|
40
|
+
const {
|
|
41
|
+
handleChangeInput,
|
|
42
|
+
handleButtonSignupClick,
|
|
43
|
+
handleReCaptcha,
|
|
44
|
+
useChekoutFileds,
|
|
45
|
+
validationFields,
|
|
46
|
+
showField,
|
|
47
|
+
isRequiredField,
|
|
48
|
+
formState,
|
|
49
|
+
handleSuccessSignup,
|
|
50
|
+
isPopup,
|
|
51
|
+
externalPhoneNumber,
|
|
52
|
+
saveCustomerUser,
|
|
53
|
+
fieldsNotValid,
|
|
54
|
+
signupData,
|
|
55
|
+
enableReCaptcha
|
|
56
|
+
} = props
|
|
57
|
+
|
|
58
|
+
const theme = useTheme()
|
|
59
|
+
const [, t] = useLanguage()
|
|
60
|
+
const [{ configs }] = useConfig()
|
|
61
|
+
const formMethods = useForm()
|
|
62
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
63
|
+
const emailInput = useRef(null)
|
|
64
|
+
|
|
65
|
+
const [userPhoneNumber, setUserPhoneNumber] = useState('')
|
|
66
|
+
const [isValidPhoneNumber, setIsValidPhoneNumber] = useState(null)
|
|
67
|
+
const [passwordSee, setPasswordSee] = useState(false)
|
|
68
|
+
|
|
69
|
+
const showInputPhoneNumber = (validationFields?.fields?.checkout?.cellphone?.enabled ?? false) || configs?.verification_phone_required?.value === '1'
|
|
70
|
+
|
|
71
|
+
const togglePasswordView = () => {
|
|
72
|
+
setPasswordSee(!passwordSee)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const closeAlert = () => {
|
|
76
|
+
setAlertState({
|
|
77
|
+
open: false,
|
|
78
|
+
content: []
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const onSubmit = () => {
|
|
83
|
+
const isPhoneNumberValid = userPhoneNumber ? isValidPhoneNumber : true
|
|
84
|
+
if (!userPhoneNumber &&
|
|
85
|
+
((validationFields?.fields?.checkout?.cellphone?.enabled &&
|
|
86
|
+
validationFields?.fields?.checkout?.cellphone?.required) ||
|
|
87
|
+
configs?.verification_phone_required?.value === '1')
|
|
88
|
+
) {
|
|
89
|
+
setAlertState({
|
|
90
|
+
open: true,
|
|
91
|
+
content: [t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Mobile phone is required.')]
|
|
92
|
+
})
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
if (!isPhoneNumberValid) {
|
|
96
|
+
setAlertState({
|
|
97
|
+
open: true,
|
|
98
|
+
content: [t('INVALID_ERROR_PHONE_NUMBER', 'The Phone Number field is invalid')]
|
|
99
|
+
})
|
|
100
|
+
return
|
|
101
|
+
}
|
|
102
|
+
handleButtonSignupClick && handleButtonSignupClick()
|
|
103
|
+
if (!formState.loading && formState.result.result && !formState.result.error) {
|
|
104
|
+
handleSuccessSignup(formState.result.result)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const handleChangePhoneNumber = (number, isValid) => {
|
|
109
|
+
setUserPhoneNumber(number)
|
|
110
|
+
|
|
111
|
+
let phoneNumberParser = null
|
|
112
|
+
let phoneNumber = {
|
|
113
|
+
country_phone_code: {
|
|
114
|
+
name: 'country_phone_code',
|
|
115
|
+
value: ''
|
|
116
|
+
},
|
|
117
|
+
cellphone: {
|
|
118
|
+
name: 'cellphone',
|
|
119
|
+
value: ''
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (isValid) {
|
|
123
|
+
phoneNumberParser = parsePhoneNumber(number)
|
|
124
|
+
}
|
|
125
|
+
if (phoneNumberParser) {
|
|
126
|
+
phoneNumber = {
|
|
127
|
+
country_phone_code: {
|
|
128
|
+
name: 'country_phone_code',
|
|
129
|
+
value: phoneNumberParser.countryCallingCode
|
|
130
|
+
},
|
|
131
|
+
cellphone: {
|
|
132
|
+
name: 'cellphone',
|
|
133
|
+
value: phoneNumberParser.nationalNumber
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
handleChangeInput(phoneNumber, true)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const handleChangeInputEmail = (e) => {
|
|
141
|
+
handleChangeInput({ target: { name: 'email', value: e.target.value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, '') } })
|
|
142
|
+
formMethods.setValue('email', e.target.value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''))
|
|
143
|
+
if (emailInput?.current) {
|
|
144
|
+
emailInput.current.value = e.target.value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, '')
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
useEffect(() => {
|
|
149
|
+
if (!formState.loading && formState.result?.error) {
|
|
150
|
+
setAlertState({
|
|
151
|
+
open: true,
|
|
152
|
+
content: formState.result?.result || [t('ERROR', 'Error')]
|
|
153
|
+
})
|
|
154
|
+
} else if (!formState.loading && !formState.result?.error && formState.result?.result) {
|
|
155
|
+
saveCustomerUser && saveCustomerUser(formState.result?.result)
|
|
156
|
+
}
|
|
157
|
+
}, [formState])
|
|
158
|
+
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
if (Object.keys(formMethods.errors).length > 0) {
|
|
161
|
+
setAlertState({
|
|
162
|
+
open: true,
|
|
163
|
+
content: Object.values(formMethods.errors).map(error => error.message)
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
}, [formMethods.errors])
|
|
167
|
+
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
if (!validationFields.loading) {
|
|
170
|
+
Object.values(validationFields?.fields?.checkout).map(field => !notValidationFields.includes(field.code) && (
|
|
171
|
+
field.code === 'email' ? (
|
|
172
|
+
formMethods.register('email', {
|
|
173
|
+
required: isRequiredField(field.code)
|
|
174
|
+
? t('VALIDATION_ERROR_EMAIL_REQUIRED', 'The field Email is required').replace('_attribute_', t('EMAIL', 'Email'))
|
|
175
|
+
: null,
|
|
176
|
+
pattern: {
|
|
177
|
+
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
|
|
178
|
+
message: t('INVALID_ERROR_EMAIL', 'Invalid email address').replace('_attribute_', t('EMAIL', 'Email'))
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
) : (
|
|
182
|
+
formMethods.register(field.code, {
|
|
183
|
+
required: isRequiredField(field.code)
|
|
184
|
+
? t(`VALIDATION_ERROR_${field.code.toUpperCase()}_REQUIRED`, `${field.name} is required`).replace('_attribute_', t(field.name, field.code))
|
|
185
|
+
: null
|
|
186
|
+
})
|
|
187
|
+
)
|
|
188
|
+
))
|
|
189
|
+
}
|
|
190
|
+
}, [formMethods])
|
|
191
|
+
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
Object.keys(signupData).map(fieldName => {
|
|
194
|
+
formMethods.setValue(fieldName, signupData[fieldName])
|
|
195
|
+
})
|
|
196
|
+
}, [signupData])
|
|
197
|
+
|
|
198
|
+
useEffect(() => {
|
|
199
|
+
if (externalPhoneNumber) {
|
|
200
|
+
setUserPhoneNumber(externalPhoneNumber)
|
|
201
|
+
handleChangePhoneNumber(externalPhoneNumber, true)
|
|
202
|
+
}
|
|
203
|
+
}, [externalPhoneNumber])
|
|
204
|
+
|
|
205
|
+
useEffect(() => {
|
|
206
|
+
handleChangeInput({
|
|
207
|
+
target: {
|
|
208
|
+
name: 'level',
|
|
209
|
+
value: 4
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
}, [])
|
|
213
|
+
|
|
214
|
+
return (
|
|
215
|
+
<SignUpDriverContainer>
|
|
216
|
+
<SignUpHeroWrapper>
|
|
217
|
+
<SignUpHero bgimage={theme.images?.general?.driverSignUpHero} />
|
|
218
|
+
</SignUpHeroWrapper>
|
|
219
|
+
<FormSide>
|
|
220
|
+
<h1>{t('TITLE_DRIVER_SIGNUP', 'Get Started')}</h1>
|
|
221
|
+
<FormInput
|
|
222
|
+
noValidate
|
|
223
|
+
isPopup={isPopup}
|
|
224
|
+
onSubmit={formMethods.handleSubmit(onSubmit)}
|
|
225
|
+
isSkeleton={useChekoutFileds && validationFields?.loading}
|
|
226
|
+
>
|
|
227
|
+
{props.beforeMidElements?.map((BeforeMidElements, i) => (
|
|
228
|
+
<React.Fragment key={i}>
|
|
229
|
+
{BeforeMidElements}
|
|
230
|
+
</React.Fragment>))}
|
|
231
|
+
{props.beforeMidComponents?.map((BeforeMidComponents, i) => (
|
|
232
|
+
<BeforeMidComponents key={i} {...props} />))}
|
|
233
|
+
{
|
|
234
|
+
!(useChekoutFileds && validationFields?.loading) ? (
|
|
235
|
+
<>
|
|
236
|
+
{validationFields?.fields?.checkout &&
|
|
237
|
+
sortInputFields({ values: validationFields?.fields?.checkout }).map(field =>
|
|
238
|
+
showField && showField(field.code) && (
|
|
239
|
+
<React.Fragment key={field.id}>
|
|
240
|
+
{field.code === 'email' ? (
|
|
241
|
+
<Input
|
|
242
|
+
type={field.type}
|
|
243
|
+
name={field.code}
|
|
244
|
+
aria-label={field.code}
|
|
245
|
+
className='form'
|
|
246
|
+
placeholder={t(field.code.toUpperCase(), field.name)}
|
|
247
|
+
onChange={handleChangeInputEmail}
|
|
248
|
+
ref={(e) => {
|
|
249
|
+
emailInput.current = e
|
|
250
|
+
}}
|
|
251
|
+
required={!!field.required}
|
|
252
|
+
autoComplete='off'
|
|
253
|
+
/>
|
|
254
|
+
) : (
|
|
255
|
+
<Input
|
|
256
|
+
type={field.type}
|
|
257
|
+
name={field.code}
|
|
258
|
+
aria-label={field.code}
|
|
259
|
+
className='form'
|
|
260
|
+
placeholder={t(field.code.toUpperCase(), field.name)}
|
|
261
|
+
onChange={handleChangeInput}
|
|
262
|
+
required={field.required}
|
|
263
|
+
autoComplete='off'
|
|
264
|
+
/>
|
|
265
|
+
)}
|
|
266
|
+
</React.Fragment>
|
|
267
|
+
)
|
|
268
|
+
)}
|
|
269
|
+
{!!showInputPhoneNumber && (
|
|
270
|
+
<PhoneNumberWrapper>
|
|
271
|
+
<InputPhoneNumber
|
|
272
|
+
value={userPhoneNumber}
|
|
273
|
+
setValue={handleChangePhoneNumber}
|
|
274
|
+
handleIsValid={setIsValidPhoneNumber}
|
|
275
|
+
/>
|
|
276
|
+
</PhoneNumberWrapper>
|
|
277
|
+
)}
|
|
278
|
+
|
|
279
|
+
{(!fieldsNotValid || (fieldsNotValid && !fieldsNotValid.includes('password'))) && (
|
|
280
|
+
<WrapperPassword>
|
|
281
|
+
<Input
|
|
282
|
+
type={!passwordSee ? 'password' : 'text'}
|
|
283
|
+
name='password'
|
|
284
|
+
aria-label='password'
|
|
285
|
+
className='form'
|
|
286
|
+
placeholder={t('PASSWORD', 'Password')}
|
|
287
|
+
onChange={handleChangeInput}
|
|
288
|
+
required
|
|
289
|
+
ref={formMethods.register({
|
|
290
|
+
required: isRequiredField('password') ? t('VALIDATION_ERROR_PASSWORD_REQUIRED', 'The field Password is required').replace('_attribute_', t('PASSWORD', 'password')) : null,
|
|
291
|
+
minLength: {
|
|
292
|
+
value: 8,
|
|
293
|
+
message: t('VALIDATION_ERROR_PASSWORD_MIN_STRING', 'The Password must be at least 8 characters.').replace('_attribute_', t('PASSWORD', 'Password')).replace('_min_', 8)
|
|
294
|
+
}
|
|
295
|
+
})}
|
|
296
|
+
/>
|
|
297
|
+
<TogglePassword onClick={togglePasswordView}>
|
|
298
|
+
{!passwordSee ? <AiOutlineEye /> : <AiOutlineEyeInvisible />}
|
|
299
|
+
</TogglePassword>
|
|
300
|
+
</WrapperPassword>
|
|
301
|
+
)}
|
|
302
|
+
|
|
303
|
+
{props.afterMidElements?.map((MidElement, i) => (
|
|
304
|
+
<React.Fragment key={i}>
|
|
305
|
+
{MidElement}
|
|
306
|
+
</React.Fragment>))}
|
|
307
|
+
{props.afterMidComponents?.map((MidComponent, i) => (
|
|
308
|
+
<MidComponent key={i} {...props} />))}
|
|
309
|
+
</>
|
|
310
|
+
) : (
|
|
311
|
+
<>
|
|
312
|
+
{[...Array(5)].map((_, i) => (
|
|
313
|
+
<SkeletonWrapper key={i}>
|
|
314
|
+
<Skeleton height={43} />
|
|
315
|
+
</SkeletonWrapper>
|
|
316
|
+
))}
|
|
317
|
+
</>
|
|
318
|
+
)
|
|
319
|
+
}
|
|
320
|
+
{props.isRecaptchaEnable && enableReCaptcha && (
|
|
321
|
+
<ReCaptchaWrapper>
|
|
322
|
+
<ReCaptcha handleReCaptcha={handleReCaptcha} />
|
|
323
|
+
</ReCaptchaWrapper>
|
|
324
|
+
)}
|
|
325
|
+
|
|
326
|
+
{configs?.terms_and_conditions?.value === 'true' && (
|
|
327
|
+
<TermsConditionWrapper>
|
|
328
|
+
<Checkbox
|
|
329
|
+
name='acceptTerms'
|
|
330
|
+
ref={formMethods.register({
|
|
331
|
+
required: t('ERROR_ACCEPT_TERMS', 'You must accept the Terms & Conditions.')
|
|
332
|
+
})}
|
|
333
|
+
id='acceptTerms'
|
|
334
|
+
/>
|
|
335
|
+
<label
|
|
336
|
+
htmlFor='acceptTerms'
|
|
337
|
+
>
|
|
338
|
+
<span>{t('TERMS_AND_CONDITIONS_TEXT', 'I’m agree with')}</span>
|
|
339
|
+
<a
|
|
340
|
+
href={configs?.terms_and_conditions_url?.value}
|
|
341
|
+
target='_blank'
|
|
342
|
+
rel='noopener noreferrer'
|
|
343
|
+
>
|
|
344
|
+
{t('TERMS_AND_CONDITIONS', 'Terms & Conditions')}
|
|
345
|
+
</a>
|
|
346
|
+
</label>
|
|
347
|
+
</TermsConditionWrapper>
|
|
348
|
+
)}
|
|
349
|
+
|
|
350
|
+
<Button
|
|
351
|
+
color='primary'
|
|
352
|
+
type='submit'
|
|
353
|
+
disabled={formState.loading || validationFields?.loading}
|
|
354
|
+
>
|
|
355
|
+
{formState.loading ? `${t('LOADING', 'Loading')}...` : t('SUBMIT', 'Submit')}
|
|
356
|
+
</Button>
|
|
357
|
+
</FormInput>
|
|
358
|
+
</FormSide>
|
|
359
|
+
<Alert
|
|
360
|
+
title={t('SIGN_UP_FOR_BUSINESS', 'Sign up for business')}
|
|
361
|
+
content={alertState.content}
|
|
362
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
363
|
+
open={alertState.open}
|
|
364
|
+
onClose={() => closeAlert()}
|
|
365
|
+
onAccept={() => closeAlert()}
|
|
366
|
+
closeOnBackdrop={false}
|
|
367
|
+
/>
|
|
368
|
+
</SignUpDriverContainer>
|
|
369
|
+
)
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export const SignUpDriver = (props) => {
|
|
373
|
+
const signUpDriverProps = {
|
|
374
|
+
...props,
|
|
375
|
+
UIComponent: SignUpDriverUI
|
|
376
|
+
}
|
|
377
|
+
return <SignUpController {...signUpDriverProps} />
|
|
378
|
+
}
|
package/src/themes/five/src/components/SignUpDriver/{styles.js → layouts/OldSignUpDriver/styles.js}
RENAMED
|
File without changes
|
|
@@ -203,11 +203,13 @@ export const RibbonBox = styled.div`
|
|
|
203
203
|
top: -4px;
|
|
204
204
|
right: -3px;
|
|
205
205
|
background-color: ${props => props.theme.colors.primary};
|
|
206
|
-
max-width: 50px;
|
|
207
206
|
display: -webkit-box;
|
|
208
207
|
-webkit-box-orient: vertical;
|
|
209
208
|
-webkit-line-clamp: 2;
|
|
210
209
|
overflow: hidden;
|
|
210
|
+
max-width: 70px;
|
|
211
|
+
word-break: break-all;
|
|
212
|
+
|
|
211
213
|
${props => props.theme.rtl && css`
|
|
212
214
|
left: -3px;
|
|
213
215
|
right: initial;
|
package/src/utils/index.js
CHANGED
|
@@ -447,6 +447,60 @@ export const reviewCommentList = (type) => {
|
|
|
447
447
|
]
|
|
448
448
|
}
|
|
449
449
|
},
|
|
450
|
+
professional: {
|
|
451
|
+
1: {
|
|
452
|
+
title: t('PROFESSIONAL_QUICK_COMMENT_TITLE_1', 'What went wrong?'),
|
|
453
|
+
list: [
|
|
454
|
+
{ key: 0, content: t('PROFESSIONAL_QUICK_COMMENT_1_0', 'Not handled with care') },
|
|
455
|
+
{ key: 1, content: t('PROFESSIONAL_QUICK_COMMENT_1_1', 'Poor communication') },
|
|
456
|
+
{ key: 2, content: t('PROFESSIONAL_QUICK_COMMENT_1_2', 'COVID-19 issue') },
|
|
457
|
+
{ key: 3, content: t('PROFESSIONAL_QUICK_COMMENT_1_3', 'Didn\'t follow instructions') },
|
|
458
|
+
{ key: 4, content: t('PROFESSIONAL_QUICK_COMMENT_1_4', 'Rude') },
|
|
459
|
+
{ key: 5, content: t('PROFESSIONAL_QUICK_COMMENT_1_5', 'Not on-time') }
|
|
460
|
+
]
|
|
461
|
+
},
|
|
462
|
+
2: {
|
|
463
|
+
title: t('PROFESSIONAL_QUICK_COMMENT_TITLE_2', 'What went wrong?'),
|
|
464
|
+
list: [
|
|
465
|
+
{ key: 0, content: t('PROFESSIONAL_QUICK_COMMENT_2_0', 'Not handled with care') },
|
|
466
|
+
{ key: 1, content: t('PROFESSIONAL_QUICK_COMMENT_2_1', 'Poor communication') },
|
|
467
|
+
{ key: 2, content: t('PROFESSIONAL_QUICK_COMMENT_2_2', 'COVID-19 issue') },
|
|
468
|
+
{ key: 3, content: t('PROFESSIONAL_QUICK_COMMENT_2_3', 'Didn\'t follow instructions') },
|
|
469
|
+
{ key: 4, content: t('PROFESSIONAL_QUICK_COMMENT_2_4', 'Rude') },
|
|
470
|
+
{ key: 5, content: t('PROFESSIONAL_QUICK_COMMENT_2_5', 'Not on-time') }
|
|
471
|
+
]
|
|
472
|
+
},
|
|
473
|
+
3: {
|
|
474
|
+
title: t('PROFESSIONAL_QUICK_COMMENT_TITLE_3', 'What could have been better?'),
|
|
475
|
+
list: [
|
|
476
|
+
{ key: 0, content: t('PROFESSIONAL_QUICK_COMMENT_3_0', 'Not handled with care') },
|
|
477
|
+
{ key: 1, content: t('PROFESSIONAL_QUICK_COMMENT_3_1', 'Poor communication') },
|
|
478
|
+
{ key: 2, content: t('PROFESSIONAL_QUICK_COMMENT_3_2', 'COVID-19 issue') },
|
|
479
|
+
{ key: 3, content: t('PROFESSIONAL_QUICK_COMMENT_3_3', 'Didn\'t follow instructions') },
|
|
480
|
+
{ key: 4, content: t('PROFESSIONAL_QUICK_COMMENT_3_4', 'Rude') },
|
|
481
|
+
{ key: 5, content: t('PROFESSIONAL_QUICK_COMMENT_3_5', 'Not on-time') }
|
|
482
|
+
]
|
|
483
|
+
},
|
|
484
|
+
4: {
|
|
485
|
+
title: t('PROFESSIONAL_QUICK_COMMENT_TITLE_4', ' Tell us more'),
|
|
486
|
+
list: [
|
|
487
|
+
{ key: 0, content: t('PROFESSIONAL_QUICK_COMMENT_4_0', 'Not handled with care') },
|
|
488
|
+
{ key: 1, content: t('PROFESSIONAL_QUICK_COMMENT_4_1', 'Poor communication') },
|
|
489
|
+
{ key: 2, content: t('PROFESSIONAL_QUICK_COMMENT_4_2', 'COVID-19 issue') },
|
|
490
|
+
{ key: 3, content: t('PROFESSIONAL_QUICK_COMMENT_4_3', 'Didn\'t follow instructions') },
|
|
491
|
+
{ key: 4, content: t('PROFESSIONAL_QUICK_COMMENT_4_4', 'Rude') },
|
|
492
|
+
{ key: 5, content: t('PROFESSIONAL_QUICK_COMMENT_4_5', 'Not on-time') }
|
|
493
|
+
]
|
|
494
|
+
},
|
|
495
|
+
5: {
|
|
496
|
+
title: t('PROFESSIONAL_QUICK_COMMENT_TITLE_5', 'What went well?'),
|
|
497
|
+
list: [
|
|
498
|
+
{ key: 0, content: t('PROFESSIONAL_QUICK_COMMENT_5_0', 'Perfect service') },
|
|
499
|
+
{ key: 1, content: t('PROFESSIONAL_QUICK_COMMENT_5_1', 'Excellent communication') },
|
|
500
|
+
{ key: 2, content: t('PROFESSIONAL_QUICK_COMMENT_5_2', 'Cordial service') }
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
},
|
|
450
504
|
product: {
|
|
451
505
|
like: [
|
|
452
506
|
{ key: 0, content: t('QUICK_COMMENT_LIKE_0', 'Tasty') },
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonpOrderingUI=window.webpackJsonpOrderingUI||[]).push([[5],{680:function(e,t,n){"use strict";n.r(t),n.d(t,"remoteMiddlewares",(function(){return o}));var r=n(3),c=n(96),i=n(100),a=n(81);function o(e,t,n){var o;return Object(r.b)(this,void 0,void 0,(function(){var s,u,d,l,b=this;return Object(r.d)(this,(function(w){switch(w.label){case 0:return Object(c.b)()?[2,[]]:(s=Object(a.b)(),u=null!==(o=t.enabledMiddleware)&&void 0!==o?o:{},d=Object.entries(u).filter((function(e){e[0];return e[1]})).map((function(e){return e[0]})),l=d.map((function(t){return Object(r.b)(b,void 0,void 0,(function(){var c,a,o,u;return Object(r.d)(this,(function(r){switch(r.label){case 0:c=t.replace("@segment/",""),a=c,n&&(a=btoa(c).replace(/=/g,"")),o="".concat(s,"/middleware/").concat(a,"/latest/").concat(a,".js.gz"),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Object(i.a)(o)];case 2:return r.sent(),[2,window["".concat(c,"Middleware")]];case 3:return u=r.sent(),e.log("error",u),e.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}}))}))})),[4,Promise.all(l)]);case 1:return[2,w.sent().filter(Boolean)]}}))}))}}}]);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 7.ordering-ui.fc62fe574704c7c4d033.js.LICENSE.txt */
|
|
2
|
-
(window.webpackJsonpOrderingUI=window.webpackJsonpOrderingUI||[]).push([[7,3],{583:function(t,e,n){"use strict";var r,i=n(619),o=n(623),s=n(624);r=i()?s:o,t.exports=r},584:function(t,e,n){"use strict";function r(t,e){var n,r;return"boolean"==typeof(null==e?void 0:e.enabled)?e.enabled:null===(r=null===(n=null==t?void 0:t.__default)||void 0===n?void 0:n.enabled)||void 0===r||r}n.d(e,"a",(function(){return r}))},585:function(t,e,n){t.exports=function(t,e,n,r,i){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)t=t?t[e[r]]:i;return t===i?n:t}},586:function(t,e,n){"use strict";var r,i=n(615),o=n(630),s=n(631);r=i()?o:s,t.exports=r},587:function(t,e,n){"use strict";var r,i=n(632),o=n(637),s=n(638);r=i()?o:s,t.exports=r},588:function(t,e,n){"use strict";var r=n(640);t.exports=r},589:function(t,e,n){"use strict";n.r(e),n.d(e,"applyDestinationMiddleware",(function(){return u})),n.d(e,"sourceMiddlewarePlugin",(function(){return c}));var r=n(3),i=n(19),o=n(89),s=n(167);function u(t,e,n){return Object(r.b)(this,void 0,void 0,(function(){function i(e,n){return Object(r.b)(this,void 0,void 0,(function(){var i,u,c;return Object(r.d)(this,(function(a){switch(a.label){case 0:return i=!1,u=null,[4,Object(o.a)(n({payload:Object(s.a)(e,{clone:!0,traverse:!1}),integration:t,next:function(t){i=!0,null===t&&(u=null),t&&(u=t.obj)}}))];case 1:return a.sent(),i||null===u||(u.integrations=Object(r.a)(Object(r.a)({},e.integrations),((c={})[t]=!1,c))),[2,u]}}))}))}var u,c,a,f;return Object(r.d)(this,(function(t){switch(t.label){case 0:u=0,c=n,t.label=1;case 1:return u<c.length?(a=c[u],[4,i(e,a)]):[3,4];case 2:if(null===(f=t.sent()))return[2,null];e=f,t.label=3;case 3:return u++,[3,1];case 4:return[2,e]}}))}))}function c(t,e){function n(n){return Object(r.b)(this,void 0,void 0,(function(){var u;return Object(r.d)(this,(function(r){switch(r.label){case 0:return u=!1,[4,Object(o.a)(t({payload:Object(s.a)(n.event,{clone:!0,traverse:!1}),integrations:null!=e?e:{},next:function(t){u=!0,t&&(n.event=t.obj)}}))];case 1:if(r.sent(),!u)throw new i.b({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,n]}}))}))}return{name:"Source Middleware ".concat(t.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(t){return Promise.resolve(t)},track:n,page:n,identify:n,alias:n,group:n}}},590:function(t,e,n){"use strict";var r=Number.POSITIVE_INFINITY;t.exports=r},591:function(t,e,n){"use strict";var r=n(604).NEGATIVE_INFINITY;t.exports=r},592:function(t,e,n){"use strict";t.exports=1023},593:function(t,e,n){"use strict";var r=n(609);t.exports=r},594:function(t,e,n){"use strict";var r=n(610);t.exports=r},595:function(t,e,n){"use strict";var r=n(613);t.exports=r},596:function(t,e,n){"use strict";var r=Object.prototype.toString;t.exports=r},597:function(t,e,n){"use strict";var r=n(660);t.exports=r},598:function(t,e,n){"use strict";var r=n(662);t.exports=r},599:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.matches=e.transform=void 0;var i=n(600);Object.defineProperty(e,"transform",{enumerable:!0,get:function(){return r(i).default}});var o=n(674);Object.defineProperty(e,"matches",{enumerable:!0,get:function(){return r(o).default}});var s=n(675);Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return r(s).default}})},600:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(601)),o=r(n(585)),s=r(n(602)),u=n(83),c=n(673);function a(t,e){for(var n in e.drop)if(e.drop.hasOwnProperty(n)){var r=""===n?t:(0,o.default)(t,n);if("object"==typeof r&&null!==r)for(var i=0,s=e.drop[n];i<s.length;i++){delete r[s[i]]}}}function f(t,e){for(var n in e.allow)if(e.allow.hasOwnProperty(n)){var r=""===n?t:(0,o.default)(t,n);if("object"==typeof r&&null!==r)for(var i in r)r.hasOwnProperty(i)&&-1===e.allow[n].indexOf(i)&&delete r[i]}}function l(t,e){var n=JSON.parse(JSON.stringify(t));for(var r in e.map)if(e.map.hasOwnProperty(r)){var i=e.map[r],s=r.split("."),a=void 0;if(s.length>1?(s.pop(),a=(0,o.default)(n,s.join("."))):a=t,"object"==typeof a){if(i.copy){var f=(0,o.default)(n,i.copy);void 0!==f&&(0,u.dset)(t,r,f)}else if(i.move){var l=(0,o.default)(n,i.move);void 0!==l&&(0,u.dset)(t,r,l),(0,c.unset)(t,i.move)}else i.hasOwnProperty("set")&&(0,u.dset)(t,r,i.set);if(i.to_string){var p=(0,o.default)(t,r);if("string"==typeof p||"object"==typeof p&&null!==p)continue;void 0!==p?(0,u.dset)(t,r,JSON.stringify(p)):(0,u.dset)(t,r,"undefined")}}}}function p(t,e){return!(e.sample.percent<=0)&&(e.sample.percent>=1||(e.sample.path?function(t,e){var n=(0,o.default)(t,e.sample.path),r=(0,i.default)(JSON.stringify(n)),u=-64,c=[];d(r.slice(0,8),c);for(var a=0,f=0;f<64&&1!==c[f];f++)a++;if(0!==a){var l=[];d(r.slice(9,16),l),u-=a,c.splice(0,a),l.splice(64-a),c=c.concat(l)}return c[63]=0===c[63]?1:0,(0,s.default)(parseInt(c.join(""),2),u)<e.sample.percent}(t,e):(n=e.sample.percent,Math.random()<=n)));var n}function d(t,e){for(var n=0;n<8;n++)for(var r=t[n],i=128;i>=1;i/=2)r-i>=0?(r-=i,e.push(1)):e.push(0)}e.default=function(t,e){for(var n=t,r=0,i=e;r<i.length;r++){var o=i[r];switch(o.type){case"drop":return null;case"drop_properties":a(n,o.config);break;case"allow_properties":f(n,o.config);break;case"sample_event":if(p(n,o.config))break;return null;case"map_properties":l(n,o.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(o.type,'" is unsupported.'))}}return n}},601:function(t,e,n){"use strict";n.r(e);for(var r=[],i=0;i<64;)r[i]=0|4294967296*Math.sin(++i%Math.PI);e.default=function(t){var e,n,o,s=[e=1732584193,n=4023233417,~e,~n],u=[],c=unescape(encodeURI(t))+"",a=c.length;for(t=--a/4+2|15,u[--t]=8*a;~a;)u[a>>2]|=c.charCodeAt(a)<<8*a--;for(i=c=0;i<t;i+=16){for(a=s;c<64;a=[o=a[3],e+((o=a[0]+[e&n|~e&o,o&e|~o&n,e^n^o,n^(e|~o)][a=c>>4]+r[c]+~~u[i|15&[c,5*c+1,3*c+5,7*c][a]])<<(a=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*a+c++%4])|o>>>-a),e,n])e=0|a[1],n=a[2];for(c=4;c;)s[--c]+=a[c]}for(t="";c<32;)t+=(s[c>>3]>>4*(1^c++)&15).toString(16);return t}},602:function(t,e,n){"use strict";var r=n(603);t.exports=r},603:function(t,e,n){"use strict";var r=n(590),i=n(591),o=n(592),s=n(606),u=n(607),c=n(608),a=n(593),f=n(594),l=n(611),p=n(664),d=n(670),v=n(595),h=n(598),y=[0,0],b=[0,0];t.exports=function(t,e){var n,g;return 0===t||a(t)||f(t)?t:(p(y,t),e+=y[1],(e+=d(t=y[0]))<c?l(0,t):e>s?t<0?i:r:(e<=u?(e+=52,g=2220446049250313e-31):g=1,v(b,t),n=b[0],n&=2148532223,g*h(n|=e+o<<20,b[1])))}},604:function(t,e,n){"use strict";var r=n(605);t.exports=r},605:function(t,e,n){"use strict";t.exports=Number},606:function(t,e,n){"use strict";t.exports=1023},607:function(t,e,n){"use strict";t.exports=-1023},608:function(t,e,n){"use strict";t.exports=-1074},609:function(t,e,n){"use strict";t.exports=function(t){return t!=t}},610:function(t,e,n){"use strict";var r=n(590),i=n(591);t.exports=function(t){return t===r||t===i}},611:function(t,e,n){"use strict";var r=n(612);t.exports=r},612:function(t,e,n){"use strict";var r=n(595),i=n(597),o=n(598),s=[0,0];t.exports=function(t,e){var n,u;return r(s,t),n=s[0],n&=2147483647,u=i(e),o(n|=u&=2147483648,s[1])}},613:function(t,e,n){"use strict";var r=n(614);t.exports=function(t,e){return 1===arguments.length?r([0,0],t):r(t,e)}},614:function(t,e,n){"use strict";var r=n(586),i=n(587),o=n(639),s=new i(1),u=new r(s.buffer),c=o.HIGH,a=o.LOW;t.exports=function(t,e){return s[0]=e,t[0]=u[c],t[1]=u[a],t}},615:function(t,e,n){"use strict";var r=n(616);t.exports=r},616:function(t,e,n){"use strict";var r=n(617),i=n(628),o=n(629);t.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,i+1,i+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===i-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}},617:function(t,e,n){"use strict";var r=n(618);t.exports=r},618:function(t,e,n){"use strict";var r=n(583),i="function"==typeof Uint32Array;t.exports=function(t){return i&&t instanceof Uint32Array||"[object Uint32Array]"===r(t)}},619:function(t,e,n){"use strict";var r=n(620);t.exports=r},620:function(t,e,n){"use strict";var r=n(621)();t.exports=function(){return r&&"symbol"==typeof Symbol.toStringTag}},621:function(t,e,n){"use strict";var r=n(622);t.exports=r},622:function(t,e,n){"use strict";t.exports=function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}},623:function(t,e,n){"use strict";var r=n(596);t.exports=function(t){return r.call(t)}},624:function(t,e,n){"use strict";var r=n(625),i=n(627),o=n(596);t.exports=function(t){var e,n,s;if(null==t)return o.call(t);n=t[i],e=r(t,i);try{t[i]=void 0}catch(e){return o.call(t)}return s=o.call(t),e?t[i]=n:delete t[i],s}},625:function(t,e,n){"use strict";var r=n(626);t.exports=r},626:function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&r.call(t,e)}},627:function(t,e,n){"use strict";var r="function"==typeof Symbol?Symbol.toStringTag:"";t.exports=r},628:function(t,e,n){"use strict";t.exports=4294967295},629:function(t,e,n){"use strict";var r="function"==typeof Uint32Array?Uint32Array:null;t.exports=r},630:function(t,e,n){"use strict";var r="function"==typeof Uint32Array?Uint32Array:void 0;t.exports=r},631:function(t,e,n){"use strict";t.exports=function(){throw new Error("not implemented")}},632:function(t,e,n){"use strict";var r=n(633);t.exports=r},633:function(t,e,n){"use strict";var r=n(634),i=n(636);t.exports=function(){var t,e;if("function"!=typeof i)return!1;try{e=new i([1,3.14,-3.14,NaN]),t=r(e)&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){t=!1}return t}},634:function(t,e,n){"use strict";var r=n(635);t.exports=r},635:function(t,e,n){"use strict";var r=n(583),i="function"==typeof Float64Array;t.exports=function(t){return i&&t instanceof Float64Array||"[object Float64Array]"===r(t)}},636:function(t,e,n){"use strict";var r="function"==typeof Float64Array?Float64Array:null;t.exports=r},637:function(t,e,n){"use strict";var r="function"==typeof Float64Array?Float64Array:void 0;t.exports=r},638:function(t,e,n){"use strict";t.exports=function(){throw new Error("not implemented")}},639:function(t,e,n){"use strict";var r,i,o;!0===n(588)?(i=1,o=0):(i=0,o=1),r={HIGH:i,LOW:o},t.exports=r},640:function(t,e,n){"use strict";var r,i,o=n(641);(i=new o.uint16(1))[0]=4660,r=52===new o.uint8(i.buffer)[0],t.exports=r},641:function(t,e,n){"use strict";var r=n(642),i={uint16:n(651),uint8:r};t.exports=i},642:function(t,e,n){"use strict";var r,i=n(643),o=n(649),s=n(650);r=i()?o:s,t.exports=r},643:function(t,e,n){"use strict";var r=n(644);t.exports=r},644:function(t,e,n){"use strict";var r=n(645),i=n(647),o=n(648);t.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,i+1,i+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===i-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}},645:function(t,e,n){"use strict";var r=n(646);t.exports=r},646:function(t,e,n){"use strict";var r=n(583),i="function"==typeof Uint8Array;t.exports=function(t){return i&&t instanceof Uint8Array||"[object Uint8Array]"===r(t)}},647:function(t,e,n){"use strict";t.exports=255},648:function(t,e,n){"use strict";var r="function"==typeof Uint8Array?Uint8Array:null;t.exports=r},649:function(t,e,n){"use strict";var r="function"==typeof Uint8Array?Uint8Array:void 0;t.exports=r},650:function(t,e,n){"use strict";t.exports=function(){throw new Error("not implemented")}},651:function(t,e,n){"use strict";var r,i=n(652),o=n(658),s=n(659);r=i()?o:s,t.exports=r},652:function(t,e,n){"use strict";var r=n(653);t.exports=r},653:function(t,e,n){"use strict";var r=n(654),i=n(656),o=n(657);t.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,i+1,i+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===i-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}},654:function(t,e,n){"use strict";var r=n(655);t.exports=r},655:function(t,e,n){"use strict";var r=n(583),i="function"==typeof Uint16Array;t.exports=function(t){return i&&t instanceof Uint16Array||"[object Uint16Array]"===r(t)}},656:function(t,e,n){"use strict";t.exports=65535},657:function(t,e,n){"use strict";var r="function"==typeof Uint16Array?Uint16Array:null;t.exports=r},658:function(t,e,n){"use strict";var r="function"==typeof Uint16Array?Uint16Array:void 0;t.exports=r},659:function(t,e,n){"use strict";t.exports=function(){throw new Error("not implemented")}},660:function(t,e,n){"use strict";var r=n(586),i=n(587),o=n(661),s=new i(1),u=new r(s.buffer);t.exports=function(t){return s[0]=t,u[o]}},661:function(t,e,n){"use strict";var r;r=!0===n(588)?1:0,t.exports=r},662:function(t,e,n){"use strict";var r=n(586),i=n(587),o=n(663),s=new i(1),u=new r(s.buffer),c=o.HIGH,a=o.LOW;t.exports=function(t,e){return u[c]=t,u[a]=e,s[0]}},663:function(t,e,n){"use strict";var r,i,o;!0===n(588)?(i=1,o=0):(i=0,o=1),r={HIGH:i,LOW:o},t.exports=r},664:function(t,e,n){"use strict";var r=n(665);t.exports=r},665:function(t,e,n){"use strict";var r=n(666);t.exports=function(t,e){return 1===arguments.length?r([0,0],t):r(t,e)}},666:function(t,e,n){"use strict";var r=n(667),i=n(594),o=n(593),s=n(668);t.exports=function(t,e){return o(e)||i(e)?(t[0]=e,t[1]=0,t):0!==e&&s(e)<r?(t[0]=4503599627370496*e,t[1]=-52,t):(t[0]=e,t[1]=0,t)}},667:function(t,e,n){"use strict";t.exports=22250738585072014e-324},668:function(t,e,n){"use strict";var r=n(669);t.exports=r},669:function(t,e,n){"use strict";t.exports=function(t){return Math.abs(t)}},670:function(t,e,n){"use strict";var r=n(671);t.exports=r},671:function(t,e,n){"use strict";var r=n(597),i=n(672),o=n(592);t.exports=function(t){var e=r(t);return(e=(e&i)>>>20)-o|0}},672:function(t,e,n){"use strict";t.exports=2146435072},673:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.unset=void 0;var i=r(n(585));e.unset=function(t,e){if((0,i.default)(t,e)){for(var n=e.split("."),r=n.pop();n.length&&"\\"===n[n.length-1].slice(-1);)r=n.pop().slice(0,-1)+"."+r;for(;n.length;)t=t[e=n.shift()];return delete t[r]}return!0}},674:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(585));function o(t,e){if(!Array.isArray(t))return!0===s(t,e);var n=t[0];switch(n){case"!":return!o(t[1],e);case"or":for(var r=1;r<t.length;r++)if(o(t[r],e))return!0;return!1;case"and":for(r=1;r<t.length;r++)if(!o(t[r],e))return!1;return!0;case"=":case"!=":return function(t,e,n,r){u(t)&&(t=o(t,r));u(e)&&(e=o(e,r));"object"==typeof t&&"object"==typeof e&&(t=JSON.stringify(t),e=JSON.stringify(e));switch(n){case"=":return t===e;case"!=":return t!==e;default:throw new Error("Invalid operator in compareItems: ".concat(n))}}(s(t[1],e),s(t[2],e),n,e);case"<=":case"<":case">":case">=":return function(t,e,n,r){u(t)&&(t=o(t,r));u(e)&&(e=o(e,r));if("number"!=typeof t||"number"!=typeof e)return!1;switch(n){case"<=":return t<=e;case">=":return t>=e;case"<":return t<e;case">":return t>e;default:throw new Error("Invalid operator in compareNumbers: ".concat(n))}}(s(t[1],e),s(t[2],e),n,e);case"contains":return function(t,e){if("string"!=typeof t||"string"!=typeof e)return!1;return-1!==t.indexOf(e)}(s(t[1],e),s(t[2],e));case"match":return function(t,e){if("string"!=typeof t||"string"!=typeof e)return!1;return function(t,e){var n,r;t:for(;t.length>0;){var i=void 0,o=void 0;if(i=(n=c(t)).star,o=n.chunk,t=n.pattern,i&&""===o)return!0;var s=a(o,e),u=s.t,f=s.ok,l=s.err;if(l)return!1;if(!f||!(0===u.length||t.length>0)){if(i)for(var p=0;p<e.length;p++){if(u=(r=a(o,e.slice(p+1))).t,f=r.ok,l=r.err,f){if(0===t.length&&u.length>0)continue;e=u;continue t}if(l)return!1}return!1}e=u}return 0===e.length}(e,t)}(s(t[1],e),s(t[2],e));case"lowercase":var i=s(t[1],e);return"string"!=typeof i?null:i.toLowerCase();case"typeof":return typeof s(t[1],e);case"length":return function(t){if(null===t)return 0;if(!Array.isArray(t)&&"string"!=typeof t)return NaN;return t.length}(s(t[1],e));default:throw new Error("FQL IR could not evaluate for token: ".concat(n))}}function s(t,e){return Array.isArray(t)?t:"object"==typeof t?t.value:(0,i.default)(e,t)}function u(t){return!!Array.isArray(t)&&(("lowercase"===t[0]||"length"===t[0]||"typeof"===t[0])&&2===t.length||("contains"===t[0]||"match"===t[0])&&3===t.length)}function c(t){for(var e={star:!1,chunk:"",pattern:""};t.length>0&&"*"===t[0];)t=t.slice(1),e.star=!0;var n,r=!1;t:for(n=0;n<t.length;n++)switch(t[n]){case"\\":n+1<t.length&&n++;break;case"[":r=!0;break;case"]":r=!1;break;case"*":if(!r)break t}return e.chunk=t.slice(0,n),e.pattern=t.slice(n),e}function a(t,e){for(var n,r,i={t:"",ok:!1,err:!1};t.length>0;){if(0===e.length)return i;switch(t[0]){case"[":var o=e[0];e=e.slice(1);var s=!0;(t=t.slice(1)).length>0&&"^"===t[0]&&(s=!1,t=t.slice(1));for(var u=!1,c=0;;){if(t.length>0&&"]"===t[0]&&c>0){t=t.slice(1);break}var a,l="";if(a=(n=f(t)).char,t=n.newChunk,n.err)return i;if(l=a,"-"===t[0]&&(l=(r=f(t.slice(1))).char,t=r.newChunk,r.err))return i;a<=o&&o<=l&&(u=!0),c++}if(u!==s)return i;break;case"?":e=e.slice(1),t=t.slice(1);break;case"\\":if(0===(t=t.slice(1)).length)return i.err=!0,i;default:if(t[0]!==e[0])return i;e=e.slice(1),t=t.slice(1)}}return i.t=e,i.ok=!0,i.err=!1,i}function f(t){var e={char:"",newChunk:"",err:!1};return 0===t.length||"-"===t[0]||"]"===t[0]||"\\"===t[0]&&0===(t=t.slice(1)).length?(e.err=!0,e):(e.char=t[0],e.newChunk=t.slice(1),0===e.newChunk.length&&(e.err=!0),e)}e.default=function(t,e){if(!e)throw new Error("No matcher supplied!");switch(e.type){case"all":return!0;case"fql":return function(t,e){if(!t)return!1;try{t=JSON.parse(t)}catch(e){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(t,'": ').concat(e))}var n=o(t,e);if("boolean"!=typeof n)return!1;return n}(e.ir,t);default:throw new Error("Matcher of type ".concat(e.type," unsupported."))}}},675:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.rules=[],this.rules=t||[]}return t.prototype.getRulesByDestinationName=function(t){for(var e=[],n=0,r=this.rules;n<r.length;n++){var i=r[n];i.destinationName!==t&&void 0!==i.destinationName||e.push(i)}return e},t}();e.default=r},682:function(t,e,n){"use strict";n.r(e),n.d(e,"LegacyDestination",(function(){return x})),n.d(e,"ajsDestinations",(function(){return _}));var r=n(3),i=n(53),o=n(44),s=n(19),u=n(96),c=n(59),a=n(89),f=n(584),l=n(185),p=n(186),d=n(45),v=n(64),h=n(589),y=n(599),b=n(81),g=n(100);function w(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function m(t,e){return void 0===e&&(e=!1),e?btoa(t).replace(/=/g,""):void 0}function j(t,e,n,i,o,s){return Object(r.b)(this,void 0,void 0,(function(){var u,c,a,f,l,p,d,v;return Object(r.d)(this,(function(h){switch(h.label){case 0:u=w(n),c=m(u,s),a=Object(b.b)(),f="".concat(a,"/integrations/").concat(null!=c?c:u,"/").concat(i,"/").concat(null!=c?c:u,".dynamic.js.gz"),h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Object(g.a)(f)];case 2:return h.sent(),function(t,e,n){var i,o;try{var s=(null!==(o=null===(i=null===window||void 0===window?void 0:window.performance)||void 0===i?void 0:i.getEntriesByName(t,"resource"))&&void 0!==o?o:[])[0];s&&e.stats.gauge("legacy_destination_time",Math.round(s.duration),Object(r.f)([n],s.duration<100?["cached"]:[],!0))}catch(t){}}(f,t,n),[3,4];case 3:throw l=h.sent(),t.stats.gauge("legacy_destination_time",-1,["plugin:".concat(n),"failed"]),l;case 4:return p=window["".concat(u,"Deps")],[4,Promise.all(p.map((function(t){return Object(g.a)(a+t+".gz")})))];case 5:return h.sent(),window["".concat(u,"Loader")](),(d=window["".concat(u,"Integration")]).Integration&&(d({user:function(){return e.user()},addIntegration:function(){}}),d=d.Integration),(v=new d(o)).analytics=e,[2,v]}}))}))}function O(t,e){return Object(r.b)(this,void 0,void 0,(function(){var n,i=this;return Object(r.d)(this,(function(u){switch(u.label){case 0:return n=[],Object(o.a)()?[2,e]:[4,Object(p.a)((function(){return e.length>0&&Object(o.b)()}),(function(){return Object(r.b)(i,void 0,void 0,(function(){var i,o;return Object(r.d)(this,(function(r){switch(r.label){case 0:return(i=e.pop())?[4,Object(c.a)(i,t)]:[2];case 1:return o=r.sent(),o instanceof s.a||n.push(i),[2]}}))}))}))];case 1:return u.sent(),n.map((function(t){return e.pushWithBackoff(t)})),[2,e]}}))}))}var x=function(){function t(t,e,n,i){void 0===n&&(n={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=t,this.version=e,this.settings=Object(r.a)({},n),this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.options=i,this.buffer=i.disableClientPersistence?new d.b(4,[]):new v.a(4,"dest-".concat(t)),this.scheduleFlush()}return t.prototype.isLoaded=function(){return this._ready},t.prototype.ready=function(){var t;return null!==(t=this.onReady)&&void 0!==t?t:Promise.resolve()},t.prototype.load=function(t,e){return Object(r.b)(this,void 0,void 0,(function(){var n,i=this;return Object(r.d)(this,(function(r){switch(r.label){case 0:return this._ready||void 0!==this.onReady?[2]:(n=this,[4,j(t,e,this.name,this.version,this.settings,this.options.obfuscate)]);case 1:n.integration=r.sent(),this.onReady=new Promise((function(t){i.integration.once("ready",(function(){i._ready=!0,t(!0)}))})),this.onInitialize=new Promise((function(t){i.integration.on("initialize",(function(){i._initialized=!0,t(!0)}))}));try{t.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(e){throw t.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),e}return[2]}}))}))},t.prototype.unload=function(t,e){return function(t,e,n){return Object(r.b)(this,void 0,void 0,(function(){var i,o,s,u;return Object(r.d)(this,(function(r){return i=Object(b.b)(),o=w(t),s=m(t,n),u="".concat(i,"/integrations/").concat(null!=s?s:o,"/").concat(e,"/").concat(null!=s?s:o,".dynamic.js.gz"),[2,Object(g.b)(u)]}))}))}(this.name,this.version,this.options.obfuscate)},t.prototype.addMiddleware=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.middleware=(t=this.middleware).concat.apply(t,e)},t.prototype.shouldBuffer=function(t){return"page"!==t.event.type&&(Object(o.a)()||!1===this._ready||!1===this._initialized)},t.prototype.send=function(t,e,n){var i,o;return Object(r.b)(this,void 0,void 0,(function(){var u,c,l,p,d,v;return Object(r.d)(this,(function(y){switch(y.label){case 0:if(this.shouldBuffer(t))return this.buffer.push(t),this.scheduleFlush(),[2,t];if(u=null===(o=null===(i=this.options)||void 0===i?void 0:i.plan)||void 0===o?void 0:o.track,c=t.event.event,u&&c&&"Segment.io"!==this.name){if(l=u[c],!Object(f.a)(u,l))return t.updateEvent("integrations",Object(r.a)(Object(r.a)({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new s.b({retry:!1,reason:"Event ".concat(c," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t];if(t.updateEvent("integrations",Object(r.a)(Object(r.a)({},t.event.integrations),null==l?void 0:l.integrations)),(null==l?void 0:l.enabled)&&!1===(null==l?void 0:l.integrations[this.name]))return t.cancel(new s.b({retry:!1,reason:"Event ".concat(c," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t]}return[4,Object(h.applyDestinationMiddleware)(this.name,(b=t.event,JSON.parse(JSON.stringify(b))),this.middleware)];case 1:if(null===(p=y.sent()))return[2,t];d=new e(p,{}),t.stats.increment("analytics_js.integration.invoke",1,["method:".concat(n),"integration_name:".concat(this.name)]),y.label=2;case 2:return y.trys.push([2,5,,6]),this.integration?[4,Object(a.a)(this.integration.invoke.call(this.integration,n,d))]:[3,4];case 3:y.sent(),y.label=4;case 4:return[3,6];case 5:throw v=y.sent(),t.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(n),"integration_name:".concat(this.name)]),v;case 6:return[2,t]}var b}))}))},t.prototype.track=function(t){return Object(r.b)(this,void 0,void 0,(function(){return Object(r.d)(this,(function(e){return[2,this.send(t,i.Track,"track")]}))}))},t.prototype.page=function(t){var e;return Object(r.b)(this,void 0,void 0,(function(){var n=this;return Object(r.d)(this,(function(r){return(null===(e=this.integration)||void 0===e?void 0:e._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then((function(){return n.send(t,i.Page,"page")}))]}))}))},t.prototype.identify=function(t){return Object(r.b)(this,void 0,void 0,(function(){return Object(r.d)(this,(function(e){return[2,this.send(t,i.Identify,"identify")]}))}))},t.prototype.alias=function(t){return Object(r.b)(this,void 0,void 0,(function(){return Object(r.d)(this,(function(e){return[2,this.send(t,i.Alias,"alias")]}))}))},t.prototype.group=function(t){return Object(r.b)(this,void 0,void 0,(function(){return Object(r.d)(this,(function(e){return[2,this.send(t,i.Group,"group")]}))}))},t.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout((function(){return Object(r.b)(t,void 0,void 0,(function(){var t;return Object(r.d)(this,(function(e){switch(e.label){case 0:return this.flushing=!0,t=this,[4,O(this,this.buffer)];case 1:return t.buffer=e.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}}))}))}),5e3*Math.random())},t}();function _(t,e,n){var r,i;if(void 0===e&&(e={}),void 0===n&&(n={}),Object(u.b)())return[];t.plan&&((n=null!=n?n:{}).plan=t.plan);var o,s=null!==(i=null===(r=t.middlewareSettings)||void 0===r?void 0:r.routingRules)&&void 0!==i?i:[],c=(o=s,function(t){var e=t.payload,n=t.integration,r=t.next;new y.Store(o).getRulesByDestinationName(n).forEach((function(t){for(var n=t.matchers,i=t.transformers,o=0;o<n.length;o++)if(y.matches(e.obj,n[o])&&(e.obj=y.transform(e.obj,i[o]),null===e.obj))return r(null)})),r(e)}),a=Object(l.a)(t,null!=n?n:{});return Object.entries(t.integrations).map((function(t){var r,i=t[0],o=t[1];if(!i.startsWith("Segment")){var u=!1===e.All&&void 0===e[i];if(!1!==e[i]&&!u){var f=o.type,l=o.bundlingStatus,p=o.versionSettings;if(("unbundled"!==l&&("browser"===f||(null===(r=null==p?void 0:p.componentTypes)||void 0===r?void 0:r.includes("browser")))||"Segment.io"===i)&&"Iterable"!==i){var d=function(t){var e,n,r,i;return null!==(i=null!==(n=null===(e=t.versionSettings)||void 0===e?void 0:e.override)&&void 0!==n?n:null===(r=t.versionSettings)||void 0===r?void 0:r.version)&&void 0!==i?i:"latest"}(o),v=new x(i,d,a[i],n);return s.filter((function(t){return t.destinationName===i})).length>0&&v.addMiddleware(c),v}}}})).filter((function(t){return void 0!==t}))}}}]);
|