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ACF,GACF,QACC6B,GAAO,KACV,EACF,CAEJ,EC5DMpR,GAAc,IAAI+R,GAAY,CAClC,eAAgB,CACd,QAAS,CACP,qBAAsB,GACtB,eAAgB,GAChB,UAAW,EACX,MAAO,GACT,CAEJ,CAAC,EAEKC,GAA+BC,GAAM,KAAK,WAC9C,OAAO,0BAA2C,4BAAE,KAAMC,IAAO,CAC/D,QAASA,EAAE,oBACX,CACJ,EAEMC,GAAO,IAAM,CACjB,KAAM,CAACC,EAAOC,CAAQ,EAAI3T,WAAS,OAAO,YAAY,EAEtDO,mBAAU,IAAM,CACd,MAAMqT,EAAoB,IAAM,CAC9BD,EAAS,OAAO,YAAY,CAC9B,EAEO,+BAAiB,cAAeC,CAAiB,EAEjD,IAAM,CACJ,2BAAoB,cAAeA,CAAiB,CAC7D,CACF,EAAG,EAAE,EAGF5U,EAAA,IAAA6U,aAAA,CACC,SAACvP,OAAAwP,GAAA,CAAoB,OAAQxS,GAC3B,UAAAtC,MAAC+U,IACC,SAAC/U,EAAA,IAAAW,GAAA,CACC,SAACX,EAAA,IAAA8T,GAAA,EAAI,EACP,CACF,GACA9T,MAACgV,GAAmB,eAAe,EAAO,GACzCN,SACEH,GAAM,SAAN,CAAe,SAAU,KACxB,SAACvU,MAAAsU,GAAA,CAA6B,EAChC,IAEJ,CACF,EAEJ,EAEAW,GAAW,SAAS,eAAe,MAAM,CAAE,EAAE,OAAOjV,EAAA,IAACyU,KAAK,CAAE","names":["enabled","event","vtlog","args","resources","translationEN","translationSV","i18n","initReactI18next","setLanguageFromQueryParam","lang","formatPriceString","amount","currency","formattedAmount","formatAmountToCents","formatStringToAmountInCents","amountWithPeriod","amountNumber","FetchError","res","errorData","__publicField","useApi","useCallback","endpoint","options","method","headers","fetchOptions","response","errorText","contentType","responseData","akovaUrls","Loading","fullHeight","height","Stack","jsx","CircularProgress","manLakeBg","womanPhoneBg","coupleBg","womanLandscapeBg","bgImages","ConfigContext","createContext","urlForEnvironment","environment","ConfigProvider","children","apiFetch","backgroundImage","setBackgroundImage","useState","searchParams","useSearchParams","p","isLoading","config","useQuery","useEffect","keys","randomKey","dynamicConfig","urls","useConfig","context","useContext","bankTransferPaymentId","normalizeServiceProvider","serviceProvider","InvoiceContext","InvoiceProvider","t","useTranslation","queryClient","useQueryClient","invoiceReferenceCode","setInvoiceReferenceCode","invoice","refetchInvoice","queryError","postInvoice","useMutation","handleSetInvoiceReferenceCode","reference","handleResetInvoice","useInvoice","Link","href","className","otherProps","MuiLink","RouterLink","successfulPaymentStatuses","failedPaymentStatuses","pendingPaymentStatuses","PaymentSessionContext","PaymentSessionProvider","partialPaymentEnabled","setPartialPaymentEnabled","partialPaymentAmount","setPartialPaymentAmount","paymentSessionId","setPaymentSessionId","isFetching","paymentSession","data","handleResetPaymentSession","postPaymentSession","referenceCode","deviceType","paymentMethodId","postPaymentRedirectionUrl","postPaymentRedirectionFailedUrl","postPaymentRedirectionCancelUrl","cancelPaymentSession","partialPayment","usePaymentSession","BankTransfer","navigate","useNavigate","Typography","jsxs","Card","CardHeader","CardContent","NotFound","CustomTextField","label","formHelperSx","error","helperText","props","theme","useTheme","FormControl","MuiTextField","FormHelperText","LOCALE","akovaLogo","akovaPayLogo","akovaCardLogo","aLogo","akovaWhiteLogo","Logo","type","width","logoSrc","Box","mastercardIcon","SwishLogo","visaIcon","bankIdIcon","PolicyLogoFooter","currentLanguage","LockOutlined","swishIcon","setError","phoneNumber","setPhoneNumber","phoneIsValid","validatePhoneNumber","phone","locale","validator","handleChange","e","value","handleBlur","handleContinue","Button","PayCallback","PayError","ErrorIcon","PaymentIcon","provider","size","alt","CreditCard","AccountBalance","PayConfirmation","paymentSessionIdFromParams","useParams","resetPaymentSession","handleContinuePayment","CheckCircle","Fragment","PaymentOptionsSelector","setSelectedPaymentMethod","selectedPaymentMethod","paymentMethods","remainingAmount","getSubtitle","getActionText","ToggleButtonGroup","_","index","isSelected","ToggleButton","Chip","Divider","useSwishPayment","token","redirection","callbackUrl","referenceCodeSchema","z","isValidReferenceCode","createPartialPaymentSchema","minimumPaymentAmount","totalAmount","_a","getDeviceType","isMobile","isTablet","ReferenceDetails","expanded","setExpanded","toggleExpanded","prev","Paper","CheckCircleIcon","item","IconButton","ArrowCircleDownOutlined","swishLogo","Swish","open","showQRCode","onClose","onCancel","onConfirm","onConfirmOtherDevice","qrCodeBlob","isProcessingPayment","Modal","PartialPayment","handlePartialPaymentAmountChange","partialPaymentError","onEnter","textFieldRef","useRef","InputAdornment","PaySession","referenceCodeFromParams","resetInvoice","fetchQrCode","getSwishAppUrl","setPartialPaymentError","modalOpen","setModalOpen","setIsProcessingPayment","setShowQRCode","setQrCodeBlob","swishToken","setSwishToken","swishRedirection","setSwishRedirection","isValidPartialPayment","swishPaymentMethodId","isSwishPayment","canHandlePayment","handlePayment","paymentSessionBody","payCallbackPath","result","_b","qrBlob","handleCancelPayment","resetModalState","handleShowQRCode","handleGoToStartPage","resetSwishPayment","resolve","reject","validatePartialPaymentAmount","valueNumber","partialPaymentAmountSchema","handleChangePaymentMethod","FormGroup","FormControlLabel","Switch","swishUrl","Pay","referenceChecked","setReferenceChecked","setReferenceCode","getQueryErrorMessage","validateReferenceCode","errorMessage","handleResetPayment","handleCheckReferenceCode","handlePostInvoice","formatPhoneNumber","countryCode","countryCodeCast","parsedNumber","parsePhoneNumberFromString","cleanedNumber","fallbackFormat","number","formatCreditCardNumber","cardNumber","formatExpirationDate","expirationDate","date","year","CardConfirmation","location","useLocation","companyName","companyPhoneNumber","_c","_d","cardExpirationDate","_e","PhoneEnabled","CardError","CardPsp","handleError","routes","RouterProvider","useRoutes","akovaTheme","createColor","mainColor","createTheme","titleColor","useBreakpoint","breakpoints","isXs","useMediaQuery","isSm","isMd","isLg","isXl","currentBreakpoint","useMemo","ContentHeader","pathname","logoType","Layout","title","Helmet","Container","Header","myPagesHref","AppBar","Toolbar","footerBg","Footer","linkStyles","Environment","ScrollToTop","App","Sentry.init","Sentry.browserTracingIntegration","Sentry.replayIntegration","Sentry.ErrorBoundary","ThemeProvider","CssBaseline","QueryClient","ReactQueryDevtoolsProduction","React","d","Main","debug","setDebug","handleDebugChange","StrictMode","QueryClientProvider","Router","ReactQueryDevtools","createRoot"],"ignoreList":[],"sources":["../../src/utils/log.ts","../../src/locales/i18n.ts","../../src/utils/numbers.ts","../../src/hooks/useApi.tsx","../../src/config.ts","../../src/components/Loading/Loading.tsx","../../src/assets/aa835f550ce0b3436a9de5fbd9ddc9c7.jpg?format=webp&imagetools","../../src/assets/b232ee8f862d584a97778cfeefa9a105.jpg?format=webp&imagetools","../../src/assets/8e99a349a76eea9d69f1e5bc9ac9eabe.jpg?format=webp&imagetools","../../src/assets/41766d2a1bfe91b6b8c54364d575c65c.jpg?format=webp&imagetools","../../src/context/ConfigContext.tsx","../../src/hooks/useConfig.tsx","../../src/context/InvoiceContext.tsx","../../src/hooks/invoice/useInvoice.tsx","../../src/components/Link/Link.tsx","../../src/context/PaymentSessionContext.tsx","../../src/hooks/payment/usePaymentSession.tsx","../../src/pages/Pay/pages/BankTransfer.tsx","../../src/pages/NotFound/NotFound.tsx","../../src/components/CustomTextField/CustomTextField.tsx","../../src/utils/constants.ts","../../src/assets/akova.png?format=webp&imagetools","../../src/assets/akova-pay.png?format=webp&imagetools","../../src/assets/akova-card.png?format=webp&imagetools","../../src/assets/a.png?format=webp&imagetools","../../src/assets/akova-white.png?format=webp&imagetools","../../src/components/Logo/Logo.tsx","../../src/assets/mastercard.png?w=34&h=24&format=webp&imagetools","../../src/assets/swish.png?w=24&h=24&format=webp&imagetools","../../src/assets/visa.png?w=48&h=24&format=webp&imagetools","../../src/assets/bankid.png?w=36&h=30&format=webp&imagetools","../../src/components/Footer/PolicyLogoFooter.tsx","../../src/pages/Card/Card.tsx","../../src/pages/Pay/pages/PayCallback.tsx","../../src/pages/Pay/pages/PayError.tsx","../../src/pages/Pay/utils.tsx","../../src/pages/Pay/pages/PayConfirmation.tsx","../../src/pages/Pay/components/PaymentOptionSelector.tsx","../../src/hooks/payment/useSwishPayment.tsx","../../src/pages/Pay/schemas.ts","../../src/utils/device.ts","../../src/pages/Pay/components/ReferenceDetails.tsx","../../src/assets/swish.png?w=100&h=100&format=webp&imagetools","../../src/pages/Pay/components/Swish.tsx","../../src/pages/Pay/components/PartialPayment.tsx","../../src/pages/Pay/pages/PaySession.tsx","../../src/pages/Pay/Pay.tsx","../../src/utils/strings.ts","../../src/pages/Card/pages/CardConfirmation.tsx","../../src/pages/Card/pages/CardError.tsx","../../src/pages/Card/pages/CardPsp.tsx","../../src/router/Routes.tsx","../../src/router/RouterProvider.tsx","../../src/theme/theme.ts","../../src/hooks/useBreakpoint.tsx","../../src/components/Header/ContentHeader.tsx","../../src/Layout.tsx","../../src/components/Header/Header.tsx","../../src/assets/footer-rectangle.svg","../../src/components/Footer/Footer.tsx","../../src/components/Environment/Environment.tsx","../../src/components/ScrollToTop/ScrollToTop.tsx","../../src/App.tsx","../../src/main.tsx"],"sourcesContent":["declare global {\r\n var _debug: (enabled: boolean) => void;\r\n var _isDebugging: boolean;\r\n var vtlog: (...args: any[]) => void;\r\n}\r\n\r\nwindow._isDebugging = localStorage.getItem('_debug') === 'true';\r\n\r\nwindow._debug = (enabled: boolean) => {\r\n localStorage.setItem('_debug', enabled ? 'true' : 'false');\r\n window._isDebugging = enabled;\r\n const event = new Event('debugChange');\r\n window.dispatchEvent(event);\r\n};\r\n\r\nconst vtlog = (...args: any[]) => {\r\n if (window._isDebugging || import.meta.env.MODE === 'development') {\r\n console.debug(...args);\r\n }\r\n};\r\n\r\nwindow.vtlog = vtlog;\r\n\r\nexport {};\r\n","import i18n from 'i18next';\r\nimport { initReactI18next } from 'react-i18next';\r\nimport translationEN from './en/en.json';\r\nimport translationSV from './sv/sv.json';\r\n\r\nconst resources = {\r\n en: {\r\n translation: translationEN\r\n },\r\n sv: {\r\n translation: translationSV\r\n }\r\n};\r\n\r\ni18n.use(initReactI18next).init({\r\n resources,\r\n lng: 'sv',\r\n interpolation: {\r\n escapeValue: false\r\n }\r\n});\r\n\r\nexport const setLanguageFromQueryParam = (lang: string | null) => {\r\n if (lang === 'en' || lang === 'sv') {\r\n i18n.changeLanguage(lang);\r\n } else {\r\n i18n.changeLanguage('sv');\r\n }\r\n};\r\n\r\nexport default i18n;\r\n","export const formatPriceString = (amount: number, currency: string = 'SEK'): string => {\r\n const formattedAmount = amount / 100; // Expects amount in cents\r\n\r\n return new Intl.NumberFormat('sv-SE', {\r\n style: 'currency',\r\n currency: currency\r\n }).format(formattedAmount);\r\n};\r\n\r\nexport const formatAmountToCents = (amount: number) => {\r\n return amount * 100;\r\n};\r\n\r\nexport const formatCentsToAmount = (cents: number) => {\r\n return cents / 100;\r\n};\r\n\r\nexport const formatStringToAmountInCents = (amount: string) => {\r\n const amountWithPeriod = amount.replace(',', '.');\r\n const amountNumber = isNaN(parseFloat(amountWithPeriod)) ? 0 : parseFloat(amountWithPeriod);\r\n const amountAsCents = formatAmountToCents(amountNumber);\r\n\r\n return amountAsCents;\r\n};\r\n","import { useCallback } from 'react';\r\n\r\ntype BackendError = {\r\n type: string;\r\n status: number;\r\n title: string;\r\n};\r\n\r\nexport class FetchError extends Error {\r\n public type: string;\r\n public title: string;\r\n public status: number;\r\n\r\n constructor(res: Response, errorData: BackendError | undefined) {\r\n super();\r\n this.type = errorData?.type || 'Error';\r\n this.title = errorData?.title || res.statusText;\r\n this.status = errorData?.status || res.status;\r\n\r\n Object.setPrototypeOf(this, FetchError.prototype);\r\n }\r\n}\r\ninterface ApiOptions extends Omit {\r\n body?: BodyInit | Record | null;\r\n}\r\n\r\nexport type ApiFetch = (endpoint: string, options?: ApiOptions) => Promise;\r\n\r\nexport const useApi = () => {\r\n const apiFetch = useCallback(async (endpoint: string, options: ApiOptions = {}): Promise => {\r\n const method = options.method || 'GET';\r\n const headers = new Headers(options.headers || {});\r\n headers.append('Content-Type', 'application/json');\r\n\r\n const fetchOptions: RequestInit = {\r\n method,\r\n headers,\r\n body: method !== 'GET' ? (options.body ? JSON.stringify(options.body) : null) : undefined\r\n };\r\n\r\n const response = await fetch(endpoint, fetchOptions);\r\n\r\n if (!response.ok && response.status !== 204) {\r\n const errorText = await response.text();\r\n\r\n let errorData: BackendError | undefined;\r\n try {\r\n errorData = JSON.parse(errorText);\r\n } catch {\r\n errorData = undefined;\r\n }\r\n\r\n const error = new FetchError(response, errorData);\r\n throw error;\r\n }\r\n\r\n if (response.status === 204 || !response.body) {\r\n return {} as T;\r\n }\r\n\r\n const contentType = response.headers.get('Content-Type');\r\n let responseData: any;\r\n\r\n if (contentType && contentType.includes('application/json')) {\r\n responseData = await response.json();\r\n } else if (contentType && contentType.includes('text/')) {\r\n responseData = await response.text();\r\n } else {\r\n responseData = await response.blob();\r\n }\r\n\r\n return responseData as T;\r\n }, []);\r\n\r\n return apiFetch;\r\n};\r\n","export type Environment = 'DEV' | 'TEST' | 'STAGE' | 'PROD';\r\n\r\nexport type Config = {\r\n url: string;\r\n environment: Environment;\r\n};\r\n\r\nexport type UrlsForEnvironment = {\r\n akovaPay: string;\r\n myPages: string;\r\n};\r\n\r\nexport type AkovaUrls = {\r\n prod: UrlsForEnvironment;\r\n stage: UrlsForEnvironment;\r\n test: UrlsForEnvironment;\r\n};\r\n\r\nexport const akovaUrls = {\r\n prod: {\r\n akovaPay: 'https://secure.akova.se',\r\n myPages: 'https://secure.akova.se/my'\r\n },\r\n stage: {\r\n akovaPay: 'https://stage-secure.akova.se',\r\n myPages: 'https://stage-secure.akova.se/my'\r\n },\r\n test: {\r\n akovaPay: 'https://test-secure.akova.local',\r\n myPages: 'https://test-secure.akova.local/my'\r\n }\r\n};\r\n","import CircularProgress from '@mui/material/CircularProgress';\r\nimport Stack from '@mui/material/Stack';\r\n\r\ntype LoadingProps = {\r\n fullHeight?: boolean;\r\n height?: string;\r\n};\r\n\r\nconst Loading = ({ fullHeight = false, height }: LoadingProps) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Loading;\r\n","export default \"__VITE_ASSET__BD8Cx17D__\";","export default \"__VITE_ASSET__Bz0itbRl__\";","export default \"__VITE_ASSET__BSl0TG98__\";","export default \"__VITE_ASSET__Cj2CIOHq__\";","import type React from 'react';\r\nimport { createContext, useEffect, useState } from 'react';\r\nimport type { Config, Environment, UrlsForEnvironment } from '@/config';\r\nimport { akovaUrls } from '@/config';\r\nimport { useQuery } from '@tanstack/react-query';\r\nimport Loading from '@/components/Loading/Loading';\r\nimport { useApi } from '@/hooks/useApi';\r\nimport { useSearchParams } from 'react-router-dom';\r\nimport manLakeBg from '@/assets/aa835f550ce0b3436a9de5fbd9ddc9c7.jpg?format=webp&imagetools';\r\nimport womanPhoneBg from '@/assets/b232ee8f862d584a97778cfeefa9a105.jpg?format=webp&imagetools';\r\nimport coupleBg from '@/assets/8e99a349a76eea9d69f1e5bc9ac9eabe.jpg?format=webp&imagetools';\r\nimport womanLandscapeBg from '@/assets/41766d2a1bfe91b6b8c54364d575c65c.jpg?format=webp&imagetools';\r\n\r\nconst bgImages: { [key: string]: string } = {\r\n aa835f550ce0b3436a9de5fbd9ddc9c7: manLakeBg,\r\n b232ee8f862d584a97778cfeefa9a105: womanPhoneBg,\r\n '8e99a349a76eea9d69f1e5bc9ac9eabe': coupleBg,\r\n '41766d2a1bfe91b6b8c54364d575c65c': womanLandscapeBg\r\n};\r\n\r\nexport const ConfigContext = createContext<{\r\n config: Config;\r\n backgroundImage: string;\r\n urls: UrlsForEnvironment;\r\n} | null>(null);\r\n\r\nconst urlForEnvironment = (environment: Environment) => {\r\n switch (environment) {\r\n case 'PROD':\r\n return akovaUrls.prod;\r\n case 'STAGE':\r\n return akovaUrls.stage;\r\n case 'TEST':\r\n case 'DEV':\r\n default:\r\n return akovaUrls.test;\r\n }\r\n};\r\n\r\nexport const ConfigProvider = ({ children }: { children: React.ReactNode }) => {\r\n const apiFetch = useApi();\r\n const [backgroundImage, setBackgroundImage] = useState('');\r\n const [searchParams] = useSearchParams();\r\n const p = searchParams.get('p');\r\n\r\n const { isLoading, data: config } = useQuery({\r\n queryKey: ['config'],\r\n queryFn: async () => {\r\n const response = apiFetch(`${window.location.origin}/config.json`);\r\n return response;\r\n },\r\n retry: 3\r\n });\r\n\r\n useEffect(() => {\r\n if (backgroundImage) return;\r\n if (p && p in bgImages) {\r\n setBackgroundImage(bgImages[p]);\r\n } else {\r\n const keys = Object.keys(bgImages);\r\n const randomKey = keys[Math.floor(Math.random() * keys.length)];\r\n setBackgroundImage(bgImages[randomKey]);\r\n }\r\n }, [p]);\r\n\r\n if (isLoading) {\r\n return ;\r\n }\r\n\r\n if (!config) {\r\n return null;\r\n }\r\n\r\n const dynamicConfig = {\r\n url: config.url,\r\n environment: config.environment\r\n };\r\n\r\n const urls = urlForEnvironment(config.environment);\r\n\r\n return (\r\n {children}\r\n );\r\n};\r\n","import { ConfigContext } from '@/context/ConfigContext';\r\nimport { useContext } from 'react';\r\n\r\nexport const useConfig = () => {\r\n const context = useContext(ConfigContext);\r\n\r\n vtlog('useConfig:', context);\r\n\r\n if (context === null) {\r\n throw new Error('useConfig must be used within a ConfigProvider');\r\n }\r\n\r\n return context;\r\n};\r\n","import { Invoice, PaymentProvider } from '@/hooks/invoice/types';\r\nimport { FetchError, useApi } from '@/hooks/useApi';\r\nimport { useConfig } from '@/hooks/useConfig';\r\nimport { useMutation, UseMutationResult, useQuery, useQueryClient } from '@tanstack/react-query';\r\nimport React, { createContext, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nconst bankTransferPaymentId = 9999;\r\n\r\nconst normalizeServiceProvider = (serviceProvider: string): PaymentProvider => {\r\n switch (serviceProvider) {\r\n case 'VIATEL_TEST_CARD':\r\n return 'inveroak';\r\n case 'VIATEL_TEST_SWISH':\r\n return 'swish';\r\n default:\r\n return serviceProvider as PaymentProvider;\r\n }\r\n};\r\n\r\ntype InvoiceContextType = {\r\n invoice: Invoice | undefined;\r\n setInvoiceReferenceCode: (reference: string | undefined) => void;\r\n isLoading: boolean;\r\n refetchInvoice: () => Promise;\r\n queryError: FetchError | null;\r\n bankTransferPaymentId: number;\r\n postInvoice: UseMutationResult;\r\n resetInvoice: () => Promise;\r\n minimumPaymentAmount: number;\r\n};\r\n\r\nexport const InvoiceContext = createContext({\r\n invoice: undefined,\r\n setInvoiceReferenceCode: () => {},\r\n isLoading: false,\r\n queryError: null,\r\n refetchInvoice: () => Promise.resolve(),\r\n bankTransferPaymentId,\r\n postInvoice: {} as UseMutationResult,\r\n resetInvoice: () => Promise.resolve(),\r\n minimumPaymentAmount: 100\r\n});\r\n\r\nexport const InvoiceProvider = ({ children }: { children: React.ReactNode }) => {\r\n const { urls } = useConfig();\r\n const { t } = useTranslation();\r\n const queryClient = useQueryClient();\r\n const apiFetch = useApi();\r\n const [invoiceReferenceCode, setInvoiceReferenceCode] = useState(undefined);\r\n\r\n const {\r\n isLoading,\r\n data: invoice,\r\n refetch: refetchInvoice,\r\n error: queryError\r\n } = useQuery({\r\n queryKey: ['getInvoice', invoiceReferenceCode, urls.akovaPay],\r\n queryFn: async () => {\r\n const response = await apiFetch(`${urls.akovaPay}/api/v1/Invoice/${invoiceReferenceCode}`);\r\n\r\n const invoice = {\r\n ...response,\r\n paymentMethods: [\r\n ...response.paymentMethods.map((method) => ({\r\n ...method,\r\n serviceProvider: normalizeServiceProvider(method.serviceProvider)\r\n })),\r\n {\r\n paymentMethodId: bankTransferPaymentId,\r\n methodText: t('components.payment-option-selector.bankgiro'),\r\n methodIcon: 'bankgiro',\r\n methodCode: 'bankgiro',\r\n serviceProvider: 'banktransfer',\r\n minimumPaymentAmount: 100\r\n }\r\n ]\r\n } as Invoice;\r\n\r\n return invoice;\r\n },\r\n enabled: !!invoiceReferenceCode,\r\n retry: false\r\n });\r\n\r\n const postInvoice = useMutation({\r\n mutationFn: () => {\r\n return apiFetch(`${urls?.akovaPay}/api/v1/invoice`, {\r\n method: 'POST',\r\n body: null\r\n });\r\n }\r\n });\r\n\r\n const handleSetInvoiceReferenceCode = (reference: string | undefined) => {\r\n setInvoiceReferenceCode(reference);\r\n };\r\n\r\n const handleResetInvoice = async () => {\r\n setInvoiceReferenceCode(undefined);\r\n queryClient.setQueryData(['getInvoice', invoiceReferenceCode, urls.akovaPay], undefined);\r\n };\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n","import { InvoiceContext } from '@/context/InvoiceContext';\r\nimport { useContext } from 'react';\r\n\r\nexport const useInvoice = () => {\r\n const context = useContext(InvoiceContext);\r\n\r\n vtlog('useInvoice:', context);\r\n\r\n if (context === null) {\r\n throw new Error('useInvoiceContext must be used within an InvoiceProvider');\r\n }\r\n\r\n return context;\r\n};\r\n","import React from 'react';\r\nimport type { LinkProps as MuiLinkProps } from '@mui/material/Link';\r\nimport { Link as MuiLink } from '@mui/material';\r\nimport { Link as RouterLink } from 'react-router-dom';\r\n\r\nconst Link: React.FC = ({ href, className, ...otherProps }) => {\r\n if (!href) {\r\n return ;\r\n }\r\n\r\n const isInternalLink = href.startsWith('/') || href.startsWith(window.location.origin);\r\n\r\n if (isInternalLink) {\r\n return ;\r\n }\r\n\r\n return ;\r\n};\r\n\r\nexport default Link;\r\n","import {\r\n DeletePaymentSessionResponse,\r\n GetPaymentSessionResponse,\r\n PostPaymentSession,\r\n PostPaymentSessionResponse\r\n} from '@/hooks/payment/types';\r\nimport { FetchError, useApi } from '@/hooks/useApi';\r\nimport { useConfig } from '@/hooks/useConfig';\r\nimport { formatPriceString, formatStringToAmountInCents } from '@/utils/numbers';\r\nimport { useMutation, UseMutationResult, useQuery, useQueryClient } from '@tanstack/react-query';\r\nimport React, { createContext, useState } from 'react';\r\nimport { PartialPayment } from './types';\r\n\r\nexport const successfulPaymentStatuses = ['Authorized', 'Confirmed', 'PendingSettle', 'Settled'];\r\nexport const failedPaymentStatuses = ['AuthFailed', 'Reversed', 'Aborted', 'PendingReversal', 'NoState'];\r\nexport const pendingPaymentStatuses = ['Authorizing'];\r\n\r\ntype PaymentSessionContextType = {\r\n isLoading: boolean;\r\n isFetching: boolean;\r\n paymentSession: GetPaymentSessionResponse | undefined;\r\n postPaymentSession: UseMutationResult;\r\n cancelPaymentSession: UseMutationResult;\r\n partialPayment: PartialPayment;\r\n setPaymentSessionId: (id: string | undefined) => void;\r\n resetPaymentSession: () => void;\r\n queryError: FetchError | null;\r\n};\r\n\r\nexport const PaymentSessionContext = createContext({\r\n isLoading: false,\r\n isFetching: false,\r\n queryError: null,\r\n paymentSession: undefined,\r\n postPaymentSession: {} as UseMutationResult,\r\n cancelPaymentSession: {} as UseMutationResult,\r\n partialPayment: {\r\n enabled: false,\r\n amount: '',\r\n amountNumberInCents: 0,\r\n amountPrice: '',\r\n setEnabled: () => {},\r\n setAmount: () => {}\r\n },\r\n setPaymentSessionId: () => {},\r\n resetPaymentSession: () => {}\r\n});\r\n\r\nexport const PaymentSessionProvider = ({ children }: { children: React.ReactNode }) => {\r\n const { urls } = useConfig();\r\n const apiFetch = useApi();\r\n const queryClient = useQueryClient();\r\n const [partialPaymentEnabled, setPartialPaymentEnabled] = useState(false);\r\n const [partialPaymentAmount, setPartialPaymentAmount] = useState('');\r\n const [paymentSessionId, setPaymentSessionId] = useState(undefined);\r\n\r\n const {\r\n isLoading,\r\n isFetching,\r\n data: paymentSession,\r\n error: queryError\r\n } = useQuery({\r\n queryKey: ['getPaymentSession', paymentSessionId],\r\n queryFn: async () => {\r\n const result = await apiFetch(\r\n `${urls?.akovaPay}/api/v1/paymentsession/${paymentSessionId}`\r\n );\r\n return result;\r\n },\r\n refetchInterval: (data) => {\r\n if (\r\n (data.state.data && successfulPaymentStatuses.includes(data.state.data.payment.status)) ||\r\n (data.state.data && failedPaymentStatuses.includes(data.state.data.payment.status))\r\n ) {\r\n return false;\r\n }\r\n\r\n return 5000;\r\n },\r\n enabled: !!paymentSessionId\r\n });\r\n\r\n const handleResetPaymentSession = () => {\r\n setPaymentSessionId(undefined);\r\n queryClient.invalidateQueries({ queryKey: ['getPaymentSession', paymentSessionId] });\r\n };\r\n\r\n const postPaymentSession = useMutation({\r\n mutationFn: ({\r\n referenceCode,\r\n deviceType,\r\n amount,\r\n paymentMethodId,\r\n postPaymentRedirectionUrl,\r\n postPaymentRedirectionFailedUrl,\r\n postPaymentRedirectionCancelUrl\r\n }: PostPaymentSession) => {\r\n return apiFetch(`${urls?.akovaPay}/api/v1/paymentsession`, {\r\n method: 'POST',\r\n body: {\r\n referenceCode,\r\n deviceType,\r\n amount,\r\n paymentMethodId,\r\n postPaymentRedirectionUrl,\r\n postPaymentRedirectionFailedUrl,\r\n postPaymentRedirectionCancelUrl\r\n }\r\n });\r\n }\r\n });\r\n\r\n const cancelPaymentSession = useMutation({\r\n mutationFn: (paymentSessionId: string) => {\r\n return apiFetch(`${urls?.akovaPay}/api/v1/paymentsession/${paymentSessionId}`, {\r\n method: 'DELETE',\r\n body: {\r\n paymentSessionId\r\n }\r\n });\r\n }\r\n });\r\n\r\n const partialPayment = {\r\n enabled: partialPaymentEnabled,\r\n amount: partialPaymentAmount,\r\n amountNumberInCents: formatStringToAmountInCents(partialPaymentAmount),\r\n amountPrice: formatPriceString(formatStringToAmountInCents(partialPaymentAmount)),\r\n setEnabled: setPartialPaymentEnabled,\r\n setAmount: setPartialPaymentAmount\r\n };\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n","import { PaymentSessionContext } from '@/context/PaymentSessionContext';\r\nimport { useContext } from 'react';\r\n\r\nexport const usePaymentSession = () => {\r\n const context = useContext(PaymentSessionContext);\r\n\r\n vtlog('usePaymentSession:', context);\r\n\r\n if (context === null) {\r\n throw new Error('usePaymentSession must be used within a PaymentSessionProvider');\r\n }\r\n\r\n return context;\r\n};\r\n","import Stack from '@mui/material/Stack';\r\nimport Typography from '@mui/material/Typography';\r\nimport Card from '@mui/material/Card';\r\nimport CardContent from '@mui/material/CardContent';\r\nimport CardHeader from '@mui/material/CardHeader';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { formatPriceString } from '@/utils/numbers';\r\nimport { useInvoice } from '@/hooks/invoice/useInvoice';\r\nimport Link from '@/components/Link/Link';\r\nimport { useConfig } from '@/hooks/useConfig';\r\nimport { useEffect } from 'react';\r\nimport Loading from '@/components/Loading/Loading';\r\nimport { useNavigate } from 'react-router-dom';\r\nimport { usePaymentSession } from '@/hooks/payment/usePaymentSession';\r\n\r\nconst BankTransfer = () => {\r\n const navigate = useNavigate();\r\n const { urls } = useConfig();\r\n const { invoice, queryError } = useInvoice();\r\n const { t } = useTranslation();\r\n const { partialPayment } = usePaymentSession();\r\n const amount = partialPayment.enabled\r\n ? partialPayment.amountPrice\r\n : formatPriceString(invoice?.remainingAmountInclVAT ?? 0);\r\n\r\n useEffect(() => {\r\n if (!invoice || queryError) {\r\n navigate('/pay/error', { replace: true });\r\n }\r\n }, [invoice]);\r\n\r\n if (!invoice) {\r\n return ;\r\n }\r\n\r\n return (\r\n \r\n \r\n {t('page.pay.pay-instructions.title')}\r\n \r\n \r\n {t('page.pay.pay-instructions.description')}
{t('page.pay.pay-instructions.choose-one')}{' '}\r\n {t('page.pay.pay-instructions.other-payment-method')}{' '}\r\n {t('page.pay.pay-instructions.to-pay-instantly')}\r\n
\r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n {t('page.pay.pay-instructions.bankgiro-number')}\r\n \r\n {invoice?.bankGiroAccount}\r\n \r\n\r\n \r\n \r\n {t('page.pay.pay-instructions.ocr')}\r\n \r\n {invoice?.bankGiroOCR}\r\n \r\n \r\n \r\n \r\n\r\n \r\n {t('common-phrases.go-to')}{' '}\r\n \r\n {t('common-phrases.my-pages')}\r\n {' '}\r\n {t('page.confirmation.to-download-invoice')}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default BankTransfer;\r\n","import Link from '@/components/Link/Link';\r\nimport Stack from '@mui/material/Stack';\r\nimport Typography from '@mui/material/Typography';\r\nimport { t } from 'i18next';\r\n\r\nconst NotFound = () => {\r\n return (\r\n \r\n \r\n {t('page.not-found.title')}\r\n \r\n \r\n {t('page.not-found.description')}{' '}\r\n \r\n {t('page.not-found.start-page')}\r\n \r\n .\r\n \r\n \r\n );\r\n};\r\n\r\nexport default NotFound;\r\n","import MuiTextField, { TextFieldProps } from '@mui/material/TextField';\r\nimport Typography from '@mui/material/Typography';\r\nimport Stack from '@mui/material/Stack';\r\nimport FormControl from '@mui/material/FormControl';\r\nimport FormHelperText from '@mui/material/FormHelperText';\r\nimport { SxProps, Theme, useTheme } from '@mui/material/styles';\r\n\r\ntype CustomTextFieldProps = TextFieldProps & {\r\n label?: string;\r\n formHelperSx?: SxProps | undefined;\r\n};\r\n\r\nconst CustomTextField = ({ label, formHelperSx, error, helperText, ...props }: CustomTextFieldProps) => {\r\n const theme = useTheme();\r\n\r\n return (\r\n \r\n {label && (\r\n \r\n {label}\r\n \r\n )}\r\n \r\n \r\n {helperText && {helperText}}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default CustomTextField;\r\n","export const LOCALE: Record = {\r\n SE: 'sv-SE',\r\n US: 'en-US'\r\n};\r\n","export default \"__VITE_ASSET__D0fE50Pm__\";","export default \"__VITE_ASSET__z6bs5n9R__\";","export default \"__VITE_ASSET__DgfgeLUI__\";","export default \"__VITE_ASSET__C0ThhEoJ__\";","export default \"__VITE_ASSET__CQeZ6Akc__\";","import { Box } from '@mui/material';\r\nimport akovaLogo from '@/assets/akova.png?format=webp&imagetools';\r\nimport akovaPayLogo from '@/assets/akova-pay.png?format=webp&imagetools';\r\nimport akovaCardLogo from '@/assets/akova-card.png?format=webp&imagetools';\r\nimport aLogo from '@/assets/a.png?format=webp&imagetools';\r\nimport akovaWhiteLogo from '@/assets/akova-white.png?format=webp&imagetools';\r\nimport { LogoProps } from './types';\r\n\r\nconst Logo = ({ type = 'default', height = '100px', width = 'auto' }: LogoProps) => {\r\n const logoSrc = (() => {\r\n switch (type) {\r\n case 'akova':\r\n return akovaLogo;\r\n case 'akova-pay':\r\n return akovaPayLogo;\r\n case 'akova-card':\r\n return akovaCardLogo;\r\n case 'akova-white':\r\n return akovaWhiteLogo;\r\n case 'default':\r\n default:\r\n return aLogo;\r\n }\r\n })();\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default Logo;\r\n","export default \"__VITE_ASSET__CinZlw7e__\";","export default \"__VITE_ASSET__DWjHPokR__\";","export default \"__VITE_ASSET__CXAhlR2O__\";","export default \"__VITE_ASSET__nmGzhgPR__\";","import { LockOutlined } from '@mui/icons-material';\r\nimport Typography from '@mui/material/Typography';\r\nimport Logo from '../Logo/Logo';\r\nimport mastercardIcon from '@/assets/mastercard.png?w=34&h=24&format=webp&imagetools';\r\nimport swishIcon from '@/assets/swish.png?w=24&h=24&format=webp&imagetools';\r\nimport visaIcon from '@/assets/visa.png?w=48&h=24&format=webp&imagetools';\r\nimport bankIdIcon from '@/assets/bankid.png?w=36&h=30&format=webp&imagetools';\r\nimport Stack from '@mui/material/Stack';\r\nimport { useTranslation } from 'react-i18next';\r\nimport Link from '@/components/Link/Link';\r\n\r\nconst PolicyLogoFooter = () => {\r\n const { t, i18n } = useTranslation();\r\n const currentLanguage = i18n.language;\r\n\r\n return (\r\n \r\n \r\n {t('common-phrases.privacy-policy')}\r\n \r\n\r\n \r\n \r\n {t('common-phrases.safe-and-secure-at')}\r\n \r\n \r\n\r\n \r\n Swish\r\n MasterCard\r\n Visa\r\n BankID\r\n \r\n \r\n );\r\n};\r\n\r\nexport default PolicyLogoFooter;\r\n","import { useState } from 'react';\r\nimport { useNavigate } from 'react-router-dom';\r\nimport CustomTextField from '@/components/CustomTextField/CustomTextField';\r\nimport Button from '@mui/material/Button';\r\nimport Typography from '@mui/material/Typography';\r\nimport Stack from '@mui/material/Stack';\r\nimport { useTranslation } from 'react-i18next';\r\nimport validator from 'validator';\r\nimport { LOCALE } from '@/utils/constants';\r\nimport PolicyLogoFooter from '@/components/Footer/PolicyLogoFooter';\r\n\r\nconst Card = () => {\r\n const { t } = useTranslation();\r\n const navigate = useNavigate();\r\n const [error, setError] = useState('');\r\n const [phoneNumber, setPhoneNumber] = useState('');\r\n const phoneIsValid = phoneNumber.length > 0 && error === '';\r\n\r\n const validatePhoneNumber = (phone: string) => {\r\n const locale = LOCALE['SE'] || 'any';\r\n\r\n if (!validator.isMobilePhone(phone, locale as validator.MobilePhoneLocale)) {\r\n setError(t('page.card.invalid-phone-number'));\r\n } else {\r\n setError('');\r\n }\r\n };\r\n\r\n const handleChange = (e: React.ChangeEvent) => {\r\n const value = e.target.value;\r\n setPhoneNumber(value);\r\n };\r\n\r\n const handleBlur = (e: React.FocusEvent) => {\r\n const value = e.target.value;\r\n\r\n if (value.length > 0) {\r\n validatePhoneNumber(value);\r\n }\r\n };\r\n\r\n const handleContinue = () => {\r\n if (!phoneIsValid) {\r\n return;\r\n }\r\n\r\n navigate('/card/psp', { state: { phoneNumber } });\r\n };\r\n\r\n return (\r\n \r\n {t('page.card.title')}\r\n\r\n \r\n\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Card;\r\n","import Loading from '@/components/Loading/Loading';\r\nimport { failedPaymentStatuses, successfulPaymentStatuses } from '@/context/PaymentSessionContext';\r\nimport { usePaymentSession } from '@/hooks/payment/usePaymentSession';\r\nimport { useEffect } from 'react';\r\nimport { useNavigate, useSearchParams } from 'react-router-dom';\r\n\r\nconst PayCallback = () => {\r\n const navigate = useNavigate();\r\n const { paymentSession, setPaymentSessionId, queryError } = usePaymentSession();\r\n const [searchParams] = useSearchParams();\r\n\r\n useEffect(() => {\r\n const paymentSessionId = searchParams.get('PaymentSessionId');\r\n if (paymentSessionId) {\r\n setPaymentSessionId(paymentSessionId);\r\n }\r\n }, [setPaymentSessionId, searchParams]);\r\n\r\n useEffect(() => {\r\n if (paymentSession) {\r\n if (successfulPaymentStatuses.includes(paymentSession.payment.status)) {\r\n navigate(`/pay/confirmation/${paymentSession.paymentSessionId}`, { replace: true });\r\n } else if (failedPaymentStatuses.includes(paymentSession.payment.status)) {\r\n navigate(`/pay/${paymentSession.referenceCode}`, { replace: true });\r\n }\r\n }\r\n }, [paymentSession]);\r\n\r\n useEffect(() => {\r\n if (queryError) {\r\n navigate('/pay/error', { replace: true });\r\n }\r\n }, [queryError]);\r\n\r\n return ;\r\n};\r\n\r\nexport default PayCallback;\r\n","import ErrorIcon from '@mui/icons-material/Error';\r\nimport Typography from '@mui/material/Typography';\r\nimport Stack from '@mui/material/Stack';\r\nimport { useTranslation } from 'react-i18next';\r\nimport Link from '@/components/Link/Link';\r\nimport { useConfig } from '@/hooks/useConfig';\r\nimport { useInvoice } from '@/hooks/invoice/useInvoice';\r\n\r\nconst PayError = () => {\r\n const { queryError } = useInvoice();\r\n const { t } = useTranslation();\r\n const { urls } = useConfig();\r\n\r\n return (\r\n \r\n \r\n {queryError?.status === 404 ? t('page.pay.error.reference-not-found') : t('page.pay.error.generic-error')}\r\n \r\n\r\n \r\n\r\n \r\n {t('page.pay.error.try-again-or-change-payment')}{' '}\r\n \r\n {t('common-phrases.click-here')}\r\n \r\n \r\n\r\n \r\n {t('page.pay.error.on')}{' '}\r\n \r\n {t('common-phrases.my-pages')}\r\n {' '}\r\n {t('page.pay.error.click-here-to-view-orders')}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default PayError;\r\n","import Stack from '@mui/material/Stack';\r\nimport SwishLogo from '@/assets/swish.png?w=24&h=24&format=webp&imagetools';\r\nimport { AccountBalance, CreditCard } from '@mui/icons-material';\r\nimport { PaymentProvider } from '@/hooks/invoice/types';\r\n\r\nexport const PaymentIcon = ({\r\n provider,\r\n size = 'medium',\r\n alt\r\n}: {\r\n provider: PaymentProvider;\r\n size?: 'small' | 'medium';\r\n alt: string;\r\n}) => {\r\n switch (provider) {\r\n case 'swish':\r\n return (\r\n \r\n );\r\n case 'inveroak':\r\n return ;\r\n case 'banktransfer':\r\n return ;\r\n default:\r\n return ;\r\n }\r\n};\r\n","import Link from '@/components/Link/Link';\r\nimport Stack from '@mui/material/Stack';\r\nimport Typography from '@mui/material/Typography';\r\nimport Card from '@mui/material/Card';\r\nimport CardContent from '@mui/material/CardContent';\r\nimport CardHeader from '@mui/material/CardHeader';\r\nimport { useTranslation } from 'react-i18next';\r\nimport CheckCircle from '@mui/icons-material/CheckCircle';\r\nimport { formatPriceString } from '@/utils/numbers';\r\nimport { useConfig } from '@/hooks/useConfig';\r\nimport Loading from '@/components/Loading/Loading';\r\nimport { useEffect } from 'react';\r\nimport { useNavigate, useParams } from 'react-router-dom';\r\nimport Box from '@mui/material/Box';\r\nimport { PaymentIcon } from '../utils';\r\nimport { PaymentProvider } from '@/hooks/invoice/types';\r\nimport { usePaymentSession } from '@/hooks/payment/usePaymentSession';\r\nimport { useInvoice } from '@/hooks/invoice/useInvoice';\r\n\r\nconst PayConfirmation = () => {\r\n const navigate = useNavigate();\r\n const { paymentSessionId: paymentSessionIdFromParams } = useParams();\r\n const { t } = useTranslation();\r\n const { urls } = useConfig();\r\n const { refetchInvoice } = useInvoice();\r\n const { paymentSession, isLoading, queryError, setPaymentSessionId, resetPaymentSession } = usePaymentSession();\r\n\r\n useEffect(() => {\r\n if (paymentSessionIdFromParams) {\r\n setPaymentSessionId(paymentSessionIdFromParams);\r\n }\r\n }, [paymentSessionIdFromParams]);\r\n\r\n useEffect(() => {\r\n if (queryError) {\r\n navigate('/pay/error', { replace: true });\r\n }\r\n }, [queryError]);\r\n\r\n if (isLoading || !paymentSession) {\r\n return ;\r\n }\r\n\r\n const handleContinuePayment = async () => {\r\n resetPaymentSession();\r\n await refetchInvoice();\r\n };\r\n\r\n return (\r\n \r\n \r\n {t('page.confirmation.thank-you')}\r\n \r\n\r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n {t('common-phrases.reference-number')}\r\n \r\n {paymentSession?.referenceCode}\r\n \r\n\r\n \r\n \r\n {t('page.confirmation.payment-method')}\r\n \r\n \r\n \r\n {paymentSession.payment.methodText}\r\n \r\n \r\n \r\n \r\n \r\n\r\n {paymentSession.invoiceStatus === 'PartiallyPaid' && (\r\n <>\r\n \r\n {t('page.confirmation.remaining-amount-to-pay', {\r\n amount: formatPriceString(paymentSession.invoiceRemainingAmount)\r\n })}\r\n \r\n\r\n \r\n \r\n {t('page.confirmation.to-continue-partially-paid', { reference: paymentSession.referenceCode })}\r\n \r\n \r\n \r\n {t('common-phrases.click-here')}\r\n \r\n \r\n \r\n \r\n )}\r\n\r\n \r\n {t('common-phrases.go-to')}{' '}\r\n \r\n {t('common-phrases.my-pages')}\r\n {' '}\r\n {t('page.confirmation.to-download-invoice')}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default PayConfirmation;\r\n","import { useTranslation } from 'react-i18next';\r\nimport { PaymentOptionSelectorProps } from '../types';\r\nimport ToggleButtonGroup from '@mui/material/ToggleButtonGroup';\r\nimport ToggleButton from '@mui/material/ToggleButton';\r\nimport Stack from '@mui/material/Stack';\r\nimport Typography from '@mui/material/Typography';\r\nimport Chip from '@mui/material/Chip';\r\nimport Divider from '@mui/material/Divider';\r\nimport { PaymentIcon } from '../utils';\r\nimport { useInvoice } from '@/hooks/invoice/useInvoice';\r\n\r\nconst PaymentOptionsSelector = ({ setSelectedPaymentMethod, selectedPaymentMethod }: PaymentOptionSelectorProps) => {\r\n const { t } = useTranslation();\r\n const { invoice } = useInvoice();\r\n const paymentMethods = invoice?.paymentMethods ?? [];\r\n const remainingAmount = invoice?.remainingAmountInclVAT || 0;\r\n\r\n const getSubtitle = (serviceProvider: string) => {\r\n switch (serviceProvider) {\r\n case 'swish':\r\n return t('components.payment-option-selector.subtitles.swish');\r\n case 'inveroak':\r\n return t('components.payment-option-selector.subtitles.credit-card');\r\n case 'banktransfer':\r\n return t('components.payment-option-selector.subtitles.bankgiro');\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n const getActionText = (serviceProvider: string) => {\r\n return serviceProvider === 'banktransfer' ? t('buttons.two-bank-days') : t('common-phrases.instant');\r\n };\r\n\r\n return (\r\n value && setSelectedPaymentMethod(value)}\r\n sx={{ width: '100%', p: 0 }}\r\n >\r\n {paymentMethods.map((method, index) => {\r\n const isSelected = method.paymentMethodId === selectedPaymentMethod?.paymentMethodId;\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n {method.methodText}\r\n {getSubtitle(method.serviceProvider)}\r\n \r\n\r\n \r\n \r\n \r\n {index !== paymentMethods.length - 1 && (\r\n \r\n )}\r\n \r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\nexport default PaymentOptionsSelector;\r\n","import { useMutation } from '@tanstack/react-query';\r\nimport { useApi } from '@/hooks/useApi';\r\nimport { useConfig } from '../useConfig';\r\n\r\nexport const useSwishPayment = () => {\r\n const apiFetch = useApi();\r\n const { urls } = useConfig();\r\n\r\n const fetchQrCode = useMutation({\r\n mutationFn: async ({ token }) => {\r\n const response = await apiFetch(\r\n `${urls?.akovaPay}/api/v1/paymentsession/qr?token=${encodeURIComponent(token)}`,\r\n {\r\n method: 'GET',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n }\r\n }\r\n );\r\n return response;\r\n }\r\n });\r\n\r\n const getSwishAppUrl = (token: string, redirection: string) => {\r\n const urlParams = new URLSearchParams(new URL(redirection).search);\r\n const callbackUrl = urlParams.get('ret');\r\n vtlog('Redirection URL:', redirection);\r\n\r\n if (!callbackUrl) {\r\n return undefined;\r\n }\r\n\r\n return `swish://paymentrequest?token=${encodeURIComponent(token)}&callbackurl=${encodeURIComponent(callbackUrl)}`;\r\n };\r\n\r\n return {\r\n fetchQrCode,\r\n getSwishAppUrl\r\n };\r\n};\r\n","import { PaymentProvider } from '@/hooks/invoice/types';\r\nimport { z } from 'zod';\r\n\r\nexport const referenceCodeSchema = z\r\n .string()\r\n .length(7, { message: 'page.pay.errors.reference-number-length' })\r\n .regex(/^[a-km-np-zA-KM-NP-Z]+$/, { message: 'page.pay.errors.reference-number-invalid-characters' });\r\n\r\nexport const isValidReferenceCode = (referenceCode: string) => referenceCodeSchema.safeParse(referenceCode).success;\r\n\r\nexport const createPartialPaymentSchema = ({\r\n minimumPaymentAmount,\r\n totalAmount,\r\n serviceProvider\r\n}: {\r\n minimumPaymentAmount: number;\r\n totalAmount: number;\r\n serviceProvider: PaymentProvider | undefined;\r\n}) => {\r\n return z\r\n .number()\r\n .min(minimumPaymentAmount, {\r\n message:\r\n serviceProvider === 'inveroak'\r\n ? 'page.pay.errors.other-amount-card-min-value'\r\n : 'page.pay.errors.other-amount-min-value'\r\n })\r\n .max(totalAmount, { message: 'page.pay.errors.other-amount-max-value' })\r\n .refine(\r\n (value) => {\r\n // Check if the number has at most 2 decimal places\r\n const decimalPlaces = value.toString().split('.')[1]?.length || 0;\r\n return decimalPlaces <= 2;\r\n },\r\n {\r\n message: 'page.pay.errors.max-two-decimals'\r\n }\r\n )\r\n .optional();\r\n};\r\n","import { isMobile, isTablet, isDesktop } from 'react-device-detect';\r\n\r\nconst getDeviceType = () => {\r\n if (isMobile || isTablet) return 'Mobile';\r\n if (isDesktop) return 'Desktop';\r\n return 'Desktop';\r\n};\r\n\r\nexport const deviceType = getDeviceType();\r\n","import { useState } from 'react';\r\nimport { Typography, Paper, Stack, IconButton, Divider, Box } from '@mui/material';\r\nimport ArrowCircleDownOutlined from '@mui/icons-material/ArrowCircleDownOutlined';\r\nimport CheckCircleIcon from '@mui/icons-material/CheckCircle';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { formatPriceString } from '@/utils/numbers';\r\nimport { ReferenceDetailsProps } from '../types';\r\n\r\nconst ReferenceDetails = ({ invoice }: ReferenceDetailsProps) => {\r\n const { t } = useTranslation();\r\n const [expanded, setExpanded] = useState(false);\r\n\r\n const toggleExpanded = () => {\r\n setExpanded((prev) => !prev);\r\n };\r\n\r\n return (\r\n \r\n \r\n {t('common-phrases.reference')}\r\n \r\n \r\n \r\n \r\n {invoice.referenceCode}\r\n \r\n \r\n\r\n 4 ? 'scroll' : 'hidden',\r\n transition: 'max-height 0.3s ease-out, margin-bottom 0.3s ease-out',\r\n marginBottom: expanded ? 2 : 0\r\n }}\r\n >\r\n \r\n {invoice &&\r\n invoice.invoiceItems.map((item, index) => (\r\n \r\n {item.description}\r\n {formatPriceString(item.amount)}\r\n \r\n ))}\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n {t('components.payment-option-selector.total-amount')}\r\n \r\n \r\n {formatPriceString(invoice.amountInclVAT)}\r\n \r\n \r\n {invoice?.status === 'PartiallyPaid' && (\r\n \r\n \r\n {t('components.payment-option-selector.remaining-amount')}\r\n \r\n \r\n {formatPriceString(invoice.remainingAmountInclVAT)}\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default ReferenceDetails;\r\n","export default \"__VITE_ASSET__ygl1zWYJ__\";","import { useEffect } from 'react';\r\nimport { Modal, Box, Typography, Button, CircularProgress, Stack } from '@mui/material';\r\nimport { SwishProps } from '../types';\r\nimport { useNavigate } from 'react-router-dom';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { deviceType } from '@/utils/device';\r\nimport swishLogo from '@/assets/swish.png?w=100&h=100&format=webp&imagetools';\r\nimport { usePaymentSession } from '@/hooks/payment/usePaymentSession';\r\nimport { failedPaymentStatuses, successfulPaymentStatuses } from '@/context/PaymentSessionContext';\r\n\r\nconst Swish = ({\r\n open,\r\n showQRCode,\r\n onClose,\r\n onCancel,\r\n onConfirm,\r\n onConfirmOtherDevice,\r\n qrCodeBlob,\r\n isProcessingPayment = false\r\n}: SwishProps) => {\r\n const { t } = useTranslation();\r\n const navigate = useNavigate();\r\n const { paymentSession } = usePaymentSession();\r\n\r\n useEffect(() => {\r\n if (paymentSession && paymentSession.payment.methodCode === 'swish') {\r\n if (successfulPaymentStatuses.includes(paymentSession.payment.status)) {\r\n navigate(`/pay/confirmation/${paymentSession.paymentSessionId}`, { replace: true });\r\n } else if (failedPaymentStatuses.includes(paymentSession.payment.status)) {\r\n onClose();\r\n }\r\n }\r\n }, [paymentSession]);\r\n\r\n return (\r\n \r\n \r\n {showQRCode && qrCodeBlob ? (\r\n \r\n \r\n {t('page.pay.swish-modal.timelimit')}\r\n \r\n Swish QR Code\r\n \r\n {t('buttons.cancel')}\r\n \r\n \r\n ) : (\r\n \r\n Swish Logo\r\n \r\n {t('page.pay.swish-modal.title')}\r\n \r\n {isProcessingPayment ? (\r\n \r\n ) : (\r\n \r\n {deviceType === 'Mobile' && (\r\n \r\n )}\r\n \r\n \r\n )}\r\n \r\n {t('buttons.cancel')}\r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default Swish;\r\n","import CustomTextField from '@/components/CustomTextField/CustomTextField';\r\nimport { usePaymentSession } from '@/hooks/payment/usePaymentSession';\r\nimport Box from '@mui/material/Box';\r\nimport InputAdornment from '@mui/material/InputAdornment';\r\nimport { useEffect, useRef } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\ntype PartialPaymentProps = {\r\n handlePartialPaymentAmountChange: (event: React.ChangeEvent) => void;\r\n partialPaymentError: string | null;\r\n onEnter: (e: React.KeyboardEvent) => void;\r\n};\r\n\r\nconst PartialPayment = ({ handlePartialPaymentAmountChange, partialPaymentError, onEnter }: PartialPaymentProps) => {\r\n const { t } = useTranslation();\r\n const { partialPayment } = usePaymentSession();\r\n const textFieldRef = useRef(null);\r\n\r\n useEffect(() => {\r\n if (textFieldRef.current && partialPayment.enabled) {\r\n textFieldRef.current.focus();\r\n }\r\n }, [partialPayment.enabled]);\r\n\r\n return (\r\n \r\n {t('common-phrases.current-locale-currency')}\r\n }\r\n }}\r\n />\r\n \r\n );\r\n};\r\n\r\nexport default PartialPayment;\r\n","import { useEffect, useState } from 'react';\r\nimport Stack from '@mui/material/Stack';\r\nimport Typography from '@mui/material/Typography';\r\nimport Button from '@mui/material/Button';\r\nimport Box from '@mui/material/Box';\r\nimport Paper from '@mui/material/Paper';\r\nimport PaymentOptionsSelector from '../components/PaymentOptionSelector';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useInvoice } from '@/hooks/invoice/useInvoice';\r\nimport { formatPriceString, formatStringToAmountInCents } from '@/utils/numbers';\r\nimport { useSwishPayment } from '@/hooks/payment/useSwishPayment';\r\nimport { payCallbackPath } from '@/router/Routes';\r\nimport { useNavigate, useParams } from 'react-router-dom';\r\nimport { createPartialPaymentSchema, isValidReferenceCode } from '../schemas';\r\nimport { deviceType } from '@/utils/device';\r\nimport ReferenceDetails from '../components/ReferenceDetails';\r\nimport { Invoice, PaymentMethod } from '@/hooks/invoice/types';\r\nimport Loading from '@/components/Loading/Loading';\r\nimport FormControlLabel from '@mui/material/FormControlLabel';\r\nimport Switch from '@mui/material/Switch';\r\nimport FormGroup from '@mui/material/FormGroup';\r\nimport Link from '@/components/Link/Link';\r\nimport Swish from '../components/Swish';\r\nimport { usePaymentSession } from '@/hooks/payment/usePaymentSession';\r\nimport { failedPaymentStatuses, pendingPaymentStatuses } from '@/context/PaymentSessionContext';\r\nimport PartialPayment from '../components/PartialPayment';\r\nimport { FetchError } from '@/hooks/useApi';\r\n\r\nconst PaySession = () => {\r\n const { referenceCode: referenceCodeFromParams } = useParams();\r\n const { t } = useTranslation();\r\n const navigate = useNavigate();\r\n const {\r\n invoice,\r\n bankTransferPaymentId,\r\n resetInvoice,\r\n queryError,\r\n setInvoiceReferenceCode,\r\n refetchInvoice,\r\n minimumPaymentAmount\r\n } = useInvoice();\r\n const {\r\n postPaymentSession,\r\n cancelPaymentSession,\r\n paymentSession,\r\n resetPaymentSession,\r\n setPaymentSessionId,\r\n partialPayment\r\n } = usePaymentSession();\r\n const { fetchQrCode, getSwishAppUrl } = useSwishPayment();\r\n const [partialPaymentError, setPartialPaymentError] = useState('');\r\n const [selectedPaymentMethod, setSelectedPaymentMethod] = useState(null);\r\n const [modalOpen, setModalOpen] = useState(false);\r\n const [isProcessingPayment, setIsProcessingPayment] = useState(false);\r\n const [showQRCode, setShowQRCode] = useState(false);\r\n const [qrCodeBlob, setQrCodeBlob] = useState(null);\r\n const [swishToken, setSwishToken] = useState(null);\r\n const [swishRedirection, setSwishRedirection] = useState(null);\r\n const isValidPartialPayment = !partialPaymentError && !!partialPayment.amount;\r\n const swishPaymentMethodId = invoice?.paymentMethods.find(\r\n (method) => method.serviceProvider === 'swish' || method.serviceProvider.toLowerCase().includes('swish')\r\n )?.paymentMethodId;\r\n const isSwishPayment = selectedPaymentMethod?.paymentMethodId === swishPaymentMethodId;\r\n\r\n const canHandlePayment =\r\n !!selectedPaymentMethod &&\r\n !!invoice &&\r\n invoice.status !== 'FullyPaid' &&\r\n (partialPayment.enabled ? isValidPartialPayment : true);\r\n const handlePayment = async () => {\r\n if (!canHandlePayment || isProcessingPayment) return;\r\n setIsProcessingPayment(true);\r\n const amount = partialPayment.enabled\r\n ? partialPayment.amountNumberInCents\r\n : invoice.status === 'Unpaid'\r\n ? invoice.amountInclVAT\r\n : invoice.remainingAmountInclVAT;\r\n\r\n const paymentSessionBody = {\r\n referenceCode: invoice.referenceCode,\r\n deviceType,\r\n amount,\r\n paymentMethodId: selectedPaymentMethod.paymentMethodId,\r\n postPaymentRedirectionUrl: location.origin + '/pay/' + payCallbackPath,\r\n postPaymentRedirectionFailedUrl: location.origin + '/pay/error',\r\n postPaymentRedirectionCancelUrl: location.origin + '/pay/' + invoice.referenceCode\r\n };\r\n\r\n if (isSwishPayment) {\r\n // If a QR Code blob already exists, just open the modal\r\n if (qrCodeBlob && !!paymentSession && !failedPaymentStatuses.includes(paymentSession.payment.status)) {\r\n setModalOpen(true);\r\n return;\r\n }\r\n\r\n postPaymentSession.mutate(paymentSessionBody, {\r\n onSuccess: async (result) => {\r\n const token = result.payment?.token;\r\n const redirection = result.payment?.redirection;\r\n const paymentSessionId = result.paymentSessionId;\r\n\r\n if (token && redirection) {\r\n vtlog('Swish token:', token);\r\n\r\n // Save token and redirection URL\r\n setSwishToken(token);\r\n setSwishRedirection(redirection);\r\n\r\n const qrBlob = await fetchQrCode.mutateAsync({ token });\r\n setQrCodeBlob(URL.createObjectURL(qrBlob));\r\n setModalOpen(true);\r\n setPaymentSessionId(paymentSessionId);\r\n } else {\r\n console.error('Token or redirection URL missing in payment session response');\r\n }\r\n },\r\n onError: (error) => {\r\n console.error('Error creating Swish payment session:', error);\r\n setIsProcessingPayment(false);\r\n if (error instanceof FetchError && error.status === 409) {\r\n refetchInvoice();\r\n } else {\r\n navigate('/pay/error', { replace: true });\r\n }\r\n },\r\n onSettled: async () => {\r\n setIsProcessingPayment(false);\r\n }\r\n });\r\n } else if (selectedPaymentMethod.paymentMethodId === bankTransferPaymentId) {\r\n navigate('/pay/confirmation', { replace: true });\r\n setIsProcessingPayment(false);\r\n } else {\r\n if (paymentSession && pendingPaymentStatuses.includes(paymentSession.payment.status)) {\r\n try {\r\n await handleCancelPayment();\r\n } catch (error) {\r\n console.error('Error cancelling payment session:', error);\r\n }\r\n }\r\n\r\n postPaymentSession.mutate(paymentSessionBody, {\r\n onSuccess: (result) => {\r\n window.location.href = result.payment.redirection;\r\n },\r\n onError: (error) => {\r\n console.error('Error creating payment session:', error);\r\n setIsProcessingPayment(false);\r\n if (error instanceof FetchError && error.status === 409) {\r\n refetchInvoice();\r\n } else {\r\n navigate('/pay/error', { replace: true });\r\n }\r\n }\r\n });\r\n }\r\n };\r\n\r\n const resetModalState = () => {\r\n setModalOpen(false);\r\n setShowQRCode(false);\r\n setIsProcessingPayment(false);\r\n };\r\n\r\n const handleShowQRCode = () => {\r\n setShowQRCode(true);\r\n };\r\n\r\n const handleGoToStartPage = async () => {\r\n await resetInvoice();\r\n navigate('/pay', { replace: true });\r\n };\r\n\r\n const resetSwishPayment = () => {\r\n resetModalState();\r\n setSwishToken(null);\r\n setSwishRedirection(null);\r\n setQrCodeBlob(null);\r\n };\r\n\r\n const handleCancelPayment = () => {\r\n return new Promise((resolve, reject) => {\r\n const paymentSessionId = invoice?.paymentSessionId || paymentSession?.paymentSessionId;\r\n\r\n if (paymentSessionId) {\r\n cancelPaymentSession.mutate(paymentSessionId, {\r\n onSuccess: async (result) => {\r\n vtlog('Payment session cancelled:', result);\r\n resetPaymentSession();\r\n await refetchInvoice();\r\n resetSwishPayment();\r\n resolve();\r\n },\r\n onError: (error) => {\r\n console.error(error);\r\n navigate('/pay/error', { replace: true });\r\n reject(error);\r\n }\r\n });\r\n } else {\r\n resolve();\r\n }\r\n });\r\n };\r\n\r\n const validatePartialPaymentAmount = (value: string) => {\r\n const valueNumber = formatStringToAmountInCents(value);\r\n const result = partialPaymentAmountSchema.safeParse(valueNumber);\r\n\r\n if (!result.success) {\r\n setPartialPaymentError(\r\n t(result.error.errors[0].message, {\r\n minimumAmount: formatPriceString(selectedPaymentMethod?.minimumPaymentAmount || minimumPaymentAmount),\r\n amount: formatPriceString(invoice?.remainingAmountInclVAT || 0)\r\n })\r\n );\r\n } else {\r\n setPartialPaymentError('');\r\n }\r\n };\r\n\r\n const handleChangePaymentMethod = (paymentMethodId: number) => {\r\n setSelectedPaymentMethod(\r\n invoice?.paymentMethods.find((method) => method.paymentMethodId === paymentMethodId) || null\r\n );\r\n };\r\n\r\n const partialPaymentAmountSchema = createPartialPaymentSchema({\r\n minimumPaymentAmount: selectedPaymentMethod?.minimumPaymentAmount || minimumPaymentAmount,\r\n totalAmount: invoice?.remainingAmountInclVAT || 0,\r\n serviceProvider: selectedPaymentMethod?.serviceProvider\r\n });\r\n\r\n const handlePartialPaymentAmountChange = (e: React.ChangeEvent) => {\r\n let value = e.target.value;\r\n validatePartialPaymentAmount(value);\r\n partialPayment.setAmount(value);\r\n };\r\n\r\n useEffect(() => {\r\n if (referenceCodeFromParams) {\r\n if (isValidReferenceCode(referenceCodeFromParams)) {\r\n setInvoiceReferenceCode(referenceCodeFromParams);\r\n } else {\r\n navigate('/pay/error', { replace: true });\r\n }\r\n }\r\n }, [referenceCodeFromParams]);\r\n\r\n useEffect(() => {\r\n if (!invoice && queryError) {\r\n navigate('/pay/error', { replace: true });\r\n }\r\n\r\n if (invoice && invoice.status === 'FullyPaid') {\r\n navigate('/pay', { replace: true });\r\n }\r\n }, [invoice, queryError]);\r\n\r\n useEffect(() => {\r\n if (partialPayment.enabled && partialPayment.amount) {\r\n validatePartialPaymentAmount(partialPayment.amount);\r\n }\r\n }, [selectedPaymentMethod]);\r\n\r\n if (!invoice) {\r\n return ;\r\n }\r\n\r\n if (invoice?.paymentSessionId) {\r\n return (\r\n \r\n \r\n {t('page.pay.payment-already-processing-info')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n {t('components.payment-option-selector.choose-pay-option')}\r\n \r\n \r\n\r\n \r\n \r\n {t('components.payment-option-selector.pay-option')}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n {t('components.payment-option-selector.remaining-amount')}\r\n \r\n {invoice?.remainingAmountInclVAT && formatPriceString(invoice?.remainingAmountInclVAT)}\r\n \r\n \r\n {invoice?.isSplitPaymentAllowed && (\r\n \r\n {\r\n partialPayment.setEnabled(e.target.checked);\r\n setTimeout(() => {\r\n partialPayment.setAmount('');\r\n setPartialPaymentError('');\r\n }, 200);\r\n }}\r\n />\r\n }\r\n label={t('page.pay.pay-session.pay-partial-amount')}\r\n labelPlacement='top'\r\n sx={{\r\n flexDirection: { xs: 'column-reverse', sm: 'row' },\r\n alignItems: 'center'\r\n }}\r\n />\r\n \r\n )}\r\n \r\n e.key === 'Enter' && canHandlePayment && handlePayment()}\r\n />\r\n \r\n \r\n \r\n {t('buttons.continue')}\r\n \r\n \r\n \r\n\r\n {\r\n if (swishToken && swishRedirection) {\r\n const swishUrl = getSwishAppUrl(swishToken, swishRedirection);\r\n if (swishUrl) {\r\n window.location.href = swishUrl;\r\n } else {\r\n vtlog('Swish URL could not be generated. Missing callback URL.');\r\n }\r\n }\r\n }}\r\n onConfirmOtherDevice={handleShowQRCode}\r\n onClose={resetModalState}\r\n onCancel={handleCancelPayment}\r\n />\r\n\r\n \r\n {t('page.pay.pay-session.payment-policy-confirmation')}{' '}\r\n \r\n {t('common-phrases.privacy-policy')}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default PaySession;\r\n","import { useEffect, useState } from 'react';\r\nimport { CircularProgress, InputAdornment } from '@mui/material';\r\nimport Link from '@/components/Link/Link';\r\nimport Stack from '@mui/material/Stack';\r\nimport Typography from '@mui/material/Typography';\r\nimport Paper from '@mui/material/Paper';\r\nimport Button from '@mui/material/Button';\r\nimport { useTranslation } from 'react-i18next';\r\nimport CustomTextField from '@/components/CustomTextField/CustomTextField';\r\nimport { isValidReferenceCode, referenceCodeSchema } from './schemas';\r\nimport { useInvoice } from '@/hooks/invoice/useInvoice';\r\nimport CheckCircleIcon from '@mui/icons-material/CheckCircle';\r\nimport { useConfig } from '@/hooks/useConfig';\r\nimport { useNavigate } from 'react-router-dom';\r\nimport { FetchError } from '@/hooks/useApi';\r\nimport PolicyLogoFooter from '@/components/Footer/PolicyLogoFooter';\r\n\r\nconst Pay = () => {\r\n const { t } = useTranslation();\r\n const { urls, config } = useConfig();\r\n const navigate = useNavigate();\r\n const [error, setError] = useState('');\r\n const [referenceChecked, setReferenceChecked] = useState(false);\r\n const { invoice, setInvoiceReferenceCode, queryError, isLoading, postInvoice, resetInvoice } = useInvoice();\r\n const [referenceCode, setReferenceCode] = useState('');\r\n\r\n const getQueryErrorMessage = (error: FetchError | null) => {\r\n return error\r\n ? error?.status === 404\r\n ? t('page.pay.errors.reference-number-invalid')\r\n : t('errors.something-went-wrong')\r\n : '';\r\n };\r\n\r\n const validateReferenceCode = (referenceCode: string) => {\r\n const result = referenceCodeSchema.safeParse(referenceCode);\r\n const errorMessage = result?.error?.errors[0]?.message;\r\n setError(t(errorMessage ?? getQueryErrorMessage(queryError) ?? ''));\r\n };\r\n\r\n const handleChange = (e: React.ChangeEvent) => {\r\n let value = e.target.value.toLocaleUpperCase();\r\n\r\n // Enforce maximum length of 7 characters\r\n if (value.length > 7) {\r\n value = value.slice(0, 7);\r\n }\r\n\r\n setReferenceCode(value);\r\n };\r\n\r\n const handleResetPayment = async () => {\r\n await resetInvoice();\r\n setReferenceCode('');\r\n };\r\n\r\n const handleCheckReferenceCode = () => {\r\n if (isValidReferenceCode(referenceCode)) {\r\n setInvoiceReferenceCode(referenceCode);\r\n setReferenceChecked(true);\r\n } else {\r\n validateReferenceCode(referenceCode);\r\n }\r\n };\r\n\r\n const handlePostInvoice = async () => {\r\n await resetInvoice();\r\n\r\n postInvoice.mutate(\r\n {},\r\n {\r\n onSuccess: (result: string) => {\r\n setReferenceCode(result);\r\n },\r\n onError: (error: Error) => {\r\n console.error(error);\r\n }\r\n }\r\n );\r\n };\r\n\r\n useEffect(() => {\r\n if (invoice) {\r\n if (invoice?.status === 'FullyPaid') {\r\n return;\r\n }\r\n\r\n navigate(`/pay/${invoice.referenceCode}`);\r\n }\r\n\r\n if (queryError) {\r\n setError(getQueryErrorMessage(queryError));\r\n }\r\n }, [invoice, queryError]);\r\n\r\n return (\r\n \r\n \r\n {t('page.invoice.description')} {t('page.invoice.instructions')}\r\n \r\n\r\n e.key === 'Enter' && handleCheckReferenceCode()}\r\n error={!!error}\r\n helperText={error}\r\n slotProps={{\r\n input: {\r\n endAdornment:\r\n isValidReferenceCode(referenceCode) && !queryError ? (\r\n \r\n \r\n \r\n ) : null\r\n }\r\n }}\r\n />\r\n\r\n {invoice?.status === 'FullyPaid' ? (\r\n \r\n \r\n \r\n {t('page.invoice.payment-already-processed')}{' '}\r\n \r\n {t('common-phrases.my-pages')}\r\n \r\n .\r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n {referenceChecked && isLoading ? (\r\n \r\n \r\n \r\n ) : (\r\n t('page.invoice.find-your-purchase')\r\n )}\r\n \r\n )}\r\n {(config.environment === 'DEV' || config.environment === 'TEST') && (\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default Pay;\r\n","import validator, { MobilePhoneLocale } from 'validator';\r\nimport { parsePhoneNumberFromString, CountryCode } from 'libphonenumber-js';\r\nimport { LOCALE } from '@/utils/constants';\r\n\r\nexport const formatPhoneNumber = (phoneNumber: string, countryCode: string = 'SE'): string => {\r\n try {\r\n const countryCodeCast = countryCode.toUpperCase() as CountryCode;\r\n\r\n const parsedNumber = parsePhoneNumberFromString(phoneNumber, countryCodeCast);\r\n if (parsedNumber && parsedNumber.isValid()) {\r\n return parsedNumber.formatNational();\r\n }\r\n\r\n const locale = (LOCALE[countryCodeCast] || 'any') as MobilePhoneLocale;\r\n\r\n const isValid = validator.isMobilePhone(phoneNumber, locale, { strictMode: false });\r\n\r\n if (isValid) {\r\n const cleanedNumber = phoneNumber.replace(/\\D/g, '');\r\n return fallbackFormat(cleanedNumber);\r\n }\r\n\r\n vtlog('Invalid phone number:', phoneNumber);\r\n return phoneNumber;\r\n } catch (error) {\r\n console.error('Error formatting phone number:', error);\r\n return phoneNumber;\r\n }\r\n};\r\n\r\nconst fallbackFormat = (number: string): string => {\r\n if (number.length === 10) {\r\n return `${number.slice(0, 3)}-${number.slice(3, 6)} ${number.slice(6, 8)} ${number.slice(8)}`;\r\n } else if (number.length === 9) {\r\n return `${number.slice(0, 2)}-${number.slice(2, 5)} ${number.slice(5, 7)} ${number.slice(7)}`;\r\n }\r\n return number;\r\n};\r\nexport const formatCreditCardNumber = (cardNumber: string): string => {\r\n try {\r\n const cleanedNumber = cardNumber.replace(/\\D/g, '');\r\n\r\n if (cleanedNumber.length < 4) {\r\n return '**** **** **** ' + cleanedNumber;\r\n }\r\n\r\n const lastFour = cleanedNumber.slice(-4);\r\n\r\n return `**** **** **** ${lastFour}`;\r\n } catch (error) {\r\n console.error('Error formatting credit card number:', error);\r\n return cardNumber;\r\n }\r\n};\r\n\r\nexport const formatExpirationDate = (expirationDate: string): string => {\r\n try {\r\n const date = new Date(expirationDate);\r\n\r\n const year = date.getUTCFullYear();\r\n const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');\r\n\r\n // Return as MM/YY\r\n return `${month}/${year.toString().slice(-2)}`;\r\n } catch (error) {\r\n vtlog('Invalid expiration date format:', expirationDate);\r\n return expirationDate; // return original if invalid\r\n }\r\n};\r\n","import { CheckCircle } from '@mui/icons-material';\r\nimport Card from '@mui/material/Card';\r\nimport CardContent from '@mui/material/CardContent';\r\nimport CardHeader from '@mui/material/CardHeader';\r\nimport Typography from '@mui/material/Typography';\r\nimport Stack from '@mui/material/Stack';\r\nimport Button from '@mui/material/Button';\r\nimport PhoneEnabled from '@mui/icons-material/PhoneEnabled';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { formatPhoneNumber, formatExpirationDate, formatCreditCardNumber } from '@/utils/strings';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { deviceType } from '@/utils/device';\r\n\r\nconst CardConfirmation = () => {\r\n const { t } = useTranslation();\r\n const location = useLocation();\r\n\r\n const phoneNumber = location.state?.phoneNumber;\r\n const companyName = location.state?.companyName;\r\n const companyPhoneNumber = location.state?.companyPhoneNumber;\r\n const cardNumber = location.state?.cardNumber;\r\n const cardExpirationDate = location.state?.cardExpirationDate;\r\n\r\n return (\r\n \r\n \r\n {t('page.card.confirmation-step.title')}\r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t('common-phrases.card-number')}\r\n \r\n {formatCreditCardNumber(cardNumber)}\r\n \r\n\r\n \r\n \r\n {t('common-phrases.valid-to')}\r\n \r\n {formatExpirationDate(cardExpirationDate)}\r\n \r\n \r\n \r\n \r\n\r\n \r\n {companyName ? (\r\n \r\n {t('page.card.confirmation-step.you-can-call-reference')}\r\n \r\n {companyName}\r\n \r\n {t('common-phrases.at')}\r\n \r\n {formatPhoneNumber(companyPhoneNumber)}\r\n \r\n \r\n ) : (\r\n \r\n {t('page.card.confirmation-step.you-can-call')}\r\n \r\n )}\r\n {deviceType === 'Mobile' && (\r\n }\r\n onClick={() => {\r\n window.location.href = `tel:${companyPhoneNumber}`;\r\n }}\r\n >\r\n {t('common-phrases.call-now')}\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default CardConfirmation;\r\n","import ErrorIcon from '@mui/icons-material/Error';\r\nimport Typography from '@mui/material/Typography';\r\nimport Stack from '@mui/material/Stack';\r\nimport { useTranslation } from 'react-i18next';\r\nimport Link from '@/components/Link/Link';\r\n\r\nconst CardError = () => {\r\n const { t } = useTranslation();\r\n\r\n return (\r\n \r\n \r\n {t('page.card.error-step.title')}\r\n \r\n\r\n \r\n\r\n \r\n {t('page.card.error-step.description')}{' '}\r\n \r\n {t('common-phrases.click-here')}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default CardError;\r\n","import Button from '@mui/material/Button';\r\nimport { useNavigate } from 'react-router-dom';\r\nimport Typography from '@mui/material/Typography';\r\nimport Stack from '@mui/material/Stack';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useLocation } from 'react-router-dom';\r\n\r\nconst CardPsp = () => {\r\n const { t } = useTranslation();\r\n const navigate = useNavigate();\r\n const location = useLocation();\r\n const phoneNumber = location.state?.phoneNumber;\r\n const companyName = 'Company Name';\r\n const companyPhoneNumber = '09391910';\r\n const cardNumber = '1234 5678 9012 3456';\r\n const cardExpirationDate = '12/24';\r\n\r\n const handleContinue = () => {\r\n navigate('/card/confirmation', {\r\n state: { phoneNumber, companyName, companyPhoneNumber, cardNumber, cardExpirationDate }\r\n });\r\n };\r\n\r\n const handleError = () => {\r\n navigate(`/card/error`);\r\n };\r\n\r\n return (\r\n \r\n PSP BOX!\r\n\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default CardPsp;\r\n","import { RouteObject } from 'react-router-dom';\r\nimport BankTransfer from '@/pages/Pay/pages/BankTransfer';\r\nimport NotFound from '@/pages/NotFound/NotFound';\r\nimport Card from '@/pages/Card/Card';\r\nimport PayCallback from '@/pages/Pay/pages/PayCallback';\r\nimport PayError from '@/pages/Pay/pages/PayError';\r\nimport PayConfirmation from '@/pages/Pay/pages/PayConfirmation';\r\nimport PaySession from '@/pages/Pay/pages/PaySession';\r\nimport Pay from '@/pages/Pay/Pay';\r\nimport CardConfirmation from '@/pages/Card/pages/CardConfirmation';\r\nimport CardError from '@/pages/Card/pages/CardError';\r\nimport CardPsp from '@/pages/Card/pages/CardPsp';\r\n\r\nexport const payCallbackPath = 'paycallback';\r\n\r\nconst routes: RouteObject[] = [\r\n {\r\n path: '/',\r\n children: [\r\n {\r\n index: true,\r\n element: \r\n },\r\n {\r\n path: 'pay',\r\n children: [\r\n {\r\n index: true,\r\n element: \r\n },\r\n {\r\n path: 'error',\r\n element: \r\n },\r\n {\r\n path: payCallbackPath,\r\n element: \r\n },\r\n {\r\n path: 'confirmation',\r\n element: \r\n },\r\n {\r\n path: 'confirmation/:paymentSessionId',\r\n element: \r\n },\r\n {\r\n path: ':referenceCode',\r\n element: \r\n }\r\n ]\r\n },\r\n {\r\n path: 'card',\r\n children: [\r\n {\r\n index: true,\r\n element: \r\n },\r\n {\r\n path: 'error',\r\n element: \r\n },\r\n {\r\n path: 'psp',\r\n element: \r\n },\r\n {\r\n path: 'confirmation',\r\n element: \r\n },\r\n {\r\n path: ':referenceCode',\r\n element: \r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n { path: '*', element: }\r\n];\r\n\r\nexport default routes;\r\n","import { useRoutes } from 'react-router-dom';\r\nimport routes from './Routes';\r\n\r\nconst RouterProvider = () => {\r\n const routing = useRoutes(routes);\r\n return routing;\r\n};\r\n\r\nexport default RouterProvider;\r\n","import { createTheme } from '@mui/material';\r\n\r\ndeclare module '@mui/material/styles' {\r\n interface Palette {\r\n primaryLight: Palette['primary'];\r\n customGrey: Palette['primary'];\r\n }\r\n interface PaletteOptions {\r\n primaryLight?: PaletteOptions['primary'];\r\n customGrey?: PaletteOptions['primary'];\r\n }\r\n\r\n interface TypographyVariants {\r\n body3: React.CSSProperties;\r\n }\r\n\r\n interface TypographyVariantsOptions {\r\n body3?: React.CSSProperties;\r\n }\r\n\r\n interface Theme {\r\n boxShadow1: string;\r\n boxShadow2: string;\r\n }\r\n interface ThemeOptions {\r\n boxShadow1?: string;\r\n boxShadow2?: string;\r\n }\r\n}\r\n\r\ndeclare module '@mui/material/Typography' {\r\n interface TypographyPropsVariantOverrides {\r\n body3: true;\r\n }\r\n\r\n interface TypographyPropsColorOverrides {\r\n customGrey: true;\r\n }\r\n}\r\n\r\ndeclare module '@mui/material/Button' {\r\n interface ButtonPropsColorOverrides {\r\n primaryLight: true;\r\n }\r\n}\r\n\r\ndeclare module '@mui/material/CircularProgress' {\r\n interface CircularProgressPropsColorOverrides {\r\n white: true;\r\n }\r\n}\r\nexport const akovaTheme = () => {\r\n const createColor = (mainColor: string) => createTheme().palette.augmentColor({ color: { main: mainColor } });\r\n const titleColor = '#003250';\r\n\r\n let theme = createTheme({\r\n palette: {\r\n primary: {\r\n main: '#5A87AA',\r\n light: '#BDCFDD',\r\n dark: '#003250',\r\n contrastText: '#fff'\r\n },\r\n secondary: createColor('#F5F5F5'),\r\n background: {\r\n default: '#EBEBE7'\r\n },\r\n success: createColor('#41A664'),\r\n error: createColor('#CB4949'),\r\n text: {\r\n primary: '#2a2a2a',\r\n secondary: '#000'\r\n },\r\n customGrey: createColor('#616161')\r\n },\r\n typography: {\r\n fontFamily: '\"Noto Sans\", sans-serif',\r\n fontSize: 16,\r\n h1: {\r\n fontSize: '1.5rem', // 24px\r\n color: titleColor\r\n },\r\n h2: {\r\n fontSize: '1.125rem', // 18px\r\n color: titleColor\r\n },\r\n body1: {\r\n fontSize: '1rem' // 16px\r\n },\r\n body2: {\r\n fontSize: '.875rem' // 14px\r\n },\r\n body3: {\r\n fontSize: '.75rem' // 12px\r\n }\r\n }\r\n });\r\n\r\n theme = createTheme(theme, {\r\n palette: {\r\n ...theme.palette,\r\n primaryLight: {\r\n main: theme.palette.primary.light,\r\n contrastText: theme.palette.primary.main\r\n }\r\n },\r\n boxShadow1: '0px 4px 4px 0px rgba(0, 0, 0, 0.25)',\r\n boxShadow2: '0px 4px 6px rgba(0, 0, 0, 0.1)',\r\n shadows: [\r\n 'none',\r\n '0px 4px 4px 0px rgba(0, 0, 0, 0.25)',\r\n '0px 4px 6px rgba(0, 0, 0, 0.1)',\r\n ...Array(22).fill('none')\r\n ],\r\n components: {\r\n MuiTextField: {\r\n styleOverrides: {\r\n root: {\r\n '& .MuiOutlinedInput-root': {\r\n '& fieldset, &:hover fieldset, &.Mui-focused fieldset': {\r\n borderColor: 'transparent !important'\r\n },\r\n '&.Mui-disabled': {\r\n WebkitTextFillColor: theme.palette.action.disabled,\r\n backgroundColor: theme.palette.action.disabledBackground\r\n }\r\n }\r\n }\r\n }\r\n },\r\n MuiOutlinedInput: {\r\n styleOverrides: {\r\n root: {\r\n boxShadow: '0px 2px 2px rgba(0, 0, 0, 0.2)',\r\n '&:hover, &.Mui-focused': {\r\n boxShadow: '0px 2px 2px rgba(0, 0, 0, 0.4)'\r\n }\r\n },\r\n input: {\r\n padding: theme.spacing(3)\r\n }\r\n }\r\n },\r\n MuiButton: {\r\n defaultProps: {\r\n disableRipple: true\r\n },\r\n styleOverrides: {\r\n root: {\r\n maxWidth: '243px',\r\n fontSize: theme.typography.body1.fontSize,\r\n paddingTop: theme.spacing(0.625),\r\n paddingBottom: theme.spacing(0.625),\r\n paddingRight: theme.spacing(2),\r\n paddingleft: theme.spacing(2),\r\n textTransform: 'none'\r\n }\r\n }\r\n },\r\n MuiFormControlLabel: {\r\n styleOverrides: {\r\n root: {\r\n '& .MuiFormControlLabel-label': {\r\n fontSize: theme.typography.body2.fontSize\r\n }\r\n }\r\n }\r\n },\r\n MuiToggleButton: {\r\n defaultProps: {\r\n disableRipple: true\r\n },\r\n styleOverrides: {\r\n root: {\r\n fontWeight: 'normal',\r\n color: theme.palette.text.primary,\r\n textTransform: 'none',\r\n backgroundColor: theme.palette.common.white,\r\n '&:hover': {\r\n backgroundColor: theme.palette.secondary.main\r\n },\r\n '&.Mui-selected': {\r\n backgroundColor: theme.palette.common.white,\r\n '&:hover': {\r\n backgroundColor: theme.palette.secondary.main\r\n }\r\n }\r\n }\r\n }\r\n },\r\n MuiLink: {\r\n styleOverrides: {\r\n root: {\r\n cursor: 'pointer',\r\n color: theme.palette.common.black\r\n }\r\n }\r\n },\r\n MuiCard: {\r\n styleOverrides: {\r\n root: {\r\n width: '100%',\r\n borderRadius: theme.shape.borderRadius * 2,\r\n boxShadow: '0px 4px 4px 0px rgba(0, 0, 0, 0.25)'\r\n }\r\n }\r\n },\r\n MuiCardHeader: {\r\n styleOverrides: {\r\n root: {\r\n backgroundColor: theme.palette.secondary.main,\r\n textAlign: 'center',\r\n padding: theme.spacing(1)\r\n },\r\n content: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center'\r\n },\r\n title: {\r\n fontSize: theme.typography.body2.fontSize\r\n },\r\n subheader: {\r\n fontWeight: 'bold',\r\n fontSize: theme.typography.body1.fontSize\r\n }\r\n }\r\n },\r\n MuiCardContent: {\r\n styleOverrides: {\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2),\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: theme.spacing(1),\r\n '&:last-child': {\r\n paddingBottom: theme.spacing(1)\r\n }\r\n }\r\n }\r\n },\r\n MuiSvgIcon: {\r\n styleOverrides: {\r\n fontSizeLarge: {\r\n fontSize: '64px'\r\n }\r\n }\r\n },\r\n MuiPaper: {\r\n styleOverrides: {\r\n root: {\r\n borderRadius: theme.shape.borderRadius,\r\n boxShadow: '0px 4px 4px 0px rgba(0, 0, 0, 0.25)',\r\n width: '100%'\r\n }\r\n }\r\n },\r\n MuiChip: {\r\n styleOverrides: {\r\n root: {\r\n color: theme.palette.grey[800],\r\n fontSize: theme.typography.body3.fontSize,\r\n borderRadius: '100px',\r\n paddingTop: theme.spacing(2),\r\n paddingBottom: theme.spacing(2),\r\n paddingLeft: theme.spacing(1),\r\n paddingRight: theme.spacing(1),\r\n variants: [\r\n {\r\n props: { color: 'primary' },\r\n style: {\r\n color: theme.palette.common.white\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n },\r\n MuiSwitch: {\r\n styleOverrides: {\r\n root: {\r\n '& .MuiSwitch-track': {\r\n backgroundColor: theme.palette.secondary.dark\r\n }\r\n }\r\n }\r\n },\r\n MuiFormHelperText: {\r\n styleOverrides: {\r\n root: {\r\n fontSize: theme.typography.body3.fontSize\r\n }\r\n }\r\n },\r\n MuiAppBar: {\r\n styleOverrides: {\r\n root: {\r\n backgroundColor: theme.palette.common.white,\r\n boxShadow: 'none',\r\n borderRadius: '0',\r\n '& .MuiToolbar-root': {\r\n height: '90px'\r\n }\r\n }\r\n }\r\n }\r\n }\r\n });\r\n\r\n return theme;\r\n};\r\n","import { useTheme } from '@mui/material/styles';\r\nimport useMediaQuery from '@mui/material/useMediaQuery';\r\nimport { useMemo } from 'react';\r\n\r\nconst useBreakpoint = () => {\r\n const theme = useTheme();\r\n const breakpoints = theme.breakpoints;\r\n\r\n const isXs = useMediaQuery(breakpoints.only('xs'));\r\n const isSm = useMediaQuery(breakpoints.only('sm'));\r\n const isMd = useMediaQuery(breakpoints.only('md'));\r\n const isLg = useMediaQuery(breakpoints.only('lg'));\r\n const isXl = useMediaQuery(breakpoints.only('xl'));\r\n const isMobile = useMediaQuery(breakpoints.down('sm'));\r\n\r\n const currentBreakpoint = useMemo(() => {\r\n if (isXl) return 'xl';\r\n if (isLg) return 'lg';\r\n if (isMd) return 'md';\r\n if (isSm) return 'sm';\r\n return 'xs';\r\n }, [isXs, isSm, isMd, isLg, isXl]);\r\n\r\n return useMemo(() => ({ currentBreakpoint, isMobile }), [currentBreakpoint, isMobile]);\r\n};\r\n\r\nexport default useBreakpoint;\r\n","import Logo from '../Logo/Logo';\r\nimport { useLocation } from 'react-router-dom';\r\nimport useBreakpoint from '@/hooks/useBreakpoint';\r\n\r\nconst ContentHeader = () => {\r\n const { pathname } = useLocation();\r\n const { isMobile } = useBreakpoint();\r\n const height = isMobile ? '48px' : '55px';\r\n const logoType = pathname === '/card' ? 'akova-card' : 'akova-pay';\r\n\r\n return ;\r\n};\r\n\r\nexport default ContentHeader;\r\n","import type React from 'react';\r\nimport Box from '@mui/material/Box';\r\nimport Stack from '@mui/material/Stack';\r\nimport Container from '@mui/material/Container';\r\nimport { useTheme } from '@mui/material/styles';\r\nimport Paper from '@mui/material/Paper';\r\nimport { Helmet } from 'react-helmet';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useLocation } from 'react-router-dom';\r\nimport ContentHeader from './components/Header/ContentHeader';\r\nimport { useConfig } from './hooks/useConfig';\r\n\r\ntype LayoutProps = {\r\n children: React.ReactNode;\r\n};\r\n\r\nconst Layout = ({ children }: LayoutProps) => {\r\n const { backgroundImage } = useConfig();\r\n const { pathname } = useLocation();\r\n const { t } = useTranslation();\r\n const theme = useTheme();\r\n const title = pathname === '/card' ? 'common-phrases.akova-card' : 'common-phrases.akova-pay';\r\n\r\n vtlog('theme:', theme);\r\n\r\n return (\r\n <>\r\n \r\n {t(title)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {children}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Layout;\r\n","import AppBar from '@mui/material/AppBar';\r\nimport Box from '@mui/material/Box';\r\nimport Toolbar from '@mui/material/Toolbar';\r\nimport Container from '@mui/material/Container';\r\nimport Button from '@mui/material/Button';\r\nimport Logo from '../Logo/Logo';\r\nimport Link from '@/components/Link/Link';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSearchParams } from 'react-router-dom';\r\nimport { Stack } from '@mui/material';\r\n\r\nconst Header = () => {\r\n const { t, i18n } = useTranslation();\r\n const currentLanguage = i18n.language;\r\n const [searchParams] = useSearchParams();\r\n const p = searchParams.get('p');\r\n const myPagesHref = p ? `https://secure.akova.se/my?p=${p}` : 'https://secure.akova.se/my';\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t('components.header.questions-and-answers')}\r\n \r\n \r\n {t('components.header.contact')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Header;\r\n","export default \"__VITE_ASSET__V2YW9gcV__\"","import Typography from '@mui/material/Typography';\r\nimport Logo from '../Logo/Logo';\r\nimport Stack from '@mui/material/Stack';\r\nimport { useTranslation } from 'react-i18next';\r\nimport Container from '@mui/material/Container';\r\nimport Box from '@mui/material/Box';\r\nimport Link from '@/components/Link/Link';\r\nimport footerBg from '@/assets/footer-rectangle.svg';\r\n\r\nconst Footer = () => {\r\n const { t, i18n } = useTranslation();\r\n const currentLanguage = i18n.language;\r\n\r\n const linkStyles = {\r\n textDecoration: 'none',\r\n '&:hover': {\r\n color: 'secondary.main'\r\n }\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n {t('components.footer.akova-title')}\r\n \r\n \r\n {t('components.footer.akova-org-number')}\r\n \r\n \r\n {t('components.footer.akova-address')}\r\n \r\n \r\n {t('components.footer.akova-phone-number')} 08-12 12 12 12\r\n \r\n \r\n {t('common-phrases.email')}{' '}\r\n \r\n hej@akova.se\r\n \r\n \r\n \r\n \r\n {t('common-phrases.privacy-policy')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Footer;\r\n","import Typography from '@mui/material/Typography';\r\nimport { useConfig } from '@/hooks/useConfig';\r\nimport Box from '@mui/material/Box';\r\n\r\nconst Environment = () => {\r\n const { config } = useConfig();\r\n\r\n return config.environment !== 'PROD' ? (\r\n \r\n \r\n {config.environment}\r\n \r\n \r\n ) : null;\r\n};\r\n\r\nexport default Environment;\r\n","import { useEffect } from 'react';\r\nimport { useLocation } from 'react-router-dom';\r\n\r\nconst ScrollToTop = () => {\r\n const { pathname } = useLocation();\r\n\r\n useEffect(() => {\r\n window.scrollTo(0, 0);\r\n }, [pathname]);\r\n\r\n return null;\r\n};\r\n\r\nexport default ScrollToTop;\r\n","import CssBaseline from '@mui/material/CssBaseline';\r\nimport './locales/i18n';\r\nimport RouterProvider from './router/RouterProvider';\r\nimport { ThemeProvider } from '@mui/material/styles';\r\nimport { akovaTheme } from './theme/theme';\r\nimport Layout from './Layout';\r\nimport { InvoiceProvider } from './context/InvoiceContext';\r\nimport { useSearchParams } from 'react-router-dom';\r\nimport { useEffect } from 'react';\r\nimport { setLanguageFromQueryParam } from './locales/i18n';\r\nimport Header from './components/Header/Header';\r\nimport Footer from './components/Footer/Footer';\r\nimport Environment from './components/Environment/Environment';\r\nimport { PaymentSessionProvider } from './context/PaymentSessionContext';\r\nimport * as Sentry from '@sentry/react';\r\nimport { useConfig } from '@/hooks/useConfig';\r\nimport ScrollToTop from './components/ScrollToTop/ScrollToTop';\r\n\r\nconst App = () => {\r\n const [searchParams] = useSearchParams();\r\n const lang = searchParams.get('lang');\r\n const { config } = useConfig();\r\n\r\n useEffect(() => {\r\n setLanguageFromQueryParam(lang);\r\n }, [lang]);\r\n\r\n useEffect(() => {\r\n if (!window.__SENTRY_INITIALIZED__) {\r\n Sentry.init({\r\n dsn: 'https://1a5282b534df3597e77e7f6747f3b41f@o4507222507520000.ingest.de.sentry.io/4508652354404432',\r\n integrations: [\r\n Sentry.browserTracingIntegration(),\r\n Sentry.replayIntegration({\r\n maskAllText: false,\r\n maskAllInputs: false,\r\n blockAllMedia: true\r\n })\r\n ],\r\n enabled: import.meta.env.MODE !== 'development',\r\n environment: config.environment,\r\n debug: false,\r\n autoSessionTracking: true,\r\n // Performance Monitoring\r\n tracesSampleRate: 0.5,\r\n // Session and Error Replay\r\n replaysSessionSampleRate: 0,\r\n replaysOnErrorSampleRate: 1\r\n });\r\n window.__SENTRY_INITIALIZED__ = true;\r\n }\r\n }, []);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n