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B,IAAI,CAAC,0BAEZ,MAAM,MAAU,+CALhBnB,EAAOmB,IAAI,CAAC,UAOhB,EASA,MAFAC,CAAAA,EAAAA,EAAAA,EAAAA,EAAUC,GAGR,GAAAC,EAAAC,GAAA,EAACC,EAAAA,CAAqBA,CAAAA,CACnB,GAAGH,CAAK,CACTd,sBAAuBA,EACvBkB,iCAXqC,IACnCC,GACFxB,EAAUuB,gCAAgC,CAACC,EAE/C,GAUF","sources":["webpack://_N_E/./src/components/PromoContentGallery/PromoContentGallery.tsx"],"sourcesContent":["import PromoContentGalleryUI, {\n Props as UIProps,\n} from '@interflora/ui-components/build/components/PromoContentGallery/PromoContentGallery'\nimport React, { useContext } from 'react'\nimport { useRouter } from 'next/router'\nimport { ADD_DELIVERY_PASS_TO_CART } from '../../graphql/queries'\nimport { useMutation } from '@apollo/client'\nimport { SiteContext } from '@interflora/ui-components/build/utils/common'\nimport AnalyticsContext from 'context/AnalyticsContext'\nimport { useLoaded } from '@interflora/ui-components'\n\ntype Props = UIProps\n\nconst PromoContentGallery = (props: Props) => {\n const { getCustomer } = useContext(SiteContext)\n const router = useRouter()\n const analytics = useContext(AnalyticsContext)\n /** add to cart mutation */\n const [addToBasketMutation] = useMutation(ADD_DELIVERY_PASS_TO_CART)\n\n const addDeliveryPassToCart = async (sku: string) => {\n const response = await addToBasketMutation({ variables: { input: { sku } } })\n const items = response.data.addDeliveryPassToCart?.consignments\n const idpType = sku == 'INTERFLORAPLATINUM' ? 'Platinum' : 'Gold'\n\n analytics.idpJourney('IDP Page', idpType)\n if (!getCustomer.data?.customer?.id || items?.length > 1) {\n router.push('/basket')\n } else if (getCustomer.data?.customer?.id && items?.length === 1) {\n /** redirecting to checkout contact information page */\n router.push('/checkout/contact')\n } else {\n throw new Error('There was a problem, please try again.')\n }\n }\n\n const sendPromoContentGalleryAnalytics = (linkText: string) => {\n if (linkText) {\n analytics.sendPromoContentGalleryAnalytics(linkText)\n }\n }\n useLoaded(props)\n\n return (\n \n )\n}\n\nexport default PromoContentGallery\n"],"names":["__webpack_exports__","getCustomer","useContext","SiteContext","router","useRouter","analytics","AnalyticsContext","addToBasketMutation","useMutation","ADD_DELIVERY_PASS_TO_CART","addDeliveryPassToCart","sku","response","items","variables","input","data","consignments","idpJourney","customer","id","length","push","useLoaded","props","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsx","PromoContentGalleryUI","sendPromoContentGalleryAnalytics","linkText"],"sourceRoot":""}