{"version":3,"sources":["shared/interceptors/axios-request.interceptors.ts","shared/configs/AppConfigs.ts","shared/components/customButton/button-type.enum.ts","shared/gql/customer.gql.ts","shared/context/auth.context.tsx","shared/services/AuthRouteGuard.tsx","shared/components/customErrorMessage/ValidationErrorMessage.tsx","assets/icon-show-password.svg","assets/icon-hide-password.svg","shared/components/customFormField/FormField.tsx","features/auth/LoginValidationSchema.ts","shared/components/customButton/Button.tsx","shared/gql/user-authentication.gql.ts","features/auth/LoginForm.tsx","assets/icon-cart-white.svg","assets/vanguard-logo-white.svg","assets/drink-wise.svg","shared/components/footer/Footer.tsx","features/home/BottleShop.tsx","pages/HomePage.tsx","assets/icon-close.svg","shared/components/customModal/CustomModal.tsx","features/invitations/DeleteModal.tsx","features/invitations/InvitationTable.tsx","features/invitations/InvitationList.tsx","features/invitations/InviteValidationSchema.ts","features/invitations/InviteModal.tsx","features/invitations/Invitations.tsx","assets/vanguard-logo.svg","assets/icon-cart.svg","assets/icon-logout.svg","shared/components/header/Header.tsx","pages/InvitationsPage.tsx","aws-exports.js","App.tsx","index.tsx"],"names":["axios","interceptors","request","use","req","headers","error","Promise","reject","ButtonType","GET_CUSTOMER","gql","AuthContext","React","createContext","AuthProvider","children","useState","isAuth","setIsAuth","email","firstName","lastName","id","__typename","loggedInCustomer","setLoggedInCustomer","useLazyQuery","notifyOnNetworkStatusChange","fetchCustomerData","customerData","data","getLoggedInCustomerData","useCallback","customerAccessToken","variables","useEffect","accessToken","sessionStorage","getItem","customer","Provider","value","useAuthContext","useContext","AuthRouteGuard","parentProps","exact","render","component","to","ValidationErrorMessage","props","className","touched","FormInput","useField","field","label","type","FormDate","fieldFocus","setFieldFocus","style","display","justifyContent","length","validate","test","age","moment","Date","diff","onChange","e","handleChange","onCustomChange","onBlur","handleBlur","onCustomBlur","FormEmail","includes","FormPassword","showPassword","setShowPassword","onClick","src","iconHidePassword","iconShowPassword","LoginValidationSchema","Yup","shape","required","max","password","Button","forwardRef","ref","buttonTypeClass","styleType","PRIMARY","PRIMARY_REVERSE","SECONDARY","TERTIARY","disabled","displayName","AUTHENTICATE_CUSTOMER","LoginForm","useMutation","authenticateUser","loginAPILoading","loading","authData","loginAPIError","setLoginAPIError","history","useHistory","accessTokenRef","useRef","submitRef","customerAccessTokenCreate","current","setItem","push","initialValues","validationSchema","validateOnMount","onSubmit","values","a","custCred","errors","isValid","handleSubmit","isSubmitting","autoComplete","name","color","css","size","Footer","isLoginPage","backgroundColor","target","rel","href","drinkWise","BottleShop","window","open","cartIcon","vanguardLogo","HomePage","CustomModal","onHide","showCloseIcon","backdrop","title","dialogClassName","rest","Modal","keyboard","centered","Header","iconClose","Body","DeleteModal","deleteLoading","setDeleteLoading","deleteError","setDeleteError","confirmRef","cancelRef","deleteCustomer","customerToBeDeleted","API","del","body","then","setShowDeleteModal","updatedCustomers","customers","filter","setCustomers","InvitationTable","colSpan","map","idx","borderBottom","created_at","format","state","showDeleteDialog","InvitationList","InviteValidationSchema","consent","oneOf","InviteModal","inviteLoading","setInviteLoading","inviteError","setInviteError","inviteErrorMessage","setInviteErrorMessage","createAndInviteCustomer","post","first_name","last_name","note","dob","tags","res","setShowInviteModal","err","response","status","setFieldTouched","placeholder","Invitations","totalAcceptedCustomers","setTotalAcceptedCustomers","totalInvitedCustomers","setTotalInvitedCustomers","showDeleteModal","setCustomerToBeDeleted","showInviteModal","invitedCustomersFetchError","setInvitedCustomersFetchError","getInvitedCustomers","get","replace","scrollTo","enabledCustomers","_","invitedCustomers","isMobileOnly","show","isMobile","removeItem","logoutIcon","InvitationsPage","awsmobile","Amplify","configure","awsconfig","App","path","httpLink","createHttpLink","uri","process","authLink","setContext","client","ApolloClient","link","from","cache","InMemoryCache","ReactDOM","StrictMode","ApolloProvider","document","getElementById"],"mappings":"gkBAEAA,EAAMC,aAAaC,QAAQC,KACzB,SAACC,GAEC,OADAA,EAAIC,QAAQ,gBAAkB,mBACvBD,KAET,SAACE,GACC,OAAOC,QAAQC,OAAOF,MCPnB,I,ECDKG,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OlCnB4BC,6CkCmB5B,YlCjBHA,iBkCoBIC,GAAWC,aAAW,iBAAO,CACjCvP,QAAS,CACP,oClCpBFqP,wCkCwBIG,GAAS,IAAIC,IAAa,CAC9BC,KAAMC,YAAK,CAACL,GAAUJ,KACtBU,MAAO,IAAIC,MAGbC,IAASnN,OACP,cAAC,IAAMoN,WAAP,UACE,cAACC,EAAA,EAAD,CAAgBR,OAAQA,GAAxB,SACE,cAAC,GAAD,QAGJS,SAASC,eAAe,W","file":"static/js/main.37094343.chunk.js","sourcesContent":["import axios from 'axios';\n\naxios.interceptors.request.use(\n (req) => {\n req.headers['Content-Type'] = 'application/json';\n return req;\n },\n (error) => {\n return Promise.reject(error);\n }\n);\n","// SHOPIFY configs\nexport const SHOPIFY_STORE_URL = process.env.REACT_APP_SHOPIFY_STORE_URL;\nexport const SHOPIFY_STOREFRONT_GRAPHQL_RELATIVE_URL =\n process.env.REACT_APP_SHOPIFY_STOREFRONT_GRAPHQL_RELATIVE_URL;\nexport const SHOPIFY_STOREFRONT_ACCESS_TOKEN =\n process.env.REACT_APP_SHOPIFY_STOREFRONT_ACCESS_TOKEN;\n","export enum ButtonType {\n PRIMARY = 1,\n PRIMARY_REVERSE = 2,\n SECONDARY = 3,\n TERTIARY,\n}\n","import { gql } from '@apollo/client';\n\nexport const GET_CUSTOMER = gql`\n query getCustomer($customerAccessToken: String!) {\n customer(customerAccessToken: $customerAccessToken) {\n email\n firstName\n lastName\n id\n }\n }\n`;\n","import React, { useState, useEffect, useCallback } from 'react';\nimport ICustomerModel from '../models/customer-info-model';\nimport { useLazyQuery } from '@apollo/client';\nimport ICustomerInfoResponseDTO from '../models/customer-info-response.dto';\nimport ICustomerInfoRequestDTO from '../models/customer-info-request.dto';\nimport { GET_CUSTOMER } from '../gql/customer.gql';\n\ninterface AuthContextInterface {\n isAuth: boolean;\n setIsAuth: React.Dispatch>;\n loggedInCustomer: ICustomerModel;\n setLoggedInCustomer: React.Dispatch>;\n}\n\nexport const AuthContext = React.createContext(\n null\n);\n\nexport const AuthProvider: React.FC = ({ children }) => {\n const [isAuth, setIsAuth] = useState(false);\n const [loggedInCustomer, setLoggedInCustomer] = useState({\n email: '',\n firstName: '',\n lastName: '',\n id: '',\n __typename: '',\n });\n const [fetchCustomerData, { data: customerData }] = useLazyQuery<\n ICustomerInfoResponseDTO,\n ICustomerInfoRequestDTO\n >(GET_CUSTOMER, {\n notifyOnNetworkStatusChange: true,\n });\n\n const getLoggedInCustomerData = useCallback(\n (customerAccessToken: string) => {\n const variables: ICustomerInfoRequestDTO = {\n customerAccessToken,\n };\n fetchCustomerData({ variables });\n },\n [fetchCustomerData]\n );\n\n useEffect(() => {\n const accessToken = sessionStorage.getItem('accessToken');\n if (accessToken) {\n getLoggedInCustomerData(accessToken);\n }\n }, [getLoggedInCustomerData]);\n\n useEffect(() => {\n if (customerData && customerData.customer) {\n setLoggedInCustomer(customerData.customer);\n setIsAuth(true);\n }\n }, [customerData]);\n\n return (\n \n {children}\n \n );\n};\n\nexport const useAuthContext = (): AuthContextInterface =>\n React.useContext(AuthContext) as AuthContextInterface;\n","import React from 'react';\nimport { Route, Redirect } from 'react-router-dom';\nimport { useAuthContext } from '../context/auth.context';\n\nexport const AuthRouteGuard: React.FC<{\n component: React.FC;\n path: string;\n exact?: boolean;\n}> = (parentProps) => {\n const { isAuth } = useAuthContext();\n\n return (\n \n isAuth || sessionStorage.getItem('accessToken') ? (\n \n ) : (\n \n )\n }\n />\n );\n};\n","import React from 'react';\nimport './validation-error-message.scss';\n\ninterface ValidationErrorMessageProps {\n error: string | undefined;\n touched: boolean | undefined;\n}\nexport const ValidationErrorMessage: React.FC = (\n props: ValidationErrorMessageProps\n) => {\n return (\n
\n {props.error && props.touched ? (\n
{props.error}
\n ) : null}\n
\n );\n};\n","export default __webpack_public_path__ + \"static/media/icon-show-password.ff9e723c.svg\";","export default __webpack_public_path__ + \"static/media/icon-hide-password.7ef3b6dd.svg\";","import React, { useState } from 'react';\nimport { useField, Field } from 'formik';\nimport { ValidationErrorMessage } from '../customErrorMessage/ValidationErrorMessage';\nimport iconShowPassword from '../../../assets/icon-show-password.svg';\nimport iconHidePassword from '../../../assets/icon-hide-password.svg';\nimport moment from 'moment';\nimport './form-field.scss';\n\ninterface IFormInputProps {\n id: string;\n name: string;\n placeholder?: string;\n label: string;\n disabled?: boolean;\n error?: string;\n touched?: boolean;\n handleBlur?: (e: React.SyntheticEvent) => void;\n handleChange?: (e: React.SyntheticEvent) => void;\n}\n\nexport const FormInput: React.FC = (props) => {\n const [field] = useField(props);\n return (\n \n \n \n \n \n );\n};\n\nexport const FormDate: React.FC = (props) => {\n const [field] = useField(props);\n const [fieldFocus, setFieldFocus] = useState(false);\n const validateDate = (value: string) => {\n let error;\n if (value === '') {\n error = 'Date of birth is required';\n } else if (\n !/^(0[1-9]|[12][0-9]|3[01])[/](0[1-9]|1[012])[/]\\d{4}$/.test(value)\n ) {\n error = 'Date of birth format is incorrect';\n } else {\n const age = moment(new Date()).diff(\n moment(value, 'DD/MM/YYYY'),\n 'years',\n true\n );\n if (age < 18) {\n error = 'Invited user should be 18+';\n } else if (age > 100) {\n error = 'Age should be less than 99 years';\n }\n }\n return error;\n };\n\n const onCustomChange = (e: React.SyntheticEvent) => {\n setFieldFocus(true);\n props.handleChange!(e);\n };\n\n const onCustomBlur = (e: React.SyntheticEvent) => {\n setFieldFocus(false);\n props.handleBlur!(e);\n };\n\n return (\n \n
\n \n 0 && (fieldFocus || props.error)\n ? 'flex'\n : 'none',\n }}\n >\n DD/MM/YYYY\n
\n \n\n ) => onCustomChange(e)}\n onBlur={(e: React.SyntheticEvent) => {\n onCustomBlur(e);\n }}\n />\n \n \n );\n};\n\nexport const FormEmail: React.FC = (props) => {\n const [field] = useField(props);\n\n const validateEmail = (value: string) => {\n let error;\n if (\n !value.includes('@lionco.com') &&\n !value.includes('@vanguardluxurybrands.com') &&\n !value.includes('@maltshovel.com.au') &&\n !value.includes('@littlecreatures.com.au') &&\n !value.includes('@thinkerbell.com') &&\n !value.includes('@umww.com') &&\n !value.includes('@affinity.ad') &&\n !value.includes('@fourpillarsgin.com.au') &&\n !value.includes('@stoneandwood.com.au') &&\n !value.includes('@twobirdsbrewing.com.au') &&\n !value.includes('@fixationbrewing.com.au') &&\n !value.includes('@fermentum.com.au')\n ) {\n error =\n 'Only Lion and Lion partner accounts can invite family & friends';\n }\n return error;\n };\n return (\n \n \n \n \n \n );\n};\n\nexport const FormPassword: React.FC = (props) => {\n const [showPassword, setShowPassword] = useState(false);\n const [field] = useField(props);\n return (\n \n
\n \n setShowPassword(!showPassword)}\n >\n {showPassword ? (\n \n ) : (\n \n )}\n {showPassword ?
Hide
:
Show
}\n
\n \n\n \n \n \n );\n};\n","import * as Yup from 'yup';\n\nexport const LoginValidationSchema = Yup.object().shape({\n email: Yup.string()\n .email('Email format is incorrect')\n .required('Email address is required')\n .max(320, 'Email is too long'),\n password: Yup.string().required('Password is required'),\n});\n","import { ButtonType } from './button-type.enum';\nimport React from 'react';\nimport './button.scss';\n\ninterface CustomButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n styleType: ButtonType;\n}\n\nconst Button = React.forwardRef(\n (props, ref) => {\n let buttonTypeClass = '';\n\n switch (props.styleType) {\n case ButtonType.PRIMARY:\n buttonTypeClass = 'button__primary';\n break;\n case ButtonType.PRIMARY_REVERSE:\n buttonTypeClass = 'button__primary-reverse';\n break;\n case ButtonType.SECONDARY:\n buttonTypeClass = 'button__secondary';\n break;\n case ButtonType.TERTIARY:\n buttonTypeClass = 'button__tertiary';\n break;\n default:\n break;\n }\n\n return (\n \n {props.children}\n \n );\n }\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n","import { gql } from '@apollo/client';\n\nexport const AUTHENTICATE_CUSTOMER = gql`\n mutation authenticateCustomer($custCred: CustomerAccessTokenCreateInput!) {\n customerAccessTokenCreate(input: $custCred) {\n customerUserErrors {\n field\n message\n code\n }\n customerAccessToken {\n accessToken\n expiresAt\n }\n }\n }\n`;\n","import React, { useRef, useState, useEffect, useCallback } from 'react';\nimport { Formik } from 'formik';\nimport {\n FormEmail,\n FormPassword,\n} from '../../shared/components/customFormField/FormField';\nimport { LoginValidationSchema } from './LoginValidationSchema';\nimport Button from '../../shared/components/customButton/Button';\nimport { ButtonType } from '../../shared/components/customButton/button-type.enum';\nimport ClipLoader from 'react-spinners/ClipLoader';\nimport { useAuthContext } from '../../shared/context/auth.context';\nimport { useHistory } from 'react-router-dom';\nimport ILoginResponseDTO from '../../shared/models/login-response.dto';\nimport ILoginRequestDTO from '../../shared/models/login-request.dto';\nimport ICustomerInfoResponseDTO from '../../shared/models/customer-info-response.dto';\nimport ICustomerInfoRequestDTO from '../../shared/models/customer-info-request.dto';\nimport { AUTHENTICATE_CUSTOMER } from '../../shared/gql/user-authentication.gql';\nimport { useLazyQuery, useMutation } from '@apollo/client';\nimport { GET_CUSTOMER } from '../../shared/gql/customer.gql';\nimport './login-form.scss';\n\nexport const LoginForm: React.FC = () => {\n const [\n authenticateUser,\n { loading: loginAPILoading, data: authData },\n ] = useMutation(AUTHENTICATE_CUSTOMER);\n\n const [fetchCustomerData, { data: customerData }] = useLazyQuery<\n ICustomerInfoResponseDTO,\n ICustomerInfoRequestDTO\n >(GET_CUSTOMER, {\n notifyOnNetworkStatusChange: true,\n });\n\n const [loginAPIError, setLoginAPIError] = useState(false);\n const { setIsAuth, setLoggedInCustomer } = useAuthContext();\n const history = useHistory();\n const accessTokenRef = React.useRef('');\n const submitRef = useRef(null);\n\n const getLoggedInCustomerData = useCallback(\n (customerAccessToken: string) => {\n const variables: ICustomerInfoRequestDTO = {\n customerAccessToken,\n };\n\n fetchCustomerData({ variables });\n },\n [fetchCustomerData]\n );\n\n useEffect(() => {\n if (authData) {\n if (authData.customerAccessTokenCreate.customerAccessToken) {\n accessTokenRef.current =\n authData.customerAccessTokenCreate.customerAccessToken.accessToken;\n getLoggedInCustomerData(\n authData.customerAccessTokenCreate.customerAccessToken.accessToken\n );\n } else {\n setLoginAPIError(true);\n }\n }\n }, [authData, setIsAuth, history, getLoggedInCustomerData]);\n\n useEffect(() => {\n if (customerData) {\n if (customerData.customer) {\n setLoggedInCustomer(customerData.customer);\n sessionStorage.setItem('accessToken', accessTokenRef.current!);\n setLoginAPIError(false);\n setIsAuth(true);\n history.push('/invitations');\n } else {\n setLoginAPIError(true);\n }\n }\n }, [customerData, history, setIsAuth, setLoggedInCustomer]);\n\n return (\n
\n {\n setLoginAPIError(false);\n const variables: ILoginRequestDTO = {\n custCred: values,\n };\n await authenticateUser({ variables });\n }}\n >\n {({ errors, touched, isValid, handleSubmit, isSubmitting }) => (\n
\n \n \n
\n Please visit the main website if you need to reset your password\n
\n \n Login\n \n \n {loginAPIError && (\n
\n Login Failed. Check credentials.\n
\n )}\n \n )}\n \n
\n );\n};\n","export default __webpack_public_path__ + \"static/media/icon-cart-white.e9b83134.svg\";","export default __webpack_public_path__ + \"static/media/vanguard-logo-white.0e202a18.svg\";","export default __webpack_public_path__ + \"static/media/drink-wise.26b87fbb.svg\";","import React from 'react';\nimport drinkWise from '../../../assets/drink-wise.svg';\nimport './footer.scss';\n\nexport const Footer: React.FC<{\n backgroundColor: string;\n isLoginPage?: boolean;\n}> = (props) => {\n return (\n <>\n \n
\n
\n
\n By submitting this form, you agree to the Privacy Policy\n
\n
\n \n
Privacy Policy
\n \n \n
Terms & Conditions
\n \n \n \n \n
\n
\n
\n © 2021, Vanguard Bottleshop. To experience this site you must be of\n legal drinking age in your country of residence. Vanguard Luxury\n Brands promotes responsible alcohol consumption practices at all\n times. NSW Packaged Liquor Licence Number LIQP770010184. NT\n Interstate Retailer Licence IRL0176. NSW | Liquor Act 2007: it is\n against the law to sell or supply alcohol to, or to obtain alcohol\n on behalf of, a person under the age of 18 years ACT | Liquor Act\n 2010: it is an offence to supply alcohol to a person under the age\n of 18 years. Penalties apply. VIC | Warning: Victoria Liquor Control\n Reform Act 1998: it is an offence to supply alcohol to a person\n under the age of 18 years (penalty exceeds at $19,000), for a person\n under the age of 18 years to purchase or receive liquor (penalty\n exceeds $800). QLD | Under the Liquor Act 1992, it is an offence to\n supply liquor to a person under the age of 18 years. WA | Warning:\n Under the Liquor Control Act 1988, it is an offence: to sell or\n supply liquor to a person under the age of 18 years on licensed or\n regulated premises; or for a person under the age of 18 years to\n purchase, or attempt to purchase, liquor on licensed or regulated\n premises. TAS | Liquor Licensing Act 1990: it is an offence for\n liquor to be delivered to a person under the age of 18 years. SA |\n Liquor Licensing Act 1997: liquor must not be supplied to persons\n under 18 years of age. NT | Liquor Act 2010: it is against the law\n to sell or supply alcohol to, or to obtain alcohol on behalf of, a\n person under the age of 18 years.\n
\n
\n \n \n );\n};\n","import React from 'react';\nimport { LoginForm } from '../../features/auth/LoginForm';\nimport cartIcon from '../../assets/icon-cart-white.svg';\nimport vanguardLogo from '../../assets/vanguard-logo-white.svg';\nimport { Footer } from '../../shared/components/footer/Footer';\nimport './bottle-shop.scss';\n\nexport const BottleShop: React.FC = () => {\n const onClickVanguard = () => {\n window.open('https://vanguardbottleshop.com.au', '_blank');\n };\n\n return (\n <>\n
\n
\n
\n
\n \n
Go to Vanguard Bottleshop
\n
\n
\n
\n \n
\n
\n
\n
\n
Vanguard Bottleshop
\n
\n Vanguard Bottleshop is an exclusive online store for team members\n of Lion and Vanguard Luxury Brands, and their friends and family.\n Please login to invite your friends and family members.\n
\n
\n
\n
Login to invite friends & family
\n \n
\n
\n
\n
\n \n );\n};\n","import React from 'react';\nimport { BottleShop } from '../features/home/BottleShop';\nimport './home-page.scss';\n\nexport const HomePage: React.FC = () => {\n return (\n
\n \n
\n );\n};\n","export default __webpack_public_path__ + \"static/media/icon-close.0fc03e3e.svg\";","import React from 'react';\nimport Modal from 'react-bootstrap/Modal';\nimport iconClose from '../../../assets/icon-close.svg';\nimport './custom-modal.scss';\n\nexport const CustomModal: React.FC<{\n show: boolean;\n showCloseIcon: boolean;\n onHide: () => void;\n title: string;\n backdrop: 'static' | boolean;\n dialogClassName?: string;\n}> = (props) => {\n const {\n onHide,\n showCloseIcon,\n backdrop,\n title,\n dialogClassName,\n ...rest\n } = props;\n\n return (\n \n \n \n \n \n
{title}
\n
\n {props.children}\n \n );\n};\n","import React, { useState, useRef } from 'react';\nimport Button from '../../shared/components/customButton/Button';\nimport { ButtonType } from '../../shared/components/customButton/button-type.enum';\nimport ClipLoader from 'react-spinners/ClipLoader';\nimport IInvitedCustomerModel from '../../shared/models/invited-customer-info-model';\nimport './delete-modal.scss';\nimport { API } from 'aws-amplify';\n\ninterface IDeleteModalProps {\n getInvitedCustomers: () => void;\n setShowDeleteModal: React.Dispatch>;\n customerToBeDeleted: IInvitedCustomerModel | undefined;\n customers: IInvitedCustomerModel[];\n setCustomers: React.Dispatch<\n React.SetStateAction\n >;\n}\n\nexport const DeleteModal: React.FC = (props) => {\n const [deleteLoading, setDeleteLoading] = useState(false);\n const [deleteError, setDeleteError] = useState(false);\n const confirmRef = useRef(null);\n const cancelRef = useRef(null);\n\n const deleteCustomer = async () => {\n const { id } = props.customerToBeDeleted!;\n setDeleteLoading(true);\n await API.del('apiVanguard', `/customer`, {\n body: { id },\n }).then(\n () => {\n setDeleteLoading(false);\n setDeleteError(false);\n props.setShowDeleteModal(false);\n const updatedCustomers = props.customers.filter(\n (customer) => customer.id !== props.customerToBeDeleted!.id\n );\n props.setCustomers(updatedCustomers);\n },\n () => {\n setDeleteLoading(false);\n setDeleteError(true);\n }\n );\n };\n\n return (\n
\n
\n The recipient will not be able to accept your invite, but you can invite\n them again later.\n
\n deleteCustomer()}\n >\n Yes\n \n props.setShowDeleteModal(false)}\n >\n No\n \n \n {deleteError && (\n
Deletion Failed. Contact Vanguard.
\n )}\n
\n );\n};\n","import React from 'react';\nimport IInvitedCustomerModel from '../../shared/models/invited-customer-info-model';\nimport moment from 'moment';\nimport './invitation-table.scss';\n\ninterface IInvitationTableProps {\n customers: IInvitedCustomerModel[];\n showDeleteDialog: (customer: IInvitedCustomerModel) => void;\n}\n\nexport const InvitationTable: React.FC = (props) => {\n return (\n
\n {props.customers && props.customers.length > 0 && (\n \n \n \n \n \n \n \n \n \n \n {props.customers!.map((customer, idx) => {\n return (\n \n \n \n \n \n \n );\n })}\n \n
EmailDateStatusAction
\n
{customer.email}
\n
\n
\n {moment(customer.created_at).format('DD/MM/YYYY')}\n
\n
\n {customer.state == 'invited' ? (\n Invite pending\n ) : customer.state == 'disabled' ? (\n Disabled\n ) : customer.state == 'declined' ? (\n Invite declined\n ) : (\n Accepted\n )}\n \n {customer.state === 'invited' ||\n customer.state === 'declined' ? (\n props.showDeleteDialog(customer)}\n >\n Delete\n \n ) : customer.state === 'disabled' ? (\n
Contact Vanguard
\n ) : (\n
\n )}\n
\n )}\n
\n );\n};\n","import React from 'react';\nimport IInvitedCustomerModel from '../../shared/models/invited-customer-info-model';\nimport './invitation-list.scss';\nimport moment from 'moment';\n\ninterface IInvitationListProps {\n customers: IInvitedCustomerModel[];\n showDeleteDialog: (customer: IInvitedCustomerModel) => void;\n}\n\nexport const InvitationList: React.FC = (props) => {\n return (\n
\n {props.customers && props.customers.length > 0 && (\n <>\n
\n
Email
\n
Status
\n
\n
\n {props.customers.map((customer, idx) => {\n return (\n
\n
\n
{customer.email}
\n {customer.state == 'invited' ? (\n
Invite pending
\n ) : customer.state == 'disabled' ? (\n
Disabled
\n ) : customer.state == 'declined' ? (\n
Invite declined
\n ) : (\n
Accepted
\n )}\n
\n
\n
\n {moment(customer.created_at).format('DD/MM/YYYY')}\n
\n {customer.state === 'invited' ||\n customer.state === 'declined' ? (\n props.showDeleteDialog(customer)}\n >\n Delete\n
\n ) : customer.state === 'disabled' ? (\n
Contact Vanguard
\n ) : (\n
\n )}\n
\n
\n );\n })}\n
\n \n )}\n \n );\n};\n","import * as Yup from 'yup';\n\nexport const InviteValidationSchema = Yup.object().shape({\n email: Yup.string()\n .email('Email format is incorrect')\n .required('Email address is required')\n .max(320, 'Email is too long'),\n firstName: Yup.string()\n .required('First name is required')\n .max(320, 'First name is too long'),\n lastName: Yup.string()\n .required('Last name is required')\n .max(320, 'Last name is too long'),\n consent: Yup.bool()\n .required('Please confirm that you have consent')\n .oneOf([true], 'Please confirm that you have consent'),\n});\n","import React, { useState, useRef } from 'react';\nimport Button from '../../shared/components/customButton/Button';\nimport { ButtonType } from '../../shared/components/customButton/button-type.enum';\nimport ClipLoader from 'react-spinners/ClipLoader';\nimport { API } from 'aws-amplify';\nimport { useAuthContext } from '../../shared/context/auth.context';\nimport './invite-modal.scss';\nimport { InviteValidationSchema } from './InviteValidationSchema';\nimport { Formik, Field } from 'formik';\nimport {\n FormInput,\n FormDate,\n} from '../../shared/components/customFormField/FormField';\nimport IInvitedCustomerModel from '../../shared/models/invited-customer-info-model';\nimport { ValidationErrorMessage } from '../../shared/components/customErrorMessage/ValidationErrorMessage';\n\ninterface IInviteModalProps {\n getInvitedCustomers: () => void;\n setShowInviteModal: React.Dispatch>;\n customers: IInvitedCustomerModel[];\n setCustomers: React.Dispatch<\n React.SetStateAction\n >;\n}\n\ninterface InviteFormModel {\n email: string;\n firstName: string;\n lastName: string;\n dob: string;\n}\n\nexport const InviteModal: React.FC = (props) => {\n const [inviteLoading, setInviteLoading] = useState(false);\n const [inviteError, setInviteError] = useState(false);\n const [inviteErrorMessage, setInviteErrorMessage] = useState('');\n const confirmRef = useRef(null);\n const cancelRef = useRef(null);\n const { loggedInCustomer } = useAuthContext();\n\n const createAndInviteCustomer = async (values: InviteFormModel) => {\n setInviteLoading(true);\n await API.post('apiVanguard', '/customer', {\n body: {\n customer: {\n email: values.email,\n first_name: values.firstName,\n last_name: values.lastName,\n note: `DOB:${values.dob}`,\n tags: loggedInCustomer.id,\n },\n },\n }).then(\n async (res) => {\n await API.post('apiVanguard', '/customer/invite', {\n body: { id: res.customer.id },\n }).then(\n () => {\n const updatedCustomers = [\n {\n email: res.customer.email,\n id: res.customer.id,\n state: 'invited',\n created_at: res.customer.created_at,\n tags: res.customer.tags,\n note: res.customer.note,\n first_name: res.customer.first_name,\n last_name: res.customer.last_name,\n },\n ...props.customers!,\n ] as IInvitedCustomerModel[];\n props.setCustomers(updatedCustomers);\n setInviteLoading(false);\n setInviteError(false);\n props.setShowInviteModal(false);\n },\n () => {\n const updatedCustomers = [\n {\n email: res.customer.email,\n id: res.customer.id,\n state: 'disabled',\n created_at: res.customer.created_at,\n tags: res.customer.tags,\n note: res.customer.note,\n first_name: res.customer.first_name,\n last_name: res.customer.last_name,\n },\n ...props.customers!,\n ] as IInvitedCustomerModel[];\n props.setCustomers(updatedCustomers);\n setInviteLoading(false);\n setInviteError(true);\n setInviteErrorMessage(\n 'Invitation email sending failed. Contact Vanguard.'\n );\n }\n );\n },\n (err) => {\n setInviteError(true);\n setInviteLoading(false);\n if (err.response.status == 422) {\n setInviteErrorMessage('This person already has an account');\n } else {\n setInviteErrorMessage('Customer creation failed. Contact Vanguard.');\n }\n }\n );\n };\n\n return (\n
\n {\n await createAndInviteCustomer(values);\n }}\n >\n {({\n errors,\n touched,\n isValid,\n handleSubmit,\n isSubmitting,\n handleBlur,\n handleChange,\n setFieldTouched,\n }) => (\n
\n \n \n \n \n
\n \n \n
\n \n Send\n \n props.setShowInviteModal(false)}\n >\n Cancel\n \n \n {inviteError && (\n
{inviteErrorMessage}
\n )}\n \n )}\n \n
\n );\n};\n","import React, { useEffect, useState, useCallback } from 'react';\nimport './invitations.scss';\nimport Button from '../../shared/components/customButton/Button';\nimport { ButtonType } from '../../shared/components/customButton/button-type.enum';\nimport { API } from 'aws-amplify';\nimport { useAuthContext } from '../../shared/context/auth.context';\nimport _ from 'underscore';\nimport { CustomModal } from '../../shared/components/customModal/CustomModal';\nimport { DeleteModal } from './DeleteModal';\nimport { InvitationTable } from './InvitationTable';\nimport { InvitationList } from './InvitationList';\nimport { InviteModal } from './InviteModal';\nimport IInvitedCustomerModel from '../../shared/models/invited-customer-info-model';\nimport { isMobileOnly } from 'react-device-detect';\n\nexport const Invitations: React.FC = () => {\n const [customers, setCustomers] = useState();\n const [totalAcceptedCustomers, setTotalAcceptedCustomers] = useState(0);\n const [totalInvitedCustomers, setTotalInvitedCustomers] = useState(0);\n const { loggedInCustomer } = useAuthContext();\n\n const [showDeleteModal, setShowDeleteModal] = useState(false);\n const [\n customerToBeDeleted,\n setCustomerToBeDeleted,\n ] = useState();\n\n const [showInviteModal, setShowInviteModal] = useState(false);\n const [invitedCustomersFetchError, setInvitedCustomersFetchError] = useState(\n false\n );\n\n const getInvitedCustomers = useCallback(async () => {\n if (loggedInCustomer.id)\n await API.get(\n 'apiVanguard',\n `/customer/${loggedInCustomer.id.replace(/^\\D+/g, '')}`,\n {}\n ).then(\n (res) => {\n setCustomers(res.customers);\n setInvitedCustomersFetchError(false);\n },\n () => {\n setInvitedCustomersFetchError(true);\n }\n );\n }, [loggedInCustomer]);\n\n useEffect(() => {\n getInvitedCustomers();\n window.scrollTo(0, 0);\n }, [loggedInCustomer, getInvitedCustomers]);\n\n useEffect(() => {\n const enabledCustomers = _.filter(customers! as any[], (customer) => {\n if (customer.state == 'enabled') {\n return true;\n }\n });\n const invitedCustomers = _.filter(customers! as any[], (customer) => {\n if (customer.state !== 'declined') {\n return true;\n }\n });\n setTotalAcceptedCustomers(enabledCustomers.length);\n setTotalInvitedCustomers(invitedCustomers.length);\n }, [customers]);\n\n const showDeleteDialog = (customer: IInvitedCustomerModel) => {\n setCustomerToBeDeleted(customer);\n setShowDeleteModal(true);\n };\n\n return (\n <>\n
\n
\n Hi, {loggedInCustomer.firstName} {loggedInCustomer.lastName}\n
\n
\n Send invites and track their status below. You can invite up to 10\n friends and family members above the age of 18.\n
\n
My invites
\n 0 ? 'space-between' : 'center',\n }}\n >\n {customers && customers.length > 0 && (\n
\n
\n
Total Invited
\n {customers ? (\n
\n {totalInvitedCustomers}\n
\n ) : (\n
0
\n )}\n
\n
\n
Total Accepted
\n
\n {totalAcceptedCustomers}\n
\n
\n
\n )}\n {customers && totalInvitedCustomers >= 10 ? (\n \n Invites used up\n \n ) : (\n setShowInviteModal(true)}\n >\n Send a new invite\n \n )}\n
\n {!invitedCustomersFetchError ? (\n isMobileOnly ? (\n \n ) : (\n \n )\n ) : (\n
\n Error fetching invited customer details\n
\n )}\n \n setShowDeleteModal(false)}\n backdrop=\"static\"\n title=\"Are you sure?\"\n >\n \n \n setShowInviteModal(false)}\n backdrop=\"static\"\n title=\"Send email invitation to\"\n >\n \n \n \n );\n};\n","export default __webpack_public_path__ + \"static/media/vanguard-logo.d40d5ae0.svg\";","export default __webpack_public_path__ + \"static/media/icon-cart.3dc28a77.svg\";","export default __webpack_public_path__ + \"static/media/icon-logout.23caf90a.svg\";","import React from 'react';\nimport { useHistory } from 'react-router-dom';\nimport vanguardLogo from '../../../assets/vanguard-logo.svg';\nimport './header.scss';\nimport cartIcon from '../../../assets/icon-cart.svg';\nimport logoutIcon from '../../../assets/icon-logout.svg';\nimport { useAuthContext } from '../../../shared/context/auth.context';\nimport { isMobile } from 'react-device-detect';\n\nexport const Header: React.FC = () => {\n const history = useHistory();\n const { setIsAuth } = useAuthContext();\n\n const logout = () => {\n sessionStorage.removeItem('accessToken');\n setIsAuth(false);\n history.push('/');\n };\n\n const onClickVanguard = () => {\n window.open('https://vanguardbottleshop.com.au', '_blank');\n };\n\n return (\n
\n
\n
\n
\n \n
\n {!isMobile ? 'Go to Vanguard Bottleshop' : 'Shop'}\n
\n
\n
\n
\n \n
\n
\n
\n \n
Logout
\n
\n
\n
\n
\n );\n};\n","import React from 'react';\nimport { Invitations } from '../features/invitations/Invitations';\n\nimport './invitations-page.scss';\nimport { Header } from '../shared/components/header/Header';\nimport { Footer } from '../shared/components/footer/Footer';\n\nexport const InvitationsPage: React.FC = () => {\n return (\n
\n
\n \n
\n
\n );\n};\n","/* eslint-disable */\n// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.\n\nconst awsmobile = {\n \"aws_project_region\": \"ap-southeast-2\",\n \"aws_cloud_logic_custom\": [\n {\n \"name\": \"apiVanguard\",\n \"endpoint\": \"https://knax5dj0xe.execute-api.ap-southeast-2.amazonaws.com/dev\",\n \"region\": \"ap-southeast-2\"\n }\n ]\n};\n\n\nexport default awsmobile;\n","import React from 'react';\nimport { Route, BrowserRouter as Router, Switch } from 'react-router-dom';\nimport { AuthProvider } from './shared/context/auth.context';\nimport { AuthRouteGuard } from './shared/services/AuthRouteGuard';\nimport { HomePage } from './pages/HomePage';\nimport { InvitationsPage } from './pages/InvitationsPage';\nimport Amplify from 'aws-amplify';\nimport awsconfig from './aws-exports';\nimport './styles/global.scss';\n\nAmplify.configure(awsconfig);\n\nconst App: React.FC = () => {\n return (\n \n
\n \n \n \n \n \n \n
\n
\n );\n};\n\nexport default App;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './styles/global.scss';\nimport '../src/shared/interceptors/axios-request.interceptors';\nimport {\n SHOPIFY_STORE_URL,\n SHOPIFY_STOREFRONT_GRAPHQL_RELATIVE_URL,\n SHOPIFY_STOREFRONT_ACCESS_TOKEN,\n} from './shared/configs/AppConfigs';\nimport {\n ApolloClient,\n InMemoryCache,\n createHttpLink,\n from,\n} from '@apollo/client';\nimport { ApolloProvider } from '@apollo/client/react';\nimport { setContext } from '@apollo/client/link/context';\nimport App from './App';\n\nconst httpLink = createHttpLink({\n uri: `${SHOPIFY_STORE_URL}/${SHOPIFY_STOREFRONT_GRAPHQL_RELATIVE_URL}`,\n});\n\nconst authLink = setContext(() => ({\n headers: {\n 'X-Shopify-Storefront-Access-Token': SHOPIFY_STOREFRONT_ACCESS_TOKEN,\n },\n}));\n\nconst client = new ApolloClient({\n link: from([authLink, httpLink]),\n cache: new InMemoryCache(),\n});\n\nReactDOM.render(\n \n \n \n \n ,\n document.getElementById('root')\n);\n"],"sourceRoot":""}