@behio/storefront-sdk 2.9.0 → 2.11.0
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/{client-GId6Qj64.d.mts → client-CmbuYuof.d.mts} +7 -0
- package/dist/{client-GId6Qj64.d.ts → client-CmbuYuof.d.ts} +7 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/next.d.mts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/react.d.mts +15 -0
- package/dist/react.d.ts +15 -0
- package/dist/react.js +47 -1
- package/dist/react.mjs +60 -14
- package/package.json +1 -1
|
@@ -2642,6 +2642,13 @@ interface CrossSellItem {
|
|
|
2642
2642
|
compareAtPrice: number | null;
|
|
2643
2643
|
/** Currency code the `price` / `compareAtPrice` are expressed in. */
|
|
2644
2644
|
currency: string;
|
|
2645
|
+
/**
|
|
2646
|
+
* true when `price` was FX-converted from the shop's default currency (no
|
|
2647
|
+
* price row for `currency`). Show it as approximate (for example with "≈");
|
|
2648
|
+
* the cart charges only real price rows. Same meaning as
|
|
2649
|
+
* `ProductPrice.isApproximate`. Backend 2026-10-02+, absent on older APIs.
|
|
2650
|
+
*/
|
|
2651
|
+
priceIsApproximate?: boolean;
|
|
2645
2652
|
imageUrl: string | null;
|
|
2646
2653
|
/** Selected-warehouse quantity; null when the merchant hides exact stock. */
|
|
2647
2654
|
stockCached: number | null;
|
|
@@ -2642,6 +2642,13 @@ interface CrossSellItem {
|
|
|
2642
2642
|
compareAtPrice: number | null;
|
|
2643
2643
|
/** Currency code the `price` / `compareAtPrice` are expressed in. */
|
|
2644
2644
|
currency: string;
|
|
2645
|
+
/**
|
|
2646
|
+
* true when `price` was FX-converted from the shop's default currency (no
|
|
2647
|
+
* price row for `currency`). Show it as approximate (for example with "≈");
|
|
2648
|
+
* the cart charges only real price rows. Same meaning as
|
|
2649
|
+
* `ProductPrice.isApproximate`. Backend 2026-10-02+, absent on older APIs.
|
|
2650
|
+
*/
|
|
2651
|
+
priceIsApproximate?: boolean;
|
|
2645
2652
|
imageUrl: string | null;
|
|
2646
2653
|
/** Selected-warehouse quantity; null when the merchant hides exact stock. */
|
|
2647
2654
|
stockCached: number | null;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-
|
|
2
|
-
export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerBadge, ad as CustomerChallenge, ae as CustomerGamification, af as CustomerGamificationQuery, ag as CustomerProfile, ah as DigitalDownload, ai as DownloadUrl, aj as Facet, ak as FacetAvailability, al as FacetCategory, am as FacetLabel, an as FacetPriceRange, ao as FacetRange, ap as FacetRatingBucket, aq as FacetValue, ar as FacetsResponse, as as FilterField, at as FulfillmentStatus, au as FulfillmentStatuses, av as GamificationRefreshResult, aw as GiftCardBalance, ax as GiftCardPurchaseInput, ay as GiftCardPurchaseResult, az as GiftCardSummary, aA as LessonNote, aB as LessonQuiz, aC as LoginInput, aD as LoyaltyBalance, aE as LoyaltyNextTier, aF as LoyaltyProgram, aG as LoyaltyQuery, aH as LoyaltyReferralResult, aI as LoyaltySummary, aJ as LoyaltyTier, aK as LoyaltyTierPerks, aL as LoyaltyTransaction, aM as Menu, aN as MenuItem, aO as MenuItemRef, aP as MenuItemType, aQ as MessageResponse, aR as NewsletterOptInDefault, aS as NewsletterSubscribeInput, aT as NewsletterSubscribeResult, aU as NewsletterUnsubscribeResult, aV as OrderAccessRequestResponse, aW as OrderAccessVerifyResponse, aX as OrderDetail, aY as OrderItem, aZ as OrderListItem, a_ as OrderPickupPoint, a$ as OrderShipment, b0 as OrderStatus, b1 as OrderStatusHistory, b2 as OrderStatuses, b3 as OrderTracking, b4 as Page, b5 as PageAttachment, b6 as PageDetail, b7 as PaginatedResponse, b8 as PaymentInstrument, b9 as PaymentStatus, ba as PaymentStatuses, bb as PaymentSwift, bc as PickupPoint, bd as PickupPointHours, be as PickupPointsInput, bf as PickupWidgetConfig, bg as PriceDisplay, bh as ProductAssetGroup, bi as ProductAssetItem, bj as ProductAvailability, bk as ProductGroup, bl as ProductLabel, bm as ProductListItem, bn as ProductMedia, bo as ProductMediaVariant, bp as ProductParameter, bq as ProductParameterGroup, br as ProductParametersResponse, bs as ProductPrice, bt as ProductPromotionSummary, bu as ProductReview, bv as ProductReviewsResponse, bw as ProductSibling, bx as ProductSort, by as ProductSortValue, bz as ProductVolumePrice, bA as ProductsQuery, bB as QuizAnswerInput, bC as QuizAnswerResult, bD as QuizQuestion, bE as QuizResult, bF as QuoteItem, bG as QuoteRequest, bH as RegisterInput, bI as RegisterResult, bJ as RequestInterceptor, bK as RequestInterceptorConfig, bL as ResponseInterceptor, bM as ResponseInterceptorData, bN as ReturnRequest, bO as ReturnRequestItem, bP as ReturnStatus, bQ as ReturnStatusItem, bR as ReturnableOrder, bS as ReturnableOrderItem, bT as SdkError, bU as ShippingMethodSummary, bV as ShippingQuote, bW as ShippingQuoteInput, bX as ShopAppearance, bY as ShopInfo, bZ as ShopScript, b_ as ShopScriptPlacement, b$ as ShopScriptType, c0 as ShopScripts, c1 as ShopSeo, c2 as ShopSeoIdentity, c3 as SiteFormField, c4 as SiteFormFieldOption, c5 as SiteFormFieldType, c6 as Sitemap, c7 as SitemapEntry, c8 as StockBehavior, c9 as StockMode, ca as StorefrontForm, cb as StorefrontFormFieldErrorCode, cc as StorefrontFormFile, cd as StorefrontFormSettings, ce as StorefrontFormSubmitInput, cf as StorefrontFormSubmitResult, cg as StorefrontFormUpload, ch as SubmitQuoteInput, ci as SubmitReturnInput, cj as SubmitReviewInput, ck as Subscription, cl as SubscriptionAction, cm as SubscriptionFrequency, cn as SubscriptionItem, co as SubscriptionStatus, cp as TaxBreakdownLine, cq as VariantAxis, cr as VariantAxisValue, cs as WishlistItem, ct as clearCartSummary, cu as err, cv as ok, cw as publishCartSummary, cx as toSdkError } from './client-
|
|
1
|
+
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-CmbuYuof.mjs';
|
|
2
|
+
export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerBadge, ad as CustomerChallenge, ae as CustomerGamification, af as CustomerGamificationQuery, ag as CustomerProfile, ah as DigitalDownload, ai as DownloadUrl, aj as Facet, ak as FacetAvailability, al as FacetCategory, am as FacetLabel, an as FacetPriceRange, ao as FacetRange, ap as FacetRatingBucket, aq as FacetValue, ar as FacetsResponse, as as FilterField, at as FulfillmentStatus, au as FulfillmentStatuses, av as GamificationRefreshResult, aw as GiftCardBalance, ax as GiftCardPurchaseInput, ay as GiftCardPurchaseResult, az as GiftCardSummary, aA as LessonNote, aB as LessonQuiz, aC as LoginInput, aD as LoyaltyBalance, aE as LoyaltyNextTier, aF as LoyaltyProgram, aG as LoyaltyQuery, aH as LoyaltyReferralResult, aI as LoyaltySummary, aJ as LoyaltyTier, aK as LoyaltyTierPerks, aL as LoyaltyTransaction, aM as Menu, aN as MenuItem, aO as MenuItemRef, aP as MenuItemType, aQ as MessageResponse, aR as NewsletterOptInDefault, aS as NewsletterSubscribeInput, aT as NewsletterSubscribeResult, aU as NewsletterUnsubscribeResult, aV as OrderAccessRequestResponse, aW as OrderAccessVerifyResponse, aX as OrderDetail, aY as OrderItem, aZ as OrderListItem, a_ as OrderPickupPoint, a$ as OrderShipment, b0 as OrderStatus, b1 as OrderStatusHistory, b2 as OrderStatuses, b3 as OrderTracking, b4 as Page, b5 as PageAttachment, b6 as PageDetail, b7 as PaginatedResponse, b8 as PaymentInstrument, b9 as PaymentStatus, ba as PaymentStatuses, bb as PaymentSwift, bc as PickupPoint, bd as PickupPointHours, be as PickupPointsInput, bf as PickupWidgetConfig, bg as PriceDisplay, bh as ProductAssetGroup, bi as ProductAssetItem, bj as ProductAvailability, bk as ProductGroup, bl as ProductLabel, bm as ProductListItem, bn as ProductMedia, bo as ProductMediaVariant, bp as ProductParameter, bq as ProductParameterGroup, br as ProductParametersResponse, bs as ProductPrice, bt as ProductPromotionSummary, bu as ProductReview, bv as ProductReviewsResponse, bw as ProductSibling, bx as ProductSort, by as ProductSortValue, bz as ProductVolumePrice, bA as ProductsQuery, bB as QuizAnswerInput, bC as QuizAnswerResult, bD as QuizQuestion, bE as QuizResult, bF as QuoteItem, bG as QuoteRequest, bH as RegisterInput, bI as RegisterResult, bJ as RequestInterceptor, bK as RequestInterceptorConfig, bL as ResponseInterceptor, bM as ResponseInterceptorData, bN as ReturnRequest, bO as ReturnRequestItem, bP as ReturnStatus, bQ as ReturnStatusItem, bR as ReturnableOrder, bS as ReturnableOrderItem, bT as SdkError, bU as ShippingMethodSummary, bV as ShippingQuote, bW as ShippingQuoteInput, bX as ShopAppearance, bY as ShopInfo, bZ as ShopScript, b_ as ShopScriptPlacement, b$ as ShopScriptType, c0 as ShopScripts, c1 as ShopSeo, c2 as ShopSeoIdentity, c3 as SiteFormField, c4 as SiteFormFieldOption, c5 as SiteFormFieldType, c6 as Sitemap, c7 as SitemapEntry, c8 as StockBehavior, c9 as StockMode, ca as StorefrontForm, cb as StorefrontFormFieldErrorCode, cc as StorefrontFormFile, cd as StorefrontFormSettings, ce as StorefrontFormSubmitInput, cf as StorefrontFormSubmitResult, cg as StorefrontFormUpload, ch as SubmitQuoteInput, ci as SubmitReturnInput, cj as SubmitReviewInput, ck as Subscription, cl as SubscriptionAction, cm as SubscriptionFrequency, cn as SubscriptionItem, co as SubscriptionStatus, cp as TaxBreakdownLine, cq as VariantAxis, cr as VariantAxisValue, cs as WishlistItem, ct as clearCartSummary, cu as err, cv as ok, cw as publishCartSummary, cx as toSdkError } from './client-CmbuYuof.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Format a price amount with currency using Intl.NumberFormat.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-
|
|
2
|
-
export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerBadge, ad as CustomerChallenge, ae as CustomerGamification, af as CustomerGamificationQuery, ag as CustomerProfile, ah as DigitalDownload, ai as DownloadUrl, aj as Facet, ak as FacetAvailability, al as FacetCategory, am as FacetLabel, an as FacetPriceRange, ao as FacetRange, ap as FacetRatingBucket, aq as FacetValue, ar as FacetsResponse, as as FilterField, at as FulfillmentStatus, au as FulfillmentStatuses, av as GamificationRefreshResult, aw as GiftCardBalance, ax as GiftCardPurchaseInput, ay as GiftCardPurchaseResult, az as GiftCardSummary, aA as LessonNote, aB as LessonQuiz, aC as LoginInput, aD as LoyaltyBalance, aE as LoyaltyNextTier, aF as LoyaltyProgram, aG as LoyaltyQuery, aH as LoyaltyReferralResult, aI as LoyaltySummary, aJ as LoyaltyTier, aK as LoyaltyTierPerks, aL as LoyaltyTransaction, aM as Menu, aN as MenuItem, aO as MenuItemRef, aP as MenuItemType, aQ as MessageResponse, aR as NewsletterOptInDefault, aS as NewsletterSubscribeInput, aT as NewsletterSubscribeResult, aU as NewsletterUnsubscribeResult, aV as OrderAccessRequestResponse, aW as OrderAccessVerifyResponse, aX as OrderDetail, aY as OrderItem, aZ as OrderListItem, a_ as OrderPickupPoint, a$ as OrderShipment, b0 as OrderStatus, b1 as OrderStatusHistory, b2 as OrderStatuses, b3 as OrderTracking, b4 as Page, b5 as PageAttachment, b6 as PageDetail, b7 as PaginatedResponse, b8 as PaymentInstrument, b9 as PaymentStatus, ba as PaymentStatuses, bb as PaymentSwift, bc as PickupPoint, bd as PickupPointHours, be as PickupPointsInput, bf as PickupWidgetConfig, bg as PriceDisplay, bh as ProductAssetGroup, bi as ProductAssetItem, bj as ProductAvailability, bk as ProductGroup, bl as ProductLabel, bm as ProductListItem, bn as ProductMedia, bo as ProductMediaVariant, bp as ProductParameter, bq as ProductParameterGroup, br as ProductParametersResponse, bs as ProductPrice, bt as ProductPromotionSummary, bu as ProductReview, bv as ProductReviewsResponse, bw as ProductSibling, bx as ProductSort, by as ProductSortValue, bz as ProductVolumePrice, bA as ProductsQuery, bB as QuizAnswerInput, bC as QuizAnswerResult, bD as QuizQuestion, bE as QuizResult, bF as QuoteItem, bG as QuoteRequest, bH as RegisterInput, bI as RegisterResult, bJ as RequestInterceptor, bK as RequestInterceptorConfig, bL as ResponseInterceptor, bM as ResponseInterceptorData, bN as ReturnRequest, bO as ReturnRequestItem, bP as ReturnStatus, bQ as ReturnStatusItem, bR as ReturnableOrder, bS as ReturnableOrderItem, bT as SdkError, bU as ShippingMethodSummary, bV as ShippingQuote, bW as ShippingQuoteInput, bX as ShopAppearance, bY as ShopInfo, bZ as ShopScript, b_ as ShopScriptPlacement, b$ as ShopScriptType, c0 as ShopScripts, c1 as ShopSeo, c2 as ShopSeoIdentity, c3 as SiteFormField, c4 as SiteFormFieldOption, c5 as SiteFormFieldType, c6 as Sitemap, c7 as SitemapEntry, c8 as StockBehavior, c9 as StockMode, ca as StorefrontForm, cb as StorefrontFormFieldErrorCode, cc as StorefrontFormFile, cd as StorefrontFormSettings, ce as StorefrontFormSubmitInput, cf as StorefrontFormSubmitResult, cg as StorefrontFormUpload, ch as SubmitQuoteInput, ci as SubmitReturnInput, cj as SubmitReviewInput, ck as Subscription, cl as SubscriptionAction, cm as SubscriptionFrequency, cn as SubscriptionItem, co as SubscriptionStatus, cp as TaxBreakdownLine, cq as VariantAxis, cr as VariantAxisValue, cs as WishlistItem, ct as clearCartSummary, cu as err, cv as ok, cw as publishCartSummary, cx as toSdkError } from './client-
|
|
1
|
+
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-CmbuYuof.js';
|
|
2
|
+
export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerBadge, ad as CustomerChallenge, ae as CustomerGamification, af as CustomerGamificationQuery, ag as CustomerProfile, ah as DigitalDownload, ai as DownloadUrl, aj as Facet, ak as FacetAvailability, al as FacetCategory, am as FacetLabel, an as FacetPriceRange, ao as FacetRange, ap as FacetRatingBucket, aq as FacetValue, ar as FacetsResponse, as as FilterField, at as FulfillmentStatus, au as FulfillmentStatuses, av as GamificationRefreshResult, aw as GiftCardBalance, ax as GiftCardPurchaseInput, ay as GiftCardPurchaseResult, az as GiftCardSummary, aA as LessonNote, aB as LessonQuiz, aC as LoginInput, aD as LoyaltyBalance, aE as LoyaltyNextTier, aF as LoyaltyProgram, aG as LoyaltyQuery, aH as LoyaltyReferralResult, aI as LoyaltySummary, aJ as LoyaltyTier, aK as LoyaltyTierPerks, aL as LoyaltyTransaction, aM as Menu, aN as MenuItem, aO as MenuItemRef, aP as MenuItemType, aQ as MessageResponse, aR as NewsletterOptInDefault, aS as NewsletterSubscribeInput, aT as NewsletterSubscribeResult, aU as NewsletterUnsubscribeResult, aV as OrderAccessRequestResponse, aW as OrderAccessVerifyResponse, aX as OrderDetail, aY as OrderItem, aZ as OrderListItem, a_ as OrderPickupPoint, a$ as OrderShipment, b0 as OrderStatus, b1 as OrderStatusHistory, b2 as OrderStatuses, b3 as OrderTracking, b4 as Page, b5 as PageAttachment, b6 as PageDetail, b7 as PaginatedResponse, b8 as PaymentInstrument, b9 as PaymentStatus, ba as PaymentStatuses, bb as PaymentSwift, bc as PickupPoint, bd as PickupPointHours, be as PickupPointsInput, bf as PickupWidgetConfig, bg as PriceDisplay, bh as ProductAssetGroup, bi as ProductAssetItem, bj as ProductAvailability, bk as ProductGroup, bl as ProductLabel, bm as ProductListItem, bn as ProductMedia, bo as ProductMediaVariant, bp as ProductParameter, bq as ProductParameterGroup, br as ProductParametersResponse, bs as ProductPrice, bt as ProductPromotionSummary, bu as ProductReview, bv as ProductReviewsResponse, bw as ProductSibling, bx as ProductSort, by as ProductSortValue, bz as ProductVolumePrice, bA as ProductsQuery, bB as QuizAnswerInput, bC as QuizAnswerResult, bD as QuizQuestion, bE as QuizResult, bF as QuoteItem, bG as QuoteRequest, bH as RegisterInput, bI as RegisterResult, bJ as RequestInterceptor, bK as RequestInterceptorConfig, bL as ResponseInterceptor, bM as ResponseInterceptorData, bN as ReturnRequest, bO as ReturnRequestItem, bP as ReturnStatus, bQ as ReturnStatusItem, bR as ReturnableOrder, bS as ReturnableOrderItem, bT as SdkError, bU as ShippingMethodSummary, bV as ShippingQuote, bW as ShippingQuoteInput, bX as ShopAppearance, bY as ShopInfo, bZ as ShopScript, b_ as ShopScriptPlacement, b$ as ShopScriptType, c0 as ShopScripts, c1 as ShopSeo, c2 as ShopSeoIdentity, c3 as SiteFormField, c4 as SiteFormFieldOption, c5 as SiteFormFieldType, c6 as Sitemap, c7 as SitemapEntry, c8 as StockBehavior, c9 as StockMode, ca as StorefrontForm, cb as StorefrontFormFieldErrorCode, cc as StorefrontFormFile, cd as StorefrontFormSettings, ce as StorefrontFormSubmitInput, cf as StorefrontFormSubmitResult, cg as StorefrontFormUpload, ch as SubmitQuoteInput, ci as SubmitReturnInput, cj as SubmitReviewInput, ck as Subscription, cl as SubscriptionAction, cm as SubscriptionFrequency, cn as SubscriptionItem, co as SubscriptionStatus, cp as TaxBreakdownLine, cq as VariantAxis, cr as VariantAxisValue, cs as WishlistItem, ct as clearCartSummary, cu as err, cv as ok, cw as publishCartSummary, cx as toSdkError } from './client-CmbuYuof.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Format a price amount with currency using Intl.NumberFormat.
|
package/dist/next.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-
|
|
1
|
+
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-CmbuYuof.mjs';
|
|
2
2
|
|
|
3
3
|
interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
|
|
4
4
|
/** Override the cart session cookie name (default: "behio_cart_session"). */
|
package/dist/next.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-
|
|
1
|
+
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-CmbuYuof.js';
|
|
2
2
|
|
|
3
3
|
interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
|
|
4
4
|
/** Override the cart session cookie name (default: "behio_cart_session"). */
|
package/dist/react.d.mts
CHANGED
|
@@ -2652,6 +2652,13 @@ interface CrossSellItem {
|
|
|
2652
2652
|
compareAtPrice: number | null;
|
|
2653
2653
|
/** Currency code the `price` / `compareAtPrice` are expressed in. */
|
|
2654
2654
|
currency: string;
|
|
2655
|
+
/**
|
|
2656
|
+
* true when `price` was FX-converted from the shop's default currency (no
|
|
2657
|
+
* price row for `currency`). Show it as approximate (for example with "≈");
|
|
2658
|
+
* the cart charges only real price rows. Same meaning as
|
|
2659
|
+
* `ProductPrice.isApproximate`. Backend 2026-10-02+, absent on older APIs.
|
|
2660
|
+
*/
|
|
2661
|
+
priceIsApproximate?: boolean;
|
|
2655
2662
|
imageUrl: string | null;
|
|
2656
2663
|
/** Selected-warehouse quantity; null when the merchant hides exact stock. */
|
|
2657
2664
|
stockCached: number | null;
|
|
@@ -4153,6 +4160,13 @@ declare function useCart(options?: UseCartOptions): {
|
|
|
4153
4160
|
updateQuantity: (itemId: string, quantity: number) => Promise<Cart>;
|
|
4154
4161
|
removeItem: (itemId: string) => Promise<Cart>;
|
|
4155
4162
|
clear: () => Promise<void>;
|
|
4163
|
+
addBundle: (bundle: string | {
|
|
4164
|
+
id: string;
|
|
4165
|
+
} | {
|
|
4166
|
+
slug: string;
|
|
4167
|
+
}, quantity?: number) => Promise<Cart>;
|
|
4168
|
+
updateBundleQuantity: (lineId: string, quantity: number) => Promise<Cart>;
|
|
4169
|
+
removeBundle: (lineId: string) => Promise<Cart>;
|
|
4156
4170
|
applyDiscount: (code: string) => Promise<Cart>;
|
|
4157
4171
|
removeDiscount: () => Promise<Cart>;
|
|
4158
4172
|
merge: () => Promise<Cart>;
|
|
@@ -4161,6 +4175,7 @@ declare function useCart(options?: UseCartOptions): {
|
|
|
4161
4175
|
isAdding: boolean;
|
|
4162
4176
|
isUpdating: boolean;
|
|
4163
4177
|
isRemoving: boolean;
|
|
4178
|
+
isUpdatingBundle: boolean;
|
|
4164
4179
|
};
|
|
4165
4180
|
|
|
4166
4181
|
interface UseCartCountOptions {
|
package/dist/react.d.ts
CHANGED
|
@@ -2652,6 +2652,13 @@ interface CrossSellItem {
|
|
|
2652
2652
|
compareAtPrice: number | null;
|
|
2653
2653
|
/** Currency code the `price` / `compareAtPrice` are expressed in. */
|
|
2654
2654
|
currency: string;
|
|
2655
|
+
/**
|
|
2656
|
+
* true when `price` was FX-converted from the shop's default currency (no
|
|
2657
|
+
* price row for `currency`). Show it as approximate (for example with "≈");
|
|
2658
|
+
* the cart charges only real price rows. Same meaning as
|
|
2659
|
+
* `ProductPrice.isApproximate`. Backend 2026-10-02+, absent on older APIs.
|
|
2660
|
+
*/
|
|
2661
|
+
priceIsApproximate?: boolean;
|
|
2655
2662
|
imageUrl: string | null;
|
|
2656
2663
|
/** Selected-warehouse quantity; null when the merchant hides exact stock. */
|
|
2657
2664
|
stockCached: number | null;
|
|
@@ -4153,6 +4160,13 @@ declare function useCart(options?: UseCartOptions): {
|
|
|
4153
4160
|
updateQuantity: (itemId: string, quantity: number) => Promise<Cart>;
|
|
4154
4161
|
removeItem: (itemId: string) => Promise<Cart>;
|
|
4155
4162
|
clear: () => Promise<void>;
|
|
4163
|
+
addBundle: (bundle: string | {
|
|
4164
|
+
id: string;
|
|
4165
|
+
} | {
|
|
4166
|
+
slug: string;
|
|
4167
|
+
}, quantity?: number) => Promise<Cart>;
|
|
4168
|
+
updateBundleQuantity: (lineId: string, quantity: number) => Promise<Cart>;
|
|
4169
|
+
removeBundle: (lineId: string) => Promise<Cart>;
|
|
4156
4170
|
applyDiscount: (code: string) => Promise<Cart>;
|
|
4157
4171
|
removeDiscount: () => Promise<Cart>;
|
|
4158
4172
|
merge: () => Promise<Cart>;
|
|
@@ -4161,6 +4175,7 @@ declare function useCart(options?: UseCartOptions): {
|
|
|
4161
4175
|
isAdding: boolean;
|
|
4162
4176
|
isUpdating: boolean;
|
|
4163
4177
|
isRemoving: boolean;
|
|
4178
|
+
isUpdatingBundle: boolean;
|
|
4164
4179
|
};
|
|
4165
4180
|
|
|
4166
4181
|
interface UseCartCountOptions {
|
package/dist/react.js
CHANGED
|
@@ -2799,6 +2799,16 @@ function useCart(options) {
|
|
|
2799
2799
|
queryClient.setQueryData([...CART_KEY], result);
|
|
2800
2800
|
void refreshBundleQueries(queryClient);
|
|
2801
2801
|
};
|
|
2802
|
+
(0, import_react5.useEffect)(
|
|
2803
|
+
() => client.on("cart:updated", (data) => {
|
|
2804
|
+
if (!data || typeof data !== "object" || !("items" in data)) return;
|
|
2805
|
+
const session = client.getCartSession();
|
|
2806
|
+
if (session) storage.set(STORAGE_KEYS.CART_SESSION, session);
|
|
2807
|
+
void acceptCart(data);
|
|
2808
|
+
}),
|
|
2809
|
+
// acceptCart only closes over queryClient, which is stable per provider.
|
|
2810
|
+
[client, queryClient, storage]
|
|
2811
|
+
);
|
|
2802
2812
|
const addMutation = (0, import_react_query12.useMutation)({
|
|
2803
2813
|
mutationFn: async ({ productId, quantity }) => {
|
|
2804
2814
|
return unwrap(client.cart.addItem({ productId, quantity: quantity ?? 1 }));
|
|
@@ -2831,6 +2841,26 @@ function useCart(options) {
|
|
|
2831
2841
|
queryClient.invalidateQueries({ queryKey: [...CART_KEY] });
|
|
2832
2842
|
}
|
|
2833
2843
|
});
|
|
2844
|
+
const acceptBundleCart = async (result) => {
|
|
2845
|
+
const session = result.newSessionToken ?? result.sessionToken;
|
|
2846
|
+
if (session) storage.set(STORAGE_KEYS.CART_SESSION, session);
|
|
2847
|
+
await acceptCart(result);
|
|
2848
|
+
};
|
|
2849
|
+
const addBundleMutation = (0, import_react_query12.useMutation)({
|
|
2850
|
+
mutationFn: async ({ bundle, quantity }) => unwrap(client.cart.addBundle(bundle, quantity ?? 1)),
|
|
2851
|
+
onMutate: cancelCartRead,
|
|
2852
|
+
onSuccess: acceptBundleCart
|
|
2853
|
+
});
|
|
2854
|
+
const updateBundleMutation = (0, import_react_query12.useMutation)({
|
|
2855
|
+
mutationFn: async ({ lineId, quantity }) => unwrap(client.cart.updateBundleQuantity(lineId, quantity)),
|
|
2856
|
+
onMutate: cancelCartRead,
|
|
2857
|
+
onSuccess: acceptBundleCart
|
|
2858
|
+
});
|
|
2859
|
+
const removeBundleMutation = (0, import_react_query12.useMutation)({
|
|
2860
|
+
mutationFn: async (lineId) => unwrap(client.cart.removeBundle(lineId)),
|
|
2861
|
+
onMutate: cancelCartRead,
|
|
2862
|
+
onSuccess: acceptBundleCart
|
|
2863
|
+
});
|
|
2834
2864
|
const clearMutation = (0, import_react_query12.useMutation)({
|
|
2835
2865
|
mutationFn: () => unwrap(client.cart.clear()),
|
|
2836
2866
|
onMutate: cancelCartRead,
|
|
@@ -2879,6 +2909,18 @@ function useCart(options) {
|
|
|
2879
2909
|
() => clearMutation.mutateAsync(),
|
|
2880
2910
|
[clearMutation]
|
|
2881
2911
|
);
|
|
2912
|
+
const addBundle = (0, import_react5.useCallback)(
|
|
2913
|
+
(bundle, quantity) => addBundleMutation.mutateAsync({ bundle, quantity }),
|
|
2914
|
+
[addBundleMutation]
|
|
2915
|
+
);
|
|
2916
|
+
const updateBundleQuantity = (0, import_react5.useCallback)(
|
|
2917
|
+
(lineId, quantity) => updateBundleMutation.mutateAsync({ lineId, quantity }),
|
|
2918
|
+
[updateBundleMutation]
|
|
2919
|
+
);
|
|
2920
|
+
const removeBundle = (0, import_react5.useCallback)(
|
|
2921
|
+
(lineId) => removeBundleMutation.mutateAsync(lineId),
|
|
2922
|
+
[removeBundleMutation]
|
|
2923
|
+
);
|
|
2882
2924
|
const applyDiscount = (0, import_react5.useCallback)(
|
|
2883
2925
|
(code) => applyDiscountMutation.mutateAsync(code),
|
|
2884
2926
|
[applyDiscountMutation]
|
|
@@ -2900,6 +2942,9 @@ function useCart(options) {
|
|
|
2900
2942
|
updateQuantity,
|
|
2901
2943
|
removeItem,
|
|
2902
2944
|
clear,
|
|
2945
|
+
addBundle,
|
|
2946
|
+
updateBundleQuantity,
|
|
2947
|
+
removeBundle,
|
|
2903
2948
|
applyDiscount,
|
|
2904
2949
|
removeDiscount,
|
|
2905
2950
|
merge,
|
|
@@ -2909,7 +2954,8 @@ function useCart(options) {
|
|
|
2909
2954
|
// Mutation states
|
|
2910
2955
|
isAdding: addMutation.isPending,
|
|
2911
2956
|
isUpdating: updateMutation.isPending,
|
|
2912
|
-
isRemoving: removeMutation.isPending
|
|
2957
|
+
isRemoving: removeMutation.isPending,
|
|
2958
|
+
isUpdatingBundle: addBundleMutation.isPending || updateBundleMutation.isPending || removeBundleMutation.isPending
|
|
2913
2959
|
};
|
|
2914
2960
|
}
|
|
2915
2961
|
|
package/dist/react.mjs
CHANGED
|
@@ -2658,7 +2658,7 @@ function useSearch(query, options) {
|
|
|
2658
2658
|
}
|
|
2659
2659
|
|
|
2660
2660
|
// src/react/hooks/use-cart.ts
|
|
2661
|
-
import { useCallback as useCallback3 } from "react";
|
|
2661
|
+
import { useCallback as useCallback3, useEffect as useEffect3 } from "react";
|
|
2662
2662
|
import { useQuery as useQuery10, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
2663
2663
|
|
|
2664
2664
|
// src/react/utils/refresh-bundle-queries.ts
|
|
@@ -2689,6 +2689,16 @@ function useCart(options) {
|
|
|
2689
2689
|
queryClient.setQueryData([...CART_KEY], result);
|
|
2690
2690
|
void refreshBundleQueries(queryClient);
|
|
2691
2691
|
};
|
|
2692
|
+
useEffect3(
|
|
2693
|
+
() => client.on("cart:updated", (data) => {
|
|
2694
|
+
if (!data || typeof data !== "object" || !("items" in data)) return;
|
|
2695
|
+
const session = client.getCartSession();
|
|
2696
|
+
if (session) storage.set(STORAGE_KEYS.CART_SESSION, session);
|
|
2697
|
+
void acceptCart(data);
|
|
2698
|
+
}),
|
|
2699
|
+
// acceptCart only closes over queryClient, which is stable per provider.
|
|
2700
|
+
[client, queryClient, storage]
|
|
2701
|
+
);
|
|
2692
2702
|
const addMutation = useMutation({
|
|
2693
2703
|
mutationFn: async ({ productId, quantity }) => {
|
|
2694
2704
|
return unwrap(client.cart.addItem({ productId, quantity: quantity ?? 1 }));
|
|
@@ -2721,6 +2731,26 @@ function useCart(options) {
|
|
|
2721
2731
|
queryClient.invalidateQueries({ queryKey: [...CART_KEY] });
|
|
2722
2732
|
}
|
|
2723
2733
|
});
|
|
2734
|
+
const acceptBundleCart = async (result) => {
|
|
2735
|
+
const session = result.newSessionToken ?? result.sessionToken;
|
|
2736
|
+
if (session) storage.set(STORAGE_KEYS.CART_SESSION, session);
|
|
2737
|
+
await acceptCart(result);
|
|
2738
|
+
};
|
|
2739
|
+
const addBundleMutation = useMutation({
|
|
2740
|
+
mutationFn: async ({ bundle, quantity }) => unwrap(client.cart.addBundle(bundle, quantity ?? 1)),
|
|
2741
|
+
onMutate: cancelCartRead,
|
|
2742
|
+
onSuccess: acceptBundleCart
|
|
2743
|
+
});
|
|
2744
|
+
const updateBundleMutation = useMutation({
|
|
2745
|
+
mutationFn: async ({ lineId, quantity }) => unwrap(client.cart.updateBundleQuantity(lineId, quantity)),
|
|
2746
|
+
onMutate: cancelCartRead,
|
|
2747
|
+
onSuccess: acceptBundleCart
|
|
2748
|
+
});
|
|
2749
|
+
const removeBundleMutation = useMutation({
|
|
2750
|
+
mutationFn: async (lineId) => unwrap(client.cart.removeBundle(lineId)),
|
|
2751
|
+
onMutate: cancelCartRead,
|
|
2752
|
+
onSuccess: acceptBundleCart
|
|
2753
|
+
});
|
|
2724
2754
|
const clearMutation = useMutation({
|
|
2725
2755
|
mutationFn: () => unwrap(client.cart.clear()),
|
|
2726
2756
|
onMutate: cancelCartRead,
|
|
@@ -2769,6 +2799,18 @@ function useCart(options) {
|
|
|
2769
2799
|
() => clearMutation.mutateAsync(),
|
|
2770
2800
|
[clearMutation]
|
|
2771
2801
|
);
|
|
2802
|
+
const addBundle = useCallback3(
|
|
2803
|
+
(bundle, quantity) => addBundleMutation.mutateAsync({ bundle, quantity }),
|
|
2804
|
+
[addBundleMutation]
|
|
2805
|
+
);
|
|
2806
|
+
const updateBundleQuantity = useCallback3(
|
|
2807
|
+
(lineId, quantity) => updateBundleMutation.mutateAsync({ lineId, quantity }),
|
|
2808
|
+
[updateBundleMutation]
|
|
2809
|
+
);
|
|
2810
|
+
const removeBundle = useCallback3(
|
|
2811
|
+
(lineId) => removeBundleMutation.mutateAsync(lineId),
|
|
2812
|
+
[removeBundleMutation]
|
|
2813
|
+
);
|
|
2772
2814
|
const applyDiscount = useCallback3(
|
|
2773
2815
|
(code) => applyDiscountMutation.mutateAsync(code),
|
|
2774
2816
|
[applyDiscountMutation]
|
|
@@ -2790,6 +2832,9 @@ function useCart(options) {
|
|
|
2790
2832
|
updateQuantity,
|
|
2791
2833
|
removeItem,
|
|
2792
2834
|
clear,
|
|
2835
|
+
addBundle,
|
|
2836
|
+
updateBundleQuantity,
|
|
2837
|
+
removeBundle,
|
|
2793
2838
|
applyDiscount,
|
|
2794
2839
|
removeDiscount,
|
|
2795
2840
|
merge,
|
|
@@ -2799,7 +2844,8 @@ function useCart(options) {
|
|
|
2799
2844
|
// Mutation states
|
|
2800
2845
|
isAdding: addMutation.isPending,
|
|
2801
2846
|
isUpdating: updateMutation.isPending,
|
|
2802
|
-
isRemoving: removeMutation.isPending
|
|
2847
|
+
isRemoving: removeMutation.isPending,
|
|
2848
|
+
isUpdatingBundle: addBundleMutation.isPending || updateBundleMutation.isPending || removeBundleMutation.isPending
|
|
2803
2849
|
};
|
|
2804
2850
|
}
|
|
2805
2851
|
|
|
@@ -3064,7 +3110,7 @@ function useAddresses(options) {
|
|
|
3064
3110
|
}
|
|
3065
3111
|
|
|
3066
3112
|
// src/react/hooks/use-address-autocomplete.ts
|
|
3067
|
-
import { useState as useState4, useEffect as
|
|
3113
|
+
import { useState as useState4, useEffect as useEffect4, useRef as useRef2, useCallback as useCallback7 } from "react";
|
|
3068
3114
|
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
3069
3115
|
var AC_KEY = ["behio", "address-autocomplete"];
|
|
3070
3116
|
function useAddressAutocomplete(options) {
|
|
@@ -3075,7 +3121,7 @@ function useAddressAutocomplete(options) {
|
|
|
3075
3121
|
const [selected, setSelected] = useState4(null);
|
|
3076
3122
|
const [isSelecting, setIsSelecting] = useState4(false);
|
|
3077
3123
|
const timerRef = useRef2(void 0);
|
|
3078
|
-
|
|
3124
|
+
useEffect4(() => {
|
|
3079
3125
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
3080
3126
|
if (query.length < minChars) {
|
|
3081
3127
|
setDebouncedQuery("");
|
|
@@ -3503,14 +3549,14 @@ function usePaymentMethods(options) {
|
|
|
3503
3549
|
}
|
|
3504
3550
|
|
|
3505
3551
|
// src/react/hooks/use-personal-offers.ts
|
|
3506
|
-
import { useCallback as useCallback8, useEffect as
|
|
3552
|
+
import { useCallback as useCallback8, useEffect as useEffect5, useState as useState5 } from "react";
|
|
3507
3553
|
import { useMutation as useMutation10, useQuery as useQuery26, useQueryClient as useQueryClient12 } from "@tanstack/react-query";
|
|
3508
3554
|
function usePersonalOffers(options) {
|
|
3509
3555
|
const { client } = useBehio();
|
|
3510
3556
|
const queryClient = useQueryClient12();
|
|
3511
3557
|
const [polledVid, setPolledVid] = useState5(null);
|
|
3512
3558
|
const explicitVid = options?.visitorId;
|
|
3513
|
-
|
|
3559
|
+
useEffect5(() => {
|
|
3514
3560
|
if (explicitVid) return;
|
|
3515
3561
|
const read = () => {
|
|
3516
3562
|
const vid = client.getAnalyticsVisitorId();
|
|
@@ -3562,7 +3608,7 @@ function usePersonalOffers(options) {
|
|
|
3562
3608
|
}
|
|
3563
3609
|
|
|
3564
3610
|
// src/react/hooks/use-visitor-messages.ts
|
|
3565
|
-
import { useCallback as useCallback9, useEffect as
|
|
3611
|
+
import { useCallback as useCallback9, useEffect as useEffect6, useRef as useRef3, useState as useState6 } from "react";
|
|
3566
3612
|
import { useQuery as useQuery27, useQueryClient as useQueryClient13 } from "@tanstack/react-query";
|
|
3567
3613
|
function useVisitorMessages(options) {
|
|
3568
3614
|
const { client } = useBehio();
|
|
@@ -3570,7 +3616,7 @@ function useVisitorMessages(options) {
|
|
|
3570
3616
|
const [polledVid, setPolledVid] = useState6(null);
|
|
3571
3617
|
const seenRef = useRef3(/* @__PURE__ */ new Set());
|
|
3572
3618
|
const explicitVid = options?.visitorId;
|
|
3573
|
-
|
|
3619
|
+
useEffect6(() => {
|
|
3574
3620
|
if (explicitVid) return;
|
|
3575
3621
|
const read = () => {
|
|
3576
3622
|
const vid = client.getAnalyticsVisitorId();
|
|
@@ -3607,7 +3653,7 @@ function useVisitorMessages(options) {
|
|
|
3607
3653
|
);
|
|
3608
3654
|
const onMessage = options?.onMessage;
|
|
3609
3655
|
const dispatchDom = options?.dispatchDomEvents !== false;
|
|
3610
|
-
|
|
3656
|
+
useEffect6(() => {
|
|
3611
3657
|
for (const message of data?.items ?? []) {
|
|
3612
3658
|
if (seenRef.current.has(message.id)) continue;
|
|
3613
3659
|
seenRef.current.add(message.id);
|
|
@@ -4093,7 +4139,7 @@ function CurrencySwitcher({
|
|
|
4093
4139
|
}
|
|
4094
4140
|
|
|
4095
4141
|
// src/react/components/storefront-scripts.tsx
|
|
4096
|
-
import { useEffect as
|
|
4142
|
+
import { useEffect as useEffect7, useMemo as useMemo5, useRef as useRef4, useState as useState10 } from "react";
|
|
4097
4143
|
|
|
4098
4144
|
// src/react/hooks/use-consent.ts
|
|
4099
4145
|
import { useQuery as useQuery35, useMutation as useMutation16, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
@@ -4185,7 +4231,7 @@ function injectHtml(target, html, start = false) {
|
|
|
4185
4231
|
function StorefrontScripts({ visitorId: visitorIdProp, initialScripts } = {}) {
|
|
4186
4232
|
const { data } = useShopScripts({ enabled: initialScripts === void 0, initialData: initialScripts ? { scripts: initialScripts } : void 0 });
|
|
4187
4233
|
const [visitorId, setVisitorId] = useState10(visitorIdProp ?? "");
|
|
4188
|
-
|
|
4234
|
+
useEffect7(() => {
|
|
4189
4235
|
if (visitorIdProp) return;
|
|
4190
4236
|
try {
|
|
4191
4237
|
const v = localStorage.getItem(VISITOR_KEY);
|
|
@@ -4205,7 +4251,7 @@ function StorefrontScripts({ visitorId: visitorIdProp, initialScripts } = {}) {
|
|
|
4205
4251
|
[scripts]
|
|
4206
4252
|
);
|
|
4207
4253
|
const activeConsented = useRef4(/* @__PURE__ */ new Set());
|
|
4208
|
-
|
|
4254
|
+
useEffect7(() => {
|
|
4209
4255
|
if (typeof document === "undefined") return;
|
|
4210
4256
|
const nextConsented = new Set(scripts.filter((s) => s.consentRequired).map((s) => s.id));
|
|
4211
4257
|
const revoked = [...activeConsented.current].some((id) => !nextConsented.has(id));
|
|
@@ -4229,7 +4275,7 @@ function StorefrontScripts({ visitorId: visitorIdProp, initialScripts } = {}) {
|
|
|
4229
4275
|
}
|
|
4230
4276
|
|
|
4231
4277
|
// src/react/components/behio-analytics.tsx
|
|
4232
|
-
import { useEffect as
|
|
4278
|
+
import { useEffect as useEffect8 } from "react";
|
|
4233
4279
|
|
|
4234
4280
|
// src/react/hooks/use-behio-client.ts
|
|
4235
4281
|
function useBehioClient() {
|
|
@@ -4239,7 +4285,7 @@ function useBehioClient() {
|
|
|
4239
4285
|
// src/react/components/behio-analytics.tsx
|
|
4240
4286
|
function BehioAnalyticsTracker() {
|
|
4241
4287
|
const client = useBehioClient();
|
|
4242
|
-
|
|
4288
|
+
useEffect8(() => {
|
|
4243
4289
|
if (typeof window === "undefined") return;
|
|
4244
4290
|
const w = window;
|
|
4245
4291
|
if (w.__behioAnalytics) return;
|