ads-web-sdkm 2.0.26 → 2.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Brandshop.js +162 -165
- package/dist/Brandshop.js.map +1 -1
- package/dist/Brandshops.js +1 -1
- package/dist/Image-BEPWcsda.js +34 -0
- package/dist/Image-BEPWcsda.js.map +1 -0
- package/dist/components/Brandshop/Banner.d.ts +1 -2
- package/dist/components/Image/Image.d.ts +1 -3
- package/package.json +2 -1
- package/dist/Image-DBd789zZ.js +0 -36
- package/dist/Image-DBd789zZ.js.map +0 -1
package/dist/Brandshop.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Brandshop.js","sources":["../src/api/services/getBrandshop.ts","../src/api/queries/useGetBrandshop.ts","../src/components/Brandshop/BannerWithLink.tsx","../src/components/Brandshop/Banner.tsx","../src/utils/analytics/trackBrandshopEvents.ts","../src/components/Brandshop/BannerSection.tsx","../src/components/Brandshop/CategorySection.tsx","../src/components/Brandshop/NavigationSection.tsx","../src/types/products.ts","../src/utils/helpers/productDiscounts.ts","../src/components/Card/Card.tsx","../src/components/Chip/Chip.tsx","../src/utils/helpers/discountChip.ts","../src/utils/helpers/translate.ts","../src/components/ProductsCarousel/DiscountChip.tsx","../src/assets/tag.svg","../src/components/ProductsCarousel/CouponBadge.tsx","../src/components/ProductsCarousel/PriceDisplay.tsx","../src/components/ProductsCarousel/ProductTitle.tsx","../node_modules/mylo-online-checkout-sdk/dist/mylo-online-checkout-sdk.esm.js","../src/assets/mylo-en.svg","../src/assets/mylo.svg","../src/hooks/use-async-memo.ts","../src/utils/helpers/price-utils.ts","../src/components/ProductsCarousel/ProductCard.tsx","../src/components/ProductsCarousel/ProductsCarousel.tsx","../src/utils/helpers/products.ts","../src/api/services/getCollection.ts","../src/api/queries/useGetCollection.ts","../src/components/ProductsCarousel/ProductCardSkeleton.tsx","../src/components/ProductsCarousel/ProductSliderSkeleton.tsx","../src/components/Brandshop/ProductSliderSection.tsx","../src/components/Brandshop/BrandshopSection.tsx","../src/utils/helpers/utilities.ts","../src/hooks/useDetectScrolledToBottom.ts","../src/components/Brandshop/BrandshopSkeleton.tsx","../src/components/Brandshop/BrandshopContent.tsx","../src/assets/error.svg","../src/components/Brandshop/BrandshopError.tsx","../src/components/ErrorBoundary/ErrorBoundary.tsx","../src/components/Brandshop/Brandshop.tsx"],"sourcesContent":["import { generateAccessToken } from '@/utils/helpers/authToken';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { getBaseUrl } from '@/utils/helpers/getBaseUrl';\r\nimport { type TEnvironment } from '@/types/configTypes';\r\nimport {\r\n type TBrandshopApiResponse,\r\n type TBrandshopData,\r\n} from '@/types/brandshop';\r\n\r\ntype TGetBrandshopProps = {\r\n deviceType: string;\r\n language: TLanguage;\r\n environment: TEnvironment;\r\n brandshopId: string;\r\n adServerApiKey: string;\r\n};\r\n\r\nexport const getBrandshop = async ({\r\n deviceType,\r\n language,\r\n brandshopId,\r\n environment,\r\n adServerApiKey,\r\n}: TGetBrandshopProps): Promise<TBrandshopData> => {\r\n const [token, timestamp] = await generateAccessToken(adServerApiKey);\r\n const adServerBaseUrl = getBaseUrl('adServer', environment);\r\n\r\n try {\r\n const res = await fetch(\r\n `${adServerBaseUrl}/api/v2/brandshop/server/${brandshopId}`,\r\n {\r\n headers: {\r\n device: deviceType,\r\n lang: language,\r\n 'auth-token': token,\r\n 'auth-timestamp': timestamp,\r\n },\r\n },\r\n );\r\n\r\n const brandshopResponse: TBrandshopApiResponse = await res.json();\r\n return brandshopResponse.data;\r\n } catch (error) {\r\n throw new Error(`Failed to fetch brandshop details - ${error}`);\r\n }\r\n};\r\n","import { useQuery } from '@tanstack/react-query';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { type TEnvironment } from '@/types/configTypes';\r\nimport { getBrandshop } from '../services/getBrandshop';\r\n\r\ntype TGetBrandshopProps = {\r\n deviceType: string;\r\n language: TLanguage;\r\n brandshopId: string;\r\n environment: TEnvironment;\r\n adServerApiKey: string;\r\n enabled?: boolean;\r\n};\r\nexport const GET_BRANDSHOP_QUERY_KEY = 'brandshop';\r\n\r\nexport const useGetBrandshopQuery = ({\r\n deviceType,\r\n language,\r\n brandshopId,\r\n environment,\r\n adServerApiKey,\r\n enabled,\r\n}: TGetBrandshopProps) => {\r\n const brandshopQueryKey = [\r\n GET_BRANDSHOP_QUERY_KEY,\r\n brandshopId,\r\n deviceType,\r\n language,\r\n ];\r\n\r\n return useQuery({\r\n queryKey: brandshopQueryKey,\r\n queryFn: () =>\r\n getBrandshop({\r\n deviceType,\r\n language,\r\n brandshopId,\r\n environment,\r\n adServerApiKey,\r\n }),\r\n enabled,\r\n });\r\n};\r\n","import styles from './Brandshop.module.css';\r\nimport { Image } from '../Image/Image';\r\n\r\ntype BannerWithLinkProps = {\r\n image: string;\r\n text: string;\r\n alt: string;\r\n onClick: () => void;\r\n};\r\n\r\nexport const BannerWithLink = ({\r\n image,\r\n text,\r\n alt,\r\n onClick,\r\n}: BannerWithLinkProps) => {\r\n if (!image) return null;\r\n\r\n return (\r\n <button type=\"button\" className={styles.bannerButton} onClick={onClick}>\r\n <Image src={image} alt={alt} className={styles.bannerImage} />\r\n <div className={styles.bannerCta}>{text}</div>\r\n </button>\r\n );\r\n};\r\n","import styles from './Brandshop.module.css';\r\nimport { Image } from '../Image/Image';\r\n\r\ntype BannerProps = {\r\n image: string;\r\n alt: string;\r\n index?: number;\r\n};\r\n\r\nexport const Banner = ({ image, alt, index }: BannerProps) => {\r\n return (\r\n <div className={styles.banner}>\r\n <Image\r\n src={image}\r\n alt={alt}\r\n className={styles.bannerImage}\r\n fetchPriority={index === 0 ? 'high' : 'low'}\r\n />\r\n </div>\r\n );\r\n};\r\n","import { TTrackEvents } from '@/types/configTypes';\r\n\r\ntype TBrandshopLoginStatus = 'logged_in' | 'guest';\r\n\r\ntype TBrandshopEventNamesEnum =\r\n | 'ads_bs_pageload'\r\n | 'ads_bs_pageend'\r\n | 'ads_bs_section_view'\r\n | 'ads_bs_content_click';\r\n\r\ntype TBrandshopEventProperties = {\r\n userStatus: TBrandshopLoginStatus;\r\n platform: 'Web';\r\n brandName?: string;\r\n sectionName?: string;\r\n sectionOrder?: string;\r\n contentName?: string;\r\n contentOrder?: string;\r\n};\r\n\r\nexport const trackBrandshopEvent = (\r\n eventName: TBrandshopEventNamesEnum,\r\n props: TBrandshopEventProperties,\r\n trackEvent?: TTrackEvents,\r\n) => {\r\n switch (eventName) {\r\n case 'ads_bs_pageload':\r\n case 'ads_bs_pageend': {\r\n const { brandName, userStatus, platform } = props;\r\n trackEvent?.(eventName, {\r\n brand_name: brandName,\r\n user_status: userStatus,\r\n platform,\r\n });\r\n break;\r\n }\r\n\r\n case 'ads_bs_section_view': {\r\n const { brandName, sectionName, sectionOrder, userStatus, platform } =\r\n props;\r\n trackEvent?.(eventName, {\r\n brand_name: brandName,\r\n section_name: sectionName,\r\n section_order: sectionOrder,\r\n user_status: userStatus,\r\n platform,\r\n });\r\n break;\r\n }\r\n\r\n case 'ads_bs_content_click': {\r\n const { contentName, contentOrder, userStatus, platform } = props;\r\n trackEvent?.(eventName, {\r\n content_name: contentName,\r\n content_order: contentOrder,\r\n user_status: userStatus,\r\n platform,\r\n });\r\n break;\r\n }\r\n }\r\n};\r\n","import { type TLinkClickEvent } from '@/types/ads';\r\nimport { type TBrandshopDataItem } from '@/types/brandshop';\r\nimport { buildLinkDestination } from '@/utils/helpers/ads';\r\nimport { BannerWithLink } from './BannerWithLink';\r\nimport { Banner } from './Banner';\r\nimport styles from './Brandshop.module.css';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport { type TTrackEvents } from '@/types/configTypes';\r\n\r\ntype BannerSectionProps = {\r\n title: string;\r\n hideTitle: boolean;\r\n banners: TBrandshopDataItem[];\r\n isLoggedin: boolean;\r\n sectionTitle: string;\r\n onBannerClick: (link: TLinkClickEvent) => void;\r\n trackBrandshopHandler?: TTrackEvents;\r\n};\r\n\r\nexport const BannerSection = ({\r\n title,\r\n hideTitle,\r\n banners,\r\n isLoggedin,\r\n sectionTitle,\r\n onBannerClick,\r\n trackBrandshopHandler,\r\n}: BannerSectionProps) => {\r\n const handleLinkClick = (bannerItem: TBrandshopDataItem) => {\r\n if (!bannerItem?.link?.link_destination) return;\r\n trackBrandshopEvent(\r\n 'ads_bs_content_click',\r\n {\r\n contentName: sectionTitle,\r\n contentOrder: bannerItem.display_order.toString(),\r\n userStatus: isLoggedin ? 'logged_in' : 'guest',\r\n platform: 'Web',\r\n },\r\n trackBrandshopHandler,\r\n );\r\n const payload = buildLinkDestination(bannerItem.link.link_destination);\r\n if (!payload) return;\r\n onBannerClick(payload);\r\n };\r\n\r\n if (banners.length === 0) return null;\r\n\r\n return (\r\n <div className={styles.sectionContainer}>\r\n {!hideTitle && <h2 className={styles.sectionTitle}>{title}</h2>}\r\n\r\n {banners.map((banner, index) => {\r\n return banner.link ? (\r\n <BannerWithLink\r\n key={banner.tracking_id}\r\n image={banner.image as string}\r\n text={banner.link.link_text}\r\n alt={title}\r\n onClick={() => handleLinkClick(banner)}\r\n />\r\n ) : (\r\n <Banner\r\n key={banner.tracking_id}\r\n image={banner.image as string}\r\n alt={title}\r\n index={index}\r\n />\r\n );\r\n })}\r\n </div>\r\n );\r\n};\r\n","import { type TLinkClickEvent } from '@/types/ads';\r\nimport { type TBrandshopDataItem } from '@/types/brandshop';\r\nimport { buildLinkDestination } from '@/utils/helpers/ads';\r\nimport styles from './Brandshop.module.css';\r\nimport { type TTrackEvents } from '@/types/configTypes';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport { Image } from '../Image/Image';\r\n\r\ntype CategorySectionProps = {\r\n title: string;\r\n hideTitle: boolean;\r\n categories: TBrandshopDataItem[];\r\n isLoggedin: boolean;\r\n onCategoryClick: (link: TLinkClickEvent) => void;\r\n trackBrandshopHandler?: TTrackEvents;\r\n};\r\n\r\nexport const CategorySection = ({\r\n title,\r\n hideTitle,\r\n categories,\r\n isLoggedin,\r\n onCategoryClick,\r\n trackBrandshopHandler,\r\n}: CategorySectionProps) => {\r\n const handleLinkClick = (categoryItem: TBrandshopDataItem) => {\r\n if (!categoryItem?.link?.link_destination) return;\r\n trackBrandshopEvent(\r\n 'ads_bs_content_click',\r\n {\r\n contentName: categoryItem.category_name,\r\n contentOrder: categoryItem.display_order.toString(),\r\n userStatus: isLoggedin ? 'logged_in' : 'guest',\r\n platform: 'Web',\r\n },\r\n trackBrandshopHandler,\r\n );\r\n const payload = buildLinkDestination(categoryItem.link.link_destination);\r\n if (!payload) return;\r\n onCategoryClick(payload);\r\n };\r\n\r\n if (categories.length < 2) return null;\r\n\r\n const limitedCategories = categories.slice(0, 6);\r\n const sortedCategories = [...limitedCategories].sort(\r\n (a, b) => a.display_order - b.display_order,\r\n );\r\n const gridColumns =\r\n limitedCategories.length === 2 || limitedCategories.length === 4 ? 2 : 3;\r\n\r\n return (\r\n <div className={styles.sectionContainer}>\r\n {!hideTitle && <h2 className={styles.sectionTitle}>{title}</h2>}\r\n\r\n <div\r\n className={`${styles.categoryContainer} ${\r\n styles[`cols${gridColumns}`]\r\n } ${limitedCategories.length === 6 ? styles.categoryShrinkGap : ''}`}\r\n >\r\n {sortedCategories.map((category) => {\r\n if (!category) return null;\r\n\r\n return (\r\n <button\r\n key={category.tracking_id}\r\n className={styles.categoryTile}\r\n onClick={() => handleLinkClick(category)}\r\n >\r\n <div className={styles.categoryImageWrapper}>\r\n {category.image && (\r\n <Image\r\n src={category.image}\r\n alt={category.category_name ?? title}\r\n className={styles.categoryImage}\r\n loading='lazy'\r\n fetchPriority='low'\r\n />\r\n )}\r\n </div>\r\n\r\n {category.category_name && (\r\n <span\r\n className={`${styles.categoryName} ${\r\n limitedCategories.length === 6\r\n ? styles.categoryNameShrink\r\n : ''\r\n }`}\r\n >\r\n {category.category_name}\r\n </span>\r\n )}\r\n </button>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n );\r\n};\r\n","import { type TNavigationLinkItem } from '@/types/brandshop';\r\nimport { type TLinkClickEvent } from '@/types/ads';\r\nimport { buildLinkDestination } from '@/utils/helpers/ads';\r\nimport { type TTrackEvents } from '@/types/configTypes';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport styles from './Brandshop.module.css';\r\nimport { Image } from '../Image/Image';\r\n\r\ntype NavigationSectionProps = {\r\n title: string;\r\n hideTitle: boolean;\r\n logo: string;\r\n navigationLinks: TNavigationLinkItem[];\r\n isLoggedin: boolean;\r\n brandshopName?: string;\r\n onLinkClick: (link: TLinkClickEvent) => void;\r\n trackBrandshopHandler?: TTrackEvents;\r\n};\r\n\r\nexport const NavigationSection = ({\r\n title,\r\n hideTitle,\r\n logo,\r\n navigationLinks,\r\n isLoggedin,\r\n brandshopName,\r\n onLinkClick,\r\n trackBrandshopHandler,\r\n}: NavigationSectionProps) => {\r\n const handleLinkClick = (navigationItem: TNavigationLinkItem) => {\r\n trackBrandshopEvent(\r\n 'ads_bs_content_click',\r\n {\r\n contentName: navigationItem.link.link_text,\r\n contentOrder: navigationItem.link.link_display_order.toString(),\r\n userStatus: isLoggedin ? 'logged_in' : 'guest',\r\n platform: 'Web',\r\n },\r\n trackBrandshopHandler,\r\n );\r\n const payload = buildLinkDestination(navigationItem.link.link_destination);\r\n if (payload) onLinkClick(payload);\r\n };\r\n if (navigationLinks.length === 0) return null;\r\n\r\n const sortedNavigationLinks = [...navigationLinks].sort(\r\n (a, b) => a.link.link_display_order - b.link.link_display_order,\r\n );\r\n\r\n return (\r\n <div\r\n className={`${styles.sectionContainer} ${styles.navigationSectionContainer}`}\r\n >\r\n {!hideTitle && <h2 className={styles.sectionTitle}>{title}</h2>}\r\n\r\n <div className={styles.navigationSection}>\r\n {logo && (\r\n <h1>\r\n <Image\r\n src={logo}\r\n alt={brandshopName ?? title}\r\n className={styles.navigationLogo}\r\n />\r\n </h1>\r\n )}\r\n <div className={styles.navigationLinks}>\r\n {sortedNavigationLinks.map((navigationLink) => (\r\n <button\r\n key={navigationLink.tracking_id}\r\n className={styles.navigationLink}\r\n onClick={() => handleLinkClick(navigationLink)}\r\n >\r\n {navigationLink.link.link_text}\r\n </button>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n","export enum DiscountValueTypesEnum {\r\n PERCENTAGE = 'PERCENTAGE',\r\n AMOUNT = 'AMOUNT',\r\n}\r\n\r\nexport enum DiscountTypesEnum {\r\n PROMOTION = 1,\r\n COUPON = 2,\r\n}\r\n\r\nexport type TPrice = {\r\n is_price_dropped: boolean;\r\n currency: string;\r\n base: string;\r\n final: string;\r\n final_float_price: string;\r\n};\r\n\r\nexport type TDiscount = {\r\n order: DiscountTypesEnum;\r\n name: string;\r\n description: string;\r\n type: DiscountValueTypesEnum;\r\n value: string;\r\n discount_value: string;\r\n price_after_discount: string;\r\n};\r\n\r\nexport type TProductDiscount = {\r\n value: string;\r\n priceAfterDiscount: string;\r\n};\r\n\r\nexport type TDiscountsMap = {\r\n promotion: TProductDiscount | null;\r\n coupon: TProductDiscount | null;\r\n};\r\n\r\n// Collection Item Types\r\nexport type TColorVariant = {\r\n offering_id: string;\r\n variant_id: string;\r\n slug: string;\r\n id: string;\r\n name: string;\r\n value: string;\r\n decorator: string;\r\n};\r\n\r\nexport type TCollectionItem = {\r\n offering_id: string;\r\n variant_id: string;\r\n title: string;\r\n slug: string;\r\n brand: string;\r\n main_image: string;\r\n formatted_main_image: string;\r\n gallery: string[];\r\n price: TPrice;\r\n stock_quantity: number;\r\n discounts: TDiscount[];\r\n colors: TColorVariant[];\r\n categories_tree: string[];\r\n dimensions: string;\r\n};\r\n\r\n// API Response Types\r\nexport type TApiError = {\r\n message: string;\r\n severity: string;\r\n details: string;\r\n};\r\n\r\nexport type TCollectionData = {\r\n collection_id: string;\r\n total_items: number;\r\n items: TCollectionItem[];\r\n};\r\n\r\nexport type TCollectionResponse = {\r\n success: boolean;\r\n data: TCollectionData | null;\r\n error: TApiError | null;\r\n};\r\n","import {\r\n DiscountTypesEnum,\r\n DiscountValueTypesEnum,\r\n type TDiscountsMap,\r\n type TDiscount,\r\n} from '@/types/products';\r\n\r\n// Helper function to get discount value display\r\nconst getDiscountValue = (discount: TDiscount, currency: string): string => {\r\n if (discount.type === DiscountValueTypesEnum.PERCENTAGE) {\r\n return `${discount.value}%`;\r\n }\r\n return `${discount.discount_value} ${currency}`;\r\n};\r\n\r\n// Helper function to get discounts map\r\nexport const getDiscounts = (discounts: TDiscount[], currency: string) => {\r\n return discounts.reduce(\r\n (acc, discount) => {\r\n if (discount.order === DiscountTypesEnum.PROMOTION) {\r\n return {\r\n ...acc,\r\n promotion: {\r\n value: getDiscountValue(discount, currency),\r\n priceAfterDiscount: discount.price_after_discount,\r\n },\r\n };\r\n }\r\n if (discount.order === DiscountTypesEnum.COUPON) {\r\n return {\r\n ...acc,\r\n coupon: {\r\n value: getDiscountValue(discount, currency),\r\n priceAfterDiscount: discount.price_after_discount,\r\n },\r\n };\r\n }\r\n return acc;\r\n },\r\n { promotion: null, coupon: null } as TDiscountsMap,\r\n );\r\n};\r\n","import React from 'react';\r\n\r\ntype TCardProps = {\r\n children: React.ReactNode;\r\n className?: string;\r\n};\r\n\r\nexport const Card = ({ children, className }: TCardProps) => {\r\n return <div className={className}>{children}</div>;\r\n};\r\n","import styles from './Chip.module.css';\r\n\r\ntype TChipProps = {\r\n children: React.ReactNode;\r\n className?: string;\r\n};\r\n\r\nexport function Chip({ children, className }: Readonly<TChipProps>) {\r\n return <div className={`${styles.chip} ${className}`}>{children}</div>;\r\n}\r\n","type TDiscountChipProps = {\r\n label: string;\r\n variant: 'coupon' | 'promotion' | 'priceDrop';\r\n};\r\n\r\ntype TChipInput = {\r\n saveLabelText: string;\r\n couponText: string;\r\n priceDropText: string;\r\n promotionValue?: string;\r\n hasCoupon?: boolean;\r\n isPriceDropped?: boolean;\r\n};\r\n\r\nexport const getDiscountChipDetails = (\r\n props: TChipInput,\r\n): TDiscountChipProps | null => {\r\n const {\r\n promotionValue,\r\n hasCoupon,\r\n isPriceDropped,\r\n saveLabelText,\r\n couponText,\r\n priceDropText,\r\n } = props;\r\n if (isPriceDropped) {\r\n return {\r\n label: priceDropText,\r\n variant: 'priceDrop',\r\n };\r\n }\r\n if (hasCoupon) {\r\n return {\r\n label: couponText,\r\n variant: 'coupon',\r\n };\r\n }\r\n if (promotionValue) {\r\n return {\r\n label: `${saveLabelText} ${promotionValue}`,\r\n variant: 'promotion',\r\n };\r\n }\r\n\r\n return null;\r\n};\r\n","import { type TLanguage } from '@/types/types';\r\n\r\nexport const translations = {\r\n en: {\r\n couponBadge: {\r\n extra: 'Extra',\r\n offAtCheckout: 'off at checkout',\r\n },\r\n discountChip: {\r\n save: 'Save',\r\n onlineExclusive: 'Online exclusive offer',\r\n priceDrop: 'Price drop',\r\n },\r\n mylo: {\r\n from: 'From',\r\n perMonth: '/mo with',\r\n },\r\n },\r\n ar: {\r\n couponBadge: {\r\n extra: 'خصم إضافي',\r\n offAtCheckout: 'يطبق عند الدفع',\r\n },\r\n discountChip: {\r\n save: 'هتوفر',\r\n onlineExclusive: 'عرض أونلاين حصري',\r\n priceDrop: 'سعر أقل',\r\n },\r\n mylo: {\r\n from: 'يبدأ من',\r\n perMonth: '/الشهر مع',\r\n },\r\n },\r\n} as const;\r\n\r\nexport const getTranslation = (language: TLanguage) => translations[language];\r\n","import { type TProductDiscount } from '@/types/products';\r\nimport { Chip } from '../Chip/Chip';\r\nimport { getDiscountChipDetails } from '@/utils/helpers/discountChip';\r\nimport styles from './ProductsCarousel.module.css';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { getTranslation } from '@/utils/helpers/translate';\r\n\r\ntype TDiscountChipProps = {\r\n language: TLanguage;\r\n promotionValue?: string;\r\n coupon?: TProductDiscount | null;\r\n isPriceDropped?: boolean;\r\n className?: string;\r\n};\r\n\r\nconst variantStyles = {\r\n coupon: styles.discountChipCoupon,\r\n promotion: styles.discountChipPromotion,\r\n priceDrop: styles.discountChipPriceDrop,\r\n};\r\n\r\nexport function DiscountChip({\r\n language,\r\n promotionValue,\r\n coupon,\r\n isPriceDropped,\r\n className,\r\n}: Readonly<TDiscountChipProps>) {\r\n const translate = getTranslation(language);\r\n\r\n const discountChipDetails = getDiscountChipDetails({\r\n promotionValue,\r\n hasCoupon: !!coupon,\r\n isPriceDropped,\r\n saveLabelText: translate.discountChip.save,\r\n couponText: translate.discountChip.onlineExclusive,\r\n priceDropText: translate.discountChip.priceDrop,\r\n });\r\n\r\n if (!discountChipDetails) return null;\r\n\r\n return (\r\n <Chip\r\n className={`${className} ${variantStyles[discountChipDetails.variant]}`}\r\n >\r\n {discountChipDetails.label}\r\n </Chip>\r\n );\r\n}\r\n","export default \"data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.94%206.38667L6.94%200.386667C6.7%200.146667%206.36667%200%206%200H1.33333C0.6%200%200%200.6%200%201.33333V6C0%206.36667%200.146667%206.7%200.393333%206.94667L6.39333%2012.9467C6.63333%2013.1867%206.96667%2013.3333%207.33333%2013.3333C7.7%2013.3333%208.03333%2013.1867%208.27333%2012.94L12.94%208.27333C13.1867%208.03333%2013.3333%207.7%2013.3333%207.33333C13.3333%206.96667%2013.18%206.62667%2012.94%206.38667ZM2.33333%203.33333C1.78%203.33333%201.33333%202.88667%201.33333%202.33333C1.33333%201.78%201.78%201.33333%202.33333%201.33333C2.88667%201.33333%203.33333%201.78%203.33333%202.33333C3.33333%202.88667%202.88667%203.33333%202.33333%203.33333Z'%20fill='%231AA573'/%3e%3c/svg%3e\"","import styles from './ProductsCarousel.module.css';\r\nimport tag from '@/assets/tag.svg';\r\nimport { Image } from '../Image/Image';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { getTranslation } from '@/utils/helpers/translate';\r\n\r\ntype TCouponBadgeProps = {\r\n value: string;\r\n language: TLanguage;\r\n};\r\n\r\nexport function CouponBadge({ value, language }: Readonly<TCouponBadgeProps>) {\r\n const translate = getTranslation(language);\r\n\r\n return (\r\n <div className={styles.couponBadge}>\r\n <Image alt=\"tag\" src={tag} width={13.3} height={13.3} />\r\n <span>\r\n {`${translate.couponBadge.extra} ${value} ${translate.couponBadge.offAtCheckout}`}\r\n </span>\r\n </div>\r\n );\r\n}\r\n","import type { TPrice, TDiscount } from '@/types/products';\r\nimport styles from './ProductsCarousel.module.css';\r\nimport { getDiscounts } from '@/utils/helpers/productDiscounts';\r\n\r\ntype TPriceDisplayProps = {\r\n price: TPrice;\r\n discounts: TDiscount[];\r\n};\r\n\r\nexport function PriceDisplay({\r\n price,\r\n discounts,\r\n}: Readonly<TPriceDisplayProps>) {\r\n const { promotion } = getDiscounts(discounts, price.currency);\r\n const hasDiscount = promotion?.priceAfterDiscount;\r\n\r\n return (\r\n <div className={styles.priceWrapper}>\r\n <span\r\n className={`${styles.priceCurrency} ${hasDiscount && styles.withPromotion}`}\r\n >\r\n {price.currency}\r\n </span>\r\n <span\r\n className={`${styles.priceAmount} ${hasDiscount && styles.withPromotion}`}\r\n >\r\n {promotion ? promotion.priceAfterDiscount : price.base}\r\n </span>\r\n {hasDiscount && (\r\n <span className={styles.priceOriginal}>{price.base}</span>\r\n )}\r\n </div>\r\n );\r\n}\r\n","import styles from './ProductsCarousel.module.css';\r\n\r\ntype TProductLinkProps = {\r\n title: string;\r\n};\r\n\r\nexport function ProductTitle({ title }: Readonly<TProductLinkProps>) {\r\n return <div className={styles.ProductTitle}>{title}</div>;\r\n}\r\n","class t{overlay;iframe;data;redirect_url;constructor(){this.overlay=null,this.iframe=null,this.data={},this.redirect_url=\"\"}set redirectUrl(t){this.redirect_url=t}open(t,e,s){this.data=e,this.overlay=document.createElement(\"div\"),this.overlay.style.position=\"fixed\",this.overlay.style.top=\"0\",this.overlay.style.left=\"0\",this.overlay.style.width=\"100%\",this.overlay.style.height=\"100%\",this.overlay.style.backgroundColor=\"rgba(0, 0, 0, 0.5)\",this.overlay.style.zIndex=\"9999\",this.overlay.style.display=\"flex\",this.overlay.style.justifyContent=\"center\",this.overlay.style.alignItems=\"center\",this.overlay.style.cursor=\"pointer\";const n=document.createElement(\"div\");n.style.position=\"relative\",n.style.zIndex=\"10000\";const a={padding:\"20px\",backgroundColor:\"#fff\",borderRadius:\"10px\",boxShadow:\"0px 5px 15px rgba(0, 0, 0, 0.2)\"},i=()=>{const t=window.innerWidth,e=window.innerHeight;s?.width||(n.style.width=t>=768?\"45%\":\"100%\"),s?.height||(n.style.height=e>=872?\"80%\":\"100%\")};i(),window.addEventListener(\"resize\",i),Object.entries(a).forEach((([t,e])=>{e&&(n.style[t]=e)})),s&&Object.keys(s).length>0&&Object.entries(s).forEach((([t,e])=>{e&&(n.style[t]=e)})),this.iframe=document.createElement(\"iframe\"),this.iframe.src=t,this.iframe.style.width=\"100%\",this.iframe.style.height=\"100%\",this.iframe.style.border=\"none\",this.iframe.style.borderRadius=s?.borderRadius||a.borderRadius,n.appendChild(this.iframe),this.overlay.appendChild(n),document.body.appendChild(this.overlay),this.overlay.addEventListener(\"click\",(t=>{t.target===this.overlay&&this.close()})),this.onIframeLoad((()=>{const t={message:this.data};console.log(\"sending data to iframe:\",JSON.stringify(t,null,2)),this.iframe?.contentWindow?.postMessage(t,\"*\")})),window.addEventListener(\"message\",(t=>{t?.origin&&(t?.data.redirect_url&&(this.redirectUrl=t?.data.redirect_url),\"success\"!==t?.data?.status&&\"failed\"!==t?.data?.status||(console.log(\"Closing Iframe Modal with status:\",t?.data?.status),this.close()))}))}close(){this.overlay&&document.body.contains(this.overlay)&&(document.body.removeChild(this.overlay),this.redirect_url&&(console.log(\"Redirecting to:\",this.redirect_url),window.location.href=this.redirect_url))}getIframe(){return this.iframe}onIframeLoad(t){this.iframe&&(this.iframe.onload=t)}}class e{iframeModal;constructor(){this.iframeModal=new t}start({baseUrl:t,path:e,data:s,iframeStyles:n}){t.endsWith(\"/\")&&(t=t.slice(0,-1)),e.startsWith(\"/\")&&(e=e.slice(1)),console.group(\"Starting Iframe Modal\"),console.log(\"Base URL:\",t),console.log(\"Path:\",e),console.log(\"Data:\",JSON.stringify(s,null,2)),console.groupEnd();const a=`${t}/${e}`;this.iframeModal.open(a,s,n)}}class s extends e{startCheckout(t,e){this.start({baseUrl:t,path:\"public/online-checkout\",data:e})}}class n extends e{startOnboarding(t,e){this.start({baseUrl:t,path:\"public/onboarding-checkout-app\",data:e,iframeStyles:{width:\"600px\",height:\"742px\",borderRadius:\"32px\",padding:\"0\"}})}}var a;!function(t){t.YEARLY=\"yearly\",t.MONTHLY=\"monthly\"}(a||(a={}));const i=[{tenor_key:\"2_Months\",duration_in_days:60,interest_percent_basis_points:600,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"3_Months\",duration_in_days:90,interest_percent_basis_points:1e3,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"6_Months\",duration_in_days:180,interest_percent_basis_points:1900,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"9_Months\",duration_in_days:270,interest_percent_basis_points:2900,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"12_Months\",duration_in_days:360,interest_percent_basis_points:3800,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"15_Months\",duration_in_days:450,interest_percent_basis_points:5e3,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"18_Months\",duration_in_days:540,interest_percent_basis_points:6500,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"24_Months\",duration_in_days:720,interest_percent_basis_points:8800,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"36_Months\",duration_in_days:1080,interest_percent_basis_points:14400,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"48_Months\",duration_in_days:1440,interest_percent_basis_points:2e4,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"}];async function r(){try{const t=await fetch(\"https://mylosmsoffers.s3.eu-west-1.amazonaws.com/btechoffer.json\",{method:\"GET\",cache:\"default\",headers:{\"Content-Type\":\"application/json\"}});if(!t.ok)throw new Error(`Failed to fetch configs: ${t.status} ${t.statusText}`);return await t.json()}catch(t){return console.error(\"Failed to fetch tenor configs:\",t),i}}function o(t,e){const s=e.interest_percent_basis_points/1e4,n=t+t*s,i=e.duration_in_days/30,r=e.tenor_key.match(/^(\\d+)_/);return{monthlyAmount:n/i,tenure:`${r?r[1]:e.duration_in_days/30} months`,murabaha:Number((e?.murabaha_schema===a.YEARLY?s/i*12*100:s/i*100).toFixed(2))}}async function l(t){const e=await r();if(0===e.length)return null;const s=e.map((e=>({config:e,installment:o(t,e)}))).reduce(((t,e)=>e.installment.monthlyAmount<t.installment.monthlyAmount?e:t)),n=function(t){return new Intl.NumberFormat(\"en-US\",{minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}(s.installment.monthlyAmount);return{message:`Pay as low as ${n}/month`,tenure:`${String(s.config.duration_in_days/30)}`,amount:n}}async function h(t){const e=await r();return 0===e.length?[]:e.map((e=>{const s=o(t,e);return{tenure:s.tenure,monthlyAmount:String(s.monthlyAmount),murabaha:s.murabaha}}))}export{s as Checkout,n as Onboarding,h as getInstallmentInfoPDP,l as getInstallmentInfoPLP};\n","export default \"data:image/svg+xml,%3csvg%20width='29'%20height='14'%20viewBox='0%200%2029%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_5501_9441)'%3e%3cpath%20d='M0%202.77278H2.23046L2.7134%204.15232H2.72612C2.88286%203.69215%203.15714%203.32694%203.54992%203.05672C3.94175%202.78648%204.38158%202.65137%204.8694%202.65137C5.35722%202.65137%205.7706%202.77669%206.08407%203.02635C6.39752%203.27702%206.61303%203.64809%206.72861%204.13958H6.74135C6.93921%203.66375%207.23309%203.29659%207.62098%203.03812C8.0089%202.77963%208.45558%202.65039%208.95906%202.65039C9.33915%202.65039%209.66534%202.73655%209.93864%202.91083C10.2119%203.08413%2010.4196%203.3338%2010.5646%203.66081C10.7086%203.98783%2010.782%204.37751%2010.782%204.82887V9.0644H7.93151V5.59157C7.93151%205.3899%207.88352%205.23226%207.78947%205.11966C7.69446%205.00608%207.56419%204.95028%207.39961%204.95028C7.27619%204.95028%207.17039%204.97868%207.08322%205.03448C6.99701%205.09126%206.93041%205.17352%206.88534%205.28316C6.84028%205.39184%206.81775%205.52305%206.81775%205.67677V9.0654H3.96723V5.59257C3.96723%205.39087%203.91924%205.23323%203.82519%205.12063C3.73018%205.00706%203.59989%204.95125%203.43533%204.95125C3.25313%204.95125%203.11109%205.01391%203.00824%205.13826C2.90538%205.26358%202.85347%205.44276%202.85347%205.67677V9.0654H0V2.77278Z'%20fill='%23D52B92'/%3e%3cpath%20d='M15.2248%202.77148L14.4568%206.5596L13.8936%202.77148H11.0078L12.2832%209.06507H13.9475L13.5214%2011.1652H16.4062L18.1096%202.77148H15.2248Z'%20fill='%23D52B92'/%3e%3cpath%20d='M22.597%2011.1848H21.3668C19.4782%2011.1848%2018.6172%2010.2527%2018.6172%208.55498V2.76953H21.3855V8.71848C21.3855%208.90843%2021.5431%209.06312%2021.738%209.06312H22.597V11.1848Z'%20fill='%23D52B92'/%3e%3cpath%20d='M23.5082%208.8079C24.0518%209.07714%2024.6836%209.21226%2025.4036%209.21226C26.1236%209.21226%2026.7544%209.07714%2027.2992%208.8079C27.8427%208.53863%2028.263%208.15581%2028.5588%207.65942C28.8546%207.16302%2029.0025%206.58731%2029.0025%205.93133C29.0025%205.27533%2028.8546%204.69963%2028.5588%204.20324C28.263%203.70682%2027.8427%203.32499%2027.2992%203.05475C26.7554%202.78551%2026.1236%202.65039%2025.4036%202.65039C24.6836%202.65039%2024.0518%202.78551%2023.5082%203.05475C22.9645%203.324%2022.5444%203.70682%2022.2484%204.20324C21.9526%204.69963%2021.8047%205.27533%2021.8047%205.93133C21.8047%206.58731%2021.9526%207.16302%2022.2484%207.65942C22.5444%208.15581%2022.9637%208.53766%2023.5082%208.8079ZM25.8719%206.97112C25.7387%207.05532%2025.583%207.09742%2025.4036%207.09742C25.2244%207.09742%2025.0676%207.05532%2024.9354%206.97112C24.8023%206.88789%2024.7014%206.76354%2024.6318%206.59907C24.5622%206.43555%2024.527%206.23877%2024.527%206.01062C24.527%205.78249%2024.5622%205.58571%2024.6318%205.42219C24.7022%205.25869%2024.8031%205.13434%2024.9354%205.05014C25.0676%204.96691%2025.2244%204.92385%2025.4036%204.92385C25.583%204.92385%2025.7387%204.96594%2025.8719%205.05014C26.0041%205.13434%2026.106%205.25772%2026.1756%205.42219C26.245%205.58668%2026.2804%205.78249%2026.2804%206.01062C26.2804%206.23877%2026.245%206.43555%2026.1756%206.59907C26.105%206.76354%2026.0041%206.88692%2025.8719%206.97112Z'%20fill='%23D52B92'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_5501_9441'%3e%3crect%20width='29'%20height='12.4286'%20fill='white'%20transform='translate(0%200.785156)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='140'%20height='60'%20viewBox='0%200%20140%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.1656%2028.8946C22.7842%2029.8017%2022.2378%2030.4854%2021.5197%2030.9493C20.8016%2031.4166%2019.9563%2031.6434%2018.9874%2031.6434C18.0184%2031.6434%2017.1732%2031.4132%2016.4516%2030.9493C15.7369%2030.4854%2015.1872%2029.7982%2014.8058%2028.8946C14.4278%2027.9875%2014.2354%2026.8983%2014.2354%2025.6338C14.2354%2024.3694%2014.4244%2023.2836%2014.8058%2022.3731C15.1872%2021.466%2015.7369%2020.7822%2016.4516%2020.3183C17.1697%2019.8545%2018.0116%2019.6208%2018.9874%2019.6208C19.9632%2019.6208%2020.8016%2019.8545%2021.5197%2020.3183C22.2344%2020.7822%2022.7842%2021.4694%2023.1656%2022.3731C23.5435%2023.2836%2023.7359%2024.3694%2023.7359%2025.6338C23.7359%2026.8983%2023.547%2027.9875%2023.1656%2028.8946ZM62.0131%2026.2214C62.0131%2027.3965%2061.7416%2028.3105%2061.2022%2028.9702C60.6593%2029.6264%2059.9206%2029.9563%2058.9825%2029.9563C58.5565%2029.9563%2058.1751%2029.8876%2057.8246%2029.7673C57.8589%2029.2038%2057.8796%202.07324%2057.8796%202.07324H42.1152L42.1392%2027.4927C42.1392%2028.6644%2041.8678%2029.5852%2041.3283%2030.2415C40.7854%2030.8978%2040.0467%2031.2276%2039.1052%2031.2276C38.7032%2031.2276%2038.3355%2031.1623%2038.0023%2031.0558L37.9748%2031.0386V25.6338C37.9748%2022.0913%2037.1914%2018.9783%2035.6314%2016.2982C34.0715%2013.6182%2031.8552%2011.5497%2028.9862%2010.0963C26.1137%208.64285%2022.7842%207.91442%2018.9874%207.91442C15.1906%207.91442%2011.8542%208.64285%208.98516%2010.0963C6.11609%2011.5497%203.89987%2013.6182%202.33992%2016.2982C0.779974%2018.9783%200%2022.0913%200%2025.6338C0%2029.1763%200.779974%2032.2928%202.34336%2034.9694C3.90331%2037.6495%206.11953%2039.7145%208.9886%2041.1714C11.8577%2042.6248%2015.194%2043.3532%2018.9908%2043.3532C20.111%2043.3532%2021.1933%2043.2879%2022.231%2043.1608V43.6728C22.231%2045.3083%2020.9081%2046.6346%2019.2691%2046.6346H15.2078V58.8701H22.3375C33.0819%2058.8701%2037.9748%2053.4447%2037.9748%2043.5525V43.3498H38.0057H45.0942C49.6503%2043.3498%2053.612%2040.8037%2055.629%2037.0516L56.1478%2036.5225C57.2027%2038.4123%2058.5668%2039.9413%2060.2538%2041.0923C62.4632%2042.5973%2065.0024%2043.3498%2067.868%2043.3498C70.0293%2043.3498%2071.8882%2042.8447%2073.4378%2041.8345C74.9874%2040.8243%2076.1763%2039.3675%2076.9975%2037.4639C77.8187%2035.5604%2078.231%2033.2926%2078.231%2030.6607V14.1714H62.0165V26.2214H62.0131Z'%20fill='%23D52B92'/%3e%3cpath%20d='M125.191%2028.8145C124.81%2029.725%20124.263%2030.4088%20123.545%2030.8726C122.827%2031.3365%20121.982%2031.5667%20121.013%2031.5667C120.044%2031.5667%20119.198%2031.3365%20118.48%2030.8726C117.762%2030.4088%20117.212%2029.7216%20116.831%2028.8145C116.453%2027.9074%20116.261%2026.8216%20116.261%2025.5571C116.261%2024.2927%20116.453%2023.2069%20116.831%2022.2998C117.212%2021.3927%20117.759%2020.7055%20118.48%2020.2451C119.195%2019.7812%20120.04%2019.5476%20121.013%2019.5476C121.985%2019.5476%20122.827%2019.7812%20123.545%2020.2451C124.26%2020.709%20124.81%2021.3962%20125.191%2022.2998C125.569%2023.2104%20125.761%2024.2927%20125.761%2025.5571C125.761%2026.8216%20125.572%2027.9108%20125.191%2028.8145ZM137.66%2016.2181C136.097%2013.5415%20133.884%2011.473%20131.015%2010.0162C128.146%208.5593%20124.813%207.83087%20121.016%207.83087C117.219%207.83087%20113.883%208.5593%20111.014%2010.0162C108.145%2011.4696%20105.932%2013.5381%20104.369%2016.2181C102.805%2018.8982%20102.025%2022.0112%20102.025%2025.5537C102.025%2027.4676%20102.256%2029.2543%20102.713%2030.9173H101.094C99.4449%2030.9173%2098.1117%2029.5807%2098.1117%2027.9348V2H82.3679V27.9589C82.3679%2037.8511%2087.2608%2043.2765%2098.0052%2043.2765H107.485L107.533%2038.741C108.564%2039.6481%20109.719%2040.4384%20111.014%2041.0947C113.883%2042.5515%20117.219%2043.2765%20121.016%2043.2765C124.813%2043.2765%20128.146%2042.5481%20131.015%2041.0947C133.884%2039.6378%20136.1%2037.5728%20137.66%2034.8927C139.22%2032.2161%20140%2029.1031%20140%2025.5571C140%2022.0112%20139.22%2018.9016%20137.66%2016.2216'%20fill='%23D52B92'/%3e%3cpath%20d='M61.2086%2046.7405C58.2949%2046.7405%2055.9343%2049.101%2055.9343%2052.0147C55.9343%2054.9284%2058.2949%2057.289%2061.2086%2057.289C64.1223%2057.289%2066.4829%2054.9284%2066.4829%2052.0147C66.4829%2049.101%2064.1223%2046.7405%2061.2086%2046.7405Z'%20fill='%23D52B92'/%3e%3cpath%20d='M72.9519%2046.7405C70.0382%2046.7405%2067.6776%2049.101%2067.6776%2052.0147C67.6776%2054.9284%2070.0382%2057.289%2072.9519%2057.289C75.8656%2057.289%2078.2262%2054.9284%2078.2262%2052.0147C78.2262%2049.101%2075.8656%2046.7405%2072.9519%2046.7405Z'%20fill='%23D52B92'/%3e%3c/svg%3e\"","import { useEffect, useState } from 'react';\r\n\r\nexport function useAsyncMemo<T>(\r\n fn: (() => Promise<T>) | null,\r\n deps: unknown[] = [],\r\n): [T | null, boolean] {\r\n const [value, setValue] = useState<T | null>(null);\r\n const [isLoading, setIsLoading] = useState<boolean>(true);\r\n\r\n useEffect(() => {\r\n if (!fn) return;\r\n let isMounted = true;\r\n setIsLoading(true);\r\n fn?.()\r\n .then((result) => {\r\n if (isMounted) setValue(result);\r\n })\r\n .finally(() => {\r\n if (isMounted) setIsLoading(false);\r\n });\r\n\r\n return () => {\r\n isMounted = false;\r\n };\r\n }, deps);\r\n\r\n return [value, isLoading];\r\n}\r\n","export const parsePriceToNumber = (priceString: string): number => {\r\n if (!priceString) return 0;\r\n\r\n const cleanedPrice = priceString.replaceAll(',', '');\r\n const parsedPrice = Number(cleanedPrice);\r\n\r\n return Number.isNaN(parsedPrice) ? 0 : parsedPrice;\r\n};\r\n","import { getDiscounts } from '@/utils/helpers/productDiscounts';\r\nimport type { TDiscount, TPrice } from '@/types/products';\r\nimport { Card } from '../Card/Card';\r\nimport { Image } from '../Image/Image';\r\nimport { DiscountChip } from './DiscountChip';\r\nimport { CouponBadge } from './CouponBadge';\r\nimport { PriceDisplay } from './PriceDisplay';\r\nimport styles from './ProductsCarousel.module.css';\r\nimport { ProductTitle } from './ProductTitle';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { getInstallmentInfoPLP } from 'mylo-online-checkout-sdk';\r\nimport myloENIcon from '@/assets/mylo-en.svg';\r\nimport myloARIcon from '@/assets/mylo.svg';\r\nimport { useAsyncMemo } from '@/hooks/use-async-memo';\r\nimport { type TMyloGetInstallmentInfoPLP } from '@/types/tenures';\r\nimport { parsePriceToNumber } from '@/utils/helpers/price-utils';\r\nimport Skeleton from '../Carousel/AdSkeleton';\r\nimport { getTranslation } from '@/utils/helpers/translate';\r\n\r\nconst MYLO_MINIMUM_PRICE_THRESHOLD = 500;\r\n\r\ntype TProductCardProps = {\r\n id: string;\r\n title: string;\r\n brand: string;\r\n image: string;\r\n price: TPrice;\r\n discounts: TDiscount[];\r\n language: TLanguage;\r\n className?: string;\r\n};\r\n\r\nexport function ProductCard({\r\n id,\r\n title,\r\n brand,\r\n image,\r\n price,\r\n discounts = [],\r\n language,\r\n className,\r\n}: Readonly<TProductCardProps>) {\r\n const { promotion, coupon } = getDiscounts(discounts, price.currency);\r\n const translate = getTranslation(language);\r\n\r\n const [myloInstallmentInfo, isMyloInstallmentInfoLoading] =\r\n useAsyncMemo<TMyloGetInstallmentInfoPLP | null>(\r\n () => getInstallmentInfoPLP(Number(price.final.replaceAll(',', ''))),\r\n [price.final],\r\n );\r\n\r\n const installmentText = `${translate.mylo.from} ${myloInstallmentInfo?.amount ?? '0'}${translate.mylo.perMonth}`;\r\n\r\n return (\r\n <Card key={id} className={`${styles.card} ${className}`}>\r\n <header className={styles.header}>\r\n <div className={styles.imageContainer}>\r\n <Image className={styles.image} src={image} alt={title} />\r\n </div>\r\n\r\n <div className={styles.topControls}>\r\n <DiscountChip\r\n language={language}\r\n coupon={coupon}\r\n promotionValue={promotion?.value}\r\n isPriceDropped={price.is_price_dropped}\r\n />\r\n </div>\r\n </header>\r\n\r\n <footer className={styles.footer}>\r\n <div className={styles.priceSection}>\r\n <PriceDisplay price={price} discounts={discounts} />\r\n </div>\r\n {isMyloInstallmentInfoLoading ? (\r\n <Skeleton className={styles.myloSkeleton} />\r\n ) : (\r\n parsePriceToNumber(price.final) >= MYLO_MINIMUM_PRICE_THRESHOLD && (\r\n <div className={styles.myloContainer}>\r\n <p className={styles.myloText}>{installmentText}</p>\r\n <Image\r\n className={styles.myloIcon}\r\n src={language === 'en' ? myloENIcon : myloARIcon}\r\n alt=\"mylo\"\r\n />\r\n </div>\r\n )\r\n )}\r\n <h4 className={styles.brand}>{brand}</h4>\r\n\r\n <ProductTitle title={title} />\r\n\r\n {coupon && <CouponBadge value={coupon.value} language={language} />}\r\n </footer>\r\n </Card>\r\n );\r\n}\r\n","import {\r\n AdCarousel,\r\n AdCarouselContent,\r\n AdCarouselItem,\r\n AdCarouselNext,\r\n AdCarouselPrevious,\r\n AdCarouselPagination,\r\n AdCarouselApi,\r\n} from '../Carousel/AdCarousel';\r\nimport { useState, useEffect } from 'react';\r\nimport { ProductCard } from '../ProductsCarousel/ProductCard';\r\nimport styles from './ProductsCarousel.module.css';\r\nimport { TCollectionItem } from '@/types/products';\r\nimport { TLanguage } from '@/types/types';\r\n\r\ntype ProductsCarouselProps = {\r\n products: TCollectionItem[];\r\n onProductClick: (product: TCollectionItem, index: number) => void;\r\n slidesToScroll?: number;\r\n language: TLanguage;\r\n};\r\n\r\nexport function ProductsCarousel({\r\n slidesToScroll,\r\n products,\r\n onProductClick,\r\n language,\r\n}: Readonly<ProductsCarouselProps>) {\r\n const [api, setApi] = useState<AdCarouselApi>();\r\n const [current, setCurrent] = useState(0);\r\n const [count, setCount] = useState(0);\r\n const [canScrollPrev, setCanScrollPrev] = useState(false);\r\n const [canScrollNext, setCanScrollNext] = useState(false);\r\n\r\n useEffect(() => {\r\n if (!api) {\r\n return;\r\n }\r\n\r\n const updateCarouselState = () => {\r\n setCount(api.scrollSnapList().length);\r\n setCurrent(api.selectedScrollSnap());\r\n setCanScrollPrev(api.canScrollPrev());\r\n setCanScrollNext(api.canScrollNext());\r\n };\r\n\r\n updateCarouselState();\r\n\r\n api.on('select', updateCarouselState);\r\n\r\n api.on('reInit', updateCarouselState);\r\n\r\n return () => {\r\n api.off('select', updateCarouselState);\r\n api.off('reInit', updateCarouselState);\r\n };\r\n }, [api]);\r\n\r\n return (\r\n <div className={styles.container}>\r\n <AdCarousel\r\n opts={{\r\n align: 'start',\r\n slidesToScroll: slidesToScroll ?? 1,\r\n direction: language === 'ar' ? 'rtl' : 'ltr',\r\n }}\r\n setApi={setApi}\r\n className={styles.carousel}\r\n >\r\n <AdCarouselContent className={styles.carouselContent}>\r\n {products.map((product, index) => (\r\n <AdCarouselItem\r\n key={`${product.offering_id}-${index}`}\r\n className={styles.carouselItem}\r\n onClick={() => onProductClick(product, index)}\r\n >\r\n <ProductCard\r\n id={product.offering_id}\r\n brand={product.brand}\r\n image={product.formatted_main_image}\r\n price={product.price}\r\n title={product.title}\r\n discounts={product.discounts}\r\n language={language}\r\n />\r\n </AdCarouselItem>\r\n ))}\r\n </AdCarouselContent>\r\n\r\n {canScrollPrev && (\r\n <AdCarouselPrevious\r\n className={styles.navButtonPrev}\r\n iconClassName={styles.navButtonPrevIcon}\r\n />\r\n )}\r\n {canScrollNext && (\r\n <AdCarouselNext\r\n className={styles.navButtonNext}\r\n iconClassName={styles.navButtonNextIcon}\r\n />\r\n )}\r\n </AdCarousel>\r\n\r\n <AdCarouselPagination\r\n slidesCount={count}\r\n currentIndex={current}\r\n onClick={(index) => api?.scrollTo(index)}\r\n showProgress={false}\r\n containerClassName={styles.paginationContainer}\r\n buttonClassName={styles.paginationButton}\r\n dotClassName={styles.paginationDot}\r\n activeDotClassName={styles.paginationActiveDot}\r\n />\r\n </div>\r\n );\r\n}\r\n","import { LinkDestination } from '@/types/ads';\r\nimport { TCollectionItem } from '@/types/products';\r\n\r\nexport const mapProductToLinkDestination = (\r\n product: TCollectionItem,\r\n): LinkDestination => {\r\n return {\r\n type: 'single product',\r\n val: [product.offering_id],\r\n filters: [\r\n {\r\n key: 'slug',\r\n value: [product.slug],\r\n },\r\n ],\r\n };\r\n};\r\n","import { generateAccessToken } from '@/utils/helpers/authToken';\r\nimport { getBaseUrl } from '@/utils/helpers/getBaseUrl';\r\nimport {\r\n type TCollectionData,\r\n type TCollectionResponse,\r\n} from '@/types/products';\r\nimport { type TGetCollectionProps } from '../queries/useGetCollection';\r\n\r\nexport const getCollection = async ({\r\n language,\r\n collectionId,\r\n environment,\r\n adServerApiKey,\r\n}: TGetCollectionProps): Promise<TCollectionData | null> => {\r\n const [token, timestamp] = await generateAccessToken(adServerApiKey);\r\n const adServerBaseUrl = getBaseUrl('adServer', environment);\r\n\r\n try {\r\n const res = await fetch(\r\n `${adServerBaseUrl}/api/v2/brandshop/server/collection/${collectionId}`,\r\n {\r\n headers: {\r\n lang: language,\r\n device: 'web',\r\n 'auth-token': token,\r\n 'auth-timestamp': timestamp,\r\n 'accept-language': language,\r\n },\r\n },\r\n );\r\n\r\n const collectionResponse: TCollectionResponse = await res.json();\r\n return collectionResponse.data;\r\n } catch (error) {\r\n throw new Error(`Failed to fetch collection data - ${error}`);\r\n }\r\n};\r\n","import { useQuery } from '@tanstack/react-query';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { type TEnvironment } from '@/types/configTypes';\r\nimport { getCollection } from '../services/getCollection';\r\n\r\nexport type TGetCollectionProps = {\r\n language: TLanguage;\r\n environment: TEnvironment;\r\n collectionId: string;\r\n adServerApiKey: string;\r\n};\r\nexport const GET_COLLECTION_QUERY_KEY = 'collection';\r\n\r\nexport const useGetCollectionQuery = ({\r\n language,\r\n collectionId,\r\n environment,\r\n adServerApiKey,\r\n}: TGetCollectionProps) => {\r\n const collectionQueryKey = [GET_COLLECTION_QUERY_KEY, collectionId, language];\r\n\r\n return useQuery({\r\n queryKey: collectionQueryKey,\r\n queryFn: () =>\r\n getCollection({\r\n language,\r\n collectionId,\r\n environment,\r\n adServerApiKey,\r\n }),\r\n });\r\n};\r\n","import Skeleton from '../Carousel/AdSkeleton';\r\nimport styles from './ProductCardSkeleton.module.css';\r\n\r\ntype TProductCardSkeletonProps = {\r\n className?: string;\r\n};\r\n\r\nexport const ProductCardSkeleton = (props: TProductCardSkeletonProps) => {\r\n const { className } = props;\r\n\r\n return (\r\n <div className={`${styles.card} ${className || ''}`}>\r\n <Skeleton className={styles.imageSkeleton} />\r\n <Skeleton className={styles.titleSkeleton} />\r\n <Skeleton className={styles.descriptionSkeleton} />\r\n <Skeleton className={styles.priceSkeleton} />\r\n <Skeleton className={styles.buttonSkeleton} />\r\n </div>\r\n );\r\n};\r\n","import Skeleton from '../Carousel/AdSkeleton';\r\nimport { ProductCardSkeleton } from './ProductCardSkeleton';\r\nimport styles from './ProductSliderSkeleton.module.css';\r\n\r\ntype TProductSliderSkeletonProps = {\r\n length?: number;\r\n};\r\n\r\nexport const ProductSliderSkeleton = (props: TProductSliderSkeletonProps) => {\r\n const { length } = props;\r\n const skeletonLength = length ?? 5;\r\n\r\n return (\r\n <div className={styles.container}>\r\n <div className={styles.header}>\r\n <Skeleton className={styles.titleSkeleton} />\r\n </div>\r\n <div className={styles.carouselWrapper}>\r\n <div className={styles.carouselContainer}>\r\n {Array.from({ length: skeletonLength }, (_, index) => (\r\n <div key={index} className={styles.cardWrapper}>\r\n <ProductCardSkeleton />\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n","import { ProductsCarousel } from '../ProductsCarousel/ProductsCarousel';\r\nimport { TCollectionItem } from '@/types/products';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport { TEnvironment, TTrackEvents } from '@/types/configTypes';\r\nimport { buildLinkDestination } from '@/utils/helpers/ads';\r\nimport { TLinkClickEvent } from '@/types/ads';\r\nimport { mapProductToLinkDestination } from '@/utils/helpers/products';\r\nimport { type TLanguage } from '@/types/types';\r\nimport styles from './Brandshop.module.css';\r\nimport { type TBrandshopCollection } from '@/types/brandshop';\r\nimport { useGetCollectionQuery } from '@/api/queries/useGetCollection';\r\nimport { ProductSliderSkeleton } from '../ProductsCarousel/ProductSliderSkeleton';\r\n\r\ntype ProductSliderSectionProps = {\r\n products: TBrandshopCollection;\r\n title: string;\r\n hideTitle: boolean;\r\n isLoggedin: boolean;\r\n language: TLanguage;\r\n environment: TEnvironment;\r\n adServerApiKey: string;\r\n trackBrandshopHandler?: TTrackEvents;\r\n onProductClick: (data: TLinkClickEvent) => void;\r\n};\r\n\r\nexport function ProductSliderSection({\r\n products,\r\n title,\r\n hideTitle,\r\n isLoggedin,\r\n language,\r\n environment,\r\n adServerApiKey,\r\n trackBrandshopHandler,\r\n onProductClick,\r\n}: Readonly<ProductSliderSectionProps>) {\r\n const { data, isLoading, error } = useGetCollectionQuery({\r\n language,\r\n collectionId: products.collection_id ?? '',\r\n environment,\r\n adServerApiKey,\r\n });\r\n const handleLinkClick = (productItem: TCollectionItem, index: number) => {\r\n trackBrandshopEvent(\r\n 'ads_bs_content_click',\r\n {\r\n contentName: productItem.title,\r\n contentOrder: (index + 1).toString(),\r\n userStatus: isLoggedin ? 'logged_in' : 'guest',\r\n platform: 'Web',\r\n },\r\n trackBrandshopHandler,\r\n );\r\n\r\n // Map product to LinkDestination and build the payload\r\n const linkDestination = mapProductToLinkDestination(productItem);\r\n const payload = buildLinkDestination(linkDestination);\r\n\r\n if (!payload) return;\r\n onProductClick(payload);\r\n };\r\n\r\n if (isLoading) return <ProductSliderSkeleton />;\r\n\r\n if (error || !data) return null;\r\n\r\n return (\r\n <div className={styles.sectionContainer}>\r\n {!hideTitle && <h2 className={styles.sectionTitle}>{title}</h2>}\r\n <ProductsCarousel\r\n products={data.items}\r\n onProductClick={(product, index) => handleLinkClick(product, index)}\r\n language={language}\r\n />\r\n </div>\r\n );\r\n}\r\n","import { TBrandshopSection } from '@/types/brandshop';\r\nimport { BannerSection } from './BannerSection';\r\nimport { CategorySection } from './CategorySection';\r\nimport { NavigationSection } from './NavigationSection';\r\nimport { type TLinkClickEvent } from '@/types/ads';\r\nimport { type TEnvironment, type TTrackEvents } from '@/types/configTypes';\r\nimport { useInView } from 'react-intersection-observer';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport { ProductSliderSection } from './ProductSliderSection';\r\nimport { TLanguage } from '@/types/types';\r\n\r\ntype BrandshopSectionProps = {\r\n section: TBrandshopSection;\r\n isLoggedin: boolean;\r\n brandName: string;\r\n language: TLanguage;\r\n environment: TEnvironment;\r\n adServerApiKey: string;\r\n brandshopName?: string;\r\n onLinkClick: (data: TLinkClickEvent) => void;\r\n trackBrandshopHandler?: TTrackEvents;\r\n};\r\n\r\nexport const BrandshopSection = ({\r\n section,\r\n onLinkClick,\r\n trackBrandshopHandler,\r\n isLoggedin,\r\n brandName,\r\n language,\r\n environment,\r\n adServerApiKey,\r\n brandshopName,\r\n}: BrandshopSectionProps) => {\r\n const {\r\n section_type,\r\n section_title,\r\n show_section_title,\r\n data,\r\n section_display_order,\r\n } = section;\r\n\r\n const { ref } = useInView({\r\n onChange: (inView) => {\r\n if (inView) {\r\n trackBrandshopEvent(\r\n 'ads_bs_section_view',\r\n {\r\n brandName,\r\n sectionName: section_title,\r\n sectionOrder: section_display_order.toString(),\r\n userStatus: isLoggedin ? 'logged_in' : 'guest',\r\n platform: 'Web',\r\n },\r\n trackBrandshopHandler,\r\n );\r\n }\r\n },\r\n });\r\n\r\n return (\r\n <div ref={ref} style={{ width: '100%' }}>\r\n {(() => {\r\n switch (section_type) {\r\n case 'nav':\r\n return (\r\n <NavigationSection\r\n title={section_title}\r\n hideTitle={!show_section_title}\r\n logo={data[0].logo ?? ''}\r\n navigationLinks={data[0].navigation_links ?? []}\r\n onLinkClick={onLinkClick}\r\n isLoggedin={isLoggedin}\r\n trackBrandshopHandler={trackBrandshopHandler}\r\n brandshopName={brandshopName}\r\n />\r\n );\r\n\r\n case 'category':\r\n return (\r\n <CategorySection\r\n title={section_title}\r\n hideTitle={!show_section_title}\r\n categories={data}\r\n onCategoryClick={onLinkClick}\r\n isLoggedin={isLoggedin}\r\n trackBrandshopHandler={trackBrandshopHandler}\r\n />\r\n );\r\n\r\n case 'banner':\r\n return (\r\n <BannerSection\r\n title={section_title}\r\n banners={data}\r\n hideTitle={!show_section_title}\r\n onBannerClick={onLinkClick}\r\n isLoggedin={isLoggedin}\r\n sectionTitle={section_title}\r\n trackBrandshopHandler={trackBrandshopHandler}\r\n />\r\n );\r\n case 'productSlider':\r\n return (\r\n <ProductSliderSection\r\n products={data[0]}\r\n title={section_title}\r\n hideTitle={!show_section_title}\r\n isLoggedin={isLoggedin}\r\n trackBrandshopHandler={trackBrandshopHandler}\r\n onProductClick={onLinkClick}\r\n language={language}\r\n environment={environment}\r\n adServerApiKey={adServerApiKey}\r\n />\r\n );\r\n\r\n default:\r\n return null;\r\n }\r\n })()}\r\n </div>\r\n );\r\n};\r\n","export const debounce = <T extends unknown[]>(\r\n callback: (...args: T) => void,\r\n delay: number,\r\n): ((...args: T) => void) => {\r\n let timeoutId: ReturnType<typeof setTimeout>;\r\n\r\n return (...args: T) => {\r\n clearTimeout(timeoutId);\r\n timeoutId = setTimeout(() => {\r\n callback(...args);\r\n }, delay);\r\n };\r\n};\r\n","import { debounce } from '@/utils/helpers/utilities';\r\nimport { useEffect, useState } from 'react';\r\n\r\n/**\r\n * Hook to detect if the user has scrolled to (or near) the bottom of the page.\r\n * @param offset distance in pixels from the bottom to trigger earlier (default: 5px)\r\n */\r\nexport function useDetectScrolledToBottom(offset: number = 5): boolean {\r\n const [isBottom, setIsBottom] = useState(false);\r\n\r\n useEffect(() => {\r\n const handleScroll = () => {\r\n const scrollTop = window.scrollY || document.documentElement.scrollTop;\r\n const windowHeight = window.innerHeight;\r\n const fullHeight = document.documentElement.scrollHeight;\r\n\r\n const reachedBottom = scrollTop + windowHeight >= fullHeight - offset;\r\n setIsBottom(reachedBottom);\r\n };\r\n\r\n const debouncedScroll = debounce(handleScroll, 100);\r\n\r\n window.addEventListener('scroll', debouncedScroll, { passive: true });\r\n debouncedScroll();\r\n\r\n return () => {\r\n window.removeEventListener('scroll', debouncedScroll);\r\n };\r\n }, [offset]);\r\n\r\n return isBottom;\r\n}\r\n","import Skeleton from '../Carousel/AdSkeleton';\r\nimport styles from './Brandshop.module.css';\r\n\r\nexport function BrandshopSkeleton() {\r\n const NAVIGATION_ITEMS_COUNT = 3;\r\n const CATEGORY_ITEMS_COUNT = 2;\r\n\r\n return (\r\n <div className={styles.brandshopContainerSkeleton}>\r\n <Skeleton className={styles.bannerSkeleton} />\r\n\r\n <div className={styles.navContainerSkeleton}>\r\n {Array.from({ length: NAVIGATION_ITEMS_COUNT }).map((_, index) => (\r\n <Skeleton key={index} className={styles.navPillSkeleton} />\r\n ))}\r\n </div>\r\n\r\n <div\r\n className={styles.categoryGridSkeleton}\r\n style={{\r\n gridTemplateColumns: `repeat(${Math.min(CATEGORY_ITEMS_COUNT, 2)}, 1fr)`,\r\n }}\r\n >\r\n {Array.from({ length: CATEGORY_ITEMS_COUNT }).map((_, index) => (\r\n <Skeleton key={index} className={styles.categoryTileSkeleton} />\r\n ))}\r\n </div>\r\n\r\n <Skeleton className={styles.promoSkeleton} />\r\n </div>\r\n );\r\n}\r\n","import { useEffect } from 'react';\r\nimport { useGetBrandshopQuery } from '@/api/queries/useGetBrandshop';\r\nimport { useIsPlatform } from '@/hooks/use-is-platform';\r\nimport { AdsDeviceType } from '@/types/ads';\r\nimport { type TBrandshopProps } from './Brandshop';\r\nimport { BrandshopSection } from './BrandshopSection';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport { useDetectScrolledToBottom } from '@/hooks/useDetectScrolledToBottom';\r\nimport { BrandshopSkeleton } from './BrandshopSkeleton';\r\nimport styles from './Brandshop.module.css';\r\n\r\nexport function BrandshopContent({\r\n language,\r\n brandshopId,\r\n environment,\r\n adServerApiKey,\r\n isLoggedin,\r\n brandshop,\r\n onLinkClick,\r\n trackBrandshopHandler,\r\n}: Readonly<TBrandshopProps>) {\r\n const { isLaptop, isDesktop } = useIsPlatform();\r\n const deviceType =\r\n isLaptop || isDesktop ? AdsDeviceType.Web : AdsDeviceType.Mobile;\r\n\r\n let data = brandshop;\r\n\r\n const {\r\n data: brandshopData,\r\n isLoading,\r\n error,\r\n } = useGetBrandshopQuery({\r\n language,\r\n brandshopId,\r\n environment,\r\n adServerApiKey,\r\n deviceType,\r\n enabled: !brandshop,\r\n });\r\n\r\n data ??= brandshopData;\r\n\r\n const isBottomReached = useDetectScrolledToBottom();\r\n\r\n const brandName = data?.name || '';\r\n const userStatus = isLoggedin ? 'logged_in' : 'guest';\r\n const platform = 'Web';\r\n\r\n useEffect(() => {\r\n window.scrollTo(0, 0);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (!data) return;\r\n trackBrandshopEvent(\r\n 'ads_bs_pageload',\r\n { brandName, userStatus, platform },\r\n trackBrandshopHandler,\r\n );\r\n }, [data]);\r\n\r\n useEffect(() => {\r\n if (!data || !isBottomReached) return;\r\n trackBrandshopEvent(\r\n 'ads_bs_pageend',\r\n { brandName, userStatus, platform },\r\n trackBrandshopHandler,\r\n );\r\n }, [isBottomReached]);\r\n\r\n if (isLoading) return <BrandshopSkeleton />;\r\n if (error) {\r\n throw new Error(\r\n `brandshop with id ${brandshopId} failed to load} - ${error?.message || 'unknown error'}`,\r\n );\r\n }\r\n\r\n const content = data?.content;\r\n if (!Array.isArray(content)) return null;\r\n\r\n const sortedSections = [...content].sort(\r\n (a, b) => a.section_display_order - b.section_display_order,\r\n );\r\n\r\n return (\r\n <div className={styles.brandshopContent}>\r\n {sortedSections.map((section) => (\r\n <BrandshopSection\r\n key={section.tracking_id}\r\n section={section}\r\n onLinkClick={onLinkClick}\r\n isLoggedin={isLoggedin}\r\n brandName={brandName}\r\n trackBrandshopHandler={trackBrandshopHandler}\r\n language={language}\r\n environment={environment}\r\n adServerApiKey={adServerApiKey}\r\n brandshopName={data?.name}\r\n />\r\n ))}\r\n </div>\r\n );\r\n}\r\n","export default \"data:image/svg+xml,%3csvg%20width='49'%20height='48'%20viewBox='0%200%2049%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M24.4941%2020.0311V24.0242M24.5%2030H24.52M22.7708%206.98426L6.27321%2034.9912C5.4892%2036.3221%206.45019%2038%207.9965%2038H40.9918C42.5381%2038%2043.4991%2036.3221%2042.7151%2034.9912L26.2174%206.98426C25.4444%205.67192%2023.5439%205.67191%2022.7708%206.98426ZM25%2030C25%2030.2761%2024.7761%2030.5%2024.5%2030.5C24.2239%2030.5%2024%2030.2761%2024%2030C24%2029.7239%2024.2239%2029.5%2024.5%2029.5C24.7761%2029.5%2025%2029.7239%2025%2030Z'%20stroke='%23DA1E28'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e\"","import errorIcon from '@/assets/error.svg';\r\nimport styles from './Brandshop.module.css';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { Image } from '../Image/Image';\r\n\r\nfunction BrandshopError({ language }: Readonly<{ language: TLanguage }>) {\r\n const isArabic = language === 'ar';\r\n\r\n const heading = isArabic ? 'حدث خطأ ما' : 'Something went wrong';\r\n const description = isArabic\r\n ? 'نواجه مشكلة في تحميل هذه الصفحة. يرجى الانتظار قليلاً؛ سيتم حلها قريباً.'\r\n : \"We're having trouble loading this page. Please bear with us; it should be resolved shortly.\";\r\n const buttonLabel = isArabic ? 'إعادة المحاولة' : 'Try again';\r\n\r\n return (\r\n <div className={styles.brandshopError}>\r\n <Image src={errorIcon} className={styles.errorIcon} alt=\"error\" />\r\n <div className={styles.errorContent}>\r\n <div className={styles.errorText}>\r\n <h2>{heading}</h2>\r\n <p>{description}</p>\r\n </div>\r\n <button\r\n className={styles.errorButton}\r\n onClick={() => window.location.reload()}\r\n >\r\n {buttonLabel}\r\n </button>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default BrandshopError;\r\n","import { Component, ErrorInfo, ReactNode } from 'react';\r\n\r\ninterface ErrorBoundaryProps {\r\n children: ReactNode;\r\n fallback: ReactNode;\r\n}\r\n\r\ninterface ErrorBoundaryState {\r\n hasError: boolean;\r\n error: Error | null;\r\n errorInfo: ErrorInfo | null;\r\n}\r\n\r\nclass ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\r\n constructor(props: ErrorBoundaryProps) {\r\n super(props);\r\n this.state = { hasError: false, error: null, errorInfo: null };\r\n }\r\n\r\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\r\n return { hasError: true, error: error, errorInfo: null };\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\r\n this.setState({ error, errorInfo });\r\n }\r\n\r\n render(): ReactNode {\r\n if (this.state.hasError) {\r\n return this.props.fallback;\r\n }\r\n\r\n return this.props.children;\r\n }\r\n}\r\n\r\nexport default ErrorBoundary;\r\n","import { type TLanguage } from '@/types/types';\r\nimport { type TTrackEvents, type TEnvironment } from '@/types/configTypes';\r\nimport { ReactQueryProvider } from '@/providers/ReactQueryProvider';\r\nimport { BrandshopContent } from './BrandshopContent';\r\nimport { type TLinkClickEvent } from '@/types/ads';\r\nimport BrandshopError from './BrandshopError';\r\nimport ErrorBoundary from '../ErrorBoundary/ErrorBoundary';\r\nimport { type TBrandshopData } from '@/types/brandshop';\r\n\r\nexport type TBrandshopProps = {\r\n language: TLanguage;\r\n brandshopId: string;\r\n environment: TEnvironment;\r\n adServerApiKey: string;\r\n isLoggedin: boolean;\r\n brandshop?: TBrandshopData;\r\n onLinkClick: (event: TLinkClickEvent) => void;\r\n trackBrandshopHandler?: TTrackEvents;\r\n};\r\n\r\nexport default function Brandshop(props: Readonly<TBrandshopProps>) {\r\n return (\r\n <ReactQueryProvider>\r\n <ErrorBoundary fallback={<BrandshopError language={props.language} />}>\r\n <BrandshopContent {...props} />\r\n </ErrorBoundary>\r\n </ReactQueryProvider>\r\n );\r\n}\r\n"],"names":["getBrandshop","deviceType","language","brandshopId","environment","adServerApiKey","token","timestamp","generateAccessToken","adServerBaseUrl","getBaseUrl","error","GET_BRANDSHOP_QUERY_KEY","useGetBrandshopQuery","enabled","useQuery","BannerWithLink","image","text","alt","onClick","styles","jsx","Image","Banner","index","trackBrandshopEvent","eventName","props","trackEvent","brandName","userStatus","platform","sectionName","sectionOrder","contentName","contentOrder","BannerSection","title","hideTitle","banners","isLoggedin","sectionTitle","onBannerClick","trackBrandshopHandler","handleLinkClick","bannerItem","payload","buildLinkDestination","jsxs","banner","CategorySection","categories","onCategoryClick","categoryItem","limitedCategories","sortedCategories","a","b","gridColumns","category","NavigationSection","logo","navigationLinks","brandshopName","onLinkClick","navigationItem","sortedNavigationLinks","navigationLink","DiscountValueTypesEnum","DiscountTypesEnum","getDiscountValue","discount","currency","getDiscounts","discounts","acc","Card","children","className","Chip","getDiscountChipDetails","promotionValue","hasCoupon","isPriceDropped","saveLabelText","couponText","priceDropText","translations","getTranslation","variantStyles","DiscountChip","coupon","translate","discountChipDetails","tag","CouponBadge","value","PriceDisplay","price","promotion","hasDiscount","ProductTitle","t","i","r","o","e","s","n","l","myloENIcon","myloARIcon","useAsyncMemo","fn","deps","setValue","useState","isLoading","setIsLoading","useEffect","isMounted","result","parsePriceToNumber","priceString","cleanedPrice","parsedPrice","MYLO_MINIMUM_PRICE_THRESHOLD","ProductCard","id","brand","myloInstallmentInfo","isMyloInstallmentInfoLoading","getInstallmentInfoPLP","installmentText","Skeleton","ProductsCarousel","slidesToScroll","products","onProductClick","api","setApi","current","setCurrent","count","setCount","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","updateCarouselState","AdCarousel","AdCarouselContent","product","AdCarouselItem","AdCarouselPrevious","AdCarouselNext","AdCarouselPagination","mapProductToLinkDestination","getCollection","collectionId","GET_COLLECTION_QUERY_KEY","useGetCollectionQuery","ProductCardSkeleton","ProductSliderSkeleton","length","skeletonLength","_","ProductSliderSection","data","productItem","linkDestination","BrandshopSection","section","section_type","section_title","show_section_title","section_display_order","ref","useInView","inView","debounce","callback","delay","timeoutId","args","useDetectScrolledToBottom","offset","isBottom","setIsBottom","debouncedScroll","scrollTop","windowHeight","fullHeight","reachedBottom","BrandshopSkeleton","BrandshopContent","brandshop","isLaptop","isDesktop","useIsPlatform","AdsDeviceType","brandshopData","isBottomReached","content","sortedSections","errorIcon","BrandshopError","isArabic","heading","description","buttonLabel","ErrorBoundary","Component","errorInfo","Brandshop","ReactQueryProvider"],"mappings":";;;;;AAiBO,MAAMA,KAAe,OAAO;AAAA,EACjC,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACF,MAAmD;AACjD,QAAM,CAACC,GAAOC,CAAS,IAAI,MAAMC,EAAoBH,CAAc,GAC7DI,IAAkBC,EAAW,YAAYN,CAAW;AAE1D,MAAI;AAcF,YADiD,OAZrC,MAAM;AAAA,MAChB,GAAGK,CAAe,4BAA4BN,CAAW;AAAA,MACzD;AAAA,QACE,SAAS;AAAA,UACP,QAAQF;AAAA,UACR,MAAMC;AAAA,UACN,cAAcI;AAAA,UACd,kBAAkBC;AAAA,QAAA;AAAA,MACpB;AAAA,IACF,GAGyD,KAAA,GAClC;AAAA,EAC3B,SAASI,GAAO;AACd,UAAM,IAAI,MAAM,uCAAuCA,CAAK,EAAE;AAAA,EAChE;AACF,GChCaC,KAA0B,aAE1BC,KAAuB,CAAC;AAAA,EACnC,YAAAZ;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,SAAAS;AACF,MAQSC,EAAS;AAAA,EACd,UARwB;AAAA,IACxBH;AAAA,IACAT;AAAA,IACAF;AAAA,IACAC;AAAA,EAAA;AAAA,EAKA,SAAS,MACPF,GAAa;AAAA,IACX,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAAA,EACH,SAAAS;AAAA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GC/BUE,KAAiB,CAAC;AAAA,EAC7B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,KAAAC;AAAA,EACA,SAAAC;AACF,MACOH,sBAGF,UAAA,EAAO,MAAK,UAA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AAW5B,EAAO,cACrB,UAAA;AAAA,MAAA,gBAAA4B,EAAC,OAAA,EAAI,WAAW5B,EAAO,WACrB,UAAA;AAAA,QAAA,gBAAAC,EAAC,QAAI,UAAA2L,EAAA,CAAQ;AAAA,QACb,gBAAA3L,EAAC,OAAG,UAAA4L,EAAA,CAAY;AAAA,MAAA,GAClB;AAAA,MACA,gBAAA5L;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWD,EAAO;AAAA,UAClB,SAAS,MAAM,OAAO,SAAS,OAAA;AAAA,UAE9B,UAAA8L;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;AClBA,MAAMC,WAAsBC,EAAkD;AAAA,EAC5E,YAAYzL,GAA2B;AACrC,UAAMA,CAAK,GACX,KAAK,QAAQ,EAAE,UAAU,IAAO,OAAO,MAAM,WAAW,KAAA;AAAA,EAC1D;AAAA,EAEA,OAAO,yBAAyBjB,GAAkC;AAChE,WAAO,EAAE,UAAU,IAAM,OAAAA,GAAc,WAAW,KAAA;AAAA,EACpD;AAAA,EAEA,kBAAkBA,GAAc2M,GAA4B;AAC1D,SAAK,SAAS,EAAE,OAAA3M,GAAO,WAAA2M,EAAA,CAAW;AAAA,EACpC;AAAA,EAEA,SAAoB;AAClB,WAAI,KAAK,MAAM,WACN,KAAK,MAAM,WAGb,KAAK,MAAM;AAAA,EACpB;AACF;ACdA,SAAwBC,GAAU3L,GAAkC;AAClE,2BACG4L,GAAA,EACC,UAAA,gBAAAlM,EAAC8L,IAAA,EAAc,4BAAWL,IAAA,EAAe,UAAUnL,EAAM,SAAA,CAAU,GACjE,UAAA,gBAAAN,EAAC8K,IAAA,EAAkB,GAAGxK,EAAA,CAAO,GAC/B,GACF;AAEJ;","x_google_ignoreList":[19]}
|
|
1
|
+
{"version":3,"file":"Brandshop.js","sources":["../src/api/services/getBrandshop.ts","../src/api/queries/useGetBrandshop.ts","../src/components/Brandshop/BannerWithLink.tsx","../src/components/Brandshop/Banner.tsx","../src/utils/analytics/trackBrandshopEvents.ts","../src/components/Brandshop/BannerSection.tsx","../src/components/Brandshop/CategorySection.tsx","../src/components/Brandshop/NavigationSection.tsx","../src/types/products.ts","../src/utils/helpers/productDiscounts.ts","../src/components/Card/Card.tsx","../src/components/Chip/Chip.tsx","../src/utils/helpers/discountChip.ts","../src/utils/helpers/translate.ts","../src/components/ProductsCarousel/DiscountChip.tsx","../src/assets/tag.svg","../src/components/ProductsCarousel/CouponBadge.tsx","../src/components/ProductsCarousel/PriceDisplay.tsx","../src/components/ProductsCarousel/ProductTitle.tsx","../node_modules/mylo-online-checkout-sdk/dist/mylo-online-checkout-sdk.esm.js","../src/assets/mylo-en.svg","../src/assets/mylo.svg","../src/hooks/use-async-memo.ts","../src/utils/helpers/price-utils.ts","../src/components/ProductsCarousel/ProductCard.tsx","../src/components/ProductsCarousel/ProductsCarousel.tsx","../src/utils/helpers/products.ts","../src/api/services/getCollection.ts","../src/api/queries/useGetCollection.ts","../src/components/ProductsCarousel/ProductCardSkeleton.tsx","../src/components/ProductsCarousel/ProductSliderSkeleton.tsx","../src/components/Brandshop/ProductSliderSection.tsx","../src/components/Brandshop/BrandshopSection.tsx","../src/utils/helpers/utilities.ts","../src/hooks/useDetectScrolledToBottom.ts","../src/components/Brandshop/BrandshopSkeleton.tsx","../src/components/Brandshop/BrandshopContent.tsx","../src/assets/error.svg","../src/components/Brandshop/BrandshopError.tsx","../src/components/ErrorBoundary/ErrorBoundary.tsx","../src/components/Brandshop/Brandshop.tsx"],"sourcesContent":["import { generateAccessToken } from '@/utils/helpers/authToken';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { getBaseUrl } from '@/utils/helpers/getBaseUrl';\r\nimport { type TEnvironment } from '@/types/configTypes';\r\nimport {\r\n type TBrandshopApiResponse,\r\n type TBrandshopData,\r\n} from '@/types/brandshop';\r\n\r\ntype TGetBrandshopProps = {\r\n deviceType: string;\r\n language: TLanguage;\r\n environment: TEnvironment;\r\n brandshopId: string;\r\n adServerApiKey: string;\r\n};\r\n\r\nexport const getBrandshop = async ({\r\n deviceType,\r\n language,\r\n brandshopId,\r\n environment,\r\n adServerApiKey,\r\n}: TGetBrandshopProps): Promise<TBrandshopData> => {\r\n const [token, timestamp] = await generateAccessToken(adServerApiKey);\r\n const adServerBaseUrl = getBaseUrl('adServer', environment);\r\n\r\n try {\r\n const res = await fetch(\r\n `${adServerBaseUrl}/api/v2/brandshop/server/${brandshopId}`,\r\n {\r\n headers: {\r\n device: deviceType,\r\n lang: language,\r\n 'auth-token': token,\r\n 'auth-timestamp': timestamp,\r\n },\r\n },\r\n );\r\n\r\n const brandshopResponse: TBrandshopApiResponse = await res.json();\r\n return brandshopResponse.data;\r\n } catch (error) {\r\n throw new Error(`Failed to fetch brandshop details - ${error}`);\r\n }\r\n};\r\n","import { useQuery } from '@tanstack/react-query';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { type TEnvironment } from '@/types/configTypes';\r\nimport { getBrandshop } from '../services/getBrandshop';\r\n\r\ntype TGetBrandshopProps = {\r\n deviceType: string;\r\n language: TLanguage;\r\n brandshopId: string;\r\n environment: TEnvironment;\r\n adServerApiKey: string;\r\n enabled?: boolean;\r\n};\r\nexport const GET_BRANDSHOP_QUERY_KEY = 'brandshop';\r\n\r\nexport const useGetBrandshopQuery = ({\r\n deviceType,\r\n language,\r\n brandshopId,\r\n environment,\r\n adServerApiKey,\r\n enabled,\r\n}: TGetBrandshopProps) => {\r\n const brandshopQueryKey = [\r\n GET_BRANDSHOP_QUERY_KEY,\r\n brandshopId,\r\n deviceType,\r\n language,\r\n ];\r\n\r\n return useQuery({\r\n queryKey: brandshopQueryKey,\r\n queryFn: () =>\r\n getBrandshop({\r\n deviceType,\r\n language,\r\n brandshopId,\r\n environment,\r\n adServerApiKey,\r\n }),\r\n enabled,\r\n });\r\n};\r\n","import styles from './Brandshop.module.css';\r\nimport { Image } from '../Image/Image';\r\n\r\ntype BannerWithLinkProps = {\r\n image: string;\r\n text: string;\r\n alt: string;\r\n onClick: () => void;\r\n};\r\n\r\nexport const BannerWithLink = ({\r\n image,\r\n text,\r\n alt,\r\n onClick,\r\n}: BannerWithLinkProps) => {\r\n if (!image) return null;\r\n\r\n return (\r\n <button type=\"button\" className={styles.bannerButton} onClick={onClick}>\r\n <Image src={image} alt={alt} className={styles.bannerImage} />\r\n <div className={styles.bannerCta}>{text}</div>\r\n </button>\r\n );\r\n};\r\n","import styles from './Brandshop.module.css';\r\nimport { Image } from '../Image/Image';\r\n\r\ntype BannerProps = {\r\n image: string;\r\n alt: string;\r\n};\r\n\r\nexport const Banner = ({ image, alt }: BannerProps) => {\r\n return (\r\n <div className={styles.banner}>\r\n <Image\r\n src={image}\r\n alt={alt}\r\n className={styles.bannerImage}\r\n fetchPriority=\"high\"\r\n />\r\n </div>\r\n );\r\n};\r\n","import { TTrackEvents } from '@/types/configTypes';\r\n\r\ntype TBrandshopLoginStatus = 'logged_in' | 'guest';\r\n\r\ntype TBrandshopEventNamesEnum =\r\n | 'ads_bs_pageload'\r\n | 'ads_bs_pageend'\r\n | 'ads_bs_section_view'\r\n | 'ads_bs_content_click';\r\n\r\ntype TBrandshopEventProperties = {\r\n userStatus: TBrandshopLoginStatus;\r\n platform: 'Web';\r\n brandName?: string;\r\n sectionName?: string;\r\n sectionOrder?: string;\r\n contentName?: string;\r\n contentOrder?: string;\r\n};\r\n\r\nexport const trackBrandshopEvent = (\r\n eventName: TBrandshopEventNamesEnum,\r\n props: TBrandshopEventProperties,\r\n trackEvent?: TTrackEvents,\r\n) => {\r\n switch (eventName) {\r\n case 'ads_bs_pageload':\r\n case 'ads_bs_pageend': {\r\n const { brandName, userStatus, platform } = props;\r\n trackEvent?.(eventName, {\r\n brand_name: brandName,\r\n user_status: userStatus,\r\n platform,\r\n });\r\n break;\r\n }\r\n\r\n case 'ads_bs_section_view': {\r\n const { brandName, sectionName, sectionOrder, userStatus, platform } =\r\n props;\r\n trackEvent?.(eventName, {\r\n brand_name: brandName,\r\n section_name: sectionName,\r\n section_order: sectionOrder,\r\n user_status: userStatus,\r\n platform,\r\n });\r\n break;\r\n }\r\n\r\n case 'ads_bs_content_click': {\r\n const { contentName, contentOrder, userStatus, platform } = props;\r\n trackEvent?.(eventName, {\r\n content_name: contentName,\r\n content_order: contentOrder,\r\n user_status: userStatus,\r\n platform,\r\n });\r\n break;\r\n }\r\n }\r\n};\r\n","import { type TLinkClickEvent } from '@/types/ads';\r\nimport { type TBrandshopDataItem } from '@/types/brandshop';\r\nimport { buildLinkDestination } from '@/utils/helpers/ads';\r\nimport { BannerWithLink } from './BannerWithLink';\r\nimport { Banner } from './Banner';\r\nimport styles from './Brandshop.module.css';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport { type TTrackEvents } from '@/types/configTypes';\r\n\r\ntype BannerSectionProps = {\r\n title: string;\r\n hideTitle: boolean;\r\n banners: TBrandshopDataItem[];\r\n isLoggedin: boolean;\r\n sectionTitle: string;\r\n onBannerClick: (link: TLinkClickEvent) => void;\r\n trackBrandshopHandler?: TTrackEvents;\r\n};\r\n\r\nexport const BannerSection = ({\r\n title,\r\n hideTitle,\r\n banners,\r\n isLoggedin,\r\n sectionTitle,\r\n onBannerClick,\r\n trackBrandshopHandler,\r\n}: BannerSectionProps) => {\r\n const handleLinkClick = (bannerItem: TBrandshopDataItem) => {\r\n if (!bannerItem?.link?.link_destination) return;\r\n trackBrandshopEvent(\r\n 'ads_bs_content_click',\r\n {\r\n contentName: sectionTitle,\r\n contentOrder: bannerItem.display_order.toString(),\r\n userStatus: isLoggedin ? 'logged_in' : 'guest',\r\n platform: 'Web',\r\n },\r\n trackBrandshopHandler,\r\n );\r\n const payload = buildLinkDestination(bannerItem.link.link_destination);\r\n if (!payload) return;\r\n onBannerClick(payload);\r\n };\r\n\r\n if (banners.length === 0) return null;\r\n\r\n return (\r\n <div className={styles.sectionContainer}>\r\n {!hideTitle && <h2 className={styles.sectionTitle}>{title}</h2>}\r\n\r\n {banners.map((banner) => {\r\n return banner.link ? (\r\n <BannerWithLink\r\n key={banner.tracking_id}\r\n image={banner.image as string}\r\n text={banner.link.link_text}\r\n alt={title}\r\n onClick={() => handleLinkClick(banner)}\r\n />\r\n ) : (\r\n <Banner\r\n key={banner.tracking_id}\r\n image={banner.image as string}\r\n alt={title}\r\n />\r\n );\r\n })}\r\n </div>\r\n );\r\n};\r\n","import { type TLinkClickEvent } from '@/types/ads';\r\nimport { type TBrandshopDataItem } from '@/types/brandshop';\r\nimport { buildLinkDestination } from '@/utils/helpers/ads';\r\nimport styles from './Brandshop.module.css';\r\nimport { type TTrackEvents } from '@/types/configTypes';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport { Image } from '../Image/Image';\r\n\r\ntype CategorySectionProps = {\r\n title: string;\r\n hideTitle: boolean;\r\n categories: TBrandshopDataItem[];\r\n isLoggedin: boolean;\r\n onCategoryClick: (link: TLinkClickEvent) => void;\r\n trackBrandshopHandler?: TTrackEvents;\r\n};\r\n\r\nexport const CategorySection = ({\r\n title,\r\n hideTitle,\r\n categories,\r\n isLoggedin,\r\n onCategoryClick,\r\n trackBrandshopHandler,\r\n}: CategorySectionProps) => {\r\n const handleLinkClick = (categoryItem: TBrandshopDataItem) => {\r\n if (!categoryItem?.link?.link_destination) return;\r\n trackBrandshopEvent(\r\n 'ads_bs_content_click',\r\n {\r\n contentName: categoryItem.category_name,\r\n contentOrder: categoryItem.display_order.toString(),\r\n userStatus: isLoggedin ? 'logged_in' : 'guest',\r\n platform: 'Web',\r\n },\r\n trackBrandshopHandler,\r\n );\r\n const payload = buildLinkDestination(categoryItem.link.link_destination);\r\n if (!payload) return;\r\n onCategoryClick(payload);\r\n };\r\n\r\n if (categories.length < 2) return null;\r\n\r\n const limitedCategories = categories.slice(0, 6);\r\n const sortedCategories = [...limitedCategories].sort(\r\n (a, b) => a.display_order - b.display_order,\r\n );\r\n const gridColumns =\r\n limitedCategories.length === 2 || limitedCategories.length === 4 ? 2 : 3;\r\n\r\n return (\r\n <div className={styles.sectionContainer}>\r\n {!hideTitle && <h2 className={styles.sectionTitle}>{title}</h2>}\r\n\r\n <div\r\n className={`${styles.categoryContainer} ${\r\n styles[`cols${gridColumns}`]\r\n } ${limitedCategories.length === 6 ? styles.categoryShrinkGap : ''}`}\r\n >\r\n {sortedCategories.map((category) => {\r\n if (!category) return null;\r\n\r\n return (\r\n <button\r\n key={category.tracking_id}\r\n className={styles.categoryTile}\r\n onClick={() => handleLinkClick(category)}\r\n >\r\n <div className={styles.categoryImageWrapper}>\r\n {category.image && (\r\n <Image\r\n src={category.image}\r\n alt={category.category_name ?? title}\r\n className={styles.categoryImage}\r\n />\r\n )}\r\n </div>\r\n\r\n {category.category_name && (\r\n <span\r\n className={`${styles.categoryName} ${\r\n limitedCategories.length === 6\r\n ? styles.categoryNameShrink\r\n : ''\r\n }`}\r\n >\r\n {category.category_name}\r\n </span>\r\n )}\r\n </button>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n );\r\n};\r\n","import { type TNavigationLinkItem } from '@/types/brandshop';\r\nimport { type TLinkClickEvent } from '@/types/ads';\r\nimport { buildLinkDestination } from '@/utils/helpers/ads';\r\nimport { type TTrackEvents } from '@/types/configTypes';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport styles from './Brandshop.module.css';\r\nimport { Image } from '../Image/Image';\r\n\r\ntype NavigationSectionProps = {\r\n title: string;\r\n hideTitle: boolean;\r\n logo: string;\r\n navigationLinks: TNavigationLinkItem[];\r\n isLoggedin: boolean;\r\n brandshopName?: string;\r\n onLinkClick: (link: TLinkClickEvent) => void;\r\n trackBrandshopHandler?: TTrackEvents;\r\n};\r\n\r\nexport const NavigationSection = ({\r\n title,\r\n hideTitle,\r\n logo,\r\n navigationLinks,\r\n isLoggedin,\r\n brandshopName,\r\n onLinkClick,\r\n trackBrandshopHandler,\r\n}: NavigationSectionProps) => {\r\n const handleLinkClick = (navigationItem: TNavigationLinkItem) => {\r\n trackBrandshopEvent(\r\n 'ads_bs_content_click',\r\n {\r\n contentName: navigationItem.link.link_text,\r\n contentOrder: navigationItem.link.link_display_order.toString(),\r\n userStatus: isLoggedin ? 'logged_in' : 'guest',\r\n platform: 'Web',\r\n },\r\n trackBrandshopHandler,\r\n );\r\n const payload = buildLinkDestination(navigationItem.link.link_destination);\r\n if (payload) onLinkClick(payload);\r\n };\r\n if (navigationLinks.length === 0) return null;\r\n\r\n const sortedNavigationLinks = [...navigationLinks].sort(\r\n (a, b) => a.link.link_display_order - b.link.link_display_order,\r\n );\r\n\r\n return (\r\n <div\r\n className={`${styles.sectionContainer} ${styles.navigationSectionContainer}`}\r\n >\r\n {!hideTitle && <h2 className={styles.sectionTitle}>{title}</h2>}\r\n\r\n <div className={styles.navigationSection}>\r\n {logo && (\r\n <h1>\r\n <Image\r\n src={logo}\r\n alt={brandshopName ?? title}\r\n className={styles.navigationLogo}\r\n />\r\n </h1>\r\n )}\r\n <div className={styles.navigationLinks}>\r\n {sortedNavigationLinks.map((navigationLink) => (\r\n <button\r\n key={navigationLink.tracking_id}\r\n className={styles.navigationLink}\r\n onClick={() => handleLinkClick(navigationLink)}\r\n >\r\n {navigationLink.link.link_text}\r\n </button>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n","export enum DiscountValueTypesEnum {\r\n PERCENTAGE = 'PERCENTAGE',\r\n AMOUNT = 'AMOUNT',\r\n}\r\n\r\nexport enum DiscountTypesEnum {\r\n PROMOTION = 1,\r\n COUPON = 2,\r\n}\r\n\r\nexport type TPrice = {\r\n is_price_dropped: boolean;\r\n currency: string;\r\n base: string;\r\n final: string;\r\n final_float_price: string;\r\n};\r\n\r\nexport type TDiscount = {\r\n order: DiscountTypesEnum;\r\n name: string;\r\n description: string;\r\n type: DiscountValueTypesEnum;\r\n value: string;\r\n discount_value: string;\r\n price_after_discount: string;\r\n};\r\n\r\nexport type TProductDiscount = {\r\n value: string;\r\n priceAfterDiscount: string;\r\n};\r\n\r\nexport type TDiscountsMap = {\r\n promotion: TProductDiscount | null;\r\n coupon: TProductDiscount | null;\r\n};\r\n\r\n// Collection Item Types\r\nexport type TColorVariant = {\r\n offering_id: string;\r\n variant_id: string;\r\n slug: string;\r\n id: string;\r\n name: string;\r\n value: string;\r\n decorator: string;\r\n};\r\n\r\nexport type TCollectionItem = {\r\n offering_id: string;\r\n variant_id: string;\r\n title: string;\r\n slug: string;\r\n brand: string;\r\n main_image: string;\r\n formatted_main_image: string;\r\n gallery: string[];\r\n price: TPrice;\r\n stock_quantity: number;\r\n discounts: TDiscount[];\r\n colors: TColorVariant[];\r\n categories_tree: string[];\r\n dimensions: string;\r\n};\r\n\r\n// API Response Types\r\nexport type TApiError = {\r\n message: string;\r\n severity: string;\r\n details: string;\r\n};\r\n\r\nexport type TCollectionData = {\r\n collection_id: string;\r\n total_items: number;\r\n items: TCollectionItem[];\r\n};\r\n\r\nexport type TCollectionResponse = {\r\n success: boolean;\r\n data: TCollectionData | null;\r\n error: TApiError | null;\r\n};\r\n","import {\r\n DiscountTypesEnum,\r\n DiscountValueTypesEnum,\r\n type TDiscountsMap,\r\n type TDiscount,\r\n} from '@/types/products';\r\n\r\n// Helper function to get discount value display\r\nconst getDiscountValue = (discount: TDiscount, currency: string): string => {\r\n if (discount.type === DiscountValueTypesEnum.PERCENTAGE) {\r\n return `${discount.value}%`;\r\n }\r\n return `${discount.discount_value} ${currency}`;\r\n};\r\n\r\n// Helper function to get discounts map\r\nexport const getDiscounts = (discounts: TDiscount[], currency: string) => {\r\n return discounts.reduce(\r\n (acc, discount) => {\r\n if (discount.order === DiscountTypesEnum.PROMOTION) {\r\n return {\r\n ...acc,\r\n promotion: {\r\n value: getDiscountValue(discount, currency),\r\n priceAfterDiscount: discount.price_after_discount,\r\n },\r\n };\r\n }\r\n if (discount.order === DiscountTypesEnum.COUPON) {\r\n return {\r\n ...acc,\r\n coupon: {\r\n value: getDiscountValue(discount, currency),\r\n priceAfterDiscount: discount.price_after_discount,\r\n },\r\n };\r\n }\r\n return acc;\r\n },\r\n { promotion: null, coupon: null } as TDiscountsMap,\r\n );\r\n};\r\n","import React from 'react';\r\n\r\ntype TCardProps = {\r\n children: React.ReactNode;\r\n className?: string;\r\n};\r\n\r\nexport const Card = ({ children, className }: TCardProps) => {\r\n return <div className={className}>{children}</div>;\r\n};\r\n","import styles from './Chip.module.css';\r\n\r\ntype TChipProps = {\r\n children: React.ReactNode;\r\n className?: string;\r\n};\r\n\r\nexport function Chip({ children, className }: Readonly<TChipProps>) {\r\n return <div className={`${styles.chip} ${className}`}>{children}</div>;\r\n}\r\n","type TDiscountChipProps = {\r\n label: string;\r\n variant: 'coupon' | 'promotion' | 'priceDrop';\r\n};\r\n\r\ntype TChipInput = {\r\n saveLabelText: string;\r\n couponText: string;\r\n priceDropText: string;\r\n promotionValue?: string;\r\n hasCoupon?: boolean;\r\n isPriceDropped?: boolean;\r\n};\r\n\r\nexport const getDiscountChipDetails = (\r\n props: TChipInput,\r\n): TDiscountChipProps | null => {\r\n const {\r\n promotionValue,\r\n hasCoupon,\r\n isPriceDropped,\r\n saveLabelText,\r\n couponText,\r\n priceDropText,\r\n } = props;\r\n if (isPriceDropped) {\r\n return {\r\n label: priceDropText,\r\n variant: 'priceDrop',\r\n };\r\n }\r\n if (hasCoupon) {\r\n return {\r\n label: couponText,\r\n variant: 'coupon',\r\n };\r\n }\r\n if (promotionValue) {\r\n return {\r\n label: `${saveLabelText} ${promotionValue}`,\r\n variant: 'promotion',\r\n };\r\n }\r\n\r\n return null;\r\n};\r\n","import { type TLanguage } from '@/types/types';\r\n\r\nexport const translations = {\r\n en: {\r\n couponBadge: {\r\n extra: 'Extra',\r\n offAtCheckout: 'off at checkout',\r\n },\r\n discountChip: {\r\n save: 'Save',\r\n onlineExclusive: 'Online exclusive offer',\r\n priceDrop: 'Price drop',\r\n },\r\n mylo: {\r\n from: 'From',\r\n perMonth: '/mo with',\r\n },\r\n },\r\n ar: {\r\n couponBadge: {\r\n extra: 'خصم إضافي',\r\n offAtCheckout: 'يطبق عند الدفع',\r\n },\r\n discountChip: {\r\n save: 'هتوفر',\r\n onlineExclusive: 'عرض أونلاين حصري',\r\n priceDrop: 'سعر أقل',\r\n },\r\n mylo: {\r\n from: 'يبدأ من',\r\n perMonth: '/الشهر مع',\r\n },\r\n },\r\n} as const;\r\n\r\nexport const getTranslation = (language: TLanguage) => translations[language];\r\n","import { type TProductDiscount } from '@/types/products';\r\nimport { Chip } from '../Chip/Chip';\r\nimport { getDiscountChipDetails } from '@/utils/helpers/discountChip';\r\nimport styles from './ProductsCarousel.module.css';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { getTranslation } from '@/utils/helpers/translate';\r\n\r\ntype TDiscountChipProps = {\r\n language: TLanguage;\r\n promotionValue?: string;\r\n coupon?: TProductDiscount | null;\r\n isPriceDropped?: boolean;\r\n className?: string;\r\n};\r\n\r\nconst variantStyles = {\r\n coupon: styles.discountChipCoupon,\r\n promotion: styles.discountChipPromotion,\r\n priceDrop: styles.discountChipPriceDrop,\r\n};\r\n\r\nexport function DiscountChip({\r\n language,\r\n promotionValue,\r\n coupon,\r\n isPriceDropped,\r\n className,\r\n}: Readonly<TDiscountChipProps>) {\r\n const translate = getTranslation(language);\r\n\r\n const discountChipDetails = getDiscountChipDetails({\r\n promotionValue,\r\n hasCoupon: !!coupon,\r\n isPriceDropped,\r\n saveLabelText: translate.discountChip.save,\r\n couponText: translate.discountChip.onlineExclusive,\r\n priceDropText: translate.discountChip.priceDrop,\r\n });\r\n\r\n if (!discountChipDetails) return null;\r\n\r\n return (\r\n <Chip\r\n className={`${className} ${variantStyles[discountChipDetails.variant]}`}\r\n >\r\n {discountChipDetails.label}\r\n </Chip>\r\n );\r\n}\r\n","export default \"data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.94%206.38667L6.94%200.386667C6.7%200.146667%206.36667%200%206%200H1.33333C0.6%200%200%200.6%200%201.33333V6C0%206.36667%200.146667%206.7%200.393333%206.94667L6.39333%2012.9467C6.63333%2013.1867%206.96667%2013.3333%207.33333%2013.3333C7.7%2013.3333%208.03333%2013.1867%208.27333%2012.94L12.94%208.27333C13.1867%208.03333%2013.3333%207.7%2013.3333%207.33333C13.3333%206.96667%2013.18%206.62667%2012.94%206.38667ZM2.33333%203.33333C1.78%203.33333%201.33333%202.88667%201.33333%202.33333C1.33333%201.78%201.78%201.33333%202.33333%201.33333C2.88667%201.33333%203.33333%201.78%203.33333%202.33333C3.33333%202.88667%202.88667%203.33333%202.33333%203.33333Z'%20fill='%231AA573'/%3e%3c/svg%3e\"","import styles from './ProductsCarousel.module.css';\r\nimport tag from '@/assets/tag.svg';\r\nimport { Image } from '../Image/Image';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { getTranslation } from '@/utils/helpers/translate';\r\n\r\ntype TCouponBadgeProps = {\r\n value: string;\r\n language: TLanguage;\r\n};\r\n\r\nexport function CouponBadge({ value, language }: Readonly<TCouponBadgeProps>) {\r\n const translate = getTranslation(language);\r\n\r\n return (\r\n <div className={styles.couponBadge}>\r\n <Image alt=\"tag\" src={tag} width={13.3} height={13.3} />\r\n <span>\r\n {`${translate.couponBadge.extra} ${value} ${translate.couponBadge.offAtCheckout}`}\r\n </span>\r\n </div>\r\n );\r\n}\r\n","import type { TPrice, TDiscount } from '@/types/products';\r\nimport styles from './ProductsCarousel.module.css';\r\nimport { getDiscounts } from '@/utils/helpers/productDiscounts';\r\n\r\ntype TPriceDisplayProps = {\r\n price: TPrice;\r\n discounts: TDiscount[];\r\n};\r\n\r\nexport function PriceDisplay({\r\n price,\r\n discounts,\r\n}: Readonly<TPriceDisplayProps>) {\r\n const { promotion } = getDiscounts(discounts, price.currency);\r\n const hasDiscount = promotion?.priceAfterDiscount;\r\n\r\n return (\r\n <div className={styles.priceWrapper}>\r\n <span\r\n className={`${styles.priceCurrency} ${hasDiscount && styles.withPromotion}`}\r\n >\r\n {price.currency}\r\n </span>\r\n <span\r\n className={`${styles.priceAmount} ${hasDiscount && styles.withPromotion}`}\r\n >\r\n {promotion ? promotion.priceAfterDiscount : price.base}\r\n </span>\r\n {hasDiscount && (\r\n <span className={styles.priceOriginal}>{price.base}</span>\r\n )}\r\n </div>\r\n );\r\n}\r\n","import styles from './ProductsCarousel.module.css';\r\n\r\ntype TProductLinkProps = {\r\n title: string;\r\n};\r\n\r\nexport function ProductTitle({ title }: Readonly<TProductLinkProps>) {\r\n return <div className={styles.ProductTitle}>{title}</div>;\r\n}\r\n","class t{overlay;iframe;data;redirect_url;constructor(){this.overlay=null,this.iframe=null,this.data={},this.redirect_url=\"\"}set redirectUrl(t){this.redirect_url=t}open(t,e,s){this.data=e,this.overlay=document.createElement(\"div\"),this.overlay.style.position=\"fixed\",this.overlay.style.top=\"0\",this.overlay.style.left=\"0\",this.overlay.style.width=\"100%\",this.overlay.style.height=\"100%\",this.overlay.style.backgroundColor=\"rgba(0, 0, 0, 0.5)\",this.overlay.style.zIndex=\"9999\",this.overlay.style.display=\"flex\",this.overlay.style.justifyContent=\"center\",this.overlay.style.alignItems=\"center\",this.overlay.style.cursor=\"pointer\";const n=document.createElement(\"div\");n.style.position=\"relative\",n.style.zIndex=\"10000\";const a={padding:\"20px\",backgroundColor:\"#fff\",borderRadius:\"10px\",boxShadow:\"0px 5px 15px rgba(0, 0, 0, 0.2)\"},i=()=>{const t=window.innerWidth,e=window.innerHeight;s?.width||(n.style.width=t>=768?\"45%\":\"100%\"),s?.height||(n.style.height=e>=872?\"80%\":\"100%\")};i(),window.addEventListener(\"resize\",i),Object.entries(a).forEach((([t,e])=>{e&&(n.style[t]=e)})),s&&Object.keys(s).length>0&&Object.entries(s).forEach((([t,e])=>{e&&(n.style[t]=e)})),this.iframe=document.createElement(\"iframe\"),this.iframe.src=t,this.iframe.style.width=\"100%\",this.iframe.style.height=\"100%\",this.iframe.style.border=\"none\",this.iframe.style.borderRadius=s?.borderRadius||a.borderRadius,n.appendChild(this.iframe),this.overlay.appendChild(n),document.body.appendChild(this.overlay),this.overlay.addEventListener(\"click\",(t=>{t.target===this.overlay&&this.close()})),this.onIframeLoad((()=>{const t={message:this.data};console.log(\"sending data to iframe:\",JSON.stringify(t,null,2)),this.iframe?.contentWindow?.postMessage(t,\"*\")})),window.addEventListener(\"message\",(t=>{t?.origin&&(t?.data.redirect_url&&(this.redirectUrl=t?.data.redirect_url),\"success\"!==t?.data?.status&&\"failed\"!==t?.data?.status||(console.log(\"Closing Iframe Modal with status:\",t?.data?.status),this.close()))}))}close(){this.overlay&&document.body.contains(this.overlay)&&(document.body.removeChild(this.overlay),this.redirect_url&&(console.log(\"Redirecting to:\",this.redirect_url),window.location.href=this.redirect_url))}getIframe(){return this.iframe}onIframeLoad(t){this.iframe&&(this.iframe.onload=t)}}class e{iframeModal;constructor(){this.iframeModal=new t}start({baseUrl:t,path:e,data:s,iframeStyles:n}){t.endsWith(\"/\")&&(t=t.slice(0,-1)),e.startsWith(\"/\")&&(e=e.slice(1)),console.group(\"Starting Iframe Modal\"),console.log(\"Base URL:\",t),console.log(\"Path:\",e),console.log(\"Data:\",JSON.stringify(s,null,2)),console.groupEnd();const a=`${t}/${e}`;this.iframeModal.open(a,s,n)}}class s extends e{startCheckout(t,e){this.start({baseUrl:t,path:\"public/online-checkout\",data:e})}}class n extends e{startOnboarding(t,e){this.start({baseUrl:t,path:\"public/onboarding-checkout-app\",data:e,iframeStyles:{width:\"600px\",height:\"742px\",borderRadius:\"32px\",padding:\"0\"}})}}var a;!function(t){t.YEARLY=\"yearly\",t.MONTHLY=\"monthly\"}(a||(a={}));const i=[{tenor_key:\"2_Months\",duration_in_days:60,interest_percent_basis_points:600,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"3_Months\",duration_in_days:90,interest_percent_basis_points:1e3,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"6_Months\",duration_in_days:180,interest_percent_basis_points:1900,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"9_Months\",duration_in_days:270,interest_percent_basis_points:2900,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"12_Months\",duration_in_days:360,interest_percent_basis_points:3800,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"15_Months\",duration_in_days:450,interest_percent_basis_points:5e3,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"18_Months\",duration_in_days:540,interest_percent_basis_points:6500,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"24_Months\",duration_in_days:720,interest_percent_basis_points:8800,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"36_Months\",duration_in_days:1080,interest_percent_basis_points:14400,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"},{tenor_key:\"48_Months\",duration_in_days:1440,interest_percent_basis_points:2e4,admin_fee_percent_basis_points:0,murabaha_schema:\"monthly\"}];async function r(){try{const t=await fetch(\"https://mylosmsoffers.s3.eu-west-1.amazonaws.com/btechoffer.json\",{method:\"GET\",cache:\"default\",headers:{\"Content-Type\":\"application/json\"}});if(!t.ok)throw new Error(`Failed to fetch configs: ${t.status} ${t.statusText}`);return await t.json()}catch(t){return console.error(\"Failed to fetch tenor configs:\",t),i}}function o(t,e){const s=e.interest_percent_basis_points/1e4,n=t+t*s,i=e.duration_in_days/30,r=e.tenor_key.match(/^(\\d+)_/);return{monthlyAmount:n/i,tenure:`${r?r[1]:e.duration_in_days/30} months`,murabaha:Number((e?.murabaha_schema===a.YEARLY?s/i*12*100:s/i*100).toFixed(2))}}async function l(t){const e=await r();if(0===e.length)return null;const s=e.map((e=>({config:e,installment:o(t,e)}))).reduce(((t,e)=>e.installment.monthlyAmount<t.installment.monthlyAmount?e:t)),n=function(t){return new Intl.NumberFormat(\"en-US\",{minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}(s.installment.monthlyAmount);return{message:`Pay as low as ${n}/month`,tenure:`${String(s.config.duration_in_days/30)}`,amount:n}}async function h(t){const e=await r();return 0===e.length?[]:e.map((e=>{const s=o(t,e);return{tenure:s.tenure,monthlyAmount:String(s.monthlyAmount),murabaha:s.murabaha}}))}export{s as Checkout,n as Onboarding,h as getInstallmentInfoPDP,l as getInstallmentInfoPLP};\n","export default \"data:image/svg+xml,%3csvg%20width='29'%20height='14'%20viewBox='0%200%2029%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_5501_9441)'%3e%3cpath%20d='M0%202.77278H2.23046L2.7134%204.15232H2.72612C2.88286%203.69215%203.15714%203.32694%203.54992%203.05672C3.94175%202.78648%204.38158%202.65137%204.8694%202.65137C5.35722%202.65137%205.7706%202.77669%206.08407%203.02635C6.39752%203.27702%206.61303%203.64809%206.72861%204.13958H6.74135C6.93921%203.66375%207.23309%203.29659%207.62098%203.03812C8.0089%202.77963%208.45558%202.65039%208.95906%202.65039C9.33915%202.65039%209.66534%202.73655%209.93864%202.91083C10.2119%203.08413%2010.4196%203.3338%2010.5646%203.66081C10.7086%203.98783%2010.782%204.37751%2010.782%204.82887V9.0644H7.93151V5.59157C7.93151%205.3899%207.88352%205.23226%207.78947%205.11966C7.69446%205.00608%207.56419%204.95028%207.39961%204.95028C7.27619%204.95028%207.17039%204.97868%207.08322%205.03448C6.99701%205.09126%206.93041%205.17352%206.88534%205.28316C6.84028%205.39184%206.81775%205.52305%206.81775%205.67677V9.0654H3.96723V5.59257C3.96723%205.39087%203.91924%205.23323%203.82519%205.12063C3.73018%205.00706%203.59989%204.95125%203.43533%204.95125C3.25313%204.95125%203.11109%205.01391%203.00824%205.13826C2.90538%205.26358%202.85347%205.44276%202.85347%205.67677V9.0654H0V2.77278Z'%20fill='%23D52B92'/%3e%3cpath%20d='M15.2248%202.77148L14.4568%206.5596L13.8936%202.77148H11.0078L12.2832%209.06507H13.9475L13.5214%2011.1652H16.4062L18.1096%202.77148H15.2248Z'%20fill='%23D52B92'/%3e%3cpath%20d='M22.597%2011.1848H21.3668C19.4782%2011.1848%2018.6172%2010.2527%2018.6172%208.55498V2.76953H21.3855V8.71848C21.3855%208.90843%2021.5431%209.06312%2021.738%209.06312H22.597V11.1848Z'%20fill='%23D52B92'/%3e%3cpath%20d='M23.5082%208.8079C24.0518%209.07714%2024.6836%209.21226%2025.4036%209.21226C26.1236%209.21226%2026.7544%209.07714%2027.2992%208.8079C27.8427%208.53863%2028.263%208.15581%2028.5588%207.65942C28.8546%207.16302%2029.0025%206.58731%2029.0025%205.93133C29.0025%205.27533%2028.8546%204.69963%2028.5588%204.20324C28.263%203.70682%2027.8427%203.32499%2027.2992%203.05475C26.7554%202.78551%2026.1236%202.65039%2025.4036%202.65039C24.6836%202.65039%2024.0518%202.78551%2023.5082%203.05475C22.9645%203.324%2022.5444%203.70682%2022.2484%204.20324C21.9526%204.69963%2021.8047%205.27533%2021.8047%205.93133C21.8047%206.58731%2021.9526%207.16302%2022.2484%207.65942C22.5444%208.15581%2022.9637%208.53766%2023.5082%208.8079ZM25.8719%206.97112C25.7387%207.05532%2025.583%207.09742%2025.4036%207.09742C25.2244%207.09742%2025.0676%207.05532%2024.9354%206.97112C24.8023%206.88789%2024.7014%206.76354%2024.6318%206.59907C24.5622%206.43555%2024.527%206.23877%2024.527%206.01062C24.527%205.78249%2024.5622%205.58571%2024.6318%205.42219C24.7022%205.25869%2024.8031%205.13434%2024.9354%205.05014C25.0676%204.96691%2025.2244%204.92385%2025.4036%204.92385C25.583%204.92385%2025.7387%204.96594%2025.8719%205.05014C26.0041%205.13434%2026.106%205.25772%2026.1756%205.42219C26.245%205.58668%2026.2804%205.78249%2026.2804%206.01062C26.2804%206.23877%2026.245%206.43555%2026.1756%206.59907C26.105%206.76354%2026.0041%206.88692%2025.8719%206.97112Z'%20fill='%23D52B92'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_5501_9441'%3e%3crect%20width='29'%20height='12.4286'%20fill='white'%20transform='translate(0%200.785156)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='140'%20height='60'%20viewBox='0%200%20140%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.1656%2028.8946C22.7842%2029.8017%2022.2378%2030.4854%2021.5197%2030.9493C20.8016%2031.4166%2019.9563%2031.6434%2018.9874%2031.6434C18.0184%2031.6434%2017.1732%2031.4132%2016.4516%2030.9493C15.7369%2030.4854%2015.1872%2029.7982%2014.8058%2028.8946C14.4278%2027.9875%2014.2354%2026.8983%2014.2354%2025.6338C14.2354%2024.3694%2014.4244%2023.2836%2014.8058%2022.3731C15.1872%2021.466%2015.7369%2020.7822%2016.4516%2020.3183C17.1697%2019.8545%2018.0116%2019.6208%2018.9874%2019.6208C19.9632%2019.6208%2020.8016%2019.8545%2021.5197%2020.3183C22.2344%2020.7822%2022.7842%2021.4694%2023.1656%2022.3731C23.5435%2023.2836%2023.7359%2024.3694%2023.7359%2025.6338C23.7359%2026.8983%2023.547%2027.9875%2023.1656%2028.8946ZM62.0131%2026.2214C62.0131%2027.3965%2061.7416%2028.3105%2061.2022%2028.9702C60.6593%2029.6264%2059.9206%2029.9563%2058.9825%2029.9563C58.5565%2029.9563%2058.1751%2029.8876%2057.8246%2029.7673C57.8589%2029.2038%2057.8796%202.07324%2057.8796%202.07324H42.1152L42.1392%2027.4927C42.1392%2028.6644%2041.8678%2029.5852%2041.3283%2030.2415C40.7854%2030.8978%2040.0467%2031.2276%2039.1052%2031.2276C38.7032%2031.2276%2038.3355%2031.1623%2038.0023%2031.0558L37.9748%2031.0386V25.6338C37.9748%2022.0913%2037.1914%2018.9783%2035.6314%2016.2982C34.0715%2013.6182%2031.8552%2011.5497%2028.9862%2010.0963C26.1137%208.64285%2022.7842%207.91442%2018.9874%207.91442C15.1906%207.91442%2011.8542%208.64285%208.98516%2010.0963C6.11609%2011.5497%203.89987%2013.6182%202.33992%2016.2982C0.779974%2018.9783%200%2022.0913%200%2025.6338C0%2029.1763%200.779974%2032.2928%202.34336%2034.9694C3.90331%2037.6495%206.11953%2039.7145%208.9886%2041.1714C11.8577%2042.6248%2015.194%2043.3532%2018.9908%2043.3532C20.111%2043.3532%2021.1933%2043.2879%2022.231%2043.1608V43.6728C22.231%2045.3083%2020.9081%2046.6346%2019.2691%2046.6346H15.2078V58.8701H22.3375C33.0819%2058.8701%2037.9748%2053.4447%2037.9748%2043.5525V43.3498H38.0057H45.0942C49.6503%2043.3498%2053.612%2040.8037%2055.629%2037.0516L56.1478%2036.5225C57.2027%2038.4123%2058.5668%2039.9413%2060.2538%2041.0923C62.4632%2042.5973%2065.0024%2043.3498%2067.868%2043.3498C70.0293%2043.3498%2071.8882%2042.8447%2073.4378%2041.8345C74.9874%2040.8243%2076.1763%2039.3675%2076.9975%2037.4639C77.8187%2035.5604%2078.231%2033.2926%2078.231%2030.6607V14.1714H62.0165V26.2214H62.0131Z'%20fill='%23D52B92'/%3e%3cpath%20d='M125.191%2028.8145C124.81%2029.725%20124.263%2030.4088%20123.545%2030.8726C122.827%2031.3365%20121.982%2031.5667%20121.013%2031.5667C120.044%2031.5667%20119.198%2031.3365%20118.48%2030.8726C117.762%2030.4088%20117.212%2029.7216%20116.831%2028.8145C116.453%2027.9074%20116.261%2026.8216%20116.261%2025.5571C116.261%2024.2927%20116.453%2023.2069%20116.831%2022.2998C117.212%2021.3927%20117.759%2020.7055%20118.48%2020.2451C119.195%2019.7812%20120.04%2019.5476%20121.013%2019.5476C121.985%2019.5476%20122.827%2019.7812%20123.545%2020.2451C124.26%2020.709%20124.81%2021.3962%20125.191%2022.2998C125.569%2023.2104%20125.761%2024.2927%20125.761%2025.5571C125.761%2026.8216%20125.572%2027.9108%20125.191%2028.8145ZM137.66%2016.2181C136.097%2013.5415%20133.884%2011.473%20131.015%2010.0162C128.146%208.5593%20124.813%207.83087%20121.016%207.83087C117.219%207.83087%20113.883%208.5593%20111.014%2010.0162C108.145%2011.4696%20105.932%2013.5381%20104.369%2016.2181C102.805%2018.8982%20102.025%2022.0112%20102.025%2025.5537C102.025%2027.4676%20102.256%2029.2543%20102.713%2030.9173H101.094C99.4449%2030.9173%2098.1117%2029.5807%2098.1117%2027.9348V2H82.3679V27.9589C82.3679%2037.8511%2087.2608%2043.2765%2098.0052%2043.2765H107.485L107.533%2038.741C108.564%2039.6481%20109.719%2040.4384%20111.014%2041.0947C113.883%2042.5515%20117.219%2043.2765%20121.016%2043.2765C124.813%2043.2765%20128.146%2042.5481%20131.015%2041.0947C133.884%2039.6378%20136.1%2037.5728%20137.66%2034.8927C139.22%2032.2161%20140%2029.1031%20140%2025.5571C140%2022.0112%20139.22%2018.9016%20137.66%2016.2216'%20fill='%23D52B92'/%3e%3cpath%20d='M61.2086%2046.7405C58.2949%2046.7405%2055.9343%2049.101%2055.9343%2052.0147C55.9343%2054.9284%2058.2949%2057.289%2061.2086%2057.289C64.1223%2057.289%2066.4829%2054.9284%2066.4829%2052.0147C66.4829%2049.101%2064.1223%2046.7405%2061.2086%2046.7405Z'%20fill='%23D52B92'/%3e%3cpath%20d='M72.9519%2046.7405C70.0382%2046.7405%2067.6776%2049.101%2067.6776%2052.0147C67.6776%2054.9284%2070.0382%2057.289%2072.9519%2057.289C75.8656%2057.289%2078.2262%2054.9284%2078.2262%2052.0147C78.2262%2049.101%2075.8656%2046.7405%2072.9519%2046.7405Z'%20fill='%23D52B92'/%3e%3c/svg%3e\"","import { useEffect, useState } from 'react';\r\n\r\nexport function useAsyncMemo<T>(\r\n fn: (() => Promise<T>) | null,\r\n deps: unknown[] = [],\r\n): [T | null, boolean] {\r\n const [value, setValue] = useState<T | null>(null);\r\n const [isLoading, setIsLoading] = useState<boolean>(true);\r\n\r\n useEffect(() => {\r\n if (!fn) return;\r\n let isMounted = true;\r\n setIsLoading(true);\r\n fn?.()\r\n .then((result) => {\r\n if (isMounted) setValue(result);\r\n })\r\n .finally(() => {\r\n if (isMounted) setIsLoading(false);\r\n });\r\n\r\n return () => {\r\n isMounted = false;\r\n };\r\n }, deps);\r\n\r\n return [value, isLoading];\r\n}\r\n","export const parsePriceToNumber = (priceString: string): number => {\r\n if (!priceString) return 0;\r\n\r\n const cleanedPrice = priceString.replaceAll(',', '');\r\n const parsedPrice = Number(cleanedPrice);\r\n\r\n return Number.isNaN(parsedPrice) ? 0 : parsedPrice;\r\n};\r\n","import { getDiscounts } from '@/utils/helpers/productDiscounts';\r\nimport type { TDiscount, TPrice } from '@/types/products';\r\nimport { Card } from '../Card/Card';\r\nimport { Image } from '../Image/Image';\r\nimport { DiscountChip } from './DiscountChip';\r\nimport { CouponBadge } from './CouponBadge';\r\nimport { PriceDisplay } from './PriceDisplay';\r\nimport styles from './ProductsCarousel.module.css';\r\nimport { ProductTitle } from './ProductTitle';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { getInstallmentInfoPLP } from 'mylo-online-checkout-sdk';\r\nimport myloENIcon from '@/assets/mylo-en.svg';\r\nimport myloARIcon from '@/assets/mylo.svg';\r\nimport { useAsyncMemo } from '@/hooks/use-async-memo';\r\nimport { type TMyloGetInstallmentInfoPLP } from '@/types/tenures';\r\nimport { parsePriceToNumber } from '@/utils/helpers/price-utils';\r\nimport Skeleton from '../Carousel/AdSkeleton';\r\nimport { getTranslation } from '@/utils/helpers/translate';\r\n\r\nconst MYLO_MINIMUM_PRICE_THRESHOLD = 500;\r\n\r\ntype TProductCardProps = {\r\n id: string;\r\n title: string;\r\n brand: string;\r\n image: string;\r\n price: TPrice;\r\n discounts: TDiscount[];\r\n language: TLanguage;\r\n className?: string;\r\n};\r\n\r\nexport function ProductCard({\r\n id,\r\n title,\r\n brand,\r\n image,\r\n price,\r\n discounts = [],\r\n language,\r\n className,\r\n}: Readonly<TProductCardProps>) {\r\n const { promotion, coupon } = getDiscounts(discounts, price.currency);\r\n const translate = getTranslation(language);\r\n\r\n const [myloInstallmentInfo, isMyloInstallmentInfoLoading] =\r\n useAsyncMemo<TMyloGetInstallmentInfoPLP | null>(\r\n () => getInstallmentInfoPLP(Number(price.final.replaceAll(',', ''))),\r\n [price.final],\r\n );\r\n\r\n const installmentText = `${translate.mylo.from} ${myloInstallmentInfo?.amount ?? '0'}${translate.mylo.perMonth}`;\r\n\r\n return (\r\n <Card key={id} className={`${styles.card} ${className}`}>\r\n <header className={styles.header}>\r\n <div className={styles.imageContainer}>\r\n <Image className={styles.image} src={image} alt={title} />\r\n </div>\r\n\r\n <div className={styles.topControls}>\r\n <DiscountChip\r\n language={language}\r\n coupon={coupon}\r\n promotionValue={promotion?.value}\r\n isPriceDropped={price.is_price_dropped}\r\n />\r\n </div>\r\n </header>\r\n\r\n <footer className={styles.footer}>\r\n <div className={styles.priceSection}>\r\n <PriceDisplay price={price} discounts={discounts} />\r\n </div>\r\n {isMyloInstallmentInfoLoading ? (\r\n <Skeleton className={styles.myloSkeleton} />\r\n ) : (\r\n parsePriceToNumber(price.final) >= MYLO_MINIMUM_PRICE_THRESHOLD && (\r\n <div className={styles.myloContainer}>\r\n <p className={styles.myloText}>{installmentText}</p>\r\n <Image\r\n className={styles.myloIcon}\r\n src={language === 'en' ? myloENIcon : myloARIcon}\r\n alt=\"mylo\"\r\n />\r\n </div>\r\n )\r\n )}\r\n <h4 className={styles.brand}>{brand}</h4>\r\n\r\n <ProductTitle title={title} />\r\n\r\n {coupon && <CouponBadge value={coupon.value} language={language} />}\r\n </footer>\r\n </Card>\r\n );\r\n}\r\n","import {\r\n AdCarousel,\r\n AdCarouselContent,\r\n AdCarouselItem,\r\n AdCarouselNext,\r\n AdCarouselPrevious,\r\n AdCarouselPagination,\r\n AdCarouselApi,\r\n} from '../Carousel/AdCarousel';\r\nimport { useState, useEffect } from 'react';\r\nimport { ProductCard } from '../ProductsCarousel/ProductCard';\r\nimport styles from './ProductsCarousel.module.css';\r\nimport { TCollectionItem } from '@/types/products';\r\nimport { TLanguage } from '@/types/types';\r\n\r\ntype ProductsCarouselProps = {\r\n products: TCollectionItem[];\r\n onProductClick: (product: TCollectionItem, index: number) => void;\r\n slidesToScroll?: number;\r\n language: TLanguage;\r\n};\r\n\r\nexport function ProductsCarousel({\r\n slidesToScroll,\r\n products,\r\n onProductClick,\r\n language,\r\n}: Readonly<ProductsCarouselProps>) {\r\n const [api, setApi] = useState<AdCarouselApi>();\r\n const [current, setCurrent] = useState(0);\r\n const [count, setCount] = useState(0);\r\n const [canScrollPrev, setCanScrollPrev] = useState(false);\r\n const [canScrollNext, setCanScrollNext] = useState(false);\r\n\r\n useEffect(() => {\r\n if (!api) {\r\n return;\r\n }\r\n\r\n const updateCarouselState = () => {\r\n setCount(api.scrollSnapList().length);\r\n setCurrent(api.selectedScrollSnap());\r\n setCanScrollPrev(api.canScrollPrev());\r\n setCanScrollNext(api.canScrollNext());\r\n };\r\n\r\n updateCarouselState();\r\n\r\n api.on('select', updateCarouselState);\r\n\r\n api.on('reInit', updateCarouselState);\r\n\r\n return () => {\r\n api.off('select', updateCarouselState);\r\n api.off('reInit', updateCarouselState);\r\n };\r\n }, [api]);\r\n\r\n return (\r\n <div className={styles.container}>\r\n <AdCarousel\r\n opts={{\r\n align: 'start',\r\n slidesToScroll: slidesToScroll ?? 1,\r\n direction: language === 'ar' ? 'rtl' : 'ltr',\r\n }}\r\n setApi={setApi}\r\n className={styles.carousel}\r\n >\r\n <AdCarouselContent className={styles.carouselContent}>\r\n {products.map((product, index) => (\r\n <AdCarouselItem\r\n key={`${product.offering_id}-${index}`}\r\n className={styles.carouselItem}\r\n onClick={() => onProductClick(product, index)}\r\n >\r\n <ProductCard\r\n id={product.offering_id}\r\n brand={product.brand}\r\n image={product.formatted_main_image}\r\n price={product.price}\r\n title={product.title}\r\n discounts={product.discounts}\r\n language={language}\r\n />\r\n </AdCarouselItem>\r\n ))}\r\n </AdCarouselContent>\r\n\r\n {canScrollPrev && (\r\n <AdCarouselPrevious\r\n className={styles.navButtonPrev}\r\n iconClassName={styles.navButtonPrevIcon}\r\n />\r\n )}\r\n {canScrollNext && (\r\n <AdCarouselNext\r\n className={styles.navButtonNext}\r\n iconClassName={styles.navButtonNextIcon}\r\n />\r\n )}\r\n </AdCarousel>\r\n\r\n <AdCarouselPagination\r\n slidesCount={count}\r\n currentIndex={current}\r\n onClick={(index) => api?.scrollTo(index)}\r\n showProgress={false}\r\n containerClassName={styles.paginationContainer}\r\n buttonClassName={styles.paginationButton}\r\n dotClassName={styles.paginationDot}\r\n activeDotClassName={styles.paginationActiveDot}\r\n />\r\n </div>\r\n );\r\n}\r\n","import { LinkDestination } from '@/types/ads';\r\nimport { TCollectionItem } from '@/types/products';\r\n\r\nexport const mapProductToLinkDestination = (\r\n product: TCollectionItem,\r\n): LinkDestination => {\r\n return {\r\n type: 'single product',\r\n val: [product.offering_id],\r\n filters: [\r\n {\r\n key: 'slug',\r\n value: [product.slug],\r\n },\r\n ],\r\n };\r\n};\r\n","import { generateAccessToken } from '@/utils/helpers/authToken';\r\nimport { getBaseUrl } from '@/utils/helpers/getBaseUrl';\r\nimport {\r\n type TCollectionData,\r\n type TCollectionResponse,\r\n} from '@/types/products';\r\nimport { type TGetCollectionProps } from '../queries/useGetCollection';\r\n\r\nexport const getCollection = async ({\r\n language,\r\n collectionId,\r\n environment,\r\n adServerApiKey,\r\n}: TGetCollectionProps): Promise<TCollectionData | null> => {\r\n const [token, timestamp] = await generateAccessToken(adServerApiKey);\r\n const adServerBaseUrl = getBaseUrl('adServer', environment);\r\n\r\n try {\r\n const res = await fetch(\r\n `${adServerBaseUrl}/api/v2/brandshop/server/collection/${collectionId}`,\r\n {\r\n headers: {\r\n lang: language,\r\n device: 'web',\r\n 'auth-token': token,\r\n 'auth-timestamp': timestamp,\r\n 'accept-language': language,\r\n },\r\n },\r\n );\r\n\r\n const collectionResponse: TCollectionResponse = await res.json();\r\n return collectionResponse.data;\r\n } catch (error) {\r\n throw new Error(`Failed to fetch collection data - ${error}`);\r\n }\r\n};\r\n","import { useQuery } from '@tanstack/react-query';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { type TEnvironment } from '@/types/configTypes';\r\nimport { getCollection } from '../services/getCollection';\r\n\r\nexport type TGetCollectionProps = {\r\n language: TLanguage;\r\n environment: TEnvironment;\r\n collectionId: string;\r\n adServerApiKey: string;\r\n};\r\nexport const GET_COLLECTION_QUERY_KEY = 'collection';\r\n\r\nexport const useGetCollectionQuery = ({\r\n language,\r\n collectionId,\r\n environment,\r\n adServerApiKey,\r\n}: TGetCollectionProps) => {\r\n const collectionQueryKey = [GET_COLLECTION_QUERY_KEY, collectionId, language];\r\n\r\n return useQuery({\r\n queryKey: collectionQueryKey,\r\n queryFn: () =>\r\n getCollection({\r\n language,\r\n collectionId,\r\n environment,\r\n adServerApiKey,\r\n }),\r\n });\r\n};\r\n","import Skeleton from '../Carousel/AdSkeleton';\r\nimport styles from './ProductCardSkeleton.module.css';\r\n\r\ntype TProductCardSkeletonProps = {\r\n className?: string;\r\n};\r\n\r\nexport const ProductCardSkeleton = (props: TProductCardSkeletonProps) => {\r\n const { className } = props;\r\n\r\n return (\r\n <div className={`${styles.card} ${className || ''}`}>\r\n <Skeleton className={styles.imageSkeleton} />\r\n <Skeleton className={styles.titleSkeleton} />\r\n <Skeleton className={styles.descriptionSkeleton} />\r\n <Skeleton className={styles.priceSkeleton} />\r\n <Skeleton className={styles.buttonSkeleton} />\r\n </div>\r\n );\r\n};\r\n","import Skeleton from '../Carousel/AdSkeleton';\r\nimport { ProductCardSkeleton } from './ProductCardSkeleton';\r\nimport styles from './ProductSliderSkeleton.module.css';\r\n\r\ntype TProductSliderSkeletonProps = {\r\n length?: number;\r\n};\r\n\r\nexport const ProductSliderSkeleton = (props: TProductSliderSkeletonProps) => {\r\n const { length } = props;\r\n const skeletonLength = length ?? 5;\r\n\r\n return (\r\n <div className={styles.container}>\r\n <div className={styles.header}>\r\n <Skeleton className={styles.titleSkeleton} />\r\n </div>\r\n <div className={styles.carouselWrapper}>\r\n <div className={styles.carouselContainer}>\r\n {Array.from({ length: skeletonLength }, (_, index) => (\r\n <div key={index} className={styles.cardWrapper}>\r\n <ProductCardSkeleton />\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n","import { ProductsCarousel } from '../ProductsCarousel/ProductsCarousel';\r\nimport { TCollectionItem } from '@/types/products';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport { TEnvironment, TTrackEvents } from '@/types/configTypes';\r\nimport { buildLinkDestination } from '@/utils/helpers/ads';\r\nimport { TLinkClickEvent } from '@/types/ads';\r\nimport { mapProductToLinkDestination } from '@/utils/helpers/products';\r\nimport { type TLanguage } from '@/types/types';\r\nimport styles from './Brandshop.module.css';\r\nimport { type TBrandshopCollection } from '@/types/brandshop';\r\nimport { useGetCollectionQuery } from '@/api/queries/useGetCollection';\r\nimport { ProductSliderSkeleton } from '../ProductsCarousel/ProductSliderSkeleton';\r\n\r\ntype ProductSliderSectionProps = {\r\n products: TBrandshopCollection;\r\n title: string;\r\n hideTitle: boolean;\r\n isLoggedin: boolean;\r\n language: TLanguage;\r\n environment: TEnvironment;\r\n adServerApiKey: string;\r\n trackBrandshopHandler?: TTrackEvents;\r\n onProductClick: (data: TLinkClickEvent) => void;\r\n};\r\n\r\nexport function ProductSliderSection({\r\n products,\r\n title,\r\n hideTitle,\r\n isLoggedin,\r\n language,\r\n environment,\r\n adServerApiKey,\r\n trackBrandshopHandler,\r\n onProductClick,\r\n}: Readonly<ProductSliderSectionProps>) {\r\n const { data, isLoading, error } = useGetCollectionQuery({\r\n language,\r\n collectionId: products.collection_id ?? '',\r\n environment,\r\n adServerApiKey,\r\n });\r\n const handleLinkClick = (productItem: TCollectionItem, index: number) => {\r\n trackBrandshopEvent(\r\n 'ads_bs_content_click',\r\n {\r\n contentName: productItem.title,\r\n contentOrder: (index + 1).toString(),\r\n userStatus: isLoggedin ? 'logged_in' : 'guest',\r\n platform: 'Web',\r\n },\r\n trackBrandshopHandler,\r\n );\r\n\r\n // Map product to LinkDestination and build the payload\r\n const linkDestination = mapProductToLinkDestination(productItem);\r\n const payload = buildLinkDestination(linkDestination);\r\n\r\n if (!payload) return;\r\n onProductClick(payload);\r\n };\r\n\r\n if (isLoading) return <ProductSliderSkeleton />;\r\n\r\n if (error || !data) return null;\r\n\r\n return (\r\n <div className={styles.sectionContainer}>\r\n {!hideTitle && <h2 className={styles.sectionTitle}>{title}</h2>}\r\n <ProductsCarousel\r\n products={data.items}\r\n onProductClick={(product, index) => handleLinkClick(product, index)}\r\n language={language}\r\n />\r\n </div>\r\n );\r\n}\r\n","import { TBrandshopSection } from '@/types/brandshop';\r\nimport { BannerSection } from './BannerSection';\r\nimport { CategorySection } from './CategorySection';\r\nimport { NavigationSection } from './NavigationSection';\r\nimport { type TLinkClickEvent } from '@/types/ads';\r\nimport { type TEnvironment, type TTrackEvents } from '@/types/configTypes';\r\nimport { useInView } from 'react-intersection-observer';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport { ProductSliderSection } from './ProductSliderSection';\r\nimport { TLanguage } from '@/types/types';\r\n\r\ntype BrandshopSectionProps = {\r\n section: TBrandshopSection;\r\n isLoggedin: boolean;\r\n brandName: string;\r\n language: TLanguage;\r\n environment: TEnvironment;\r\n adServerApiKey: string;\r\n brandshopName?: string;\r\n onLinkClick: (data: TLinkClickEvent) => void;\r\n trackBrandshopHandler?: TTrackEvents;\r\n};\r\n\r\nexport const BrandshopSection = ({\r\n section,\r\n onLinkClick,\r\n trackBrandshopHandler,\r\n isLoggedin,\r\n brandName,\r\n language,\r\n environment,\r\n adServerApiKey,\r\n brandshopName,\r\n}: BrandshopSectionProps) => {\r\n const {\r\n section_type,\r\n section_title,\r\n show_section_title,\r\n data,\r\n section_display_order,\r\n } = section;\r\n\r\n const { ref } = useInView({\r\n onChange: (inView) => {\r\n if (inView) {\r\n trackBrandshopEvent(\r\n 'ads_bs_section_view',\r\n {\r\n brandName,\r\n sectionName: section_title,\r\n sectionOrder: section_display_order.toString(),\r\n userStatus: isLoggedin ? 'logged_in' : 'guest',\r\n platform: 'Web',\r\n },\r\n trackBrandshopHandler,\r\n );\r\n }\r\n },\r\n });\r\n\r\n return (\r\n <div ref={ref} style={{ width: '100%' }}>\r\n {(() => {\r\n switch (section_type) {\r\n case 'nav':\r\n return (\r\n <NavigationSection\r\n title={section_title}\r\n hideTitle={!show_section_title}\r\n logo={data[0].logo ?? ''}\r\n navigationLinks={data[0].navigation_links ?? []}\r\n onLinkClick={onLinkClick}\r\n isLoggedin={isLoggedin}\r\n trackBrandshopHandler={trackBrandshopHandler}\r\n brandshopName={brandshopName}\r\n />\r\n );\r\n\r\n case 'category':\r\n return (\r\n <CategorySection\r\n title={section_title}\r\n hideTitle={!show_section_title}\r\n categories={data}\r\n onCategoryClick={onLinkClick}\r\n isLoggedin={isLoggedin}\r\n trackBrandshopHandler={trackBrandshopHandler}\r\n />\r\n );\r\n\r\n case 'banner':\r\n return (\r\n <BannerSection\r\n title={section_title}\r\n banners={data}\r\n hideTitle={!show_section_title}\r\n onBannerClick={onLinkClick}\r\n isLoggedin={isLoggedin}\r\n sectionTitle={section_title}\r\n trackBrandshopHandler={trackBrandshopHandler}\r\n />\r\n );\r\n case 'productSlider':\r\n return (\r\n <ProductSliderSection\r\n products={data[0]}\r\n title={section_title}\r\n hideTitle={!show_section_title}\r\n isLoggedin={isLoggedin}\r\n trackBrandshopHandler={trackBrandshopHandler}\r\n onProductClick={onLinkClick}\r\n language={language}\r\n environment={environment}\r\n adServerApiKey={adServerApiKey}\r\n />\r\n );\r\n\r\n default:\r\n return null;\r\n }\r\n })()}\r\n </div>\r\n );\r\n};\r\n","export const debounce = <T extends unknown[]>(\r\n callback: (...args: T) => void,\r\n delay: number,\r\n): ((...args: T) => void) => {\r\n let timeoutId: ReturnType<typeof setTimeout>;\r\n\r\n return (...args: T) => {\r\n clearTimeout(timeoutId);\r\n timeoutId = setTimeout(() => {\r\n callback(...args);\r\n }, delay);\r\n };\r\n};\r\n","import { debounce } from '@/utils/helpers/utilities';\r\nimport { useEffect, useState } from 'react';\r\n\r\n/**\r\n * Hook to detect if the user has scrolled to (or near) the bottom of the page.\r\n * @param offset distance in pixels from the bottom to trigger earlier (default: 5px)\r\n */\r\nexport function useDetectScrolledToBottom(offset: number = 5): boolean {\r\n const [isBottom, setIsBottom] = useState(false);\r\n\r\n useEffect(() => {\r\n const handleScroll = () => {\r\n const scrollTop = window.scrollY || document.documentElement.scrollTop;\r\n const windowHeight = window.innerHeight;\r\n const fullHeight = document.documentElement.scrollHeight;\r\n\r\n const reachedBottom = scrollTop + windowHeight >= fullHeight - offset;\r\n setIsBottom(reachedBottom);\r\n };\r\n\r\n const debouncedScroll = debounce(handleScroll, 100);\r\n\r\n window.addEventListener('scroll', debouncedScroll, { passive: true });\r\n debouncedScroll();\r\n\r\n return () => {\r\n window.removeEventListener('scroll', debouncedScroll);\r\n };\r\n }, [offset]);\r\n\r\n return isBottom;\r\n}\r\n","import Skeleton from '../Carousel/AdSkeleton';\r\nimport styles from './Brandshop.module.css';\r\n\r\nexport function BrandshopSkeleton() {\r\n const NAVIGATION_ITEMS_COUNT = 3;\r\n const CATEGORY_ITEMS_COUNT = 2;\r\n\r\n return (\r\n <div className={styles.brandshopContainerSkeleton}>\r\n <Skeleton className={styles.bannerSkeleton} />\r\n\r\n <div className={styles.navContainerSkeleton}>\r\n {Array.from({ length: NAVIGATION_ITEMS_COUNT }).map((_, index) => (\r\n <Skeleton key={index} className={styles.navPillSkeleton} />\r\n ))}\r\n </div>\r\n\r\n <div\r\n className={styles.categoryGridSkeleton}\r\n style={{\r\n gridTemplateColumns: `repeat(${Math.min(CATEGORY_ITEMS_COUNT, 2)}, 1fr)`,\r\n }}\r\n >\r\n {Array.from({ length: CATEGORY_ITEMS_COUNT }).map((_, index) => (\r\n <Skeleton key={index} className={styles.categoryTileSkeleton} />\r\n ))}\r\n </div>\r\n\r\n <Skeleton className={styles.promoSkeleton} />\r\n </div>\r\n );\r\n}\r\n","import { useEffect } from 'react';\r\nimport { useGetBrandshopQuery } from '@/api/queries/useGetBrandshop';\r\nimport { useIsPlatform } from '@/hooks/use-is-platform';\r\nimport { AdsDeviceType } from '@/types/ads';\r\nimport { type TBrandshopProps } from './Brandshop';\r\nimport { BrandshopSection } from './BrandshopSection';\r\nimport { trackBrandshopEvent } from '@/utils/analytics/trackBrandshopEvents';\r\nimport { useDetectScrolledToBottom } from '@/hooks/useDetectScrolledToBottom';\r\nimport { BrandshopSkeleton } from './BrandshopSkeleton';\r\nimport styles from './Brandshop.module.css';\r\n\r\nexport function BrandshopContent({\r\n language,\r\n brandshopId,\r\n environment,\r\n adServerApiKey,\r\n isLoggedin,\r\n brandshop,\r\n onLinkClick,\r\n trackBrandshopHandler,\r\n}: Readonly<TBrandshopProps>) {\r\n const { isLaptop, isDesktop } = useIsPlatform();\r\n const deviceType =\r\n isLaptop || isDesktop ? AdsDeviceType.Web : AdsDeviceType.Mobile;\r\n\r\n let data = brandshop;\r\n\r\n const {\r\n data: brandshopData,\r\n isLoading,\r\n error,\r\n } = useGetBrandshopQuery({\r\n language,\r\n brandshopId,\r\n environment,\r\n adServerApiKey,\r\n deviceType,\r\n enabled: !brandshop,\r\n });\r\n\r\n data ??= brandshopData;\r\n\r\n const isBottomReached = useDetectScrolledToBottom();\r\n\r\n const brandName = data?.name || '';\r\n const userStatus = isLoggedin ? 'logged_in' : 'guest';\r\n const platform = 'Web';\r\n\r\n useEffect(() => {\r\n window.scrollTo(0, 0);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (!data) return;\r\n trackBrandshopEvent(\r\n 'ads_bs_pageload',\r\n { brandName, userStatus, platform },\r\n trackBrandshopHandler,\r\n );\r\n }, [data]);\r\n\r\n useEffect(() => {\r\n if (!data || !isBottomReached) return;\r\n trackBrandshopEvent(\r\n 'ads_bs_pageend',\r\n { brandName, userStatus, platform },\r\n trackBrandshopHandler,\r\n );\r\n }, [isBottomReached]);\r\n\r\n if (isLoading) return <BrandshopSkeleton />;\r\n if (error) {\r\n throw new Error(\r\n `brandshop with id ${brandshopId} failed to load} - ${error?.message || 'unknown error'}`,\r\n );\r\n }\r\n\r\n const content = data?.content;\r\n if (!Array.isArray(content)) return null;\r\n\r\n const sortedSections = [...content].sort(\r\n (a, b) => a.section_display_order - b.section_display_order,\r\n );\r\n\r\n return (\r\n <div className={styles.brandshopContent}>\r\n {sortedSections.map((section) => (\r\n <BrandshopSection\r\n key={section.tracking_id}\r\n section={section}\r\n onLinkClick={onLinkClick}\r\n isLoggedin={isLoggedin}\r\n brandName={brandName}\r\n trackBrandshopHandler={trackBrandshopHandler}\r\n language={language}\r\n environment={environment}\r\n adServerApiKey={adServerApiKey}\r\n brandshopName={data?.name}\r\n />\r\n ))}\r\n </div>\r\n );\r\n}\r\n","export default \"data:image/svg+xml,%3csvg%20width='49'%20height='48'%20viewBox='0%200%2049%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M24.4941%2020.0311V24.0242M24.5%2030H24.52M22.7708%206.98426L6.27321%2034.9912C5.4892%2036.3221%206.45019%2038%207.9965%2038H40.9918C42.5381%2038%2043.4991%2036.3221%2042.7151%2034.9912L26.2174%206.98426C25.4444%205.67192%2023.5439%205.67191%2022.7708%206.98426ZM25%2030C25%2030.2761%2024.7761%2030.5%2024.5%2030.5C24.2239%2030.5%2024%2030.2761%2024%2030C24%2029.7239%2024.2239%2029.5%2024.5%2029.5C24.7761%2029.5%2025%2029.7239%2025%2030Z'%20stroke='%23DA1E28'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e\"","import errorIcon from '@/assets/error.svg';\r\nimport styles from './Brandshop.module.css';\r\nimport { type TLanguage } from '@/types/types';\r\nimport { Image } from '../Image/Image';\r\n\r\nfunction BrandshopError({ language }: Readonly<{ language: TLanguage }>) {\r\n const isArabic = language === 'ar';\r\n\r\n const heading = isArabic ? 'حدث خطأ ما' : 'Something went wrong';\r\n const description = isArabic\r\n ? 'نواجه مشكلة في تحميل هذه الصفحة. يرجى الانتظار قليلاً؛ سيتم حلها قريباً.'\r\n : \"We're having trouble loading this page. Please bear with us; it should be resolved shortly.\";\r\n const buttonLabel = isArabic ? 'إعادة المحاولة' : 'Try again';\r\n\r\n return (\r\n <div className={styles.brandshopError}>\r\n <Image src={errorIcon} className={styles.errorIcon} alt=\"error\" />\r\n <div className={styles.errorContent}>\r\n <div className={styles.errorText}>\r\n <h2>{heading}</h2>\r\n <p>{description}</p>\r\n </div>\r\n <button\r\n className={styles.errorButton}\r\n onClick={() => window.location.reload()}\r\n >\r\n {buttonLabel}\r\n </button>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default BrandshopError;\r\n","import { Component, ErrorInfo, ReactNode } from 'react';\r\n\r\ninterface ErrorBoundaryProps {\r\n children: ReactNode;\r\n fallback: ReactNode;\r\n}\r\n\r\ninterface ErrorBoundaryState {\r\n hasError: boolean;\r\n error: Error | null;\r\n errorInfo: ErrorInfo | null;\r\n}\r\n\r\nclass ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\r\n constructor(props: ErrorBoundaryProps) {\r\n super(props);\r\n this.state = { hasError: false, error: null, errorInfo: null };\r\n }\r\n\r\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\r\n return { hasError: true, error: error, errorInfo: null };\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\r\n this.setState({ error, errorInfo });\r\n }\r\n\r\n render(): ReactNode {\r\n if (this.state.hasError) {\r\n return this.props.fallback;\r\n }\r\n\r\n return this.props.children;\r\n }\r\n}\r\n\r\nexport default ErrorBoundary;\r\n","import { type TLanguage } from '@/types/types';\r\nimport { type TTrackEvents, type TEnvironment } from '@/types/configTypes';\r\nimport { ReactQueryProvider } from '@/providers/ReactQueryProvider';\r\nimport { BrandshopContent } from './BrandshopContent';\r\nimport { type TLinkClickEvent } from '@/types/ads';\r\nimport BrandshopError from './BrandshopError';\r\nimport ErrorBoundary from '../ErrorBoundary/ErrorBoundary';\r\nimport { type TBrandshopData } from '@/types/brandshop';\r\n\r\nexport type TBrandshopProps = {\r\n language: TLanguage;\r\n brandshopId: string;\r\n environment: TEnvironment;\r\n adServerApiKey: string;\r\n isLoggedin: boolean;\r\n brandshop?: TBrandshopData;\r\n onLinkClick: (event: TLinkClickEvent) => void;\r\n trackBrandshopHandler?: TTrackEvents;\r\n};\r\n\r\nexport default function Brandshop(props: Readonly<TBrandshopProps>) {\r\n return (\r\n <ReactQueryProvider>\r\n <ErrorBoundary fallback={<BrandshopError language={props.language} />}>\r\n <BrandshopContent {...props} />\r\n </ErrorBoundary>\r\n </ReactQueryProvider>\r\n );\r\n}\r\n"],"names":["getBrandshop","deviceType","language","brandshopId","environment","adServerApiKey","token","timestamp","generateAccessToken","adServerBaseUrl","getBaseUrl","error","GET_BRANDSHOP_QUERY_KEY","useGetBrandshopQuery","enabled","useQuery","BannerWithLink","image","text","alt","onClick","styles","jsx","Image","Banner","trackBrandshopEvent","eventName","props","trackEvent","brandName","userStatus","platform","sectionName","sectionOrder","contentName","contentOrder","BannerSection","title","hideTitle","banners","isLoggedin","sectionTitle","onBannerClick","trackBrandshopHandler","handleLinkClick","bannerItem","payload","buildLinkDestination","jsxs","banner","CategorySection","categories","onCategoryClick","categoryItem","limitedCategories","sortedCategories","a","b","gridColumns","category","NavigationSection","logo","navigationLinks","brandshopName","onLinkClick","navigationItem","sortedNavigationLinks","navigationLink","DiscountValueTypesEnum","DiscountTypesEnum","getDiscountValue","discount","currency","getDiscounts","discounts","acc","Card","children","className","Chip","getDiscountChipDetails","promotionValue","hasCoupon","isPriceDropped","saveLabelText","couponText","priceDropText","translations","getTranslation","variantStyles","DiscountChip","coupon","translate","discountChipDetails","tag","CouponBadge","value","PriceDisplay","price","promotion","hasDiscount","ProductTitle","t","i","r","o","e","s","n","l","myloENIcon","myloARIcon","useAsyncMemo","fn","deps","setValue","useState","isLoading","setIsLoading","useEffect","isMounted","result","parsePriceToNumber","priceString","cleanedPrice","parsedPrice","MYLO_MINIMUM_PRICE_THRESHOLD","ProductCard","id","brand","myloInstallmentInfo","isMyloInstallmentInfoLoading","getInstallmentInfoPLP","installmentText","Skeleton","ProductsCarousel","slidesToScroll","products","onProductClick","api","setApi","current","setCurrent","count","setCount","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","updateCarouselState","AdCarousel","AdCarouselContent","product","index","AdCarouselItem","AdCarouselPrevious","AdCarouselNext","AdCarouselPagination","mapProductToLinkDestination","getCollection","collectionId","GET_COLLECTION_QUERY_KEY","useGetCollectionQuery","ProductCardSkeleton","ProductSliderSkeleton","length","skeletonLength","_","ProductSliderSection","data","productItem","linkDestination","BrandshopSection","section","section_type","section_title","show_section_title","section_display_order","ref","useInView","inView","debounce","callback","delay","timeoutId","args","useDetectScrolledToBottom","offset","isBottom","setIsBottom","debouncedScroll","scrollTop","windowHeight","fullHeight","reachedBottom","BrandshopSkeleton","BrandshopContent","brandshop","isLaptop","isDesktop","useIsPlatform","AdsDeviceType","brandshopData","isBottomReached","content","sortedSections","errorIcon","BrandshopError","isArabic","heading","description","buttonLabel","ErrorBoundary","Component","errorInfo","Brandshop","ReactQueryProvider"],"mappings":";;;;;AAiBO,MAAMA,KAAe,OAAO;AAAA,EACjC,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACF,MAAmD;AACjD,QAAM,CAACC,GAAOC,CAAS,IAAI,MAAMC,EAAoBH,CAAc,GAC7DI,IAAkBC,EAAW,YAAYN,CAAW;AAE1D,MAAI;AAcF,YADiD,OAZrC,MAAM;AAAA,MAChB,GAAGK,CAAe,4BAA4BN,CAAW;AAAA,MACzD;AAAA,QACE,SAAS;AAAA,UACP,QAAQF;AAAA,UACR,MAAMC;AAAA,UACN,cAAcI;AAAA,UACd,kBAAkBC;AAAA,QAAA;AAAA,MACpB;AAAA,IACF,GAGyD,KAAA,GAClC;AAAA,EAC3B,SAASI,GAAO;AACd,UAAM,IAAI,MAAM,uC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E,OAAA3M,GAAO,WAAA2M,EAAA,CAAW;AAAA,EACpC;AAAA,EAEA,SAAoB;AAClB,WAAI,KAAK,MAAM,WACN,KAAK,MAAM,WAGb,KAAK,MAAM;AAAA,EACpB;AACF;ACdA,SAAwBC,GAAU5L,GAAkC;AAClE,2BACG6L,GAAA,EACC,UAAA,gBAAAlM,EAAC8L,IAAA,EAAc,4BAAWL,IAAA,EAAe,UAAUpL,EAAM,SAAA,CAAU,GACjE,UAAA,gBAAAL,EAAC8K,IAAA,EAAkB,GAAGzK,EAAA,CAAO,GAC/B,GACF;AAEJ;","x_google_ignoreList":[19]}
|
package/dist/Brandshops.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { g as B, a as _, u as b, R as k } from "./ReactQueryProvider-D__k2BsQ.js";
|
|
3
|
-
import { I as m } from "./Image-
|
|
3
|
+
import { I as m } from "./Image-BEPWcsda.js";
|
|
4
4
|
const g = async ({
|
|
5
5
|
language: n,
|
|
6
6
|
environment: r,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l } from "react";
|
|
3
|
+
import { d as g } from "./ReactQueryProvider-D__k2BsQ.js";
|
|
4
|
+
function E({
|
|
5
|
+
src: r,
|
|
6
|
+
alt: o,
|
|
7
|
+
className: t,
|
|
8
|
+
fallback: a,
|
|
9
|
+
onError: e,
|
|
10
|
+
fetchPriority: s,
|
|
11
|
+
width: m,
|
|
12
|
+
height: i
|
|
13
|
+
}) {
|
|
14
|
+
const [u, c] = l(!1);
|
|
15
|
+
return /* @__PURE__ */ n(
|
|
16
|
+
"img",
|
|
17
|
+
{
|
|
18
|
+
src: r,
|
|
19
|
+
alt: o,
|
|
20
|
+
width: m,
|
|
21
|
+
height: i,
|
|
22
|
+
className: t,
|
|
23
|
+
style: u ? { backgroundColor: "#D2D2D2" } : void 0,
|
|
24
|
+
onError: (f) => {
|
|
25
|
+
f.currentTarget.src = a ?? g, c(!0), e?.();
|
|
26
|
+
},
|
|
27
|
+
fetchPriority: s ?? "auto"
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
E as I
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=Image-BEPWcsda.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image-BEPWcsda.js","sources":["../src/components/Image/Image.tsx"],"sourcesContent":["import { useState } from 'react';\r\nimport defaultFallbackImg from '@/assets/fallback-image.svg';\r\n\r\ntype TFetchPriority = 'high' | 'low' | 'auto';\r\n\r\ntype ImageProps = {\r\n src: string;\r\n alt: string;\r\n className?: string;\r\n fallback?: string;\r\n onError?: () => void;\r\n fetchPriority?: TFetchPriority;\r\n width?: number;\r\n height?: number;\r\n};\r\nexport function Image({\r\n src,\r\n alt,\r\n className,\r\n fallback,\r\n onError,\r\n fetchPriority,\r\n width,\r\n height,\r\n}: Readonly<ImageProps>) {\r\n const [hasError, setHasError] = useState(false);\r\n return (\r\n <img\r\n src={src}\r\n alt={alt}\r\n width={width}\r\n height={height}\r\n className={className}\r\n style={hasError ? { backgroundColor: '#D2D2D2' } : undefined}\r\n onError={(e) => {\r\n (e.currentTarget as HTMLImageElement).src =\r\n fallback ?? defaultFallbackImg;\r\n setHasError(true);\r\n onError?.();\r\n }}\r\n fetchPriority={fetchPriority ?? 'auto'}\r\n />\r\n );\r\n}\r\n"],"names":["Image","src","alt","className","fallback","onError","fetchPriority","width","height","hasError","setHasError","useState","jsx","e","defaultFallbackImg"],"mappings":";;;AAeO,SAASA,EAAM;AAAA,EACpB,KAAAC;AAAA,EACA,KAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AACF,GAAyB;AACvB,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK;AAC9C,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAX;AAAA,MACA,KAAAC;AAAA,MACA,OAAAK;AAAA,MACA,QAAAC;AAAA,MACA,WAAAL;AAAA,MACA,OAAOM,IAAW,EAAE,iBAAiB,cAAc;AAAA,MACnD,SAAS,CAACI,MAAM;AACb,QAAAA,EAAE,cAAmC,MACpCT,KAAYU,GACdJ,EAAY,EAAI,GAChBL,IAAA;AAAA,MACF;AAAA,MACA,eAAeC,KAAiB;AAAA,IAAA;AAAA,EAAA;AAGtC;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
type BannerProps = {
|
|
2
2
|
image: string;
|
|
3
3
|
alt: string;
|
|
4
|
-
index?: number;
|
|
5
4
|
};
|
|
6
|
-
export declare const Banner: ({ image, alt
|
|
5
|
+
export declare const Banner: ({ image, alt }: BannerProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
type TFetchPriority = 'high' | 'low' | 'auto';
|
|
2
|
-
type Tloading = 'eager' | 'lazy';
|
|
3
2
|
type ImageProps = {
|
|
4
3
|
src: string;
|
|
5
4
|
alt: string;
|
|
@@ -9,7 +8,6 @@ type ImageProps = {
|
|
|
9
8
|
fetchPriority?: TFetchPriority;
|
|
10
9
|
width?: number;
|
|
11
10
|
height?: number;
|
|
12
|
-
loading?: Tloading;
|
|
13
11
|
};
|
|
14
|
-
export declare function Image({ src, alt, className, fallback, onError, fetchPriority, width, height,
|
|
12
|
+
export declare function Image({ src, alt, className, fallback, onError, fetchPriority, width, height, }: Readonly<ImageProps>): import("react/jsx-runtime").JSX.Element;
|
|
15
13
|
export {};
|