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,CAAEC,KAAMxO,EAAMoM,WAAa,CAAEqC,SAAUzO,EAAMyO,WAAatD,KAAMnL,EAAMmL,KAAM,aAAcnL,EAAM0O,UAAW,gBAAiB1O,EAAM2O,aAAc,gBAAiB3O,EAAM4O,aAAc,gBAAiB5O,EAAM6O,aAAc,cAAe7O,EAAM8O,WAAY,eAAgB9O,EAAM+O,YAAaC,SAAUhP,EAAMiP,eAAiBjP,EAAMiP,oBAAiBnM,EAAWoM,GAAIlP,EAAMkP,GAAI,eAAgBlP,EAAMmP,SAAWnP,EAAMoP,eAAiBpP,EAAMqP,SAAW,gBAAoB,OAAQ,KAAMrP,EAAMqP,WAE5wBxB,EAAOD,aAAe,CAClBS,IAAK,CAAC,mBACNhO,UAAW,IAEf,K","sources":["webpack:///./assets/common/src/components/common/ErrorBox.tsx","webpack:///./assets/common/src/utils/constants.ts","webpack:///./assets/stone/src/components/clientService/ContactUsForm.tsx","webpack:///./assets/stone/src/components/clientService/ContactUs.tsx","webpack:///./assets/stone/src/components/clientService/ClientServiceContactUsLoader.tsx","webpack:///./assets/stone/src/components/clientService/ClientSrviceFAQSAccordion.tsx","webpack:///./assets/stone/src/ui/button/Button.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React from 'react';\nconst ErrorBox = (props) => {\n if (!props.errors || props.errors.length === 0 || props.errors.every((err) => err === '')) {\n return React.createElement(React.Fragment, null);\n }\n return (React.createElement(\"div\", { className: classNames('globalerrors', 'invalid-feedback', props.className), role: \"alert\" }, props.errors.map((e, i) => (React.createElement(\"div\", { key: i }, (e || '').toString())))));\n};\nexport default ErrorBox;\n","export const chat = {\n zendesk: 'zendesk',\n sprinklr: 'sprinklr',\n none: 'none',\n};\nexport const BAA = {\n REASONS: {\n PERSONALIZATION: 552250004,\n DISCOVERCOLLECTION: 552250000,\n },\n APPOINTMENT: {\n INSTORE: 552250000,\n VIRTUAL: 552250001,\n CARAVAN: 552250002,\n },\n TREBASELEGHE: {\n SELF: 'myself',\n GUEST: 'guest',\n },\n};\nexport const menu = {\n overlay: {\n timeout: 200,\n },\n};\nexport const freeExpressShippingCustomerGroup = 'FreeExpressShippingForNewMembers';\nexport const contactFormId = 'contact-form';\n","import React, { useEffect, useRef, useState } from 'react';\nimport { Form } from 'react-final-form';\nimport { useTranslation } from 'react-i18next';\nimport customEventBus from '@common/scripts/libs/eventBus';\nimport createDecorator from 'final-form-focus';\nimport { createPortal } from 'react-dom';\nimport ReCAPTCHA from 'react-google-recaptcha';\nimport addressutils from '@utils/addressutils';\n// import analytics from '@utils/analytics';\nimport api from '@utils/api';\nimport formutils from '@utils/formutils';\nimport DwFormField from '@ui/formfield/DwFormField';\nimport DwFormFieldPhoneWithPrefix from '@ui/formfield/DwFormFieldPhoneWithPrefix';\nimport ErrorBox from '@components/common/ErrorBox';\nimport RegisteredInStoreCheckoutConfirm from '@stone/components/login/RegisteredInStoreCheckoutConfirm';\nimport UploadFiles from '@stone/components/common/UploadFiles';\nimport ProfileNameFields from '@stone/components/account/ProfileNameFields';\nimport RegisterForm from '@stone/components/login/RegisterForm';\nimport ClientServiceFAQSAccordion from '@stone/components/clientService/ClientSrviceFAQSAccordion';\nimport SubmitButton from '@stone/ui/button/SubmitButton';\nconst focusOnError = createDecorator(); // must be outside the component\nconst ContactUsForm = (props) => {\n const { t } = useTranslation();\n const [formdef, setFormdef] = useState();\n const [initialValues, setInitialValues] = useState();\n const [errors, setErrors] = useState([]);\n const [submitted, setSubmitted] = useState(false);\n const [userData, setUserData] = useState();\n const [faqs, setFaqs] = useState([]);\n // const [fetchForm, setFetchForm] = useState(false);\n const [filename, setFilename] = useState(undefined);\n const [showOrderNumber, setShowOrderNumber] = useState(false);\n const [locale, setLocale] = useState(`${window.language}_${window.country}`);\n const [showForm, setShowForm] = useState(true);\n const [loginStep, setLoginStep] = useState();\n const [loginEmail, setLoginEmail] = useState();\n const [firstName, setFirstName] = useState();\n const [lastName, setLastName] = useState();\n const [localName, setLocalName] = useState();\n const [localSurname, setLocalSurname] = useState();\n const [phone, setPhone] = useState();\n const [phonePrefix, setPhonePrefix] = useState();\n const reCaptchaRef = useRef();\n const showRecaptcha = window.recapchaCfg && JSON.parse(window.recapchaCfg).loginButton;\n const formDefinitionType = window.isClothing ? 'contactUsClothing' : 'contactUs';\n const orderNumberByReasonMap = {\n Payment: true,\n Shipping: true,\n 'Returns And Refunds': true,\n mbm: true,\n };\n useEffect(() => {\n if (window.loggedin) {\n api.getProfile().then((data) => {\n setFirstName(data.firstName);\n setLastName(data.lastName);\n setPhone(data.phone);\n setPhonePrefix(data.phonePrefix);\n setLoginEmail(data.email);\n });\n }\n }, []);\n useEffect(() => {\n customEventBus.on('contacts:selected-country', (data) => {\n var _a;\n setLocale(`${window.language}_${data.countryCode}`);\n setShowForm(!!((_a = data.csdata.contactCenter) === null || _a === void 0 ? void 0 : _a.enableWeb));\n });\n api.GetContactsByCountry(window.country).then((data) => {\n var _a;\n if (data && ((_a = data.contactCenter) === null || _a === void 0 ? void 0 : _a.enableWeb)) {\n let val = {};\n api.getForm(formDefinitionType, val).then((data) => {\n setInitialValues(val);\n if (val.contactreason) {\n selectContactReason(val.contactreason);\n }\n if (!props.mbmReasonActive) {\n data.contactreason.options = data.contactreason.options.filter((opt) => opt.value != 'mbm');\n }\n const orderedData = Object.assign({}, data);\n orderedData.contactreason.options.sort((a, b) => {\n if (a.value && b.value) {\n const A = a.label.toUpperCase();\n const B = b.label.toUpperCase();\n return A.localeCompare(B);\n }\n });\n setFormdef(orderedData);\n });\n }\n else {\n setShowForm(false);\n }\n });\n }, []);\n const onFileChange = () => {\n let val = {};\n api.getForm(formDefinitionType, val).then((data) => {\n setInitialValues(val);\n setFormdef(data);\n });\n };\n const onSubmit = async (values) => {\n setErrors([]);\n let errors = await validate(values);\n if (errors && Object.keys(errors).length > 0) {\n return errors;\n }\n values.file1 = filename;\n if (showRecaptcha) {\n const token = await reCaptchaRef.current.executeAsync();\n values.gr3Token = token;\n }\n if (!window.isClothing) {\n values.locale = locale;\n }\n api\n .checkLogin(values)\n .then((data) => {\n if (data.success) {\n if (!window.loggedin) {\n setLoginEmail(values.email);\n setFirstName(values.firstname);\n setLastName(values.lastname);\n if (values.localname && values.localsurname) {\n setLocalName(values.localname);\n setLocalSurname(values.localsurname);\n }\n }\n setPhone(values.phone);\n setPhonePrefix(values.phonePrefix);\n if (data.exist && data.hasAvailableLoginMethods) {\n //check account creato in Store\n if (data.isCreatedInStore && !data.hasChangedPassword) {\n if (data.hasSentCompleteProfileEmail) {\n setLoginStep('registeredInStore');\n }\n else {\n setLoginStep('registeredInStoreSendEmail');\n }\n }\n }\n else {\n // NON esiste account con questa mail\n setLoginStep('register');\n }\n }\n })\n .catch((e) => {\n setErrors([e]);\n });\n setUserData({ title: values.title, firstname: values.firstname, lastname: values.lastname });\n return api\n .contactUsSubmit(values, formdef)\n .then((data) => {\n if (data.success) {\n setSubmitted(true);\n const select = document.querySelector('.cs-form-container');\n const header = document.querySelector('header').offsetHeight;\n window.scrollTo({\n top: select.offsetTop - header,\n behavior: 'smooth',\n });\n select.focus();\n }\n if (data.error && data.error.length > 0) {\n setErrors(data.error);\n }\n if (!formutils.checkValidationAfterSubmit(data, errors)) {\n return errors;\n }\n // analytics.contactUsTwo();\n })\n .catch((e) => setErrors([e]));\n };\n const validate = async (values) => {\n if (window.loggedin) {\n values.privacyFlag = true;\n }\n return await formutils.validateForm(values, formdef, formDefinitionType);\n };\n const selectContactReason = (reason) => {\n if (reason != '') {\n api.contactUsFaqs(reason).then((data) => !!data && setFaqs(data));\n setShowOrderNumber(!!orderNumberByReasonMap[reason]);\n }\n else {\n setFaqs([]);\n setShowOrderNumber(false);\n }\n };\n const selectFilenameUploaded = (fileName) => {\n formdef['file1'].htmlValue = fileName;\n setFilename(fileName);\n };\n if (!formdef || !showForm) {\n return React.createElement(React.Fragment, null);\n }\n return (React.createElement(\"div\", { className: \"cs-contactus-form\" },\n !submitted && (React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col\" },\n React.createElement(\"h2\", { className: \"cs-contactus-form__title font__title\" }, t('contactus.contactform'))))),\n submitted ? (React.createElement(\"div\", { className: \"cs-contactus__submit\" },\n React.createElement(\"div\", { className: \"cs-contactus__submit-message\" },\n React.createElement(\"div\", null,\n React.createElement(\"p\", { className: \"font__title mb-20\" }, t('contactus.thankyou')),\n React.createElement(\"p\", null,\n window.country != 'JP' && t('contactus.dear'),\n ' ',\n addressutils.salutation(userData.firstname, userData.lastname, formutils.labelByValue(userData.title, formdef === null || formdef === void 0 ? void 0 : formdef.title)),\n '. ',\n t('contactus.salutation'),\n React.createElement(\"br\", null),\n t('contactus.wewillcontactyousoon'))),\n window.loggedin && (React.createElement(React.Fragment, null,\n React.createElement(\"hr\", { className: \"divider divider--small\" }),\n React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col col-lg-12 offset-lg-12\" },\n React.createElement(\"a\", { href: window.homeurl, className: \"button button--primary full\" },\n React.createElement(\"span\", null, t('button.backtoshopping')))))))),\n (loginStep == 'register' || loginStep == 'registeredInStoreSendEmail' || loginStep == 'registeredInStore') && (React.createElement(\"div\", { className: \"cs-contactus__submit-registration\" },\n React.createElement(\"hr\", { className: \"divider divider--small\" }),\n loginStep == 'register' && (React.createElement(React.Fragment, null,\n React.createElement(\"p\", { className: \"font__title\" }, t('contactus.registration.title')),\n React.createElement(RegisterForm, { inContactUs: true, phone: phone, localName: localName, localSurname: localSurname, phonePrefix: phonePrefix, firstName: firstName, lastName: lastName, loginEmail: loginEmail }))),\n (loginStep == 'registeredInStoreSendEmail' || loginStep == 'registeredInStore') && (React.createElement(\"div\", { className: \"cs-contactus__submit-instoreregistration\" },\n React.createElement(RegisteredInStoreCheckoutConfirm, { email: loginEmail }))))))) : (React.createElement(React.Fragment, null,\n !(props === null || props === void 0 ? void 0 : props.fromModal) && (React.createElement(\"div\", { className: \"row cs-contactus__desc\" },\n React.createElement(\"div\", { className: \"col\" }, t('contactus.intro')))),\n React.createElement(Form, { onSubmit: onSubmit, validate: validate, initialValues: initialValues, decorators: [focusOnError], render: ({ handleSubmit, form, submitting, pristine, values }) => {\n var _a, _b;\n return (React.createElement(\"form\", { onSubmit: handleSubmit },\n React.createElement(ProfileNameFields, { formdef: formdef, disabled: window.loggedin }),\n React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col\" },\n React.createElement(DwFormField, { def: formdef, name: \"email\", readonly: window.loggedin, autocomplete: \"email\", validTick: true }))),\n React.createElement(DwFormFieldPhoneWithPrefix, { disabled: ((_a = formdef.phone) === null || _a === void 0 ? void 0 : _a.htmlValue) && window.loggedin, def: formdef, uniqueLabel: t('profile.phonenumber') }),\n React.createElement(DwFormField, { def: formdef, name: \"country\", autocomplete: \"country\", type: ((_b = formdef === null || formdef === void 0 ? void 0 : formdef.country) === null || _b === void 0 ? void 0 : _b.options) ? 'select' : 'text' }),\n React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col\" },\n React.createElement(DwFormField, { def: formdef, name: \"contactreason\", type: \"select\", onChange: (e) => selectContactReason(e.target.value) }))),\n faqs.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: \"row justify-center\" },\n React.createElement(\"div\", { className: \"col cs-contactus__description\" }, t('contactus.seefaq'))),\n React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col-24\" },\n React.createElement(ClientServiceFAQSAccordion, { faqs: faqs }))))),\n showOrderNumber && (React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col\" },\n React.createElement(DwFormField, { def: formdef, name: \"ordernumber\" })))),\n React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col\" },\n React.createElement(DwFormField, { def: formdef, name: \"message\", className: \"blockview\", type: \"textarea\" }))),\n React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col\" },\n React.createElement(UploadFiles, { formfield: \"contactUs.file1\", label: formdef['file1'].label, uploadedFile: filename, filetype: \"IMAGES\", onFileChange: onFileChange, tooltipText: t('contactus.imagetooltip'), selectedFile: selectFilenameUploaded }))),\n !window.loggedin && (React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col\" },\n React.createElement(DwFormField, { def: formdef, type: \"checkbox\", name: \"privacyFlag\" })))),\n React.createElement(\"div\", { className: \"row\" }, (props === null || props === void 0 ? void 0 : props.fromModal) ? (React.createElement(\"div\", { className: \"col-24\" },\n React.createElement(SubmitButton, { label: t('button.submit'), submitting: submitting }))) : (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: \"col-24 col-lg-12 offset-lg-12\" },\n showRecaptcha &&\n createPortal(React.createElement(ReCAPTCHA, { className: \"recaptcha\", sitekey: window.atob(window.recapchaData), size: \"invisible\", ref: reCaptchaRef }), document.body),\n React.createElement(SubmitButton, { label: t('button.submit'), fullWidth: true, submitting: submitting }))))),\n React.createElement(ErrorBox, { errors: errors })));\n } })))));\n};\nexport default ContactUsForm;\n","import React, { useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { contactFormId } from '@utils/constants';\nimport customEventBus from '@common/scripts/libs/eventBus';\n// import ContactPhoneBox from '@moncler/components/contacts/ContactPhoneBox';\n// import InstantMessageBox from '@moncler/components/contacts/InstantMessageBox';\n// import ContactChatBox from '@moncler/components/contacts/ContactChatBox';\nimport ContactUsForm from '@stone/components/clientService/ContactUsForm';\nimport ClientServiceSection from '@stone/components/clientService/ClientServiceSection';\nconst ContactUs = (props) => {\n const { t } = useTranslation();\n const scrollToAnchor = () => {\n if (window.location.hash === `#${contactFormId}`) {\n const contactForm = document.getElementById(contactFormId);\n contactForm && contactForm.scrollIntoView();\n }\n };\n useEffect(() => {\n window.addEventListener('load', scrollToAnchor);\n customEventBus.on('contacts:selected-country', scrollToAnchor);\n return () => {\n window.removeEventListener('load', scrollToAnchor);\n };\n }, []);\n return (React.createElement(ClientServiceSection, { className: \"contact-us\" },\n React.createElement(ContactUsForm, { mbmReasonActive: props.mbmReasonActive })));\n};\nexport default ContactUs;\n","import { configureAccountStore } from '@state';\nimport React from 'react';\nimport { Provider } from 'react-redux';\nimport ContactUs from '@stone/components/clientService/ContactUs';\nconst store = configureAccountStore();\nconst ClientServiceContactUs = (props) => {\n return (React.createElement(Provider, { store: store },\n React.createElement(ContactUs, Object.assign({}, props))));\n};\nexport default ClientServiceContactUs;\n","import React from 'react';\nimport Accordion from '@common/ui/accordion/Accordion';\nimport AccordionItem from '@common/ui/accordion/AccordionItem';\nimport classNames from 'classnames';\nimport { t } from 'i18next';\nconst ClientSrviceFAQSAccordion = (props) => {\n var _a;\n const getHtmlContent = (str) => {\n return React.createElement(\"div\", { dangerouslySetInnerHTML: { __html: str } });\n };\n return (React.createElement(\"div\", { className: classNames(props.className, 'cs-faqs__accordiongroup', { 'no-divider': !props.divider }) },\n React.createElement(Accordion, { type: \"ul\" }, (_a = props.faqs) === null || _a === void 0 ? void 0 : _a.map((f, i) => (React.createElement(AccordionItem, { key: f.title, title: getHtmlContent(f.title), accordionId: f.title, itemClass: \"faq--card\", headerClass: \"accordion__header--lc\" },\n React.createElement(\"div\", { className: \"faq--card-body\" }, getHtmlContent(f.content)))))),\n props.viewallurl && (React.createElement(\"div\", null,\n React.createElement(\"a\", { href: props.viewallurl, className: \"button button--tertiary\" }, t('button.viewall'))))));\n};\nClientSrviceFAQSAccordion.defaultProps = {\n divider: true,\n};\nexport default ClientSrviceFAQSAccordion;\n","import classNames from 'classnames';\nimport React from 'react';\nconst Button = (props) => {\n const handleClick = (e) => {\n if (props.usesDefault != undefined && !props.usesDefault && props.onClick) {\n e.preventDefault();\n }\n props.onClick && props.onClick.call(this, e);\n };\n const handleKeyDown = (e) => {\n if (props.usesDefault != undefined && !props.usesDefault && props.onKeyDown) {\n e.preventDefault();\n }\n props.onKeyDown && props.onKeyDown.call(this, e);\n };\n return (React.createElement(\"button\", { ref: props.reference, onClick: handleClick, onFocus: props === null || props === void 0 ? void 0 : props.onFocus, onKeyDown: handleKeyDown, disabled: props.disabled, className: classNames('button', props.cls, props.className, { loading: props.isLoading }, { full: props.fullWidth }, { inverted: props.inverted }), type: props.type, \"aria-label\": props.ariaLabel, \"aria-expanded\": props.ariaExpanded, \"aria-haspopup\": props.ariaHaspopup, \"aria-controls\": props.ariaControls, \"aria-hidden\": props.ariaHidden, \"aria-pressed\": props.ariaPressed, tabIndex: props.customTabIndex ? props.customTabIndex : undefined, id: props.id, \"data-pressed\": props.pressed }, props.customChildren ? props.children : React.createElement(\"span\", null, props.children)));\n};\nButton.defaultProps = {\n cls: ['button--primary'],\n className: '',\n};\nexport default Button;\n"],"names":["props","errors","length","every","err","className","role","map","e","i","key","toString","chat","zendesk","sprinklr","none","BAA","REASONS","PERSONALIZATION","DISCOVERCOLLECTION","APPOINTMENT","INSTORE","VIRTUAL","CARAVAN","TREBASELEGHE","SELF","GUEST","freeExpressShippingCustomerGroup","contactFormId","focusOnError","t","useTranslation","formdef","setFormdef","useState","initialValues","setInitialValues","setErrors","submitted","setSubmitted","userData","setUserData","faqs","setFaqs","filename","setFilename","undefined","showOrderNumber","setShowOrderNumber","locale","setLocale","window","language","country","showForm","setShowForm","loginStep","setLoginStep","loginEmail","setLoginEmail","firstName","setFirstName","lastName","setLastName","localName","setLocalName","localSurname","setLocalSurname","phone","setPhone","phonePrefix","setPhonePrefix","reCaptchaRef","useRef","showRecaptcha","recapchaCfg","JSON","parse","loginButton","formDefinitionType","isClothing","orderNumberByReasonMap","Payment","Shipping","mbm","useEffect","loggedin","api","then","data","email","_a","countryCode","csdata","contactCenter","enableWeb","val","contactreason","selectContactReason","mbmReasonActive","options","filter","opt","value","orderedData","Object","assign","sort","a","b","A","label","toUpperCase","B","localeCompare","onFileChange","validate","async","values","privacyFlag","formutils","reason","selectFilenameUploaded","fileName","htmlValue","addressutils","firstname","lastname","title","href","homeurl","RegisterForm","inContactUs","RegisteredInStoreCheckoutConfirm","fromModal","onSubmit","keys","file1","token","current","executeAsync","gr3Token","success","localname","localsurname","exist","hasAvailableLoginMethods","isCreatedInStore","hasChangedPassword","hasSentCompleteProfileEmail","catch","select","document","querySelector","header","offsetHeight","scrollTo","top","offsetTop","behavior","focus","error","decorators","render","handleSubmit","form","submitting","pristine","_b","ProfileNameFields","disabled","DwFormField","def","name","readonly","autocomplete","validTick","DwFormFieldPhoneWithPrefix","uniqueLabel","type","onChange","target","UploadFiles","formfield","uploadedFile","filetype","tooltipText","selectedFile","SubmitButton","createPortal","sitekey","atob","recapchaData","size","ref","body","fullWidth","ErrorBox","scrollToAnchor","location","hash","contactForm","getElementById","scrollIntoView","addEventListener","removeEventListener","ClientServiceSection","store","ClientSrviceFAQSAccordion","getHtmlContent","str","dangerouslySetInnerHTML","__html","divider","f","accordionId","itemClass","headerClass","content","viewallurl","defaultProps","Button","reference","onClick","usesDefault","preventDefault","call","onFocus","onKeyDown","cls","loading","isLoading","full","inverted","ariaLabel","ariaExpanded","ariaHaspopup","ariaControls","ariaHidden","ariaPressed","tabIndex","customTabIndex","id","pressed","customChildren","children"],"sourceRoot":""}