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gBC,mBAXKD,IACD,iBAAbA,EAAKpa,KACZka,EAAmBre,MAAMye,GACrBF,EAAKpa,IAAIrB,WAAW2b,KASxBC,CAAgBH,IANMA,IACA,iBAAfA,EAAKI,OACZJ,EAAKI,MAAMnc,SAAS,0BAKpBoc,CAAiBL,GAERnc,EAA8BA,IACvC1K,MAAMoB,KACF2T,SAASoS,KAAKC,iBACV,2CAGHhpB,OAAOwoB,GACPhoB,SAASyoB,GAAWA,EAAOC,U","sources":["webpack://touchweb/./src/apps/my-tradera/app/constants/list-types.ts","webpack://touchweb/./src/apps/nextweb/components/next-link.tsx","webpack://touchweb/./src/components/alink/use-next-web-spa-link.ts","webpack://touchweb/./src/components/alink/use-touchweb-in-next-web-spa-link.ts","webpack://touchweb/./src/components/alink/alink.tsx","webpack://touchweb/./src/components/toasts/item-toast.module.scss","webpack://touchweb/./src/components/toasts/item-toast.jsx","webpack://touchweb/./src/components/toasts/message-toast.tsx","webpack://touchweb/./src/constants/endpoints.ts","webpack://touchweb/./src/hooks/use-is-feature-enabled.ts","webpack://touchweb/./src/hooks/use-location.ts","webpack://touchweb/./src/hooks/use-navigation.ts","webpack://touchweb/./src/hooks/use-query.ts","webpack://touchweb/./src/utils/condition-check.ts","webpack://touchweb/./src/lang/shared-config.ts","webpack://touchweb/./src/lang/helpers.ts","webpack://touchweb/./src/lang/boot-languages.js","webpack://touchweb/./src/lang/translations-context.tsx","webpack://touchweb/./src/legacy/static/packages/logger.ts","webpack://touchweb/./src/services/google-tagmanager/google-tagmanager-service.ts","webpack://touchweb/./src/services/google-tagmanager/google-tagmanager-snippet.js","webpack://touchweb/./src/services/toast-queue.js","webpack://touchweb/./src/state/environment/native-app-info-helper.ts","webpack://touchweb/./src/state/environment/actions.ts","webpack://touchweb/./src/utils/versions.js","webpack://touchweb/./src/state/environment/reducer.ts","webpack://touchweb/./src/state/environment/native-app-support.js","webpack://touchweb/./src/state/hooks.ts","webpack://touchweb/./src/utils/gdpr-settings.js","webpack://touchweb/./src/utils/google-tagmanager.js","webpack://touchweb/./src/utils/language.js","webpack://touchweb/./src/utils/nextjs.ts","webpack://touchweb/./src/utils/privacy-sandbox-iframes.ts"],"sourcesContent":["export const LIST_VIEW_TYPES = {\n BASIC: 'Basic',\n NORMAL: 'Normal'\n} as const;\n\nexport const PAGE_LIST_TYPES = {\n BUYER_ACTIVE_ITEMS: 'BUYER_ACTIVE_ITEMS',\n BUYER_PURCHASES: 'BUYER_PURCHASES',\n BUYER_ITEMS_LOST: 'BUYER_ITEMS_LOST',\n SELLER_ACTIVE: 'SELLER_ACTIVE',\n SELLER_SOLD: 'SELLER_SOLD',\n SELLER_NOT_SOLD: 'SELLER_NOT_SOLD'\n} as const;\n\nexport const PAGE_BULK_ACTIONS = {\n ACTIVE_CANCEL: 'ActiveItems_Cancel',\n UNSOLD_RESTART: 'UnsoldItems_Restart',\n BUYER_MARK_PAID: 'Buyer_MarkPaid',\n BUYER_SHOW_ACTIVE: 'ShowActive',\n BUYER_HIDE_ACTIVE: 'HideActive',\n PURCHASES_SHOW: 'PurchasesShow'\n} as const;\n","'use client';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n// This is a cleaned-up ES6 copy of the next/link component without prefetch from:\n// https://github.com/vercel/next.js/blob/v12.2.5/packages/next/client/link.tsx\n// This component was mainly copied to completely disable prefetch on link mouse-over\n// Update this component if needed when updating Next.js\n\nimport type { NextRouter } from 'next/dist/shared/lib/router/router';\n\nimport React from 'react';\nimport type { UrlObject } from 'url';\nimport { resolveHref } from 'next/dist/client/resolve-href';\nimport { isLocalURL } from 'next/dist/shared/lib/router/utils/is-local-url';\nimport { formatUrl } from 'next/dist/shared/lib/router/utils/format-url';\nimport { isAbsoluteUrl } from 'next/dist/shared/lib/utils';\nimport { addLocale } from 'next/dist/client/add-locale';\nimport { RouterContext } from 'next/dist/shared/lib/router-context.shared-runtime';\nimport { AppRouterContext } from 'next/dist/shared/lib/app-router-context.shared-runtime';\nimport type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime';\nimport { useIntersection } from 'next/dist/client/use-intersection';\nimport { getDomainLocale } from 'next/dist/client/get-domain-locale';\nimport { addBasePath } from 'next/dist/client/add-base-path';\n\ntype Url = string | UrlObject;\ntype RequiredKeys = {\n // eslint-disable-next-line @typescript-eslint/ban-types\n [K in keyof T]-?: {} extends Pick ? never : K;\n}[keyof T];\ntype OptionalKeys = {\n // eslint-disable-next-line @typescript-eslint/ban-types\n [K in keyof T]-?: {} extends Pick ? K : never;\n}[keyof T];\n\ntype InternalLinkProps = {\n /**\n * The path or URL to navigate to. It can also be an object.\n *\n * @example https://nextjs.org/docs/api-reference/next/link#with-url-object\n */\n href: Url;\n /**\n * Optional decorator for the path that will be shown in the browser URL bar. Before Next.js 9.5.3 this was used for dynamic routes, check our [previous docs](https://nextjs.org/docs/tag/v9.5.2/api-reference/next/link#dynamic-routes) to see how it worked. Note: when this path differs from the one provided in `href` the previous `href`/`as` behavior is used as shown in the [previous docs](https://nextjs.org/docs/tag/v9.5.2/api-reference/next/link#dynamic-routes).\n */\n as?: Url;\n /**\n * Replace the current `history` state instead of adding a new url into the stack.\n *\n * @defaultValue `false`\n */\n replace?: boolean;\n /**\n * Whether to override the default scroll behavior\n *\n * @example https://nextjs.org/docs/api-reference/next/link#disable-scrolling-to-the-top-of-the-page\n *\n * @defaultValue `true`\n */\n scroll?: boolean;\n /**\n * Update the path of the current page without rerunning [`getStaticProps`](/docs/basic-features/data-fetching/get-static-props.md), [`getServerSideProps`](/docs/basic-features/data-fetching/get-server-side-props.md) or [`getInitialProps`](/docs/api-reference/data-fetching/get-initial-props.md).\n *\n * @defaultValue `false`\n */\n shallow?: boolean;\n /**\n * Forces `Link` to send the `href` property to its child.\n *\n * @defaultValue `false`\n */\n passHref?: boolean;\n /**\n * The active locale is automatically prepended. `locale` allows for providing a different locale.\n * When `false` `href` has to include the locale as the default behavior is disabled.\n */\n locale?: string | false;\n /**\n * Optional event handler for when the mouse pointer is moved onto Link\n */\n onMouseEnter?: React.MouseEventHandler;\n /**\n * Optional event handler for when Link is touched.\n */\n onTouchStart?: React.TouchEventHandler;\n /**\n * Optional event handler for when Link is clicked.\n */\n onClick?: React.MouseEventHandler;\n};\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when the webpack plugin runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps = InternalLinkProps;\ntype LinkPropsRequired = RequiredKeys;\ntype LinkPropsOptional = OptionalKeys;\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement;\n const target = eventTarget.getAttribute('target');\n return (\n (target && target !== '_self') ||\n event.metaKey || // open in new tab on macOS\n event.ctrlKey || // right-click on macOS, open in new tab on Windows\n event.shiftKey || // open in new window\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n );\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n router: NextRouter | AppRouterInstance,\n href: string,\n as: string,\n replace?: boolean,\n shallow?: boolean,\n scroll?: boolean,\n locale?: string | false,\n isAppRouter?: boolean\n): void {\n const { nodeName } = e.currentTarget;\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A';\n\n if (\n isAnchorNodeName &&\n (isModifiedEvent(e) ||\n // app-router supports external urls out of the box so it shouldn't short-circuit here as support for e.g. `replace` is added in the app-router.\n (!isAppRouter && !isLocalURL(href)))\n ) {\n // ignore click for browser’s default behavior\n return;\n }\n\n e.preventDefault();\n\n const navigate = () => {\n // If the router is an NextRouter instance it will have `beforePopState`\n const routerScroll = scroll ?? true;\n if ('beforePopState' in router) {\n router[replace ? 'replace' : 'push'](href, as, {\n shallow,\n locale,\n scroll: routerScroll\n });\n } else {\n router[replace ? 'replace' : 'push'](as || href, {\n scroll: routerScroll\n });\n }\n };\n\n if (isAppRouter) {\n React.startTransition(navigate);\n } else {\n navigate();\n }\n}\n\ntype LinkPropsReal = React.PropsWithChildren<\n Omit, keyof LinkProps> &\n LinkProps\n>;\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString;\n }\n\n return formatUrl(urlObjOrString);\n}\n\nfunction createPropError(args: {\n key: string;\n expected: string;\n actual: string;\n}) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n );\n}\n\n/**\n * React Component that enables client-side transitions between routes.\n */\nconst Link = React.forwardRef(\n function LinkComponent(props, forwardedRef) {\n if (process.env.NODE_ENV !== 'production') {\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record = {\n href: true\n } as const;\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[];\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' &&\n typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual:\n props[key] === null ? 'null' : typeof props[key]\n });\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = key;\n }\n });\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n locale: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true\n } as const;\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[];\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key];\n\n if (key === 'as') {\n if (\n props[key] &&\n valType !== 'string' &&\n valType !== 'object'\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType\n });\n }\n } else if (key === 'locale') {\n if (props[key] && valType !== 'string') {\n throw createPropError({\n key,\n expected: '`string`',\n actual: valType\n });\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType\n });\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType\n });\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = key;\n }\n });\n }\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n passHref,\n replace,\n shallow,\n scroll,\n locale,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n ...restProps\n } = props;\n\n const children: React.ReactNode = childrenProp;\n\n const pagesRouter = React.useContext(RouterContext);\n const appRouter = React.useContext(AppRouterContext);\n const router = pagesRouter ?? appRouter;\n\n // We're in the app directory if there is no pages router.\n const isAppRouter = !pagesRouter;\n\n if (process.env.NODE_ENV !== 'production') {\n if (isAppRouter && !asProp) {\n let href: string | undefined;\n if (typeof hrefProp === 'string') {\n href = hrefProp;\n } else if (\n typeof hrefProp === 'object' &&\n typeof hrefProp.pathname === 'string'\n ) {\n href = hrefProp.pathname;\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some(\n (segment) =>\n segment.startsWith('[') && segment.endsWith(']')\n );\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n );\n }\n }\n }\n }\n\n const { href, as } = React.useMemo(() => {\n if (!pagesRouter) {\n const resolvedHref = formatStringOrUrl(hrefProp);\n return {\n href: resolvedHref,\n as: asProp ? formatStringOrUrl(asProp) : resolvedHref\n };\n }\n\n const [resolvedHref, resolvedAs] = resolveHref(\n pagesRouter,\n hrefProp,\n true\n );\n\n return {\n href: resolvedHref,\n as: asProp\n ? resolveHref(pagesRouter, asProp)\n : resolvedAs || resolvedHref\n };\n }, [pagesRouter, hrefProp, asProp]);\n\n const previousHref = React.useRef(href);\n const previousAs = React.useRef(as);\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any;\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid with child. Please remove .\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n );\n }\n }\n\n const childRef: any = forwardedRef;\n\n const [setIntersectionRef, , resetVisible] = useIntersection({\n rootMargin: '200px'\n });\n\n const setRef = React.useCallback(\n (el: Element) => {\n // Before the link getting observed, check if visible state need to be reset\n if (\n previousAs.current !== as ||\n previousHref.current !== href\n ) {\n resetVisible();\n previousAs.current = as;\n previousHref.current = href;\n }\n\n setIntersectionRef(el);\n if (childRef) {\n if (typeof childRef === 'function') childRef(el);\n else if (typeof childRef === 'object') {\n childRef.current = el;\n }\n }\n },\n [as, childRef, href, resetVisible, setIntersectionRef]\n );\n\n const childProps: {\n onTouchStart: React.TouchEventHandler;\n onMouseEnter: React.MouseEventHandler;\n onClick: React.MouseEventHandler;\n href?: string;\n ref?: any;\n } = {\n ref: setRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n );\n }\n }\n\n if (typeof onClick === 'function') {\n onClick(e);\n }\n\n if (!router) {\n return;\n }\n\n if (e.defaultPrevented) {\n return;\n }\n\n linkClicked(\n e,\n router,\n href,\n as,\n replace,\n shallow,\n scroll,\n locale,\n isAppRouter\n );\n },\n onMouseEnter(e) {\n if (typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e);\n }\n },\n onTouchStart(e) {\n if (typeof onTouchStartProp === 'function') {\n onTouchStartProp(e);\n }\n }\n };\n\n // If child is an tag and doesn't have a href attribute, or if the 'passHref' property is\n // defined, we specify the current 'href', so that repetition is not needed by the user.\n // If the url is absolute, we can bypass the logic to prepend the domain and locale.\n if (isAbsoluteUrl(as)) {\n childProps.href = as;\n } else if (\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n const curLocale =\n typeof locale !== 'undefined' ? locale : pagesRouter?.locale;\n\n // we only render domain locales if we are currently on a domain locale\n // so that locale links are still visitable in development/preview envs\n const localeDomain =\n pagesRouter?.isLocaleDomain &&\n getDomainLocale(\n as,\n curLocale,\n pagesRouter?.locales,\n pagesRouter?.domainLocales\n );\n\n childProps.href =\n localeDomain ||\n addBasePath(\n addLocale(as, curLocale, pagesRouter?.defaultLocale)\n );\n }\n\n return (\n \n {children}\n \n );\n }\n);\n\nexport { Link as NextLink };\n","import { useLocation } from 'tradera/hooks/use-location';\nimport { URL_LANGUAGES } from 'tradera/lang/constants.mjs';\nimport { selectEnvironment } from 'tradera/state/environment/selectors';\nimport { useAppSelector } from 'tradera/state/hooks';\n\n// Add any new NextWeb routes to this array to enable SPA navigation.\n// This is the art of the path after the language prefix until the end.\nexport const NEXTWEB_SPA_REGEX_PATHS = [\n '/item/[0-9]+/([0-9]+)/',\n '/cause/',\n '/charity/',\n '/campaign/',\n '/shop/',\n '/top-lists/',\n '/brand/',\n '/category/([0-9]+)',\n '/profile/information/',\n '/profile/items/',\n '/profile/feedback/',\n '/causes$',\n '/causes/items$',\n '/brands$',\n '/categories$',\n '/how-to-buy$',\n '/how-to-sell$',\n '/my/overview-seller$',\n '/my/wish-list$',\n '/top-lists$',\n '/my/picklist$',\n '/search/detailed$'\n];\n\nconst PATH_PREFIX = `(/(${URL_LANGUAGES.join('|')}))?`;\n\nconst createPathRegex = (pathRegex: string) =>\n new RegExp(`^${PATH_PREFIX}${pathRegex}`);\n\nconst NEXTWEB_REGEX_FULL_PATHS = NEXTWEB_SPA_REGEX_PATHS.map(createPathRegex);\n\nexport const isNextWebLink = (absoluteUrl: URL, location: URL) => {\n const pathname = absoluteUrl?.pathname;\n const pathnameAndSearch = `${absoluteUrl.pathname}${absoluteUrl.search}`;\n\n if (absoluteUrl.searchParams.get('next') === '1') {\n return true;\n }\n\n if (createPathRegex('/?$').test(pathname)) {\n // Prevent SPA navigation to the start page as redux state is reset\n return pathname !== location.pathname;\n }\n\n if (createPathRegex('/search\\\\?q=.*').test(pathnameAndSearch)) {\n return true;\n }\n\n if (NEXTWEB_REGEX_FULL_PATHS.some((regex) => regex.test(pathname))) {\n return true;\n }\n\n return false;\n};\n\nexport const useNextWebSpaLink = (absoluteUrl: URL) => {\n const location = useLocation();\n const { isNativeAppContext } = useAppSelector(selectEnvironment);\n\n if (isNativeAppContext) return false;\n\n return isNextWebLink(absoluteUrl, location);\n};\n","import { URL_LANGUAGES } from 'tradera/lang/constants.mjs';\nimport {\n selectEnvironment,\n selectFeatureSwitches\n} from 'tradera/state/environment/selectors';\nimport { useAppSelector } from 'tradera/state/hooks';\n\nconst PATH_PREFIX = `(/(${URL_LANGUAGES.join('|')}))?`;\n\nconst shippingRegex = new RegExp(`${PATH_PREFIX}/frakt`);\nconst isShippingLink = (pathname: string) => shippingRegex.test(pathname);\n\nconst valuationRegex = new RegExp(`${PATH_PREFIX}/valuation`);\nconst isValuationLink = (pathname: string) => valuationRegex.test(pathname);\n\nconst messagingRegex = new RegExp(`${PATH_PREFIX}/messaging`);\nconst isMessagingLink = (pathname: string) => messagingRegex.test(pathname);\n\nexport const useTouchwebInNextWebSpaLink = (absoluteUrl: URL) => {\n const toggles = useAppSelector(selectFeatureSwitches) || {};\n const pathname = absoluteUrl?.pathname;\n const { isNativeAppContext } = useAppSelector(selectEnvironment);\n\n if (isNativeAppContext) return false;\n\n if (isMessagingLink(pathname)) {\n return Boolean(toggles?.['next-web-messaging']);\n }\n\n if (isShippingLink(pathname)) {\n return Boolean(toggles?.['next-web-shipping']);\n }\n\n if (isValuationLink(pathname)) {\n return Boolean(toggles?.['next-web-valuation']);\n }\n\n return false;\n};\n","import React, { useCallback } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { Link } from 'react-router-dom';\nimport { NextLink } from 'tradera/apps/nextweb/components/next-link';\nimport { updateEnvironmentHash } from 'tradera/state/environment/actions';\nimport { useIsFeatureEnabled } from 'tradera/hooks/use-is-feature-enabled';\nimport { useLocation } from 'tradera/hooks/use-location';\nimport { isNextJs, isTouchwebInNextweb } from 'tradera/utils/nextjs';\nimport { useAppSelector } from 'tradera/state/hooks';\nimport { useNextWebSpaLink } from './use-next-web-spa-link';\nimport { useTouchwebInNextWebSpaLink } from './use-touchweb-in-next-web-spa-link';\nimport { removePrivacySandboxIframes } from 'tradera/utils/privacy-sandbox-iframes';\nimport { selectIsNativeApp } from 'tradera/state/environment/selectors';\n\nconst PRODUCTION_ORIGIN = 'https://www.tradera.com';\n\nconst isFragmentNavSamePage = (url: URL, href?: string) =>\n !!url.hash && url.pathname === '/' && !href?.startsWith('/#');\n\nconst getRelativeUrl = (url: URL, href?: string) => {\n if (isFragmentNavSamePage(url, href)) return `${url.search}${url.hash}`;\n return `${url.pathname}${url.search}${url.hash}`;\n};\n\nexport type ALinkProps = React.ComponentPropsWithRef<'a'> & {\n useLink?: boolean;\n};\n\nconst ALink = React.forwardRef(function ALink(\n {\n useLink: isTouchwebSpaLink,\n href,\n children,\n onClick: givenOnClick,\n ...otherProps\n }: ALinkProps,\n forwardedRef\n) {\n const dispatch = useDispatch();\n const location = useLocation();\n const isNativeApp = useAppSelector(selectIsNativeApp);\n const isSpaNavigationEnabled =\n (useAppSelector((state) => state.environment.isSpaNavigationEnabled) ||\n isTouchwebInNextweb) &&\n !isNativeApp; // Apps cannot handle history correctly if SPA navigation is enabled\n const isNextWebAddUrlParamEnabled = useIsFeatureEnabled(\n 'next-web-add-url-param'\n );\n const isTouchWebAddUrlParamEnabled = useIsFeatureEnabled(\n 'touch-web-add-url-param'\n );\n const absoluteUrl = new URL(href ?? '', PRODUCTION_ORIGIN);\n\n if (isTouchWebAddUrlParamEnabled) {\n absoluteUrl.searchParams.set('next', '0');\n } else if (isNextWebAddUrlParamEnabled) {\n absoluteUrl.searchParams.set('next', '1');\n }\n\n const isNextWebSpaLink = useNextWebSpaLink(absoluteUrl);\n const isTouchwebInNextWebSpaLink = useTouchwebInNextWebSpaLink(absoluteUrl);\n const handleSpaNavigationClick = useCallback(\n (evt: React.MouseEvent) => {\n removePrivacySandboxIframes();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n dispatch(updateEnvironmentHash());\n if (givenOnClick) givenOnClick(evt);\n },\n [dispatch, givenOnClick]\n );\n\n const spaNavigationOrigins = [PRODUCTION_ORIGIN, location?.origin];\n const isRelativeUrl = spaNavigationOrigins.includes(absoluteUrl.origin);\n\n // Strip away origin for SPA links\n const relativeUrl = getRelativeUrl(absoluteUrl, href);\n\n if (isSpaNavigationEnabled && isRelativeUrl) {\n // We have 3 types of routing in the app:\n // 1. NextJS routing using NextLink\n const fromNextWeb = isNextJs && !isTouchwebInNextweb;\n const toNextWeb = isNextWebSpaLink && !isTouchwebInNextWebSpaLink;\n\n // 2. react-router-dom routing\n const fromTouchweb = !isNextJs && !isTouchwebInNextweb;\n const toTouchweb =\n !isNextWebSpaLink &&\n !isTouchwebInNextWebSpaLink &&\n isTouchwebSpaLink;\n\n // 3. react-router-dom routing mounted in a SSR NextJS routed page\n const fromNextWebTouchwebHybrid = isTouchwebInNextweb;\n const toNextWebTouchwebHybrid = isTouchwebInNextWebSpaLink;\n\n if (fromNextWeb && toNextWeb) {\n // NextJS routing\n return (\n \n {children}\n \n );\n } else if (\n (fromTouchweb && toTouchweb) ||\n (fromNextWebTouchwebHybrid && toTouchweb) ||\n (fromNextWebTouchwebHybrid && toNextWebTouchwebHybrid)\n ) {\n // react-router-dom routing\n return (\n \n {/* @ts-ignore: TS2322 because types from react-router relies on some other React version. */}\n {children}\n \n );\n }\n }\n\n // Anything that ends up here will result in a full page load instead of SPA navigation.\n // Remaining 4 out of 9 combinations of navigations that end up in this else block:\n // if (\n // (fromNextWeb && toTouchweb) ||\n // (fromNextWeb && toNextWebTouchwebHybrid) ||\n // (fromTouchweb && toNextWeb) ||\n // (fromTouchweb && toNextWebTouchwebHybrid) ||\n // (fromNextWebTouchwebHybrid && toNextWeb)\n // ) {\n const url = isRelativeUrl ? relativeUrl : absoluteUrl.toString();\n return (\n \n {children}\n \n );\n});\n\n// Deprecated, please use the named export instead\nexport default ALink;\n","// extracted by mini-css-extract-plugin\nexport default {\"item-toast\":\"item-toast--S7lV1\",\"itemToast\":\"item-toast--S7lV1\",\"item-toast-image\":\"item-toast-image--LsD4b\",\"itemToastImage\":\"item-toast-image--LsD4b\"};","import React from 'react';\nimport ALink from 'tradera/components/alink/alink';\nimport { useTranslator, useUrlLocalizer } from 'tradera/lang/translate';\nimport styles from './item-toast.module.scss';\nimport { useLocalizedPriceFormatter } from 'tradera/localization/use-localized-price-formatter';\n\nexport const ItemToast = ({\n imageUrl,\n itemUrl,\n shortDescription,\n type,\n eventData\n}) => {\n const { toLocalizedUrl } = useUrlLocalizer();\n\n return (\n \n
\n \n \n
\n
\n );\n};\n\nconst ToastMessage = ({ type, shortDescription, eventData }) => {\n const { t } = useTranslator();\n const localizedPriceFormatter = useLocalizedPriceFormatter();\n let message;\n switch (type) {\n case 'ItemOutbidded':\n message = t('siteWideNotifications_itemOutbidded_localized', {\n newLeadingBid: localizedPriceFormatter(\n eventData.newLeadingBidAmount\n ),\n shortDescription\n });\n break;\n case 'ItemFirstBid':\n message = t('siteWideNotifications_itemFirstBid', {\n shortDescription\n });\n break;\n case 'ItemSold':\n message = t('siteWideNotifications_itemSold_localized', {\n price: localizedPriceFormatter(eventData.price),\n shortDescription\n });\n break;\n case 'ItemWon':\n message = t('siteWideNotifications_itemWon_localized', {\n price: localizedPriceFormatter(eventData.price),\n shortDescription\n });\n break;\n case 'ItemPaid':\n message = t('siteWideNotifications_itemPaid', {\n shortDescription\n });\n break;\n case 'ItemWishListReminder':\n message = t('siteWideNotifications_itemWishListReminder', {\n shortDescription,\n timeLeftMinutes: eventData.timeLeftMinutes\n });\n }\n return
{message}
;\n};\n","import React from 'react';\nimport { useTranslator } from 'tradera/lang/translate';\n\ntype Props = {\n message: string;\n header?: string;\n messageData?: Record;\n headerData?: Record;\n};\n\nexport const MessageToast = ({\n message,\n header,\n messageData,\n headerData\n}: Props) => {\n const { t } = useTranslator();\n\n return (\n
\n {header &&

{t(header, headerData)}

}\n {message && (\n \n {t(message, messageData)}\n \n )}\n
\n );\n};\n","import initData from 'tradera/legacy/static/packages/init-data';\nimport { isNextJs, isServer, isTouchwebInNextweb } from 'tradera/utils/nextjs';\n\nconst getSiteBaseUrl = () =>\n isServer\n ? process.env.PUBLIC_TOUCHWEB_WINDOW_LOCATION_ORIGIN\n : window.location.origin;\n\nconst webApiUrl: string =\n isNextJs && !isTouchwebInNextweb\n ? `${getSiteBaseUrl()}/api/webapi`\n : initData.webApiUrl;\n\nexport default {\n AVAILABLE_SHIPPING_COUNTRIES:\n webApiUrl + '/member/getavailablecountriesforshipping',\n CART_OVERVIEW_VIEW: webApiUrl + '/shopping/checkout/cartoverview',\n CART_ADD_ITEM: webApiUrl + '/shopping/cart/item',\n CART_REMOVE_ITEMS: webApiUrl + '/shopping/cart/removeitems',\n CART_SET_ITEM_QUANTITY: webApiUrl + '/shopping/cart/setitemquantity',\n FAVOURITE_SELLERS: webApiUrl + `/discover/favouritesellers-and-items2`,\n HYPERWALLET_PAYOUT_COMPLETE:\n webApiUrl + '/member/paymentprovider/completehyperwallettransfermethod',\n HYPERWALLET_PAYOUT_TOKEN:\n webApiUrl + '/member/paymentprovider/hyperwalletauthenticationtoken',\n HYPERWALLET_PAYOUT:\n webApiUrl +\n '/member/paymentprovider/hyperwallettransfermethodviewmodel',\n INTERNATIONAL_SHIPPING_CALCULATOR:\n webApiUrl + '/browse/internationalshippingcalculator',\n ORDER_CHECKOUT_PAYMENT: initData.orderCheckoutPaymentUrl,\n ORDER_CHECKOUT_REQUEST_COMBINED_PRICE:\n webApiUrl + '/shopping/ordercheckout/requestcombinedshippingprice',\n ORDER_CHECKOUT_CREATE_UNCOMMITTED_PURCHASE_ORDER:\n webApiUrl + '/shopping/ordercheckout/createuncommittedpurchaseorder',\n ORDER_PURCHASE_SHOP_ITEMS:\n webApiUrl + '/shopping/ordercheckout/purchaseshopitems',\n PERSONALISED_SUGGESTIONS: '/api/personalised-suggestions',\n SEARCH: '/search',\n WEB_API: webApiUrl,\n UPI: (purchaseOrderId: string) =>\n webApiUrl + '/member/uppo-strike/?PurchaseOrderId=' + purchaseOrderId,\n MCP: (purchaseOrderId: string) =>\n webApiUrl + '/member/mcp-strike/?PurchaseOrderId=' + purchaseOrderId,\n MCP_CONFIRM: (purchaseOrderId: string) =>\n webApiUrl +\n '/member/mcp-strike-confirm/?PurchaseOrderId=' +\n purchaseOrderId,\n PURCHASE_ORDER: (purchaseOrderId: string) =>\n webApiUrl + '/member/purchaseorder/?PurchaseOrderId=' + purchaseOrderId,\n MARKETING_PUBLIC_API: '/api/marketing',\n SHIPPING_CHECKOUT_DELETE: '/my/shipping/checkout/delete'\n};\n","import { useSelector } from 'react-redux';\nimport { selectIsFeatureEnabled } from 'tradera/state/environment/selectors';\n\nexport const useIsFeatureEnabled = (featureName: string) =>\n useSelector(selectIsFeatureEnabled(featureName));\n","import { useMemo } from 'react';\nimport { useAppSelector } from 'tradera/state/hooks';\nimport { isServer } from 'tradera/utils/nextjs';\n\nexport const useLocation = (fallback = '') => {\n const request = useAppSelector((state) => state.request);\n const location = isServer\n ? // During static site generation isServer will be true, but we do not\n // have access to a request object. In those cases the consumer can pass in a fallback.\n (request.location ?? fallback)\n : window.location.href;\n const url = useMemo(() => new URL(location), [location]);\n return url;\n};\n","import { useMemo } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { useRouter } from 'next/compat/router';\nimport { isNextJs, isServer, isTouchwebInNextweb } from 'tradera/utils/nextjs';\nimport { removePrivacySandboxIframes } from 'tradera/utils/privacy-sandbox-iframes';\nimport { useSelector } from 'react-redux';\nimport { selectIsNativeApp } from 'tradera/state/environment/selectors';\n\nexport type PushConfig = {\n breakIframe?: boolean;\n};\n\nexport type PushLocation = {\n pathname?: string | number;\n search?: string;\n};\n\nconst hasPathname = (obj: unknown): obj is { pathname: string | number } =>\n obj !== null &&\n typeof obj === 'object' &&\n 'pathname' in obj &&\n typeof obj.pathname !== 'undefined';\n\nconst hasSearch = (obj: unknown): obj is { search: string } =>\n obj !== null &&\n typeof obj === 'object' &&\n 'search' in obj &&\n typeof obj.search !== 'undefined';\n\nexport const toUrlString = (location: PushLocation | string) => {\n if (typeof location === 'string') {\n return location;\n } else if (hasPathname(location) && hasSearch(location)) {\n return `${location.pathname}${location.search}`;\n } else if (hasPathname(location)) {\n return `${location.pathname}`;\n } else if (hasSearch(location)) {\n return `${location.search}`;\n }\n return '';\n};\n\nexport const useNavigation = (isNextDataFetchingDisabled?: boolean) => {\n const nextRouter = useRouter();\n const touchwebHistory = useHistory();\n const isNativeApp = useSelector(selectIsNativeApp);\n\n return useMemo(\n () => ({\n push: (\n location: PushLocation | string,\n pushConfig?: PushConfig\n ) => {\n removePrivacySandboxIframes();\n\n const url = toUrlString(location);\n\n if (\n pushConfig?.breakIframe &&\n window.self !== window.top &&\n window.top !== null\n ) {\n window.top.location.href = url.toString();\n return;\n } else if (isNativeApp) {\n window.location.href = url.toString();\n return;\n } else if (isNextJs && !isTouchwebInNextweb) {\n return nextRouter?.push(url, undefined, {\n shallow: isNextDataFetchingDisabled\n });\n }\n return touchwebHistory.push(url);\n },\n replace: (location: PushLocation | string) => {\n const url = toUrlString(location);\n if (isNextJs && !isTouchwebInNextweb) {\n return nextRouter?.replace(url, undefined, {\n shallow: isNextDataFetchingDisabled\n });\n }\n return touchwebHistory.replace(url);\n },\n back: () => {\n if (isNativeApp) {\n window.history.back();\n return;\n } else if (isNextJs && !isTouchwebInNextweb) {\n return nextRouter?.back();\n }\n return touchwebHistory.goBack();\n },\n refresh: () => {\n if (isNextJs && !isTouchwebInNextweb) {\n // Trigger fetching data from getServerSideProps().\n return nextRouter?.replace(window.location, undefined, {\n shallow: isNextDataFetchingDisabled\n });\n }\n throw new Error('This is only for NextWeb!');\n },\n hasPagesInHistory: () => !isServer && window.history.length > 1\n }),\n [isNextDataFetchingDisabled, isNativeApp, nextRouter, touchwebHistory]\n );\n};\n","import { useNavigation } from 'tradera/hooks/use-navigation';\nimport { useLocation } from 'tradera/hooks/use-location';\nimport { useCallback } from 'react';\nimport { isNullOrUndefined } from 'tradera/utils/condition-check';\n\nexport enum ROUTING_TYPE {\n URL = 'url',\n PUSH = 'push',\n REPLACE = 'replace'\n}\n\nexport type UpdateSearchParams = (\n value?: string | number | boolean | null | undefined,\n routing?: ROUTING_TYPE,\n locationParameter?: URL\n) => URL;\n\n// This is TS overloading, meaning that the function can be called in different ways.\n// If called with a parameter, if will return a string or null.\n// If called with a defaultValue parameter, it will return a string or the defaultValue.\n/**\n * @deprecated\n * This is deprecated - use src/apps/nextweb/hooks/use-query-param.ts instead in Next.js\n *\n * If a parameter is passed, it returns an array with the value of the parameter and a function to update the value.\n * By default, the update function will trigger a `navigation.push()` call, but that can be disabled by passing `false` as the second parameter.\n *\n * If not parameter is passed, it returns a URLSearchParams object.\n *\n * @example\n * const [pageQuery, setPageQuery] = useQuery('page', 1);\n * const [filterQuery, setFilterQuery] = useQuery('filter', 'all');\n *\n * const handleFilterChange = (newFilter) => {\n * const url = setPageQuery(null, false);\n * setFilterQuery(newFilter, true, url);\n * };\n */\nexport function useQuery(\n parameter: string,\n defaultValue: string | number | boolean\n): [string, UpdateSearchParams];\nexport function useQuery(\n parameter: string\n): [string | null, UpdateSearchParams];\nexport function useQuery(\n parameter: string,\n defaultValue?: string | number | boolean\n): [string | null, UpdateSearchParams] {\n const location = useLocation('https://example.com');\n const navigation = useNavigation(true);\n const searchParams = new URLSearchParams(location.search);\n\n /**\n * Updates the value of the parameter in the URL.\n * If no value is passed, it will remove the parameter from the URL.\n *\n * By default, it will trigger a `navigation.push()` call, but that can be disabled by passing `false` as the second parameter.\n * By default it will use the current location, but that can be overridden by passing a URL as the third parameter.\n */\n const updateSearchParam: UpdateSearchParams = useCallback(\n (value, routing = ROUTING_TYPE.PUSH, locationParameter) => {\n const url = new URL(locationParameter ?? location);\n if (!parameter) return url;\n\n if (\n typeof value !== 'undefined' &&\n value !== null &&\n value !== defaultValue\n ) {\n url.searchParams.set(parameter, value.toString());\n } else {\n url.searchParams.delete(parameter);\n }\n\n if (routing !== ROUTING_TYPE.URL) navigation[routing](url);\n\n return url;\n },\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [parameter]\n );\n\n return [\n searchParams.get(parameter) ?? toStringOrNull(defaultValue),\n updateSearchParam\n ];\n}\n\n// this is to avoid stringifying undefined to \"undefined\"\nconst toStringOrNull = (\n value: string | number | boolean | undefined | null\n): string | null => (isNullOrUndefined(value) ? null : value.toString());\n","export function isNullOrUndefined(value: unknown): value is null | undefined {\n // For undeclared variables, typeof foo will return the string literal\n // \"undefined\", whereas the identity check foo === undefined would\n // trigger the error \"foo is not defined\".\n return value === null || typeof value === 'undefined';\n}\n\nexport function isNotNullOrUndefined(\n value: TValue | null | undefined\n): value is TValue {\n return value !== null && typeof value !== 'undefined';\n}\n\nexport function isUndefinedOrEmpty(value: string | undefined) {\n return value === undefined || (value as string).trim() === '';\n}\n","import * as Sentry from '@sentry/nextjs';\nimport { isNextJs, isServer } from 'tradera/utils/nextjs';\nimport type { InitOptions } from 'i18next';\nimport { isAttributeStuffing } from 'tradera/lang/helpers';\n\nexport const missingKeyLoggingConfig = {\n saveMissing: true,\n saveMissingTo: 'current' as const,\n missingKeyHandler: (\n language,\n namespace,\n key,\n _fallbackValue,\n _updateMissing,\n options\n ) => {\n if (\n (!isNextJs ||\n isServer ||\n (isNextJs && !isServer && options.hasLoadedAllTranslations)) &&\n !isAttributeStuffing(key, namespace)\n ) {\n const errorMessage = `TranslationMissing (javascript) - Unable to find key ${key} (namespace ${namespace}) in language ${language}!`;\n Sentry.captureException(new Error(errorMessage));\n }\n },\n missingInterpolationHandler: (text, value) => {\n Sentry.captureException(\n new Error(\n `InterpolationFailure (javascript) - Unable to interpolate the text \"${text}\" fully. The following placeholder values were missing: ${JSON.stringify(\n value\n )}`\n )\n );\n return undefined;\n }\n};\n","/**\n * This is used to filter away errors that would otherwise be logged to Sentry and flood the logs.\n * It happens when people try to use the attributes to try to inject code or markup.\n */\nexport function isAttributeStuffing(key: string, namespace: string): boolean {\n if (namespace !== 'attributes') return false;\n return /[[\\]#<*()]+/.test(key);\n}\n","/* eslint-disable better-mutation/no-mutation */\n\nimport i18n from 'i18next';\nimport { logger } from 'packages/logger';\n// eslint-disable-next-line no-restricted-imports\nimport { initReactI18next } from 'react-i18next';\nimport LanguageDetector from 'i18next-browser-languagedetector';\nimport { toLocalizedUrl } from 'tradera/utils/url';\nimport { formatNumberWithSeparators } from 'tradera/utils/format';\nimport { missingKeyLoggingConfig } from 'tradera/lang/shared-config';\nimport {\n NS_TOUCHWEB,\n NS_ATTRIBUTES,\n DEFAULT_LANGUAGE\n} from 'tradera/lang/constants.mjs';\nimport 'dayjs/locale/sv';\nimport 'dayjs/locale/da';\nimport 'dayjs/locale/de';\nimport { isServer } from 'tradera/utils/nextjs';\n\nlet i18nInitialized;\n\n/**\n * Initialize function for i18next\n * Must be run before doing any translations\n * @param {Array} [translations]\n * @param {Object} [options]\n * @returns {Promise} - a promise to the i18next t function\n */\nexport const bootLanguages = (\n translations = window.touchwebTranslations,\n attributeTranslations = window.attributeTranslations\n) => {\n if (isServer) {\n // Do not remove this without also removing the disable of eslint better-mutation/no-mutation at top of file.\n throw new Error(\n 'This implementation is not compatible with SSR as global properties are shared between server instances'\n );\n }\n\n const translationResources = Object.entries(translations).map(\n ([key, value]) => ({\n key,\n value,\n namespace: 'touchWeb'\n })\n );\n const attributeResources = Object.entries(attributeTranslations).map(\n ([key, value]) => ({ key, value, namespace: 'attributes' })\n );\n\n const resources = translationResources\n .concat(attributeResources)\n .reduce((prev, { key, value, namespace }) => {\n const s = prev[key] || {};\n s[namespace] = value;\n return {\n ...prev,\n [key]: s\n };\n }, {});\n\n i18nInitialized = i18n\n .use(initReactI18next)\n .use(LanguageDetector)\n .init(initOptions(resources), (err) => {\n if (err) {\n logger('error when loading translations', err);\n }\n });\n\n return i18nInitialized;\n};\n\nexport const initOptions = (resources) => ({\n detection: {\n order: ['htmlTag'],\n htmlTag: document.html\n },\n defaultNS: [NS_TOUCHWEB],\n ns: [NS_ATTRIBUTES],\n fallbackLng: DEFAULT_LANGUAGE,\n resources,\n debug: false,\n keySeparator: false,\n nsSeparator: ':::',\n interpolation: {\n skipOnVariables: true,\n escapeValue: false,\n format: (value, format) => {\n if (format === 'formatNumber') {\n return formatNumberWithSeparators(value);\n }\n\n return value;\n }\n },\n react: {\n useSuspense: false // loading from file currently breaks if this is true\n },\n ...missingKeyLoggingConfig\n});\n\n/**\n * This function helps you make sure that i18next init has completed before continuing\n */\nexport const whenInitialized = () => {\n if (!i18nInitialized) {\n throw new Error(\n \"Can't call boot-languages whenInitialized before init!\"\n );\n }\n return i18nInitialized.then((t) => ({\n t,\n toLocalizedUrl: (url) => toLocalizedUrl(url, i18n.language)\n }));\n};\n\n/**\n * Only required for Storybook, do not use.\n */\nexport const changeLanguage = (language) => i18n.changeLanguage(language);\n\nexport const getCurrentLanguage = () => i18n.language;\n","import type { MutableRefObject } from 'react';\nimport { createContext, createRef, useCallback, useContext } from 'react';\nimport { NS_ATTRIBUTES, NS_TOUCHWEB } from 'tradera/lang/constants.mjs';\nimport { isServer } from 'tradera/utils/nextjs';\n\ntype TranslationKeyValue = Record;\ntype NamespaceTranslations = Record | null;\n\nconst initialState: NamespaceTranslations = {\n [NS_ATTRIBUTES]: {},\n [NS_TOUCHWEB]: {}\n};\n\nexport const TranslationContext = createContext<\n MutableRefObject\n>({ current: initialState });\n\nexport const TranslationProvider = ({\n children\n}: {\n children: React.ReactNode;\n}) => {\n const translationsRef: MutableRefObject =\n createRef();\n translationsRef.current = initialState;\n\n return (\n \n {children}\n \n );\n};\n\nexport const useTranslations = () => {\n const translationsRef = useContext(TranslationContext);\n\n return translationsRef;\n};\n\nexport type AddTranslation = (\n namespace: string,\n pluralizedKey: string,\n translation: string\n) => void;\n\nexport const useAddTranslation = (): AddTranslation => {\n const translationsRef = useContext(TranslationContext);\n\n return useCallback(\n (namespace, pluralizedKey, translation) => {\n if (!isServer) {\n return;\n }\n\n if (!translationsRef?.current) {\n return;\n }\n\n if (!translationsRef.current[namespace]) {\n translationsRef.current[namespace] = {};\n }\n translationsRef.current[namespace][pluralizedKey] = translation;\n },\n [translationsRef]\n );\n};\n","import * as Sentry from '@sentry/react';\nimport type { CaptureContext } from '@sentry/types';\nimport { AxiosError } from 'axios';\nimport { isClientNetworkError } from 'tradera/utils/api';\n\ntype SomeError = Error | string | object | unknown;\n\n/**\n * @param {object} error - takes an exception and logs to Sentry or the console in development\n * @param {object} [scope] - Sentry CaptureContext created with new Sentry.Scope() or plain object\n * @desc logger is designed for logging errors. It will accept an argument of any type and create a stacktrace containing a reference to the callee.\n * @TODO Migrate this functionality to a logging module that handles different levels of logs\n */\nexport const logger = (error: SomeError, scope?: CaptureContext) => {\n if (error instanceof AxiosError && isClientNetworkError(error)) {\n // Ignore client network API errors like aborts, timeouts etc.\n return;\n }\n\n let sentryException;\n if (error instanceof Error) {\n sentryException = error;\n } else if (typeof error === 'string') {\n sentryException = new Error(error);\n } else {\n sentryException = new Error(JSON.stringify(error));\n }\n if (scope) {\n Sentry.captureException(sentryException, scope);\n } else {\n Sentry.captureException(sentryException);\n }\n};\n","/* eslint-disable better-mutation/no-mutation */\n\n/**\n *\n * # track events:\n * import { GtmService } from 'tradera/services/google-tagmanager/google-tagmanager-service';\n * GtmService.trackGtmEvent(\"zorro\", { marvel: false, black: true })\n *\n *\n *\n */\n\nimport * as Sentry from '@sentry/react';\nimport initData from 'tradera/legacy/static/packages/init-data';\nimport { isServer, isNextJs, isTouchwebInNextweb } from 'tradera/utils/nextjs';\nimport { buildInitialGtmDataLayerFromInitData } from 'tradera/utils/google-tagmanager';\nimport { queueBackgroundTask } from 'tradera/utils/scheduler';\nimport { googleTagManagerSnippet } from 'tradera/services/google-tagmanager/google-tagmanager-snippet';\nimport type { SOURCE_SCREEN } from 'tradera/services/google-tagmanager/constants';\nimport type { ItemCardSearchResultOrigin } from 'tradera/state/services/types/webapi-discover-generated';\n\ndeclare global {\n interface Window {\n dataLayer: unknown[];\n legacyDataLayer: unknown[];\n logGaWebViewEvent?: (name: string, params: unknown) => void;\n setGaWebViewUserProperty?: (name: string, value: string) => void;\n AnalyticsWebInterface?: {\n logEvent: (name: string, params: string) => void;\n setUserProperty: (name: string, value: string) => void;\n };\n webkit?: {\n messageHandlers?: {\n firebase: {\n postMessage: (message: unknown) => void;\n };\n };\n };\n }\n}\n\n/**\n * SPA page view tracking becomes enabled after first\n * page view tracking which happens after the first\n * page is loaded from server.\n * This prevents reset of data layer after a SPA route has\n * changed (happens late after full page load) and prevents\n * duplicated trackPageView events.\n */\nlet spaPageViewTrackingEnabled = false;\n\nclass GoogleTagManagerService {\n isScriptLoaded: boolean;\n constructor() {\n this.isScriptLoaded = false;\n\n if (!isNextJs) this._setWebViewHelperFunctionsToWindow();\n }\n\n loadGtmScript() {\n if (!isNextJs || isTouchwebInNextweb) {\n this._newPageFromServer();\n }\n const accountId =\n (typeof process === 'object' &&\n process?.env.NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ACCOUNT_ID) ||\n 'GTM-5TMB2D';\n googleTagManagerSnippet(accountId);\n this.isScriptLoaded = true;\n }\n\n push(payload: object) {\n if (isServer) {\n return;\n }\n\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push(payload);\n }\n\n pushArguments(...args: unknown[]) {\n if (isServer) {\n return;\n }\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push(...args);\n }\n\n _getDatalayerObject(): Record {\n let output = {};\n if (window.dataLayer) {\n for (const entry of window.dataLayer) {\n output = { ...output, ...(entry as Record) };\n }\n }\n return output;\n }\n\n /**\n * destroy datalayer from previous loading. this is really only useful in spa pages, it's backwards compatible so it doesnt do any harm on old pages\n */\n _reset() {\n if (!window.dataLayer) {\n return;\n }\n\n const data = this._getDatalayerObject();\n for (const key of Object.keys(data)) {\n data[key] = undefined;\n }\n window.dataLayer.push({ ...data, event: 'reset' });\n }\n\n _hasPreviouslyTrackedPage = () =>\n !!window.dataLayer?.find(\n (item) => (item as { event: string }).event === 'trackPageview'\n );\n\n newPage(pageType: string, initialDataLayer: object) {\n if (this._hasPreviouslyTrackedPage()) {\n this._reset();\n }\n this._pushInitialDataLayer(initialDataLayer);\n // It is important that the \"Container loaded\" triggered by dataLayer.push({event: \"gtm.js\", ...})\n // happens after \"initialDataLayer\" otherwise variables for the GDPR banner may have the wrong\n // values in Tagmanager. For that reason the GTM script is loaded here after initialDatalayer is set.\n if (!this.isScriptLoaded) {\n this.loadGtmScript();\n }\n this.push({ event: 'pageType', 'page.pageType': pageType });\n }\n\n /**\n * Same as newPage but with logic for case in Touchweb where initial\n * datalayer was set on server and already tracked on landing page.\n * This function does nothing until after first call to trackPageView\n * (e.g. after a SPA-navigation away from the landing page).\n */\n newSpaPage(pageType: string, initialDataLayer: Record) {\n if (!spaPageViewTrackingEnabled) {\n return;\n }\n this.newPage(pageType, initialDataLayer);\n }\n\n _newPageFromServer() {\n const initialDataLayer = buildInitialGtmDataLayerFromInitData(initData);\n this._pushInitialDataLayer(initialDataLayer);\n // ------------------------------------------------\n // backwards compatibility\n // get old datalayer info and push it in\n if (window.legacyDataLayer) {\n for (const entry of window.legacyDataLayer) {\n window.dataLayer.push({\n event: 'tradera/legacyDataLayer',\n ...(entry as unknown[])\n });\n }\n }\n }\n\n _pushInitialDataLayer(initialDataLayer: object) {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n ...initialDataLayer,\n event: 'initialDataLayer'\n });\n }\n\n /**\n * Tracks a google analytics event asynchronously\n * Good for SEO, users and Web Vitals Interaction to Next Paint.\n * @param {string} category ga category\n * @param {string} action ga action what happens, ie: \"Filter box - open/close\"\n * @param {string} [label] ga label what the value of the action was, ie \"close\"\n * @param {integer} [value] ga interger value of the action\n * @param {boolean} [nonInteractive] if the action does not stems from a user interaction\n */\n trackAction(\n category: string,\n action: string,\n label?: string,\n value?: number,\n nonInteractive?: boolean\n ) {\n queueBackgroundTask(() =>\n this.trackActionSynchronously(\n category,\n action,\n label,\n value || 0,\n nonInteractive ?? false\n )\n );\n }\n\n /**\n * Tracks a google analytics event synchronously\n * @deprecated In 99% of cases, use `trackAction` instead. Using this can cause high Web Vitals INP.\n * @param {string} category ga category\n * @param {string} action ga action what happens, ie: \"Filter box - open/close\"\n * @param {string} [label] ga label what the value of the action was, ie \"close\"\n * @param {integer} [value] ga interger value of the action\n * @param {boolean} [nonInteractive] if the action does not stems from a user interaction\n */\n trackActionSynchronously(\n category: string,\n action: string,\n label?: string,\n value?: number,\n nonInteractive?: boolean\n ) {\n this.push({\n event: 'trackEvent',\n eventCategory: category || '',\n eventAction: action || '',\n eventLabel: label || '',\n eventValue: value || '0',\n eventNonInteractive: nonInteractive || false\n });\n\n Sentry.addBreadcrumb({\n type: 'default',\n level: 'info',\n category: nonInteractive ? 'tracking' : 'ui-action',\n message: 'Analytics Event',\n data: {\n category,\n action,\n label,\n value: value ?? 0\n }\n });\n }\n\n /**\n * google tag manager event. Note: if you want to send google analytics events use trackAction instead\n * @param {string} eventName\n * @param {object} [data] data\n */\n trackGtmEvent(eventName: string, data: object = {}) {\n this.push({\n event: eventName,\n ...data\n });\n }\n\n /**\n * Track a pageview. Use this script in SPA's to make sure that analytics gets pageview information.\n * This creates a virtual page view since google analytics by default doesn't track changes to url via\n * push state.\n */\n trackPageView() {\n this.trackGtmEvent('trackPageview');\n spaPageViewTrackingEnabled = true;\n }\n\n trackLinkClickAndCallback(\n category: string,\n action: string,\n label: string,\n callback: () => void,\n value: unknown = 0\n ) {\n this.push({\n event: 'trackEvent',\n eventCategory: category || '',\n eventAction: action || '',\n eventLabel: label || '',\n eventValue: value || '0',\n eventNonInteractive: false,\n eventCallback: callback // part of google tag manager api to execute code after all tags in datalayer have been executed\n });\n }\n\n trackLinkClickAndGotoUrl(\n category: string,\n action: string,\n label: string,\n url: string,\n value = 0\n ) {\n const callback = () => {\n if (url === null) return;\n location.href = url;\n };\n this.trackLinkClickAndCallback(\n category,\n action,\n label,\n callback,\n value\n );\n }\n\n /**\n * Set up helper functions which purpose is to post data to\n * either Android or iOS\n * These are accessed by Google Tag Manager\n *\n * https://firebase.google.com/docs/analytics/webview?platform=ios\n */\n _setWebViewHelperFunctionsToWindow() {\n window.logGaWebViewEvent = (name: string, params: unknown) => {\n if (!name) {\n return;\n }\n\n if (window.AnalyticsWebInterface) {\n // Call Android interface\n window.AnalyticsWebInterface.logEvent(\n name,\n JSON.stringify(params)\n );\n } else if (\n window.webkit &&\n window.webkit.messageHandlers &&\n window.webkit.messageHandlers.firebase\n ) {\n // Call iOS interface\n const message = {\n command: 'logEvent',\n name: name,\n parameters: params\n };\n window.webkit.messageHandlers.firebase.postMessage(message);\n }\n };\n\n window.setGaWebViewUserProperty = (name, value) => {\n if (!name || !value) {\n return;\n }\n\n if (window.AnalyticsWebInterface) {\n // Call Android interface\n window.AnalyticsWebInterface.setUserProperty(name, value);\n } else if (\n window.webkit &&\n window.webkit.messageHandlers &&\n window.webkit.messageHandlers.firebase\n ) {\n // Call iOS interface\n const message = {\n command: 'setUserProperty',\n name: name,\n value: value\n };\n window.webkit.messageHandlers.firebase.postMessage(message);\n }\n };\n }\n /**\n * Track event to GA4 via GTM.\n *\n * `timestamp` will always be attached.\n *\n * @example\n * GtmService.trackGA4('saved_search_deleted', {\n * saved_search_id: id\n * })\n */\n trackGA4(\n eventName: string,\n eventParams: EventParams = {},\n userData: UserData = {}\n ) {\n const payload = {\n event: 'track_ga4_event',\n eventName,\n eventParams: { timestamp: Date.now(), ...eventParams },\n userData\n };\n this.push(payload);\n }\n}\n\nexport const GtmService = new GoogleTagManagerService();\n\nexport enum FlowId {\n Unknown = 0,\n SYI = 1,\n VIP = 2\n}\n\nexport type GA4Item = {\n item_id: number;\n};\n\n// All new eventParams must be added to GTM\n// Mapped in \"GA4 - Track events\" and separate variable definitions\nexport type EventParams = {\n flow_id?: FlowId;\n boolean_value?: 1 | 0;\n item_id?: number;\n timestamp?: number;\n source_section?: string;\n items?: GA4Item[];\n source_screen?: SOURCE_SCREEN;\n\n // Wishlist specific params\n wishlist_type?: string;\n\n // SYI specific params\n draft_id?: string;\n form_name?: 'syi_draft';\n syi_session_id?: string;\n attribute_name?: string;\n ai_title?: 1 | 0;\n ai_description?: 1 | 0;\n ai_images?: number;\n ai_processing_time?: number;\n\n // Item card specific params\n item_placement?: number;\n pagination?: number;\n\n // pagination specific params\n direction?: string;\n\n // search specific params\n search_type?: string;\n search_term?: string;\n search_category?: number;\n sort_type?: string;\n saved_search_type?: string;\n saved_search_id?: number;\n search_model?: ItemCardSearchResultOrigin;\n exact_search?: number;\n\n // scroll specific params\n scroll_percentage?: number;\n scroll_percentage_max?: number;\n};\n\ntype UserData = {\n member_id?: number;\n};\n","/* eslint-disable better-mutation/no-mutation */\n\nexport const googleTagManagerSnippet = (accountId) =>\n (function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({\n 'gtm.start': new Date().getTime(),\n event: 'gtm.js'\n });\n const f = d.getElementsByTagName(s)[0];\n const j = d.createElement(s);\n j.async = true;\n j.src = '//www.googletagmanager.com/gtm.js?id=' + i;\n f.parentNode?.insertBefore(j, f);\n })(window, document, 'script', 'dataLayer', accountId);\n","/**\n * A queue with a that handled max age (ttl) for messages.\n * @returns\n */\nexport const createQueue = () => {\n const items = [];\n const dayInMinutes = 60 * 24;\n const add = (item, ttlInMinutes = dayInMinutes) => {\n const timeStamp = Date.now();\n items.push({ item, ttlInMinutes, timeStamp });\n };\n const isAlive = ({ ttlInMinutes, timeStamp }) => {\n return timeStamp + ttlInMinutes * 60 * 1000 >= Date.now();\n };\n let inProgress = null;\n return {\n add,\n next: () => {\n let itemData = items.shift();\n while (itemData && !isAlive(itemData)) {\n itemData = items.shift();\n }\n // eslint-disable-next-line better-mutation/no-mutation\n inProgress = itemData?.item || null;\n return inProgress;\n },\n notifyDone: () => {\n // eslint-disable-next-line better-mutation/no-mutation\n inProgress = null;\n },\n isInProgress: () => inProgress !== null,\n getLength: () => items.length\n };\n};\n","import cookie from 'cookie';\nimport type { IncomingHttpHeaders } from 'http';\nimport { addCookie } from 'tradera-backend/utils/cookies';\nimport type { Request, Response } from 'tradera/backend/http/types/http';\nimport { NATIVE_APP_ENVIRONMENT } from 'tradera/constants/cookies';\n\nexport type NativeAppInfo = {\n osVersion?: string;\n appDevice?: string;\n appVersion?: string;\n appContext?: string;\n appLanguage?: string;\n appInstanceId?: string;\n};\n\ntype NativeAppCookieAndHeaderConfig = {\n [P in keyof NativeAppInfo]: {\n header: string;\n initDataName: string;\n };\n};\n\nconst NATIVE_APP_COOKIE_AND_HEADER_CONFIG: NativeAppCookieAndHeaderConfig = {\n osVersion: {\n header: 'x-tradera-app-os-version',\n initDataName: 'nativeAppOsVersion'\n },\n appDevice: {\n header: 'x-tradera-app-device',\n initDataName: 'nativeAppDevice'\n },\n appVersion: {\n header: 'x-tradera-app-version',\n initDataName: 'nativeAppVersion'\n },\n appContext: { header: 'x-tradera-app', initDataName: 'nativeAppContext' },\n appLanguage: {\n header: 'x-language',\n initDataName: 'nativeAppLanguage'\n },\n appInstanceId: {\n header: 'X-Tradera-App-GA-App-Instance-Id',\n initDataName: 'nativeAppInstanceId'\n }\n};\n\nconst createCookie = (name: string, value: string) => {\n const options = {\n httpOnly: false,\n path: '/'\n };\n return cookie.serialize(name, String(value), options);\n};\n\nconst isString = (s: unknown) => typeof s === 'string';\n\nexport const createNativeAppCookieValue = (\n nativeAppInfo: Record\n) => {\n const valueObject = Object.fromEntries(\n Object.entries(nativeAppInfo).filter(\n ([key, value]) =>\n key in NATIVE_APP_COOKIE_AND_HEADER_CONFIG && isString(value)\n )\n );\n return JSON.stringify(valueObject);\n};\n\nexport const createNativeAppCookie = (\n nativeAppInfo: Record\n) => {\n return createCookie(\n NATIVE_APP_ENVIRONMENT,\n createNativeAppCookieValue(nativeAppInfo)\n );\n};\n\n/**\n * Gets info about the native app if in native app context.\n * The function also updates a cookie with the same information\n * to be used for later calls to this function if the headers are\n * not present.\n *\n * @param {*} req\n * @param {*} res\n * @returns An object with these properties: {\n osVersion,\n appDevice,\n appVersion,\n appContext\n }\n */\nexport const getAndUpdateNativeAppInfo = (\n req: Request,\n res: Response\n): NativeAppInfo => {\n const nativeAppInfoFromHeaders = extractNativeAppInfoFromHeaders(\n req.headers\n );\n\n const hasAppHeaders =\n Object.values(nativeAppInfoFromHeaders).filter(Boolean).length > 0;\n if (hasAppHeaders) {\n const cookie = createNativeAppCookie(nativeAppInfoFromHeaders);\n addCookie(res, cookie);\n return nativeAppInfoFromHeaders;\n }\n\n const nativeAppInfoFromCookie = extractNativeAppInfoFromCookie(\n req.cookies[NATIVE_APP_ENVIRONMENT]\n );\n return nativeAppInfoFromCookie;\n};\n\nexport const extractNativeAppInfoFromCookie = (\n nativeAppCookieString: string | null | undefined\n): NativeAppInfo =>\n nativeAppCookieString\n ? Object.fromEntries(\n Object.entries(\n JSON.parse(decodeURIComponent(nativeAppCookieString))\n ).filter(([key]) => key in NATIVE_APP_COOKIE_AND_HEADER_CONFIG)\n )\n : {};\n\nexport const extractNativeAppInfoFromHeaders = (\n headers: IncomingHttpHeaders\n) => {\n return Object.entries(NATIVE_APP_COOKIE_AND_HEADER_CONFIG).reduce(\n (obj: Record, [key, config]) => {\n const header = headers[config.header];\n const singleValue = Array.isArray(header) ? header[0] : header;\n obj[key] = singleValue || '';\n return obj;\n },\n {}\n );\n};\n\nexport const extractNativeAppInfoFromInitData = (\n initData: Record\n) => {\n return Object.entries(NATIVE_APP_COOKIE_AND_HEADER_CONFIG).reduce(\n (obj: Record, [key, config]) => {\n obj[key] = initData[config.initDataName] || '';\n return obj;\n },\n {}\n );\n};\n","import axios from 'axios';\nimport { selectPreferredLanguageCode } from 'tradera/state/language/selectors';\nimport { toLocalizedUrl } from 'tradera/utils/url';\nimport {\n setEnvironmentHash,\n setIsSpaNavigationEnabled,\n setGATrackingData,\n setNativeAppInfo,\n setVariables,\n setVersion,\n setFeatureSwitches,\n setSplitTestGroups,\n setEnvironment\n} from './reducer';\nimport { isNextJs } from 'tradera/utils/nextjs';\nimport { selectMemberId } from 'tradera/state/member/selectors';\nimport {\n createNativeAppCookieValue,\n extractNativeAppInfoFromCookie,\n extractNativeAppInfoFromInitData\n} from './native-app-info-helper';\nimport cookie from 'tradera/utils/cookie';\nimport { NATIVE_APP_ENVIRONMENT } from 'tradera/constants/cookies';\nimport { GtmService as gtm } from 'tradera/services/google-tagmanager/google-tagmanager-service';\nimport type { AppDispatch, GetState } from 'tradera/state/configure-store';\nimport {\n isAndroid,\n isMobile,\n isMobileSafari,\n isIOS,\n browserName\n} from 'react-device-detect';\n\nconst getVersionUrl = (getState: GetState) => {\n if (isNextJs) {\n const queryParameters = new URLSearchParams({ next: '1' });\n const memberId = selectMemberId(getState());\n if (memberId) {\n queryParameters.set('memberId', `${memberId}`);\n }\n return `/api/version?${queryParameters}`;\n }\n\n const preferredLanguageCode = selectPreferredLanguageCode(getState());\n\n return toLocalizedUrl('/ping', preferredLanguageCode);\n};\n\nexport const updateEnvironmentHash =\n () => async (dispatch: AppDispatch, getState: GetState) => {\n const url = getVersionUrl(getState);\n const response = await axios.get(url);\n const environmentHash = response.headers['x-tradera-environment'];\n const current = getState().environment.environmentHash;\n if (environmentHash !== current) {\n dispatch(setEnvironmentHash(environmentHash));\n dispatch(setIsSpaNavigationEnabled(false));\n }\n };\n\nconst getAndUpdateNativeAppInfo = (initData: Record) => {\n const nativeAppInfoFromInitData =\n extractNativeAppInfoFromInitData(initData);\n const hasAnyValidProperties =\n Object.values(nativeAppInfoFromInitData).filter(Boolean).length > 0;\n if (hasAnyValidProperties) {\n const nativeAppCookieValue = createNativeAppCookieValue(\n nativeAppInfoFromInitData\n );\n cookie.createCookie(NATIVE_APP_ENVIRONMENT, nativeAppCookieValue);\n return nativeAppInfoFromInitData;\n }\n\n const cookieValue = cookie.readCookie(NATIVE_APP_ENVIRONMENT);\n const nativeAppInfo = extractNativeAppInfoFromCookie(cookieValue);\n return nativeAppInfo;\n};\n\nexport const setupGATrackingData =\n () => (dispatch: AppDispatch, getState: GetState) => {\n const {\n environment: { variables }\n } = getState();\n const { PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID } = variables;\n\n if (PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID) {\n gtm.pushArguments(\n 'get',\n PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID,\n 'session_id',\n (sessionId: string) => {\n dispatch(setGATrackingData({ sessionId }));\n }\n );\n }\n };\n\nexport const initEnvironment =\n (initData: {\n environment: string;\n environmentHash: string;\n featureSwitches: Record;\n googleAnalyticsTrackingId: string;\n googleAnalyticsMeasurementId: string;\n geoPublicApiBaseUrl: string;\n isSinglePageApp: boolean;\n splitTests: Record;\n splitTestGroups: Record;\n version: string;\n webLiveUrl: string;\n }) =>\n async (dispatch: AppDispatch) => {\n const {\n environment,\n environmentHash,\n featureSwitches,\n googleAnalyticsTrackingId,\n googleAnalyticsMeasurementId,\n geoPublicApiBaseUrl,\n isSinglePageApp,\n splitTestGroups,\n version,\n webLiveUrl\n } = initData;\n\n const isSpaNavigationEnabled =\n isSinglePageApp && !window.frameElement ? true : false; // No SPA navigation in native apps or iFrame\n dispatch(setIsSpaNavigationEnabled(isSpaNavigationEnabled));\n dispatch(setEnvironment(environment));\n dispatch(setEnvironmentHash(environmentHash));\n dispatch(setFeatureSwitches(featureSwitches));\n dispatch(setSplitTestGroups(splitTestGroups));\n dispatch(setVersion(version));\n dispatch(\n setVariables({\n // Names must be the same as NextWeb's .env variables\n PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID: googleAnalyticsTrackingId,\n PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID:\n googleAnalyticsMeasurementId,\n PUBLIC_GEO_PUBLIC_API_BASE_URL: geoPublicApiBaseUrl,\n PUBLIC_WEB_LIVE_URL: webLiveUrl\n })\n );\n dispatch(\n setNativeAppInfo({\n ...getAndUpdateNativeAppInfo(initData),\n browserName,\n isMobileDevice: isMobile,\n isMobileSafari,\n isIOS,\n isAndroid\n })\n );\n\n dispatch(setupGATrackingData());\n };\n","export const parseAppVersion = (version) => {\n const [major = 0, minor = 0, patch = 0] = String(version)\n .split('.')\n .map(Number)\n .filter((number) => !Number.isNaN(number));\n return { major, minor, patch };\n};\n\nexport const isSupportedMinimumVersion = (\n appVersionString,\n minimumVersionString\n) => {\n const appVersion = parseAppVersion(appVersionString);\n const minimumVersion = parseAppVersion(minimumVersionString);\n if (appVersion.major > minimumVersion.major) {\n return true;\n }\n if (appVersion.major === minimumVersion.major) {\n if (appVersion.minor > minimumVersion.minor) {\n return true;\n }\n if (appVersion.minor === minimumVersion.minor) {\n if (appVersion.patch >= minimumVersion.patch) {\n return true;\n }\n }\n }\n\n return false;\n};\n","/* eslint-disable better-mutation/no-mutation */\n\nimport { type PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport type { NativeAppInfo } from 'tradera/state/environment/native-app-info-helper';\nimport { getNativeAppSupport } from 'tradera/state/environment/native-app-support';\n\ntype EnvironmentSlice = {\n isSpaNavigationEnabled: boolean;\n featureSwitches: Record;\n splitTestGroups: Record;\n variables: Record;\n environmentHash: string | null;\n gaTrackingSessionId: string | null;\n isHybridAppContextForAndroid: boolean;\n isHybridAppContextForIos: boolean;\n isNativeAppWithApplyPaySupport: boolean;\n isNativeAppWithSwishCallbackSupport: boolean;\n isNativeAppWithKlarnaSupport: boolean;\n isNativeAppWithTrustlySupport: boolean;\n isNativeAppWithInternationalVerificationSupport: boolean;\n isHybridAppContext: boolean;\n appInstanceId: string | null;\n isIOS: boolean;\n isNativeAppContext?: boolean;\n isMobileDevice: boolean;\n isMobileSafari: boolean;\n version: string | null;\n browserName: string | null;\n appLanguage: string | null;\n appVersion: string | null;\n environment: string;\n};\n\nexport const initialState: EnvironmentSlice = {\n featureSwitches: {},\n splitTestGroups: {},\n variables: {},\n isSpaNavigationEnabled: true,\n environment: process.env.NODE_ENV,\n version: null,\n environmentHash: null,\n gaTrackingSessionId: null,\n isHybridAppContextForAndroid: false,\n isHybridAppContextForIos: false,\n isNativeAppWithApplyPaySupport: false,\n isNativeAppWithSwishCallbackSupport: false,\n isNativeAppWithKlarnaSupport: false,\n isNativeAppWithTrustlySupport: false,\n isNativeAppWithInternationalVerificationSupport: false,\n isHybridAppContext: false,\n isIOS: false,\n appInstanceId: null,\n isMobileDevice: false,\n isMobileSafari: false,\n browserName: null,\n appLanguage: null,\n appVersion: null\n};\n\nconst slice = createSlice({\n name: 'environment',\n initialState,\n reducers: {\n setEnvironmentHash: (state, { payload }) => {\n state.environmentHash = payload;\n },\n setEnvironment: (state, { payload }: PayloadAction) => {\n state.environment = payload;\n },\n setIsSpaNavigationEnabled: (state, { payload }) => {\n state.isSpaNavigationEnabled = payload;\n },\n setGATrackingData: (state, { payload }) => {\n state.gaTrackingSessionId = payload.sessionId;\n },\n setFeatureSwitches: (\n state,\n { payload }: PayloadAction>\n ) => {\n state.featureSwitches = payload;\n },\n setSplitTestGroups: (\n state,\n { payload }: PayloadAction>\n ) => {\n state.splitTestGroups = payload;\n },\n setVariables: (\n state,\n { payload }: PayloadAction>\n ) => {\n state.variables = payload;\n },\n setVersion: (state, { payload }: PayloadAction) => {\n state.version = payload;\n },\n setNativeAppInfo: (\n state,\n {\n payload: {\n appContext,\n appDevice,\n appInstanceId,\n appLanguage,\n appVersion,\n browserName,\n osVersion,\n isIOS,\n isAndroid,\n isMobileDevice,\n isMobileSafari\n }\n }: PayloadAction<\n NativeAppInfo & {\n browserName: string;\n isMobileDevice: boolean;\n isMobileSafari: boolean;\n isIOS: boolean;\n isAndroid: boolean;\n }\n >\n ) => {\n const isHybridAppContext = Boolean(appContext);\n const isNativeAppContext = appContext === 'Native';\n const nativeAppSupport = getNativeAppSupport({\n isNativeAppContext,\n isHybridAppContext,\n hybridAppDevice: appDevice,\n hybridAppVersion: appVersion,\n appOsVersion: osVersion,\n isIOS,\n isAndroid\n });\n\n state.isHybridAppContextForAndroid =\n nativeAppSupport.isHybridAppContextForAndroid;\n state.isHybridAppContextForIos =\n nativeAppSupport.isHybridAppContextForIos;\n state.isNativeAppWithApplyPaySupport =\n nativeAppSupport.isNativeAppWithApplyPaySupport;\n state.isNativeAppWithSwishCallbackSupport =\n nativeAppSupport.isNativeAppWithSwishCallbackSupport;\n state.isNativeAppWithKlarnaSupport =\n nativeAppSupport.isNativeAppWithKlarnaSupport;\n state.isNativeAppWithTrustlySupport =\n nativeAppSupport.isNativeAppWithTrustlySupport;\n state.isNativeAppWithInternationalVerificationSupport =\n nativeAppSupport.isNativeAppWithInternationalVerificationSupport;\n state.isHybridAppContext = isHybridAppContext;\n state.appInstanceId = appInstanceId || null;\n state.isIOS = isIOS;\n state.isMobileDevice = isMobileDevice;\n state.isMobileSafari = isMobileSafari;\n state.isNativeAppContext = isNativeAppContext;\n state.appLanguage = appLanguage || null;\n state.appVersion = appVersion || null;\n state.browserName = browserName;\n }\n }\n});\n\nexport const {\n setEnvironment,\n setEnvironmentHash,\n setIsSpaNavigationEnabled,\n setGATrackingData,\n setNativeAppInfo,\n setFeatureSwitches,\n setSplitTestGroups,\n setVariables,\n setVersion\n} = slice.actions;\nexport const reducer = slice.reducer;\n","import { isSupportedMinimumVersion } from 'tradera/utils/versions';\n\nexport const getNativeAppSupport = ({\n isNativeAppContext,\n isHybridAppContext,\n hybridAppDevice,\n hybridAppVersion,\n appOsVersion,\n isIOS,\n isAndroid\n}) => {\n const isHybridAppContextForAndroid = Boolean(\n isHybridAppContext &&\n (hybridAppDevice?.toLowerCase().includes('android') || isAndroid)\n );\n const isHybridAppContextForIos = Boolean(\n isHybridAppContext &&\n (hybridAppDevice?.toLowerCase().includes('iphone') ||\n hybridAppDevice?.toLowerCase().includes('ipad') ||\n isIOS)\n );\n const isIos13 =\n isNativeAppContext &&\n isHybridAppContextForIos &&\n isSupportedMinimumVersion(appOsVersion, '13');\n return {\n isHybridAppContextForAndroid,\n isHybridAppContextForIos,\n isNativeAppWithApplyPaySupport:\n isIos13 && isSupportedMinimumVersion(hybridAppVersion, '3.51'),\n isNativeAppWithSwishCallbackSupport:\n isIos13 && isSupportedMinimumVersion(hybridAppVersion, '3.57'),\n isNativeAppWithKlarnaSupport:\n isNativeAppContext &&\n ((isIOS && isSupportedMinimumVersion(hybridAppVersion, '3.68')) ||\n (isAndroid &&\n isSupportedMinimumVersion(hybridAppVersion, '3.58'))),\n isNativeAppWithTrustlySupport:\n isNativeAppContext &&\n ((isIOS && isSupportedMinimumVersion(hybridAppVersion, '3.123')) ||\n (isAndroid &&\n isSupportedMinimumVersion(hybridAppVersion, '3.87'))),\n isNativeAppWithInternationalVerificationSupport:\n isNativeAppContext &&\n ((isIOS && isSupportedMinimumVersion(hybridAppVersion, '3.999')) || // TODO: Update version when implemented\n (isAndroid &&\n isSupportedMinimumVersion(hybridAppVersion, '3.999'))) // TODO: Update version when implemented\n };\n};\n","import { useSelector, useDispatch } from 'react-redux';\nimport type { TypedUseSelectorHook } from 'react-redux';\nimport type { RootState, AppDispatch } from './configure-store';\n\n// Use throughout our app instead of plain `useSelector` since this gets us typed state\nexport const useAppSelector: TypedUseSelectorHook = useSelector;\n// Use throughout our app instead of plain `useDispatch` since it includes the thunk middleware types etc\nexport const useAppDispatch: () => AppDispatch = useDispatch;\n","/***\n *\n * Keep track of users' GDPR settings.\n *\n */\nimport dayjs from 'dayjs';\nimport cookie from 'cookie';\n\nimport {\n GDPR_CONSENT_COOKIE,\n COOKIE_CATEGORIES\n} from 'tradera/constants/cookies';\nimport { getCookieFromBrowser, setCookieToBrowser } from './cookie-helpers';\n\nconst createCookie = (name, value, expires) => {\n const options = {\n expires,\n httpOnly: false,\n path: '/'\n };\n return cookie.serialize(name, String(value), options);\n};\n\nexport class GdprSettings {\n constructor(getCookie, setCookie) {\n if (!getCookie || !setCookie) {\n throw new Error('You must provide getCookie and setCookie');\n }\n this.getCookie = getCookie;\n this.setCookie = setCookie;\n }\n /**\n *\n * @param {int} cookieCategory use the constant COOKIE_CATEGORIES to get different values.\n */\n isCategoryEnabled(cookieCategory) {\n if (cookieCategory === COOKIE_CATEGORIES.Essential) {\n return true;\n }\n\n const encodedConsentCookie = this.getCookie(GDPR_CONSENT_COOKIE);\n const consentCookie = decodeURI(encodedConsentCookie);\n\n if (!consentCookie || consentCookie.length === 0) {\n return true;\n }\n\n const categoryPattern = new RegExp(`,${cookieCategory}:1`);\n return categoryPattern.test(consentCookie);\n }\n\n isPerformanceEnabled() {\n return this.isCategoryEnabled(COOKIE_CATEGORIES.Performance);\n }\n\n isFunctionalEnabled() {\n return this.isCategoryEnabled(COOKIE_CATEGORIES.Functional);\n }\n\n isMarketingEnabled() {\n return this.isCategoryEnabled(COOKIE_CATEGORIES.Marketing);\n }\n\n set(performance, functional, marketing) {\n const cookieValue = [\n `${COOKIE_CATEGORIES.Essential}:1`,\n `${COOKIE_CATEGORIES.Performance}:${performance ? '1' : '0'}`,\n `${COOKIE_CATEGORIES.Functional}:${functional ? '1' : '0'}`,\n `${COOKIE_CATEGORIES.Marketing}:${marketing ? '1' : '0'}`\n ];\n const cookieString = createCookie(\n GDPR_CONSENT_COOKIE,\n cookieValue.join(','),\n dayjs().add(1, 'years').toDate()\n );\n this.setCookie(cookieString);\n }\n}\n\nexport default new GdprSettings(getCookieFromBrowser, setCookieToBrowser);\n","export const buildInitialGtmDataLayerFromInitData = (initData) => {\n // ***** ATTENTION !!! *****\n // If you change anything here you must\n // also change in buildInitialGtmDataLayerFromState\n // so that they match. Otherwise values\n // between Touchweb and NextWeb don't match.\n const initialDataLayer = {\n memberId: initData.memberId || 0,\n userLanguage: initData.languageCodeIso2,\n memberEmail: initData.isLoggedIn ? initData.memberEmail : '',\n memberHashedEmail: initData.isLoggedIn\n ? initData.memberEmailSha256\n : '',\n 'criteo.hashedEmail': initData.isLoggedIn\n ? initData.memberEmailMd5\n : '',\n memberFirstName: initData.isLoggedIn ? initData.memberFirstName : '',\n memberLastName: initData.isLoggedIn ? initData.memberLastName : '',\n memberCountry: initData.isLoggedIn ? initData.memberCountry : '',\n loginState: initData.isLoggedIn ? 'logged in' : 'not logged in',\n isNotInIframe: window.self === window.top,\n 'blueshift.event-api-key': initData.blueshiftEventApiKey,\n 'blueshift.event-signature': initData.blueshiftEventSignature || '',\n 'blueshift.event-verification-key': initData.memberId || 0,\n isSinglePageApp: initData.isSinglePageApp,\n isNativeAppContext: initData.isNativeAppContext,\n isQuantcastConsentEnabled:\n initData.featureSwitches['quantcast-consent'],\n isTikTokPixelEnabled: initData.featureSwitches['tiktok-pixel'],\n isDigitalAudienceTrackingEnabled:\n initData.featureSwitches['digital-audience-tracking'],\n quantcastSite: initData.featureSwitches['use-beta-consent-property']\n ? 'beta.tradera.com'\n : 'www.tradera.com'\n };\n // add split tests to datalayer\n if (initData.splitTestGroups) {\n for (const [key, value] of Object.entries(initData.splitTestGroups)) {\n initialDataLayer[`splittest_${key}`] = value;\n }\n }\n return initialDataLayer;\n};\n\nexport const buildInitialGtmDataLayerFromState = (state) => {\n const { environment, language, member } = state;\n const { featureSwitches } = environment;\n const isQuantcastConsentEnabled = featureSwitches['quantcast-consent'];\n const isTikTokPixelEnabled = featureSwitches['tiktok-pixel'];\n const isDigitalAudienceTrackingEnabled =\n featureSwitches['digital-audience-tracking'];\n const quantcastSite = featureSwitches['use-beta-consent-property']\n ? 'beta.tradera.com'\n : 'www.tradera.com';\n const splitTestGroups = Object.entries(environment.splitTestGroups).reduce(\n (groups, [key, value]) => {\n return {\n ...groups,\n [`splittest_${key}`]: value\n };\n },\n {}\n );\n // ***** ATTENTION !!! *****\n // If you change anything here you must\n // also change in buildInitialGtmDataLayerFromInitData\n // so that they match. Otherwise values\n // between Touchweb and NextWeb don't match.\n return {\n memberId: member.memberId || 0,\n userLanguage: language.preferred.languageCodeIso2,\n memberEmail: member.memberEmail || '',\n memberHashedEmail: member.memberEmailSha256 || '',\n 'criteo.hashedEmail': member.memberEmailMd5 || '',\n memberFirstName: member.memberFirstName || '',\n memberLastName: member.memberLastName || '',\n memberCountry: member.memberCountry || '',\n loginState: member.isLoggedIn ? 'logged in' : 'not logged in',\n isNotInIframe: window.self === window.top,\n 'blueshift.event-api-key':\n environment.variables.PUBLIC_BLUESHIFT_EVENT_API_KEY,\n 'blueshift.event-signature': member.blueshiftEventSignature || '',\n 'blueshift.event-verification-key': member.memberId || 0,\n isSinglePageApp: true,\n isNativeAppContext: environment.isNativeAppContext,\n isQuantcastConsentEnabled,\n isDigitalAudienceTrackingEnabled,\n isTikTokPixelEnabled,\n quantcastSite,\n ...splitTestGroups\n };\n};\n","import { toLocalizedUrl } from 'tradera/utils/url';\nimport { isServer } from 'tradera/utils/nextjs';\n\nexport const toLocalizedRiotUrl = (url) => toLocalizedUrl(url, getLanguage());\n\nlet language;\nexport const getLanguage = () => {\n if (isServer) {\n return;\n }\n if (language === '' || language === null || language === undefined) {\n // If we did this on the server in NextWeb all requests to the\n // same server would get the same language. This code is only\n // OK to run in the browser.\n // eslint-disable-next-line better-mutation/no-mutation\n language = document.querySelector('html').getAttribute('lang');\n }\n\n return language;\n};\n","import type { Request } from 'tradera/backend/http/types/http';\n\nexport const isServer = typeof window === 'undefined';\nexport const isServerFunc = () => typeof window === 'undefined';\n\nexport const isTest = process.env.NODE_ENV === 'test';\n\nexport const isClientApiRequest = (req: Request) =>\n Boolean(req?.url?.startsWith('/_next/data'));\n\nexport const isTouchwebInNextweb =\n typeof document !== 'undefined' &&\n document.getElementById('__next') !== null &&\n document.getElementById('init-data') !== null;\n\nexport const isNextJs = isServer || document.getElementById('__next') !== null;\n","/**\n * This is a workaround to remove the following predefined GTM tag iframes on SPA navigation:\n * - Google Ads Remarketing\n * - Google Ads Conversion Tracking\n * - Floodlight Counter\n * - Floodlight Sales\n * - Criteo\n * Iframe are removed to prevent these iframes from duplicating the browser\n * back/forward-history entries, which seems to be a bug on Google's side:\n * https://support.google.com/tagmanager/thread/237899073/?hl=en\n *\n * This issue is likely originating from the introduction of the\n * Privacy Sandbox https://privacysandbox.com/\n */\n\nconst SANDBOX_IFRAME_SRC = [\n 'https://td.doubleclick.net/',\n 'https://fledge.eu.criteo.com/'\n];\n\nconst isSandboxOrigin = (node: HTMLIFrameElement) =>\n typeof node.src === 'string' &&\n SANDBOX_IFRAME_SRC.some((sandboxOrigins) =>\n node.src.startsWith(sandboxOrigins)\n );\n\nconst isPrivacySandbox = (node: HTMLIFrameElement) =>\n typeof node.allow === 'string' &&\n node.allow.includes('join-ad-interest-group');\n\nconst isGoogleAdsIframe = (node: Node): boolean =>\n node instanceof HTMLIFrameElement &&\n isSandboxOrigin(node) &&\n isPrivacySandbox(node);\n\nexport const removePrivacySandboxIframes = () =>\n Array.from(\n document.body.querySelectorAll(\n 'iframe[allow=\"join-ad-interest-group\"]'\n )\n )\n .filter(isGoogleAdsIframe)\n .forEach((iframe) => iframe.remove());\n"],"names":["LIST_VIEW_TYPES","BASIC","NORMAL","PAGE_LIST_TYPES","BUYER_ACTIVE_ITEMS","BUYER_PURCHASES","BUYER_ITEMS_LOST","SELLER_ACTIVE","SELLER_SOLD","SELLER_NOT_SOLD","PAGE_BULK_ACTIONS","ACTIVE_CANCEL","UNSOLD_RESTART","BUYER_MARK_PAID","BUYER_SHOW_ACTIVE","BUYER_HIDE_ACTIVE","PURCHASES_SHOW","_excluded","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","i","Symbol","toPrimitive","call","TypeError","String","Number","_toPrimitive","configurable","writable","_slicedToArray","arr","Array","isArray","_arrayWithHoles","l","iterator","n","u","a","f","next","done","return","_iterableToArrayLimit","minLen","_arrayLikeToArray","prototype","toString","slice","constructor","name","from","test","_unsupportedIterableToArray","_nonIterableRest","len","arr2","_objectWithoutProperties","source","excluded","target","hasOwnProperty","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","formatStringOrUrl","urlObjOrString","formatUrl","Link","React","props","forwardedRef","hrefProp","href","asProp","as","childrenProp","children","passHref","replace","shallow","scroll","locale","onClick","onMouseEnterProp","onMouseEnter","onTouchStartProp","onTouchStart","restProps","pagesRouter","RouterContext","appRouter","AppRouterContext","router","isAppRouter","_React$useMemo","resolvedHref","_resolveHref2","resolveHref","resolvedAs","previousHref","previousAs","child","childRef","_useIntersection2","useIntersection","rootMargin","setIntersectionRef","resetVisible","childProps","ref","el","current","defaultPrevented","currentTarget","nodeName","toUpperCase","event","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","isModifiedEvent","isLocalURL","preventDefault","navigate","routerScroll","linkClicked","isAbsoluteUrl","type","curLocale","localeDomain","isLocaleDomain","getDomainLocale","locales","domainLocales","addBasePath","addLocale","defaultLocale","_jsx","PATH_PREFIX","URL_LANGUAGES","join","createPathRegex","pathRegex","RegExp","NEXTWEB_REGEX_FULL_PATHS","map","useNextWebSpaLink","absoluteUrl","location","useLocation","useAppSelector","selectEnvironment","isNativeAppContext","isNextWebLink","pathname","pathnameAndSearch","search","searchParams","get","some","regex","shippingRegex","valuationRegex","messagingRegex","useTouchwebInNextWebSpaLink","toggles","selectFeatureSwitches","isMessagingLink","Boolean","isShippingLink","isValuationLink","PRODUCTION_ORIGIN","_ref","isTouchwebSpaLink","useLink","givenOnClick","otherProps","dispatch","useDispatch","isNativeApp","selectIsNativeApp","isSpaNavigationEnabled","state","environment","isTouchwebInNextweb","isNextWebAddUrlParamEnabled","useIsFeatureEnabled","isTouchWebAddUrlParamEnabled","URL","set","isNextWebSpaLink","isTouchwebInNextWebSpaLink","handleSpaNavigationClick","useCallback","evt","removePrivacySandboxIframes","updateEnvironmentHash","isRelativeUrl","origin","includes","relativeUrl","getRelativeUrl","url","isFragmentNavSamePage","hash","startsWith","fromNextWeb","isNextJs","toNextWeb","fromTouchweb","toTouchweb","fromNextWebTouchwebHybrid","toNextWebTouchwebHybrid","NextLink","to","ItemToast","imageUrl","itemUrl","shortDescription","eventData","toLocalizedUrl","useUrlLocalizer","ALink","className","styles","_jsxs","src","title","alt","ToastMessage","_ref2","useTranslator","localizedPriceFormatter","useLocalizedPriceFormatter","message","newLeadingBid","newLeadingBidAmount","price","timeLeftMinutes","MessageToast","header","messageData","headerData","webApiUrl","isServer","process","env","PUBLIC_TOUCHWEB_WINDOW_LOCATION_ORIGIN","window","initData","AVAILABLE_SHIPPING_COUNTRIES","CART_OVERVIEW_VIEW","CART_ADD_ITEM","CART_REMOVE_ITEMS","CART_SET_ITEM_QUANTITY","FAVOURITE_SELLERS","HYPERWALLET_PAYOUT_COMPLETE","HYPERWALLET_PAYOUT_TOKEN","HYPERWALLET_PAYOUT","INTERNATIONAL_SHIPPING_CALCULATOR","ORDER_CHECKOUT_PAYMENT","orderCheckoutPaymentUrl","ORDER_CHECKOUT_REQUEST_COMBINED_PRICE","ORDER_CHECKOUT_CREATE_UNCOMMITTED_PURCHASE_ORDER","ORDER_PURCHASE_SHOP_ITEMS","PERSONALISED_SUGGESTIONS","SEARCH","WEB_API","UPI","purchaseOrderId","MCP","MCP_CONFIRM","PURCHASE_ORDER","MARKETING_PUBLIC_API","SHIPPING_CHECKOUT_DELETE","featureName","useSelector","selectIsFeatureEnabled","_request$location","fallback","undefined","request","useMemo","hasPathname","hasSearch","toUrlString","useNavigation","isNextDataFetchingDisabled","nextRouter","useRouter","touchwebHistory","useHistory","pushConfig","breakIframe","self","top","back","goBack","history","refresh","Error","hasPagesInHistory","ROUTING_TYPE","useQuery","parameter","defaultValue","_searchParams$get","navigation","URLSearchParams","updateSearchParam","routing","PUSH","locationParameter","delete","toStringOrNull","isNullOrUndefined","missingKeyLoggingConfig","saveMissing","saveMissingTo","missingKeyHandler","language","namespace","_fallbackValue","_updateMissing","options","hasLoadedAllTranslations","isAttributeStuffing","errorMessage","Sentry","missingInterpolationHandler","text","JSON","stringify","i18nInitialized","bootLanguages","translations","touchwebTranslations","attributeTranslations","translationResources","entries","attributeResources","_ref3","_ref4","resources","concat","reduce","prev","_ref5","s","i18n","use","initReactI18next","LanguageDetector","init","initOptions","err","logger","detection","order","htmlTag","document","html","defaultNS","NS_TOUCHWEB","ns","NS_ATTRIBUTES","fallbackLng","DEFAULT_LANGUAGE","debug","keySeparator","nsSeparator","interpolation","skipOnVariables","escapeValue","format","formatNumberWithSeparators","react","useSuspense","initialState","TranslationContext","createContext","useAddTranslation","translationsRef","useContext","pluralizedKey","translation","error","scope","AxiosError","isClientNetworkError","sentryException","spaPageViewTrackingEnabled","GtmService","_hasPreviouslyTrackedPage","_window$dataLayer","dataLayer","find","item","this","isScriptLoaded","_setWebViewHelperFunctionsToWindow","loadGtmScript","_process","_newPageFromServer","accountId","w","d","_f$parentNode","Date","getTime","getElementsByTagName","j","createElement","async","parentNode","insertBefore","googleTagManagerSnippet","NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ACCOUNT_ID","payload","pushArguments","_getDatalayerObject","output","entry","_reset","data","newPage","pageType","initialDataLayer","_pushInitialDataLayer","newSpaPage","buildInitialGtmDataLayerFromInitData","legacyDataLayer","trackAction","category","action","label","nonInteractive","queueBackgroundTask","trackActionSynchronously","eventCategory","eventAction","eventLabel","eventValue","eventNonInteractive","level","trackGtmEvent","eventName","trackPageView","trackLinkClickAndCallback","callback","eventCallback","trackLinkClickAndGotoUrl","logGaWebViewEvent","params","AnalyticsWebInterface","logEvent","webkit","messageHandlers","firebase","command","parameters","postMessage","setGaWebViewUserProperty","setUserProperty","trackGA4","eventParams","userData","timestamp","now","FlowId","createQueue","items","isAlive","ttlInMinutes","timeStamp","inProgress","add","_itemData","itemData","shift","notifyDone","isInProgress","getLength","NATIVE_APP_COOKIE_AND_HEADER_CONFIG","osVersion","initDataName","appDevice","appVersion","appContext","appLanguage","appInstanceId","createNativeAppCookieValue","nativeAppInfo","valueObject","fromEntries","extractNativeAppInfoFromCookie","nativeAppCookieString","parse","decodeURIComponent","getVersionUrl","getState","queryParameters","memberId","selectMemberId","preferredLanguageCode","selectPreferredLanguageCode","environmentHash","axios","headers","setEnvironmentHash","setIsSpaNavigationEnabled","getAndUpdateNativeAppInfo","nativeAppInfoFromInitData","_ref7","_ref8","config","extractNativeAppInfoFromInitData","values","nativeAppCookieValue","cookie","createCookie","NATIVE_APP_ENVIRONMENT","cookieValue","readCookie","initEnvironment","featureSwitches","googleAnalyticsTrackingId","googleAnalyticsMeasurementId","geoPublicApiBaseUrl","isSinglePageApp","splitTestGroups","version","webLiveUrl","frameElement","setEnvironment","setFeatureSwitches","setSplitTestGroups","setVersion","setVariables","PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID","PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID","PUBLIC_GEO_PUBLIC_API_BASE_URL","PUBLIC_WEB_LIVE_URL","setNativeAppInfo","browserName","isMobileDevice","isMobile","isMobileSafari","isIOS","isAndroid","variables","gtm","sessionId","setGATrackingData","parseAppVersion","_String$split$map$fil2","split","number","isNaN","_String$split$map$fil3","major","_String$split$map$fil4","minor","_String$split$map$fil5","patch","isSupportedMinimumVersion","appVersionString","minimumVersionString","minimumVersion","createSlice","gaTrackingSessionId","isHybridAppContextForAndroid","isHybridAppContextForIos","isNativeAppWithApplyPaySupport","isNativeAppWithSwishCallbackSupport","isNativeAppWithKlarnaSupport","isNativeAppWithTrustlySupport","isNativeAppWithInternationalVerificationSupport","isHybridAppContext","reducers","_ref6","_ref9","_ref9$payload","nativeAppSupport","hybridAppDevice","hybridAppVersion","appOsVersion","toLowerCase","isIos13","getNativeAppSupport","_slice$actions","actions","reducer","useAppDispatch","GdprSettings","getCookie","setCookie","isCategoryEnabled","cookieCategory","COOKIE_CATEGORIES","Essential","encodedConsentCookie","GDPR_CONSENT_COOKIE","consentCookie","decodeURI","isPerformanceEnabled","Performance","isFunctionalEnabled","Functional","isMarketingEnabled","Marketing","performance","functional","marketing","cookieString","expires","httpOnly","path","dayjs","toDate","getCookieFromBrowser","setCookieToBrowser","userLanguage","languageCodeIso2","memberEmail","isLoggedIn","memberHashedEmail","memberEmailSha256","memberEmailMd5","memberFirstName","memberLastName","memberCountry","loginState","isNotInIframe","blueshiftEventApiKey","blueshiftEventSignature","isQuantcastConsentEnabled","isTikTokPixelEnabled","isDigitalAudienceTrackingEnabled","quantcastSite","toLocalizedRiotUrl","getLanguage","querySelector","getElementById","SANDBOX_IFRAME_SRC","isGoogleAdsIframe","node","HTMLIFrameElement","sandboxOrigins","isSandboxOrigin","allow","isPrivacySandbox","body","querySelectorAll","iframe","remove"],"sourceRoot":""}