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I,CAAEL,GAGhC,IAAI,CAACpP,IAAI,CAAG,aACZ,IAAI,CAACgJ,QAAQ,CAAGA,EAChB,IAAI,CAACM,IAAI,CAAGA,MAAAA,EAAAA,EAAQ,CAAE+F,QAAAA,CAAQ,CAChC,CACF,oFC9CO,IAAMnB,EAAY,CAACwB,EAA0B1Q,EAAqBQ,IAAgC,EACvGsP,MAAO,GACP9O,KAAM0P,EAAY1P,IAAI,CACtBhB,YAAAA,EACA6P,eAAgB,GAChBtS,GAAImT,EAAYC,GAAG,CACnBZ,MAAOrF,EAAAA,CAAYA,CAACC,SAAS,CAAC3K,GAC9BQ,aAAAA,EACA8O,OAAQoB,EAAY9B,GAAG,CACzB","sources":["webpack://_N_E/?87cc","webpack://_N_E/./src/growthbook/growthbook.ts","webpack://_N_E/./src/components/ui/toast.tsx","webpack://_N_E/./src/components/ui/toaster.tsx","webpack://_N_E/./src/app/layout.tsx","webpack://_N_E/./src/constants/Endpoints.ts","webpack://_N_E/./src/constants/QueryTypes.ts","webpack://_N_E/./src/hooks/use-toast.ts","webpack://_N_E/./src/lib/useUser.ts","webpack://_N_E/./src/lib/utils.ts","webpack://_N_E/./src/services/api.ts","webpack://_N_E/./src/services/auth0.ts","webpack://_N_E/./src/services/jwt.ts","webpack://_N_E/./src/state/user/context.ts","webpack://_N_E/./src/state/user/actions.ts","webpack://_N_E/./src/state/user/reducer.ts","webpack://_N_E/./src/state/user/state.ts","webpack://_N_E/./src/utils/fetchJson.ts","webpack://_N_E/./src/utils/user.ts","webpack://_N_E/./src/styles/chat.css","webpack://_N_E/./src/styles/globals.css","webpack://_N_E/./src/styles/order.css","webpack://_N_E/./src/styles/otp.css","webpack://_N_E/./src/styles/profile.css","webpack://_N_E/./src/styles/team.css"],"sourcesContent":["import(/* webpackMode: \"eager\" */ \"/codebuild/output/src3430008616/src/supplier-web/src/app/layout.tsx\");\n","import { GrowthBook } from '@growthbook/growthbook-react';\n\nexport const growthbook = new GrowthBook({\n apiHost: 'https://cdn.growthbook.io',\n clientKey: 'sdk-vz10FslX7uF08w',\n enableDevMode: true,\n trackingCallback: (experiment, result) => {\n // TODO: Use your real analytics tracking system\n console.log('Viewed Experiment', {\n experimentId: experiment.key,\n variationId: result.key,\n });\n },\n});\n","'use client';\n\nimport * as React from 'react';\n\nimport { Cross2Icon } from '@radix-ui/react-icons';\nimport * as ToastPrimitives from '@radix-ui/react-toast';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariants = cva(\n 'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border border-gray-200 p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full dark:border-gray-800',\n {\n variants: {\n variant: {\n default: 'border bg-white text-gray-950 dark:bg-gray-950 dark:text-gray-50',\n destructive:\n 'destructive group border-red-500 bg-red-500 text-gray-50 dark:border-red-900 dark:bg-red-900 dark:text-gray-50',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nconst Toast = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & VariantProps\n>(({ className, variant, ...props }, ref) => {\n return ;\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef;\n\ntype ToastActionElement = React.ReactElement;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n","\"use client\"\n\nimport { useToast } from \"@/hooks/use-toast\"\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from \"@/components/ui/toast\"\n\nexport function Toaster() {\n const { toasts } = useToast()\n\n return (\n \n {toasts.map(function ({ id, title, description, action, ...props }) {\n return (\n \n
\n {title && {title}}\n {description && (\n {description}\n )}\n
\n {action}\n \n
\n )\n })}\n \n
\n )\n}\n","/* eslint-disable @typescript-eslint/no-confusing-void-expression */\n'use client';\n\nimport React, { useTransition, useEffect, useReducer, useState } from 'react';\nimport '@/styles/chat.css';\nimport '@/styles/globals.css';\nimport '@/styles/order.css';\nimport '@/styles/otp.css';\nimport '@/styles/profile.css';\nimport '@/styles/team.css';\n\nimport { GrowthBookProvider } from '@growthbook/growthbook-react';\nimport { get } from 'lodash';\nimport { useRouter } from 'next/navigation';\nimport { GoogleAnalytics } from 'nextjs-google-analytics';\nimport { default as GA4, default as UA } from 'react-ga4';\nimport { hotjar } from 'react-hotjar';\nimport { QueryClient, QueryClientProvider } from 'react-query';\nimport { ReactQueryDevtools } from 'react-query/devtools';\nimport { ToastContainer } from 'react-toastify';\n\nimport useUser from '@/lib/useUser';\nimport { JWTService } from '@/services/jwt';\nimport { UserContext } from '@/state/user/context';\nimport { setUser, userReducer } from '@/state/user/reducer';\nimport { initialUserState } from '@/state/user/state';\n\nimport 'react-toastify/dist/ReactToastify.css';\nimport { growthbook } from '@/growthbook/growthbook';\n\nimport { Toaster } from '../components/ui/toaster';\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n const router = useRouter();\n const segment = get(children, 'props.childProp.segment');\n const { fetchUser } = useUser({ isLanding: segment !== 'dashboard' });\n\n const [queryClient] = useState(() => new QueryClient());\n const [state, dispatch] = useReducer(userReducer, initialUserState);\n const [loadingUser, setLoadingUser] = useState(true);\n const [isPending, startTransition] = useTransition();\n const [isReady, setIsReady] = useState(false);\n\n useEffect(() => {\n // Load features asynchronously when the app renders\n growthbook.init({ streaming: true });\n }, []);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n if (process.env.NEXT_PUBLIC_HOTJAR_ID && process.env.NEXT_PUBLIC_HOTJAR_SNIPPET_VERSION) {\n hotjar.initialize(+process.env.NEXT_PUBLIC_HOTJAR_ID, +process.env.NEXT_PUBLIC_HOTJAR_SNIPPET_VERSION);\n }\n UA.initialize('UA-237619107-1');\n GA4.initialize('G-8TEG8J9F50');\n }\n }, []);\n\n useEffect(() => {\n if (!isPending && isReady) {\n hideLoading();\n }\n }, [isPending, isReady]);\n\n useEffect(() => {\n const getUser = async () => {\n const isValidToken = JWTService.isValidToken();\n const user = await fetchUser('/api/user', 'GET');\n if (isValidToken && user && user?.accessToken !== '') {\n await getStoredUser();\n if (segment === 'auth' || segment === '__PAGE__') {\n startTransition(() => {\n router.push('/dashboard/orders');\n });\n }\n setIsReady(true);\n } else {\n try {\n localStorage.clear();\n await fetchUser('/api/logout', 'POST');\n hideLoading();\n } catch (error) {\n router.push('/');\n hideLoading();\n }\n }\n };\n getUser();\n }, []);\n\n const getStoredUser = async () => {\n const storedUser: string | null = localStorage.getItem('user');\n if (storedUser) {\n JWTService.refreshToken();\n const user: User = JSON.parse(storedUser);\n dispatch(setUser(user));\n }\n };\n\n const hideLoading = () => {\n setLoadingUser(false);\n };\n\n return (\n \n \n Alisto Web Suppliers\n \n \n {process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID && }\n \n \n \n \n \n {loadingUser ? (\n
\n
\n \n \n \n \n
\n
\n ) : (\n
{children}
\n )}\n \n \n \n
\n
\n
\n \n \n );\n}\n","/* eslint-disable import/no-anonymous-default-export */\nexport default {\n AD_BROADCASTS: '/ad-broadcasts',\n AUTH0_OAUTH_TOKEN: '/oauth/token',\n AUTH0_PASSWORDLESS_START: '/passwordless/start',\n AUTH0_ROLES: 'api/v2/roles',\n AUTH0_UPDATE_USER_METADATA: '/api/v2/users/',\n AUTH0_UPDATE_USERS: '/api/v2/users',\n ADMINISTRATIVE_DIVISIONS: '/app-settings/administrative-divisions',\n BD_USER_PROFILE: '/users/profile',\n FAVORITE_PRODUCTS: '/favorite-products/',\n FILE_UPLOADS: '/file-uploads',\n ORDER_BULK_CONFIRM: '/orders/bulk-confirm',\n ORDER_EXPORT: '/orders/export',\n ORDER_GET: '/orders/',\n ORDER_UPDATE_TOKEN: '/orders/approve_anonymously',\n ORDERS: '/orders',\n PRODUCT_CATEGORIES: '/product-categories',\n PRODUCT_TO_FAVORITES: '/favorite-products/',\n PRODUCT_UNITS: '/products-measurement-units',\n PRODUCTS_BULK: '/products/bulk-update',\n PRODUCTS_DELETE_BULK: '/products/bulk-remove',\n PRODUCTS: '/products/',\n ADD_PRODUCT_CATALOG: '/products/add-catalog/',\n RESTAURANT_FAVORITES: '/products',\n RESTAURANT_GET: '/restaurants/',\n RESTAURANT_GET_SIMILARITIES: '/restaurants/similar',\n RESTAURANT_CREATE: '/restaurants',\n RESTAURANT_REGISTRATION: '/registrations/restaurants',\n RESTAURANT_SEARCH_AUTOCOMPLETE: '/searches/restaurants',\n RESTAURANT_SUPPLIER: '/restaurants-suppliers/',\n RESTAURANT_USER_INVITATIONS_DETAIL: '/supplier-user-invitations/details',\n RESTAURANT_USER_INVITATIONS: '/restaurant-invitations',\n RESTAURANT_USER_INVITATIONS_CREATE: '/restaurant-user-invitations',\n RESTAURANT_USER: '/restaurant-users',\n USER_INVITATIONS_DETAIL: '/restaurant-user-invitations/details',\n SUPPLIER_CATALOG: '/products/',\n SUPPLIER_CATEGORIES: '/supplier-categories',\n SUPPLIER_SCHEDULE: '/suppliers/schedule',\n SUPPLIER_GET: '/suppliers/',\n SUPPLIER_INVITE: '/supplier-invites',\n SUPPLIER_REGISTRATION: '/registrations/suppliers',\n SUPPLIER_REQUEST_ACCESS: '/access-requests/supplier',\n SUPPLIER_RESTAURANTS_BULK: '/restaurants-suppliers/bulk-update',\n SUPPLIER_RESTAURANTS: '/restaurants-suppliers',\n SUPPLIER_SEARCH_AUTOCOMPLETE: '/searches/suppliers',\n SUPPLIER_USER_INVITATION_POST: '/supplier-user-invitations',\n SUPPLIER_USER_INVITATIONS_DETAIL: '/supplier-user-invitations/details',\n SUPPLIER_USER_INVITATIONS: '/supplier-user-invitations',\n SUPPLIER_USER_VALIDATION: '/user-validations/supplier',\n UPLOAD_CSV: '/product-uploads/upload',\n UPLOAD_FILE: '/file-uploads',\n UPLOAD_FILES: '/file-uploads/multiple',\n PRODUCT_THUMBNAIL: '/file-uploads/product',\n USER_UPDATE_DATA: '/users/',\n SUPPLIER_USERS: '/supplier-users',\n};\n","export enum QueryTypes {\n PROFILE = 'profile',\n CATALOG = 'catalog',\n CATEGORY = 'category',\n FAVORITES = 'favorites',\n DBPROFILE = 'dbprofile',\n RESTAURANT_SUPPLIER = 'restaurant-supplier',\n RESTAURANT_USER_INVITATION_DETAILS = 'restaurant-user-invitation-details',\n ORDER = 'order',\n INVITATION = 'invitation',\n ORDERS = 'orders',\n PENDING_ORDERS = 'pending_orders',\n SUPPLIER = 'supplier',\n PRODUCTS = 'products',\n FAVORITE_PRODUCTS = 'favorite_products',\n PRODUCT_CATEGORIES = 'product-categories',\n PRODUCT_UNITS = 'product-units',\n SUPPLIER_CATEGORIES = 'supplier-categories',\n SUPPLIER_SCHEDULE = 'supplier-schedule',\n ORDERS_EXPORT_PDF = 'orders_export_pdf',\n USERS_BY_COMPANY_WITH_DOMAIN = 'users-by-company-with-domain',\n USERS_BY_COMPANY = 'users-by-company',\n SUPPLIER_USERS = 'supplier-users',\n}\n\nexport interface BaseApiRequest {\n data: T[];\n links: {\n current: string;\n };\n meta: {\n currentPage: number;\n itemsPerPage: number;\n sortBy: string[][];\n totalItems: number;\n totalPages: number;\n };\n}\n","\"use client\"\n\n// Inspired by react-hot-toast library\nimport * as React from \"react\"\n\nimport type {\n ToastActionElement,\n ToastProps,\n} from \"@/components/ui/toast\"\n\nconst TOAST_LIMIT = 1\nconst TOAST_REMOVE_DELAY = 1000000\n\ntype ToasterToast = ToastProps & {\n id: string\n title?: React.ReactNode\n description?: React.ReactNode\n action?: ToastActionElement\n}\n\nconst actionTypes = {\n ADD_TOAST: \"ADD_TOAST\",\n UPDATE_TOAST: \"UPDATE_TOAST\",\n DISMISS_TOAST: \"DISMISS_TOAST\",\n REMOVE_TOAST: \"REMOVE_TOAST\",\n} as const\n\nlet count = 0\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER\n return count.toString()\n}\n\ntype ActionType = typeof actionTypes\n\ntype Action =\n | {\n type: ActionType[\"ADD_TOAST\"]\n toast: ToasterToast\n }\n | {\n type: ActionType[\"UPDATE_TOAST\"]\n toast: Partial\n }\n | {\n type: ActionType[\"DISMISS_TOAST\"]\n toastId?: ToasterToast[\"id\"]\n }\n | {\n type: ActionType[\"REMOVE_TOAST\"]\n toastId?: ToasterToast[\"id\"]\n }\n\ninterface State {\n toasts: ToasterToast[]\n}\n\nconst toastTimeouts = new Map>()\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId)\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId: toastId,\n })\n }, TOAST_REMOVE_DELAY)\n\n toastTimeouts.set(toastId, timeout)\n}\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case \"ADD_TOAST\":\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n }\n\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n }\n\n case \"DISMISS_TOAST\": {\n const { toastId } = action\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId)\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id)\n })\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n }\n }\n case \"REMOVE_TOAST\":\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n }\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n }\n }\n}\n\nconst listeners: Array<(state: State) => void> = []\n\nlet memoryState: State = { toasts: [] }\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action)\n listeners.forEach((listener) => {\n listener(memoryState)\n })\n}\n\ntype Toast = Omit\n\nfunction toast({ ...props }: Toast) {\n const id = genId()\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...props, id },\n })\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id })\n\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss()\n },\n },\n })\n\n return {\n id: id,\n dismiss,\n update,\n }\n}\n\nfunction useToast() {\n const [state, setState] = React.useState(memoryState)\n\n React.useEffect(() => {\n listeners.push(setState)\n return () => {\n const index = listeners.indexOf(setState)\n if (index > -1) {\n listeners.splice(index, 1)\n }\n }\n }, [state])\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\n }\n}\n\nexport { useToast, toast }\n","'use client';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { useRouter } from 'next/navigation';\n\nimport { JWTService } from '@/services/jwt';\nimport fetchJson from '@/utils/fetchJson';\n\nexport default function useUser({ redirectTo = '', redirectIfFound = false, isLanding = false } = {}) {\n const router = useRouter();\n const [user, setUser] = useState();\n\n useEffect(() => {\n fetchUser();\n }, []);\n\n useEffect(() => {\n const isValidToken = JWTService.isValidToken();\n if (redirectTo && redirectIfFound && user?.accessToken && isValidToken) {\n router.push(redirectTo);\n return;\n }\n\n if (!isLanding && redirectTo === '' && user?.accessToken === '' && !isValidToken) {\n router.push('/');\n }\n }, [user, redirectTo, redirectIfFound, isLanding]);\n\n const fetchUser = useCallback(async (route: string = '/api/user', method: string = 'GET', body?: object) => {\n const fetchedUser = await fetchJson(route, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n });\n setUser(fetchedUser);\n return fetchedUser;\n }, []);\n\n return { user, fetchUser };\n}\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import axios, { type AxiosInstance } from 'axios';\nimport { get } from 'lodash';\n\nimport useUser from '@/lib/useUser';\nimport { JWTService } from '@/services/jwt';\n\nconst apiURL = process.env.NEXT_PUBLIC_API_URL;\nconst auth0ApiURL = process.env.NEXT_PUBLIC_AUTH0_ISSUER_BASE_URL;\nconst axiosInstance: AxiosInstance = axios.create({ baseURL: apiURL });\nexport const axiosAuth0Instance: AxiosInstance = axios.create({ baseURL: auth0ApiURL });\n\naxiosInstance.interceptors.request.use(\n async request => {\n const storedUser: string | null = localStorage.getItem('user');\n const anonymous = get(request, 'anonymous', false);\n\n if (request.headers) {\n request.headers['access-control-allow-origin'] = '*';\n request.headers.Tenant = 'supplier';\n }\n if (!anonymous && storedUser && request.headers) {\n const user: User = JSON.parse(storedUser || '');\n request.headers.Authorization = `Bearer ${user.accessToken}`;\n }\n\n return request;\n },\n async err => {\n return await Promise.reject(err);\n },\n);\n\naxiosInstance.interceptors.response.use(\n response => response,\n async error => {\n if (error.response) {\n const isConfirmLocation = window.location.pathname.split('/')[1] === 'confirm';\n if (\n !isConfirmLocation &&\n error.response &&\n (error.response.status === 401 || error.response.status === 403 || !JWTService.isValidToken())\n ) {\n const { fetchUser } = useUser();\n localStorage.clear();\n fetchUser('/api/logout', 'POST');\n }\n }\n\n return await Promise.reject(error.response.data);\n },\n);\n\naxiosAuth0Instance.interceptors.request.use(\n async request => {\n const storedMngmtToken: string | null = localStorage.getItem('mngmtAccessToken');\n if (storedMngmtToken && request.headers) {\n const accessToken: string = JSON.parse(storedMngmtToken || '');\n request.headers.authorization = `Bearer ${accessToken}`;\n request.headers['content-type'] = 'application/json';\n }\n return request;\n },\n async err => {\n return await Promise.reject(err);\n },\n);\n\naxiosAuth0Instance.interceptors.response.use(\n response => response,\n async error => {\n const isConfirmLocation = window.location.pathname.split('/')[1] === 'confirm';\n if (!isConfirmLocation && error.response && error.response.data.statusCode === 401) {\n const { fetchUser } = useUser();\n localStorage.clear();\n fetchUser('/api/logout', 'POST');\n }\n\n return await Promise.reject(error.response.data);\n },\n);\n\nexport default axiosInstance;\n","import {\n useMutation,\n type UseMutationOptions,\n type UseMutationResult,\n useQuery,\n type UseQueryResult,\n type UseQueryOptions,\n} from 'react-query';\n\nimport Endpoints from '@/constants/Endpoints';\nimport { QueryTypes } from '@/constants/QueryTypes';\nimport { axiosAuth0Instance } from '@/services/api';\nimport { JWTService } from '@/services/jwt';\n\ninterface PasswordlessStartFormData {\n client_id: string;\n client_secret?: string; // For Regular Web Applications\n connection: 'email' | 'sms';\n email?: string; // set for connection=email\n phone_number?: string; // set for connection=sms\n send?: 'link' | 'code'; // if left null defaults to link\n authParams?: {\n // any authentication parameters that you would like to add\n scope?: string; // used when asking for a magic link\n state?: string; // used when asking for a magic link, or from the custom login page\n };\n}\n\ninterface PasswordlessStartResponse {\n _id: string;\n phone_number: string;\n phone_verified: boolean;\n request_language: string; // en-US,en;q=0.9\n}\n\ninterface OAuthTokenFormData {\n grant_type: 'http://auth0.com/oauth/grant-type/passwordless/otp' | 'refresh_token';\n client_id: string;\n client_secret?: string; // only for web apps, native apps don’t have a client secret\n username?: string; // or \"\"\n otp?: string;\n realm?: 'email' | 'sms'; // or \"sms\"\n audience?: string; // in case you need an access token for a specific API\n scope?: string; // \"openid\" | \"profile\" | \"email\" whatever scopes you need\n refresh_token?: string;\n}\n\nexport interface OAuthTokenResponse {\n access_token: string;\n refresh_token: string;\n id_token: string; // Too much personal information, maybe this will be not sent\n token_type: string;\n expires_in: number;\n}\n\ninterface UpdateUserFormData {\n blocked?: boolean;\n email_verified?: boolean;\n email?: string;\n phone_number?: string;\n phone_verified?: boolean;\n user_metadata?: object;\n app_metadata?: object;\n given_name?: string;\n family_name?: string;\n name?: string;\n nickname?: string;\n picture?: string;\n verify_email?: boolean;\n verify_phone_number?: boolean;\n password?: string;\n connection?: string;\n client_id?: string;\n username?: string;\n}\n\ninterface UpdateUserResponse {\n user_id: string;\n email: string;\n email_verified: boolean;\n username: string;\n phone_number: string;\n phone_verified: boolean;\n created_at: string;\n updated_at: string;\n identities: Array<{\n connection: string;\n user_id: string;\n provider: string;\n isSocial: boolean;\n }>;\n app_metadata: object;\n user_metadata: object;\n picture: string;\n name: string;\n nickname: string;\n multifactor: string[];\n last_ip: string;\n last_login: string;\n logins_count: number;\n blocked: boolean;\n given_name: string;\n family_name: string;\n}\n\ninterface OAuthMngmtTokenFormData {\n grant_type: string;\n client_id: string;\n client_secret: string; // only for web apps, native apps don’t have a client secret\n audience: string; // in case you need an access token for a specific API\n}\n\ninterface OAuthMngmtTokenResponse {\n access_token: string;\n expires_in: number;\n scope: string;\n token_type: string;\n}\n\ninterface RoleItem {\n description: string;\n id: string;\n name: string;\n}\n\nexport interface OAuthUserRolesResponse extends Array {}\n\ninterface setUserRolesFormData {\n roles: string[];\n userId?: string;\n}\n\nexport class Auth0Service {\n /**\n * @description Sends sms OTP\n * @param username\n */\n static _passwordlessStart = async (username: string): Promise => {\n const formData: PasswordlessStartFormData = {\n connection: 'sms',\n client_id: process.env.NEXT_PUBLIC_AUTH0_CLIENT_ID || '',\n phone_number: username,\n send: 'code',\n };\n\n try {\n const response: any = (await axiosAuth0Instance.post(`${Endpoints.AUTH0_PASSWORDLESS_START}`, formData)).data;\n return response || null;\n } catch (error) {\n throw new Error(`Unknown error: ${JSON.stringify(error)}`);\n }\n };\n\n /**\n * @description Used to log-in based on OTP received from sms.\n * *WARNING: You cannot use this endpoint from Single Page Applications.*\n * @param phone\n * @param code\n */\n static _oauthToken = async (phone: string, code: string): Promise => {\n const formData: OAuthTokenFormData = {\n grant_type: 'http://auth0.com/oauth/grant-type/passwordless/otp',\n client_id: process.env.NEXT_PUBLIC_AUTH0_CLIENT_ID || '',\n client_secret: process.env.NEXT_PUBLIC_AUTH0_CLIENT_SECRET || '',\n username: phone,\n otp: code,\n realm: 'sms', // or \"sms\"\n scope: 'offline_access', // whatever scopes you need\n audience: process.env.NEXT_PUBLIC_AUTH0_AUDIENCE, // THIS MUST BE SET OTHERWISE WE WILL RECEIVE AN OPAQUE TOKEN (CAN'T BE DECODED)\n };\n\n try {\n const response: OAuthTokenResponse = (await axiosAuth0Instance.post(`${Endpoints.AUTH0_OAUTH_TOKEN}`, formData))\n .data;\n return response || null;\n } catch (error: any) {\n throw new Error(error.error_description);\n }\n };\n\n /**\n * @description Get user metadata using auth0 user id\n * @param userId\n */\n private static readonly _getUserProfile = async (userId: string): Promise => {\n try {\n const response: Auth0Profile = (await axiosAuth0Instance.get(`${Endpoints.AUTH0_UPDATE_USER_METADATA}${userId}`))\n .data;\n return response || null;\n } catch (error: any) {\n throw new Error(error.error_description);\n }\n };\n\n public static useUserProfile = (\n userId: string,\n { ...opts }: UseQueryOptions,\n ): UseQueryResult => {\n return useQuery(QueryTypes.PROFILE, async () => await this._getUserProfile(userId), {\n refetchOnWindowFocus: false,\n cacheTime: 0,\n ...opts,\n });\n };\n\n /**\n * @description Patch user metadata using auth0 user id\n * @param userId\n * @param data\n */\n static _patchUserMetaData = async (userId: string, data: object, extraData?: any): Promise => {\n const formData: UpdateUserFormData = {\n user_metadata: data,\n // client_id: Constants.manifest && Constants.manifest.extra ? Constants.manifest.extra.auth0ClientID || '' : '',\n };\n\n if (extraData) {\n formData.name = extraData.name;\n formData.given_name = extraData.given_name;\n formData.family_name = extraData.family_name;\n formData.picture = extraData?.picture;\n }\n\n try {\n const response: UpdateUserResponse = (\n await axiosAuth0Instance.patch(`${Endpoints.AUTH0_UPDATE_USER_METADATA}${userId}`, formData)\n ).data;\n return response || null;\n } catch (error: any) {\n throw new Error(error.error_description);\n }\n };\n\n /**\n * @description Used to log-in based on OTP received from sms.\n * *WARNING: You cannot use this endpoint from Single Page Applications.*\n */\n static _oauthMngmtToken = async (): Promise => {\n const formData: OAuthMngmtTokenFormData = {\n grant_type: 'client_credentials',\n client_id: process.env.NEXT_PUBLIC_AUTH0_MNGMNT_CLIENT_ID || '',\n client_secret: process.env.NEXT_PUBLIC_AUTH0_MNGMNT_CLIENT_SECRET || '',\n audience: process.env.NEXT_PUBLIC_AUTH0_MNGMNT_AUDIENCE || '',\n };\n try {\n const response: OAuthMngmtTokenResponse = (\n await axiosAuth0Instance.post(`${Endpoints.AUTH0_OAUTH_TOKEN}`, formData)\n ).data;\n return response || null;\n } catch (error: any) {\n throw new Error(error.error_description);\n }\n };\n\n static UserRoles(accessToken: string): string[] {\n return JWTService.decodeUserRoles(accessToken);\n }\n\n /**\n * @description Get user roles permissions\n */\n private static readonly _getUserRoles = async (): Promise => {\n try {\n const response: OAuthUserRolesResponse = (await axiosAuth0Instance.get(`${Endpoints.AUTH0_ROLES}`)).data;\n return response || null;\n } catch (error: any) {\n throw new Error(error);\n }\n };\n\n public static useMutationGetUserRoles = (\n options?: UseMutationOptions,\n ): UseMutationResult => {\n return useMutation(async () => await Auth0Service._getUserRoles(), options);\n };\n\n /**\n * @description Set user roles\n * @param formData\n */\n static _setUserRoles = async (formData: setUserRolesFormData): Promise => {\n const { userId } = formData;\n delete formData.userId;\n\n try {\n const response: OAuthUserRolesResponse = (\n await axiosAuth0Instance.post(`${Endpoints.AUTH0_UPDATE_USER_METADATA}${userId}/roles`, formData)\n ).data;\n return response || null;\n } catch (error: any) {\n throw new Error(error);\n }\n };\n\n public static useSetUserRoles = (\n options?: UseMutationOptions,\n ): UseMutationResult => {\n return useMutation(\n async inviteSupplierFormData => await Auth0Service._setUserRoles(inviteSupplierFormData),\n options,\n );\n };\n\n /**\n * @description Used to log-in based on OTP received from sms.\n * *WARNING: You cannot use this endpoint from Single Page Applications.*\n * @param refreshToken\n */\n static _refreshToken = async (refreshToken: string): Promise => {\n const formData: OAuthTokenFormData = {\n grant_type: 'refresh_token',\n client_id: process.env.NEXT_PUBLIC_AUTH0_CLIENT_ID || '',\n client_secret: process.env.NEXT_PUBLIC_AUTH0_CLIENT_SECRET || '',\n refresh_token: refreshToken,\n };\n\n try {\n const response: OAuthTokenResponse = (await axiosAuth0Instance.post(`${Endpoints.AUTH0_OAUTH_TOKEN}`, formData))\n .data;\n return response || null;\n } catch (error: any) {\n throw new Error(error.error_description);\n }\n };\n\n /**\n * @description Get users by company id\n * @param companyId\n */\n private static readonly _getUsersByCompanyWithDomain = async (companyId: number): Promise => {\n try {\n const response: Auth0Profile = (\n await axiosAuth0Instance.get(`${Endpoints.AUTH0_UPDATE_USERS}`, {\n params: {\n q: `user_metadata.company_id:${companyId} AND _exists_:user_metadata.restaurants_domain`,\n search_engine: 'v3',\n },\n })\n ).data;\n return response || null;\n } catch (error: any) {\n throw new Error(error.error_description);\n }\n };\n\n public static useGetUsersByCompanyWithDomain = (\n companyId: number,\n { ...opts }: UseQueryOptions,\n ): UseQueryResult => {\n return useQuery(\n QueryTypes.USERS_BY_COMPANY_WITH_DOMAIN,\n async () => await this._getUsersByCompanyWithDomain(companyId),\n {\n refetchOnWindowFocus: false,\n cacheTime: 0,\n ...opts,\n },\n );\n };\n\n private static readonly _getUsersByCompany = async (companyId: number): Promise => {\n try {\n const response: Auth0Profile[] = (\n await axiosAuth0Instance.get(`${Endpoints.AUTH0_UPDATE_USERS}`, {\n params: {\n q: `user_metadata.company_id:${companyId}`,\n search_engine: 'v3',\n },\n })\n ).data;\n return response || null;\n } catch (error: any) {\n throw new Error(error.error_description);\n }\n };\n\n public static useGetUsersByCompany = (\n companyId: number,\n { ...opts }: UseQueryOptions,\n ): UseQueryResult => {\n return useQuery(QueryTypes.USERS_BY_COMPANY, async () => await this._getUsersByCompany(companyId), {\n refetchOnWindowFocus: false,\n cacheTime: 0,\n ...opts,\n });\n };\n}\n","import * as Sentry from '@sentry/nextjs';\nimport jwt_decode, { type JwtPayload } from 'jwt-decode';\n\nimport { Auth0Service, type OAuthTokenResponse } from '@/services/auth0';\nimport fetchJson from '@/utils/fetchJson';\nimport { userParse } from '@/utils/user';\n\nconst oneDay = 86400000;\nexport interface DecodedUser extends JwtPayload {\n nickname: string;\n name: string;\n picture: string;\n updated_at: string;\n iss: string;\n sub: string;\n aud: string;\n iat: number;\n exp: number;\n}\n\ninterface DecodedUserAccessToken extends JwtPayload {\n 'http://dev-suppliers-uselisto.com/roles': string[];\n 'http://dev-suppliers-uselisto.com/user_metadata': {\n name?: string;\n company_id: number;\n };\n iss: 'https://dev-suppliers-uselisto.us.auth0.com/';\n sub: string;\n aud: string[];\n iat: number;\n exp: number;\n azp: string;\n scope: string;\n gty: string;\n}\n\nexport class JWTService {\n static decodeUser = (auth0User: OAuthTokenResponse): DecodedUser => {\n return jwt_decode(auth0User.access_token);\n };\n\n static decodeUserRoles = (accessToken: string): string[] => {\n const decodedAccessToken: any = jwt_decode(accessToken);\n return decodedAccessToken[process.env.NEXT_PUBLIC_AUTH0_ROLES_URL || 'http://dev-suppliers-uselisto.com/roles'];\n };\n\n static isValidToken = (): boolean => {\n const storedUser: string | null = localStorage.getItem('user');\n if (!storedUser) {\n return false;\n }\n const user: User = JSON.parse(storedUser || '');\n const token = user.accessToken;\n const decodedToken: DecodedUser = jwt_decode(token);\n const currentDate = new Date();\n // JWT exp is in seconds\n if (decodedToken.exp * 1000 < currentDate.getTime()) {\n return false;\n } else {\n return true;\n }\n };\n\n static getManagmentToken = async (responseToken: OAuthTokenResponse) => {\n const response = await Auth0Service._oauthMngmtToken();\n if (responseToken && response) {\n localStorage.setItem('mngmtAccessToken', JSON.stringify(response.access_token));\n const decodedUserData = JWTService.decodeUser(responseToken);\n const user = userParse(decodedUserData, responseToken.access_token, responseToken.refresh_token);\n localStorage.setItem('user', JSON.stringify(user));\n await fetchJson('/api/login', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(user),\n });\n }\n };\n\n static refreshToken = async () => {\n try {\n const currentTime = (Date.now() + oneDay) / 1000;\n const storedUser: string | null = localStorage.getItem('user');\n const user: User = JSON.parse(storedUser || '');\n if (user.expire && user.expire < currentTime) {\n const response = await Auth0Service._refreshToken(user.refreshToken);\n await this.getManagmentToken(response);\n }\n } catch (err) {\n Sentry.captureException(err);\n }\n };\n}\n","import React from 'react';\n\nimport { UserActions } from '@/state/user/actions';\nimport { UserState, initialUserState } from '@/state/user/state';\n\nexport const UserContext = React.createContext<{\n state: UserState;\n dispatch: React.Dispatch;\n}>({\n state: initialUserState,\n dispatch: () => undefined,\n});\n","export enum UserActionTypes {\n SetUser,\n SetUserToken,\n SetUserShowOnboarding,\n}\n\nexport interface SetUser {\n type: UserActionTypes.SetUser;\n payload: User;\n}\n\nexport interface SetUserToken {\n type: UserActionTypes.SetUserToken;\n payload: { accessToken: string };\n}\n\nexport interface SetUserShowOnboarding {\n type: UserActionTypes.SetUserShowOnboarding;\n payload: { showOnboarding: boolean };\n}\n\nexport type UserActions = SetUser | SetUserToken | SetUserShowOnboarding;\n","import {\n type UserActions,\n UserActionTypes,\n type SetUser,\n type SetUserToken,\n type SetUserShowOnboarding,\n} from '@/state/user/actions';\nimport { type UserState } from '@/state/user/state';\n\nexport const userReducer = (state: UserState, action: UserActions): UserState => {\n switch (action.type) {\n case UserActionTypes.SetUser:\n return { ...state, user: action.payload };\n case UserActionTypes.SetUserToken:\n return {\n ...state,\n user: { ...state.user, accessToken: action.payload.accessToken },\n };\n case UserActionTypes.SetUserShowOnboarding:\n return {\n ...state,\n user: { ...state.user, showOnboarding: action.payload.showOnboarding },\n };\n default:\n return state;\n }\n};\n\nexport const getUserToken = (state: UserState): string | null => state.user.accessToken;\n\nexport const setUserToken = (accessToken: string): SetUserToken => ({\n type: UserActionTypes.SetUserToken,\n payload: { accessToken },\n});\n\nexport const getUser = (state: UserState): User => state.user;\n\nexport const setUser = (user: User): SetUser => ({\n type: UserActionTypes.SetUser,\n payload: user,\n});\n\nexport const getUserShowOnboarding = (state: UserState): boolean => state.user.showOnboarding;\n\nexport const setUserShowOnboarding = (showOnboarding: boolean): SetUserShowOnboarding => ({\n type: UserActionTypes.SetUserShowOnboarding,\n payload: { showOnboarding },\n});\n","export interface UserState {\n user: User;\n}\n\nexport const initialUserState: UserState = {\n user: {\n email: '',\n name: '',\n accessToken: '',\n showOnboarding: false,\n id: '',\n roles: [],\n refreshToken: '',\n },\n};\n","export default async function fetchJson(input: RequestInfo, init?: RequestInit): Promise {\n const response = await fetch(input, init);\n\n // if the server replies, there's always some data in json\n // if there's a network error, it will throw at the previous line\n const data = await response.json();\n\n // response.ok is true when res.status is 2xx\n // https://developer.mozilla.org/en-US/docs/Web/API/Response/ok\n if (response.ok) {\n return data;\n }\n\n throw new FetchError({\n message: response.statusText,\n response,\n data,\n });\n}\n\nclass FetchError extends Error {\n response: Response;\n data: {\n message: string;\n };\n\n constructor({\n message,\n response,\n data,\n }: {\n message: string;\n response: Response;\n data: {\n message: string;\n };\n }) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(message);\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, FetchError);\n }\n\n this.name = 'FetchError';\n this.response = response;\n this.data = data ?? { message };\n }\n}\n","import { Auth0Service } from '@/services/auth0';\nimport { type DecodedUser } from '@/services/jwt';\n\nexport const userParse = (decodedUser: DecodedUser, accessToken: string, refreshToken: string): User => ({\n email: '',\n name: decodedUser.name,\n accessToken,\n showOnboarding: false,\n id: decodedUser.sub,\n roles: Auth0Service.UserRoles(accessToken),\n refreshToken,\n expire: decodedUser.exp,\n});\n","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin"],"names":["Promise","resolve","then","__webpack_require__","bind","growthbook","GrowthBook","apiHost","clientKey","enableDevMode","trackingCallback","experiment","result","console","log","experimentId","key","variationId","ToastProvider","ToastPrimitives","ToastViewport","React","param","ref","className","props","jsx_runtime","jsx","cn","displayName","toastVariants","cva","variants","variant","default","destructive","defaultVariants","Toast","ToastAction","ToastClose","toast-close","Cross2Icon","ToastTitle","ToastDescription","Toaster","toasts","useToast","jsxs","map","id","title","description","action","div","RootLayout","children","router","useRouter","segment","get","fetchUser","useUser","isLanding","queryClient","useState","QueryClient","state","dispatch","useReducer","userReducer","initialUserState","loadingUser","setLoadingUser","isPending","startTransition","useTransition","isReady","setIsReady","useEffect","init","streaming","hotjar","initialize","UA","GA4","hideLoading","getUser","isValidToken","JWTService","user","accessToken","getStoredUser","push","localStorage","clear","error","storedUser","getItem","refreshToken","JSON","parse","setUser","html","lang","head","meta","name","content","link","rel","href","GoogleAnalytics","trackPageViews","body","QueryClientProvider","client","UserContext","Provider","value","GrowthBookProvider","role","svg","aria-hidden","viewBox","fill","xmlns","path","d","ToastContainer","ReactQueryDevtools","initialIsOpen","__webpack_exports__","Z","AD_BROADCASTS","AUTH0_OAUTH_TOKEN","AUTH0_PASSWORDLESS_START","AUTH0_ROLES","AUTH0_UPDATE_USER_METADATA","AUTH0_UPDATE_USERS","ADMINISTRATIVE_DIVISIONS","BD_USER_PROFILE","FAVORITE_PRODUCTS","FILE_UPLOADS","ORDER_BULK_CONFIRM","ORDER_EXPORT","ORDER_GET","ORDER_UPDATE_TOKEN","ORDERS","PRODUCT_CATEGORIES","PRODUCT_TO_FAVORITES","PRODUCT_UNITS","PRODUCTS_BULK","PRODUCTS_DELETE_BULK","PRODUCTS","ADD_PRODUCT_CATALOG","RESTAURANT_FAVORITES","RESTAURANT_GET","RESTAURANT_GET_SIMILARITIES","RESTAURANT_CREATE","RESTAURANT_REGISTRATION","RESTAURANT_SEARCH_AUTOCOMPLETE","RESTAURANT_SUPPLIER","RESTAURANT_USER_INVITATIONS_DETAIL","RESTAURANT_USER_INVITATIONS","RESTAURANT_USER_INVITATIONS_CREATE","RESTAURANT_USER","USER_INVITATIONS_DETAIL","SUPPLIER_CATALOG","SUPPLIER_CATEGORIES","SUPPLIER_SCHEDULE","SUPPLIER_GET","SUPPLIER_INVITE","SUPPLIER_REGISTRATION","SUPPLIER_REQUEST_ACCESS","SUPPLIER_RESTAURANTS_BULK","SUPPLIER_RESTAURANTS","SUPPLIER_SEARCH_AUTOCOMPLETE","SUPPLIER_USER_INVITATION_POST","SUPPLIER_USER_INVITATIONS_DETAIL","SUPPLIER_USER_INVITATIONS","SUPPLIER_USER_VALIDATION","UPLOAD_CSV","UPLOAD_FILE","UPLOAD_FILES","PRODUCT_THUMBNAIL","USER_UPDATE_DATA","SUPPLIER_USERS","QueryTypes","count","toastTimeouts","Map","addToRemoveQueue","has","toastId","timeout","setTimeout","delete","type","set","reducer","toast","slice","t","forEach","undefined","open","filter","listeners","memoryState","listener","Number","MAX_SAFE_INTEGER","toString","dismiss","onOpenChange","update","setState","index","indexOf","splice","redirectTo","redirectIfFound","arguments","length","useCallback","route","method","fetchedUser","fetchJson","headers","stringify","_len","inputs","_key","twMerge","clsx","axiosInstance","axios","baseURL","process","axiosAuth0Instance","interceptors","request","use","anonymous","Tenant","Authorization","concat","err","reject","response","window","location","pathname","split","status","data","storedMngmtToken","authorization","statusCode","Auth0Service","UserRoles","decodeUserRoles","_passwordlessStart","username","post","Endpoints","connection","client_id","phone_number","send","formData","_oauthToken","phone","code","grant_type","client_secret","otp","realm","scope","audience","error_description","_getUserProfile","userId","useUserProfile","opts","useQuery","PROFILE","refetchOnWindowFocus","cacheTime","_patchUserMetaData","extraData","user_metadata","given_name","family_name","picture","patch","_oauthMngmtToken","_getUserRoles","useMutationGetUserRoles","useMutation","options","_setUserRoles","useSetUserRoles","inviteSupplierFormData","_refreshToken","refresh_token","_getUsersByCompanyWithDomain","companyId","params","q","search_engine","useGetUsersByCompanyWithDomain","USERS_BY_COMPANY_WITH_DOMAIN","_getUsersByCompany","useGetUsersByCompany","USERS_BY_COMPANY","decodeUser","jwt_decode","auth0User","access_token","decodedAccessToken","token","decodedToken","currentDate","Date","exp","getTime","getManagmentToken","responseToken","setItem","decodedUserData","userParse","currentTime","now","oneDay","expire","Sentry","UserActionTypes","SetUser","payload","SetUserToken","SetUserShowOnboarding","showOnboarding","email","roles","input","fetch","json","ok","FetchError","message","statusText","Error","constructor","captureStackTrace","decodedUser","sub"],"sourceRoot":""}