/***/
/*
* As of this writing, there is no single Product query type in the M2.3 schema.
* The recommended solution is to use filter criteria on a Products query.
* However, the `id` argument is not supported. See
* https://github.com/magento/graphql-ce/issues/86
* TODO: Replace with a single product query when possible.
*/
/*#__PURE__*/
// extracted by extract-css-chunks-webpack-plugin
// const editProductData = JSON.parse(
// localStorage.getItem('editProductData')
// );
// if (
// isRecommendationProduct ||
// (isProductUpdate &&
// editProductData &&
// editProductData.editTriggerFrom == 'cart')
// )
// history.push(ROUTES.CART);
// else
// isFromPromotionPage
// ? dispatch({
// type: 'UPDATE_MODAL_DATA',
// payload: {
// autoApplyCoupon,
// offerName
// }
// }) && history.push(ROUTES.PROMOTIONS)
// : history.push(ROUTES.MENU);
//handleBF_LargeOrder(res);
//const promotionRelatedProduct=res?.addSimpleProductsToCart?.cart?.items?.filter((data)=>(data?.product?.url_key == urlKey))
// if(isFromPromotionPage && res?.addSimpleProductsToCart?.cart?.items?.length && autoApplyCoupon){
// sessionStorage.setItem('itemId', promotionRelatedProduct[0]?.uid);
// }
// handleBF_LargeOrder(res); // BF large order check logic moved to PLP
// Exit if there are no categories for this product.
// If we couldn't find a leaf category then just use the first category
// in the list for this product.
// breadcrumbs can be `null`...
// If this is a simple product it has no option codes.
// Initialize optionCodes based on the options of the product.
// Non-configurable products can't be missing options.
// Configurable products are missing options if we have fewer
// option selections than the product has options.
// If any of the possible variants matches the selection add that
// variant's image to the media gallery. NOTE: This _can_, and does,
// include variants such as size. If Magento is configured to display
// an image for a size attribute, it will render that image.
// For simple items, this will be an empty map.
/*
@deprecated in favor of general addProductsToCart mutation. Will support until the next MAJOR.
*/
// Use the proper mutation for the type.
//"4.0001"; //localizationAddress?.latlong?.lat;
//"114.8888" //localizationAddress?.latlong?.lng;
// We must create a new Map here so that React knows that the value
// of optionSelections has changed.
//|| isAddProductLoading,
// const thumbnails = useMemo(() => {
// return Array.from({ length: 3 })
// .fill(null)
// .map((value, index) => {
// return (
//
//
//
// );
// });
// }, [classes]);
/* import() */
// const [getCartDetails, { data: cartItems }] = useLazyQuery(
// GET_CART_QUERY,
// {
// fetchPolicy: 'no-cache'
// }
// eslint-disable-next-line react-hooks/exhaustive-deps
// useEffect(() => {
// getCartDetails({ variables: { cartId } });
// }, [cartId, getCartDetails]);
// const cartDataArr = cartDetails?.cart?.items?.map(data => {
// if (data?.product?.sku == promotionValidationRules?.productSku)
// return true;
// else return false;
// });
// // const CartSubtotal =
// // cartDetails?.cart?.prices?.subtotal_excluding_tax?.value;
// if (cartDataArr) {
// cartDataArr?.includes(true) && setIsProductSkuSame(true);
// // }
// // if (
// // Number(promotionValidationRules?.finalPrice) +
// // Number(CartSubtotal) <
// // promotionValidationRules?.minOrderValue &&
// // location?.state &&
// // isSignedIn
// // ) {
// // setOpenErrorPopUp(true);
// // setIsMinimumOrderValue({
// // minimumOrder: true,
// // orderValue:
// // promotionValidationRules?.minOrderValue >
// // Number(promotionValidationRules?.finalPrice)
// // ? promotionValidationRules?.minOrderValue -
// // Number(promotionValidationRules?.finalPrice)
// // : Number(promotionValidationRules?.finalPrice) -
// // promotionValidationRules?.minOrderValue
// // });
// }, [cartDetails?.cart?.items, promotionValidationRules?.productSku]);
//parseFloat(promotionValidationRules)?.discountedPrice || 0;
// Handle cases where a user token is invalid or expired. Preferably
// this would be handled elsewhere with an error code and not a string.
// Handle cases where a cart wasn't created properly.
// Handle cases where user try to add item with selecting location.
// An unknown error should still present a readable message.
// disabled={isAddToCartDisabled || isCartButtonDisable}
// return productOptsState && !isEmpty(productOptsState)
// ? Object.keys(productOptsState)
// //.filter(key => productOptsState[key].title !== 'addOns')
// .filter(
// key =>
// productOptsState[key]?.div_class?.toLowerCase() !=
// 'optionimage' &&
// 'optionupsize'
// )
// .map(key => productOptsState[key])
// .reduce((acc, curr) => {
// const details = curr?.details?.length ? curr.details : [];
// return [...acc, ...details];
// }, [])
// : null;
//setProductOptsState(KFC_productOptsState)
// const Options = React.lazy(() =>
// import('@magento/venia-ui/lib/components/ProductOptions')
// The product isn't in the cache and we don't have a response from GraphQL yet.
// Note: if a product is out of stock _and_ the backend specifies not to
// display OOS items, the items array will be empty.
// Only return the product that we queried for.
// Update the page indicator if the GraphQL query is in flight.