@behio/storefront-sdk 2.1.0 → 2.3.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/README.md CHANGED
@@ -252,6 +252,16 @@ A failed price entitlement lookup returns HTTP 503 with `be.storefront.pricingUn
252
252
 
253
253
  `catalog.getCategoryProducts(slug, query)` shares the full `ProductsQuery` serializer with `getProducts`. Price bounds retain zero, boolean filters retain false, arrays use repeated parameters and public parameter/facet selections use JSON. Category, main-list and featured availability follow the same published-variant and stock-mode rules in the backend.
254
254
 
255
+ ### Cart summary for page scripts (2.2, helper 2.3)
256
+
257
+ Browser cart responses dispatch `behio:cart` on `window` with
258
+ `{total, currency, itemCount}` and keep the last value in `window.__behioCart`
259
+ (Behio Chat reads it for cart-value greetings). Carts with
260
+ `totalsAvailable: false` are not announced. Storefronts that mutate the cart on
261
+ the server (Server Actions, snapshot routes) call
262
+ `publishCartSummary({total, currency, itemCount})` on the client after each
263
+ fresh cart; it does nothing during SSR.
264
+
255
265
  ### Bundle offers and galleries (2.0, unreleased)
256
266
 
257
267
  `catalog.getBundles({locale, currency, country})` and `getBundle(slug, options)`
@@ -478,6 +478,7 @@ var BehioStorefront = class {
478
478
  async request(method, path, options) {
479
479
  try {
480
480
  const data = await this.rawRequest(method, path, options);
481
+ if (path === "/cart" || path.startsWith("/cart/")) emitCartEvent(data);
481
482
  return ok(data);
482
483
  } catch (err2) {
483
484
  if (this.throwOnAvailabilityError && isAvailabilityFailure(err2)) {
@@ -2103,6 +2104,30 @@ var NewsletterModule = class {
2103
2104
  );
2104
2105
  }
2105
2106
  };
2107
+ function publishCartSummary(summary) {
2108
+ if (typeof window === "undefined" || typeof window.dispatchEvent !== "function") return;
2109
+ if (!Number.isFinite(summary.total) || !Number.isFinite(summary.itemCount)) return;
2110
+ const detail = { total: summary.total, currency: _nullishCoalesce(summary.currency, () => ( null)), itemCount: summary.itemCount };
2111
+ try {
2112
+ window.__behioCart = detail;
2113
+ window.dispatchEvent(new CustomEvent("behio:cart", { detail }));
2114
+ } catch (e6) {
2115
+ }
2116
+ }
2117
+ function emitCartEvent(data) {
2118
+ if (typeof window === "undefined") return;
2119
+ const cart = data;
2120
+ if (!cart || typeof cart !== "object" || !Array.isArray(cart.items)) return;
2121
+ if (cart.totalsAvailable === false) return;
2122
+ const items = cart.items;
2123
+ const total = typeof cart.grandTotal === "number" ? cart.grandTotal : typeof cart.subtotal === "number" ? cart.subtotal : 0;
2124
+ publishCartSummary({
2125
+ total,
2126
+ currency: typeof cart.currency === "string" ? cart.currency : null,
2127
+ itemCount: items.reduce((n, i) => n + (typeof _optionalChain([i, 'optionalAccess', _53 => _53.quantity]) === "number" ? i.quantity : 1), 0)
2128
+ });
2129
+ }
2130
+
2106
2131
 
2107
2132
 
2108
2133
 
@@ -2116,4 +2141,4 @@ var NewsletterModule = class {
2116
2141
 
2117
2142
 
2118
2143
 
2119
- exports.ProductSort = ProductSort; exports.OrderStatuses = OrderStatuses; exports.PaymentStatuses = PaymentStatuses; exports.FulfillmentStatuses = FulfillmentStatuses; exports.AddressTypes = AddressTypes; exports.BehioApiError = BehioApiError; exports.BehioNetworkError = BehioNetworkError; exports.ok = ok; exports.err = err; exports.toSdkError = toSdkError; exports.BehioStorefront = BehioStorefront;
2144
+ exports.ProductSort = ProductSort; exports.OrderStatuses = OrderStatuses; exports.PaymentStatuses = PaymentStatuses; exports.FulfillmentStatuses = FulfillmentStatuses; exports.AddressTypes = AddressTypes; exports.BehioApiError = BehioApiError; exports.BehioNetworkError = BehioNetworkError; exports.ok = ok; exports.err = err; exports.toSdkError = toSdkError; exports.BehioStorefront = BehioStorefront; exports.publishCartSummary = publishCartSummary;
@@ -478,6 +478,7 @@ var BehioStorefront = class {
478
478
  async request(method, path, options) {
479
479
  try {
480
480
  const data = await this.rawRequest(method, path, options);
481
+ if (path === "/cart" || path.startsWith("/cart/")) emitCartEvent(data);
481
482
  return ok(data);
482
483
  } catch (err2) {
483
484
  if (this.throwOnAvailabilityError && isAvailabilityFailure(err2)) {
@@ -2103,6 +2104,29 @@ var NewsletterModule = class {
2103
2104
  );
2104
2105
  }
2105
2106
  };
2107
+ function publishCartSummary(summary) {
2108
+ if (typeof window === "undefined" || typeof window.dispatchEvent !== "function") return;
2109
+ if (!Number.isFinite(summary.total) || !Number.isFinite(summary.itemCount)) return;
2110
+ const detail = { total: summary.total, currency: summary.currency ?? null, itemCount: summary.itemCount };
2111
+ try {
2112
+ window.__behioCart = detail;
2113
+ window.dispatchEvent(new CustomEvent("behio:cart", { detail }));
2114
+ } catch {
2115
+ }
2116
+ }
2117
+ function emitCartEvent(data) {
2118
+ if (typeof window === "undefined") return;
2119
+ const cart = data;
2120
+ if (!cart || typeof cart !== "object" || !Array.isArray(cart.items)) return;
2121
+ if (cart.totalsAvailable === false) return;
2122
+ const items = cart.items;
2123
+ const total = typeof cart.grandTotal === "number" ? cart.grandTotal : typeof cart.subtotal === "number" ? cart.subtotal : 0;
2124
+ publishCartSummary({
2125
+ total,
2126
+ currency: typeof cart.currency === "string" ? cart.currency : null,
2127
+ itemCount: items.reduce((n, i) => n + (typeof i?.quantity === "number" ? i.quantity : 1), 0)
2128
+ });
2129
+ }
2106
2130
 
2107
2131
  export {
2108
2132
  ProductSort,
@@ -2115,5 +2139,6 @@ export {
2115
2139
  ok,
2116
2140
  err,
2117
2141
  toSdkError,
2118
- BehioStorefront
2142
+ BehioStorefront,
2143
+ publishCartSummary
2119
2144
  };
@@ -3790,5 +3790,19 @@ declare class NewsletterModule {
3790
3790
  subscribe(input: NewsletterSubscribeInput): Promise<SdkResult<NewsletterSubscribeResult>>;
3791
3791
  unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
3792
3792
  }
3793
+ /** Souhrn kosiku pro skripty na strance (Behio Chat, analytika). */
3794
+ interface CartSummaryEvent {
3795
+ total: number;
3796
+ currency: string | null;
3797
+ itemCount: number;
3798
+ }
3799
+ /**
3800
+ * Vysle v prohlizeci udalost `behio:cart` ({total, currency, itemCount})
3801
+ * a ulozi ji do `window.__behioCart`. Posloucha ji Behio Chat (osloveni podle
3802
+ * hodnoty kosiku, promenne {cartTotal}). SDK ji vola samo po kazde odpovedi
3803
+ * kosiku v prohlizeci. Sablona, ktera kosik meni na serveru (Server Actions,
3804
+ * vlastni route), ji zavola sama s aktualnim souhrnem. Na serveru nedela nic.
3805
+ */
3806
+ declare function publishCartSummary(summary: CartSummaryEvent): void;
3793
3807
 
3794
- export { type CourseDetail as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type Cart as D, type CartBundleLine as E, type CartBundleLineItem as F, type CartDiscount as G, type CartItem as H, type CartItemProduct as I, type CartPromotion as J, type Category as K, type CategoryDetail as L, type CertificateVerification as M, type CheckoutAddress as N, type CheckoutInput as O, type ProductDetail as P, type CheckoutPaymentMethod as Q, type CheckoutPreview as R, type SdkResult as S, type CheckoutResult as T, type CheckoutSettings as U, type CookieConsentInput as V, type CourseAttachment as W, type CourseCertificate as X, type CourseComment as Y, type CourseCommentReply as Z, type CourseCommentsList as _, type ProductVariant as a, PaymentStatuses as a$, type CourseLesson as a0, type CourseListItem as a1, type CourseModule as a2, type CoursePostedComment as a3, type CourseProgress as a4, type CourseTutorMessage as a5, type CourseTutorThread as a6, type CrossSellItem as a7, type CurrencyDisplayFormat as a8, type CustomerAddress as a9, type LoyaltyTier as aA, type LoyaltyTierPerks as aB, type LoyaltyTransaction as aC, type Menu as aD, type MenuItem as aE, type MenuItemRef as aF, type MenuItemType as aG, type MessageResponse as aH, type NewsletterOptInDefault as aI, type NewsletterSubscribeInput as aJ, type NewsletterSubscribeResult as aK, type NewsletterUnsubscribeResult as aL, type OrderAccessRequestResponse as aM, type OrderAccessVerifyResponse as aN, type OrderDetail as aO, type OrderItem as aP, type OrderListItem as aQ, type OrderStatus as aR, type OrderStatusHistory as aS, OrderStatuses as aT, type OrderTracking as aU, type Page as aV, type PageAttachment as aW, type PageDetail as aX, type PaginatedResponse as aY, type PaymentInstrument as aZ, type PaymentStatus as a_, type CustomerProfile as aa, type DigitalDownload as ab, type DownloadUrl as ac, type Facet as ad, type FacetAvailability as ae, type FacetCategory as af, type FacetLabel as ag, type FacetPriceRange as ah, type FacetRange as ai, type FacetRatingBucket as aj, type FacetValue as ak, type FacetsResponse as al, type FilterField as am, type FulfillmentStatus as an, FulfillmentStatuses as ao, type GiftCardBalance as ap, type GiftCardPurchaseInput as aq, type GiftCardPurchaseResult as ar, type GiftCardSummary as as, type LessonNote as at, type LessonQuiz as au, type LoginInput as av, type LoyaltyBalance as aw, type LoyaltyNextTier as ax, type LoyaltyProgram as ay, type LoyaltySummary as az, type StorefrontFormFieldError as b, type StorefrontForm as b$, type PaymentSwift as b0, type PickupPoint as b1, type PickupPointHours as b2, type PickupPointsInput as b3, type PickupWidgetConfig as b4, type PriceDisplay as b5, type ProductAssetGroup as b6, type ProductAssetItem as b7, type ProductAvailability as b8, type ProductGroup as b9, type ResponseInterceptor as bA, type ResponseInterceptorData as bB, type ReturnRequest as bC, type ReturnRequestItem as bD, type ReturnStatus as bE, type ReturnStatusItem as bF, type ReturnableOrder as bG, type ReturnableOrderItem as bH, type SdkError as bI, type ShippingMethodSummary as bJ, type ShippingQuote as bK, type ShippingQuoteInput as bL, type ShopAppearance as bM, type ShopInfo as bN, type ShopScript as bO, type ShopScriptPlacement as bP, type ShopScriptType as bQ, type ShopScripts as bR, type ShopSeo as bS, type ShopSeoIdentity as bT, type SiteFormField as bU, type SiteFormFieldOption as bV, type SiteFormFieldType as bW, type Sitemap as bX, type SitemapEntry as bY, type StockBehavior as bZ, type StockMode as b_, type ProductLabel as ba, type ProductListItem as bb, type ProductMedia as bc, type ProductMediaVariant as bd, type ProductParameter as be, type ProductParameterGroup as bf, type ProductParametersResponse as bg, type ProductPrice as bh, type ProductPromotionSummary as bi, type ProductReview as bj, type ProductReviewsResponse as bk, type ProductSibling as bl, ProductSort as bm, type ProductSortValue as bn, type ProductVolumePrice as bo, type ProductsQuery as bp, type QuizAnswerInput as bq, type QuizAnswerResult as br, type QuizQuestion as bs, type QuizResult as bt, type QuoteItem as bu, type QuoteRequest as bv, type RegisterInput as bw, type RegisterResult as bx, type RequestInterceptor as by, type RequestInterceptorConfig as bz, type AddToCartInput as c, type StorefrontFormFieldErrorCode as c0, type StorefrontFormFile as c1, type StorefrontFormSettings as c2, type StorefrontFormSubmitInput as c3, type StorefrontFormSubmitResult as c4, type StorefrontFormUpload as c5, type SubmitQuoteInput as c6, type SubmitReturnInput as c7, type SubmitReviewInput as c8, type Subscription as c9, type SubscriptionAction as ca, type SubscriptionFrequency as cb, type SubscriptionItem as cc, type SubscriptionStatus as cd, type TaxBreakdownLine as ce, type VariantAxis as cf, type VariantAxisValue as cg, type WishlistItem as ch, err as ci, ok as cj, toSdkError as ck, type AddressDetail as d, type AddressSuggestion as e, type AddressType as f, AddressTypes as g, type AuthTokens as h, type BackInStockSubscription as i, type BadgeTone as j, BehioApiError as k, type BehioErrorCode as l, type BehioEventHandler as m, type BehioEventType as n, BehioNetworkError as o, type BehioStorefrontConfig as p, type Blog as q, type BlogPostDetail as r, type BlogPostListItem as s, type BlogPostsPage as t, type BlogPostsQuery as u, type BlogSettings as v, type BlogTag as w, type Bundle as x, type BundleCatalogQuery as y, type BundleItem as z };
3808
+ export { type CourseCommentsList as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type Cart as D, type CartBundleLine as E, type CartBundleLineItem as F, type CartDiscount as G, type CartItem as H, type CartItemProduct as I, type CartPromotion as J, type CartSummaryEvent as K, type Category as L, type CategoryDetail as M, type CertificateVerification as N, type CheckoutAddress as O, type ProductDetail as P, type CheckoutInput as Q, type CheckoutPaymentMethod as R, type SdkResult as S, type CheckoutPreview as T, type CheckoutResult as U, type CheckoutSettings as V, type CookieConsentInput as W, type CourseAttachment as X, type CourseCertificate as Y, type CourseComment as Z, type CourseCommentReply as _, type ProductVariant as a, type PaymentStatus as a$, type CourseDetail as a0, type CourseLesson as a1, type CourseListItem as a2, type CourseModule as a3, type CoursePostedComment as a4, type CourseProgress as a5, type CourseTutorMessage as a6, type CourseTutorThread as a7, type CrossSellItem as a8, type CurrencyDisplayFormat as a9, type LoyaltySummary as aA, type LoyaltyTier as aB, type LoyaltyTierPerks as aC, type LoyaltyTransaction as aD, type Menu as aE, type MenuItem as aF, type MenuItemRef as aG, type MenuItemType as aH, type MessageResponse as aI, type NewsletterOptInDefault as aJ, type NewsletterSubscribeInput as aK, type NewsletterSubscribeResult as aL, type NewsletterUnsubscribeResult as aM, type OrderAccessRequestResponse as aN, type OrderAccessVerifyResponse as aO, type OrderDetail as aP, type OrderItem as aQ, type OrderListItem as aR, type OrderStatus as aS, type OrderStatusHistory as aT, OrderStatuses as aU, type OrderTracking as aV, type Page as aW, type PageAttachment as aX, type PageDetail as aY, type PaginatedResponse as aZ, type PaymentInstrument as a_, type CustomerAddress as aa, type CustomerProfile as ab, type DigitalDownload as ac, type DownloadUrl as ad, type Facet as ae, type FacetAvailability as af, type FacetCategory as ag, type FacetLabel as ah, type FacetPriceRange as ai, type FacetRange as aj, type FacetRatingBucket as ak, type FacetValue as al, type FacetsResponse as am, type FilterField as an, type FulfillmentStatus as ao, FulfillmentStatuses as ap, type GiftCardBalance as aq, type GiftCardPurchaseInput as ar, type GiftCardPurchaseResult as as, type GiftCardSummary as at, type LessonNote as au, type LessonQuiz as av, type LoginInput as aw, type LoyaltyBalance as ax, type LoyaltyNextTier as ay, type LoyaltyProgram as az, type StorefrontFormFieldError as b, type StockMode as b$, PaymentStatuses as b0, type PaymentSwift as b1, type PickupPoint as b2, type PickupPointHours as b3, type PickupPointsInput as b4, type PickupWidgetConfig as b5, type PriceDisplay as b6, type ProductAssetGroup as b7, type ProductAssetItem as b8, type ProductAvailability as b9, type RequestInterceptorConfig as bA, type ResponseInterceptor as bB, type ResponseInterceptorData as bC, type ReturnRequest as bD, type ReturnRequestItem as bE, type ReturnStatus as bF, type ReturnStatusItem as bG, type ReturnableOrder as bH, type ReturnableOrderItem as bI, type SdkError as bJ, type ShippingMethodSummary as bK, type ShippingQuote as bL, type ShippingQuoteInput as bM, type ShopAppearance as bN, type ShopInfo as bO, type ShopScript as bP, type ShopScriptPlacement as bQ, type ShopScriptType as bR, type ShopScripts as bS, type ShopSeo as bT, type ShopSeoIdentity as bU, type SiteFormField as bV, type SiteFormFieldOption as bW, type SiteFormFieldType as bX, type Sitemap as bY, type SitemapEntry as bZ, type StockBehavior as b_, type ProductGroup as ba, type ProductLabel as bb, type ProductListItem as bc, type ProductMedia as bd, type ProductMediaVariant as be, type ProductParameter as bf, type ProductParameterGroup as bg, type ProductParametersResponse as bh, type ProductPrice as bi, type ProductPromotionSummary as bj, type ProductReview as bk, type ProductReviewsResponse as bl, type ProductSibling as bm, ProductSort as bn, type ProductSortValue as bo, type ProductVolumePrice as bp, type ProductsQuery as bq, type QuizAnswerInput as br, type QuizAnswerResult as bs, type QuizQuestion as bt, type QuizResult as bu, type QuoteItem as bv, type QuoteRequest as bw, type RegisterInput as bx, type RegisterResult as by, type RequestInterceptor as bz, type AddToCartInput as c, type StorefrontForm as c0, type StorefrontFormFieldErrorCode as c1, type StorefrontFormFile as c2, type StorefrontFormSettings as c3, type StorefrontFormSubmitInput as c4, type StorefrontFormSubmitResult as c5, type StorefrontFormUpload as c6, type SubmitQuoteInput as c7, type SubmitReturnInput as c8, type SubmitReviewInput as c9, type Subscription as ca, type SubscriptionAction as cb, type SubscriptionFrequency as cc, type SubscriptionItem as cd, type SubscriptionStatus as ce, type TaxBreakdownLine as cf, type VariantAxis as cg, type VariantAxisValue as ch, type WishlistItem as ci, err as cj, ok as ck, publishCartSummary as cl, toSdkError as cm, type AddressDetail as d, type AddressSuggestion as e, type AddressType as f, AddressTypes as g, type AuthTokens as h, type BackInStockSubscription as i, type BadgeTone as j, BehioApiError as k, type BehioErrorCode as l, type BehioEventHandler as m, type BehioEventType as n, BehioNetworkError as o, type BehioStorefrontConfig as p, type Blog as q, type BlogPostDetail as r, type BlogPostListItem as s, type BlogPostsPage as t, type BlogPostsQuery as u, type BlogSettings as v, type BlogTag as w, type Bundle as x, type BundleCatalogQuery as y, type BundleItem as z };
@@ -3790,5 +3790,19 @@ declare class NewsletterModule {
3790
3790
  subscribe(input: NewsletterSubscribeInput): Promise<SdkResult<NewsletterSubscribeResult>>;
3791
3791
  unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
3792
3792
  }
3793
+ /** Souhrn kosiku pro skripty na strance (Behio Chat, analytika). */
3794
+ interface CartSummaryEvent {
3795
+ total: number;
3796
+ currency: string | null;
3797
+ itemCount: number;
3798
+ }
3799
+ /**
3800
+ * Vysle v prohlizeci udalost `behio:cart` ({total, currency, itemCount})
3801
+ * a ulozi ji do `window.__behioCart`. Posloucha ji Behio Chat (osloveni podle
3802
+ * hodnoty kosiku, promenne {cartTotal}). SDK ji vola samo po kazde odpovedi
3803
+ * kosiku v prohlizeci. Sablona, ktera kosik meni na serveru (Server Actions,
3804
+ * vlastni route), ji zavola sama s aktualnim souhrnem. Na serveru nedela nic.
3805
+ */
3806
+ declare function publishCartSummary(summary: CartSummaryEvent): void;
3793
3807
 
3794
- export { type CourseDetail as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type Cart as D, type CartBundleLine as E, type CartBundleLineItem as F, type CartDiscount as G, type CartItem as H, type CartItemProduct as I, type CartPromotion as J, type Category as K, type CategoryDetail as L, type CertificateVerification as M, type CheckoutAddress as N, type CheckoutInput as O, type ProductDetail as P, type CheckoutPaymentMethod as Q, type CheckoutPreview as R, type SdkResult as S, type CheckoutResult as T, type CheckoutSettings as U, type CookieConsentInput as V, type CourseAttachment as W, type CourseCertificate as X, type CourseComment as Y, type CourseCommentReply as Z, type CourseCommentsList as _, type ProductVariant as a, PaymentStatuses as a$, type CourseLesson as a0, type CourseListItem as a1, type CourseModule as a2, type CoursePostedComment as a3, type CourseProgress as a4, type CourseTutorMessage as a5, type CourseTutorThread as a6, type CrossSellItem as a7, type CurrencyDisplayFormat as a8, type CustomerAddress as a9, type LoyaltyTier as aA, type LoyaltyTierPerks as aB, type LoyaltyTransaction as aC, type Menu as aD, type MenuItem as aE, type MenuItemRef as aF, type MenuItemType as aG, type MessageResponse as aH, type NewsletterOptInDefault as aI, type NewsletterSubscribeInput as aJ, type NewsletterSubscribeResult as aK, type NewsletterUnsubscribeResult as aL, type OrderAccessRequestResponse as aM, type OrderAccessVerifyResponse as aN, type OrderDetail as aO, type OrderItem as aP, type OrderListItem as aQ, type OrderStatus as aR, type OrderStatusHistory as aS, OrderStatuses as aT, type OrderTracking as aU, type Page as aV, type PageAttachment as aW, type PageDetail as aX, type PaginatedResponse as aY, type PaymentInstrument as aZ, type PaymentStatus as a_, type CustomerProfile as aa, type DigitalDownload as ab, type DownloadUrl as ac, type Facet as ad, type FacetAvailability as ae, type FacetCategory as af, type FacetLabel as ag, type FacetPriceRange as ah, type FacetRange as ai, type FacetRatingBucket as aj, type FacetValue as ak, type FacetsResponse as al, type FilterField as am, type FulfillmentStatus as an, FulfillmentStatuses as ao, type GiftCardBalance as ap, type GiftCardPurchaseInput as aq, type GiftCardPurchaseResult as ar, type GiftCardSummary as as, type LessonNote as at, type LessonQuiz as au, type LoginInput as av, type LoyaltyBalance as aw, type LoyaltyNextTier as ax, type LoyaltyProgram as ay, type LoyaltySummary as az, type StorefrontFormFieldError as b, type StorefrontForm as b$, type PaymentSwift as b0, type PickupPoint as b1, type PickupPointHours as b2, type PickupPointsInput as b3, type PickupWidgetConfig as b4, type PriceDisplay as b5, type ProductAssetGroup as b6, type ProductAssetItem as b7, type ProductAvailability as b8, type ProductGroup as b9, type ResponseInterceptor as bA, type ResponseInterceptorData as bB, type ReturnRequest as bC, type ReturnRequestItem as bD, type ReturnStatus as bE, type ReturnStatusItem as bF, type ReturnableOrder as bG, type ReturnableOrderItem as bH, type SdkError as bI, type ShippingMethodSummary as bJ, type ShippingQuote as bK, type ShippingQuoteInput as bL, type ShopAppearance as bM, type ShopInfo as bN, type ShopScript as bO, type ShopScriptPlacement as bP, type ShopScriptType as bQ, type ShopScripts as bR, type ShopSeo as bS, type ShopSeoIdentity as bT, type SiteFormField as bU, type SiteFormFieldOption as bV, type SiteFormFieldType as bW, type Sitemap as bX, type SitemapEntry as bY, type StockBehavior as bZ, type StockMode as b_, type ProductLabel as ba, type ProductListItem as bb, type ProductMedia as bc, type ProductMediaVariant as bd, type ProductParameter as be, type ProductParameterGroup as bf, type ProductParametersResponse as bg, type ProductPrice as bh, type ProductPromotionSummary as bi, type ProductReview as bj, type ProductReviewsResponse as bk, type ProductSibling as bl, ProductSort as bm, type ProductSortValue as bn, type ProductVolumePrice as bo, type ProductsQuery as bp, type QuizAnswerInput as bq, type QuizAnswerResult as br, type QuizQuestion as bs, type QuizResult as bt, type QuoteItem as bu, type QuoteRequest as bv, type RegisterInput as bw, type RegisterResult as bx, type RequestInterceptor as by, type RequestInterceptorConfig as bz, type AddToCartInput as c, type StorefrontFormFieldErrorCode as c0, type StorefrontFormFile as c1, type StorefrontFormSettings as c2, type StorefrontFormSubmitInput as c3, type StorefrontFormSubmitResult as c4, type StorefrontFormUpload as c5, type SubmitQuoteInput as c6, type SubmitReturnInput as c7, type SubmitReviewInput as c8, type Subscription as c9, type SubscriptionAction as ca, type SubscriptionFrequency as cb, type SubscriptionItem as cc, type SubscriptionStatus as cd, type TaxBreakdownLine as ce, type VariantAxis as cf, type VariantAxisValue as cg, type WishlistItem as ch, err as ci, ok as cj, toSdkError as ck, type AddressDetail as d, type AddressSuggestion as e, type AddressType as f, AddressTypes as g, type AuthTokens as h, type BackInStockSubscription as i, type BadgeTone as j, BehioApiError as k, type BehioErrorCode as l, type BehioEventHandler as m, type BehioEventType as n, BehioNetworkError as o, type BehioStorefrontConfig as p, type Blog as q, type BlogPostDetail as r, type BlogPostListItem as s, type BlogPostsPage as t, type BlogPostsQuery as u, type BlogSettings as v, type BlogTag as w, type Bundle as x, type BundleCatalogQuery as y, type BundleItem as z };
3808
+ export { type CourseCommentsList as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type Cart as D, type CartBundleLine as E, type CartBundleLineItem as F, type CartDiscount as G, type CartItem as H, type CartItemProduct as I, type CartPromotion as J, type CartSummaryEvent as K, type Category as L, type CategoryDetail as M, type CertificateVerification as N, type CheckoutAddress as O, type ProductDetail as P, type CheckoutInput as Q, type CheckoutPaymentMethod as R, type SdkResult as S, type CheckoutPreview as T, type CheckoutResult as U, type CheckoutSettings as V, type CookieConsentInput as W, type CourseAttachment as X, type CourseCertificate as Y, type CourseComment as Z, type CourseCommentReply as _, type ProductVariant as a, type PaymentStatus as a$, type CourseDetail as a0, type CourseLesson as a1, type CourseListItem as a2, type CourseModule as a3, type CoursePostedComment as a4, type CourseProgress as a5, type CourseTutorMessage as a6, type CourseTutorThread as a7, type CrossSellItem as a8, type CurrencyDisplayFormat as a9, type LoyaltySummary as aA, type LoyaltyTier as aB, type LoyaltyTierPerks as aC, type LoyaltyTransaction as aD, type Menu as aE, type MenuItem as aF, type MenuItemRef as aG, type MenuItemType as aH, type MessageResponse as aI, type NewsletterOptInDefault as aJ, type NewsletterSubscribeInput as aK, type NewsletterSubscribeResult as aL, type NewsletterUnsubscribeResult as aM, type OrderAccessRequestResponse as aN, type OrderAccessVerifyResponse as aO, type OrderDetail as aP, type OrderItem as aQ, type OrderListItem as aR, type OrderStatus as aS, type OrderStatusHistory as aT, OrderStatuses as aU, type OrderTracking as aV, type Page as aW, type PageAttachment as aX, type PageDetail as aY, type PaginatedResponse as aZ, type PaymentInstrument as a_, type CustomerAddress as aa, type CustomerProfile as ab, type DigitalDownload as ac, type DownloadUrl as ad, type Facet as ae, type FacetAvailability as af, type FacetCategory as ag, type FacetLabel as ah, type FacetPriceRange as ai, type FacetRange as aj, type FacetRatingBucket as ak, type FacetValue as al, type FacetsResponse as am, type FilterField as an, type FulfillmentStatus as ao, FulfillmentStatuses as ap, type GiftCardBalance as aq, type GiftCardPurchaseInput as ar, type GiftCardPurchaseResult as as, type GiftCardSummary as at, type LessonNote as au, type LessonQuiz as av, type LoginInput as aw, type LoyaltyBalance as ax, type LoyaltyNextTier as ay, type LoyaltyProgram as az, type StorefrontFormFieldError as b, type StockMode as b$, PaymentStatuses as b0, type PaymentSwift as b1, type PickupPoint as b2, type PickupPointHours as b3, type PickupPointsInput as b4, type PickupWidgetConfig as b5, type PriceDisplay as b6, type ProductAssetGroup as b7, type ProductAssetItem as b8, type ProductAvailability as b9, type RequestInterceptorConfig as bA, type ResponseInterceptor as bB, type ResponseInterceptorData as bC, type ReturnRequest as bD, type ReturnRequestItem as bE, type ReturnStatus as bF, type ReturnStatusItem as bG, type ReturnableOrder as bH, type ReturnableOrderItem as bI, type SdkError as bJ, type ShippingMethodSummary as bK, type ShippingQuote as bL, type ShippingQuoteInput as bM, type ShopAppearance as bN, type ShopInfo as bO, type ShopScript as bP, type ShopScriptPlacement as bQ, type ShopScriptType as bR, type ShopScripts as bS, type ShopSeo as bT, type ShopSeoIdentity as bU, type SiteFormField as bV, type SiteFormFieldOption as bW, type SiteFormFieldType as bX, type Sitemap as bY, type SitemapEntry as bZ, type StockBehavior as b_, type ProductGroup as ba, type ProductLabel as bb, type ProductListItem as bc, type ProductMedia as bd, type ProductMediaVariant as be, type ProductParameter as bf, type ProductParameterGroup as bg, type ProductParametersResponse as bh, type ProductPrice as bi, type ProductPromotionSummary as bj, type ProductReview as bk, type ProductReviewsResponse as bl, type ProductSibling as bm, ProductSort as bn, type ProductSortValue as bo, type ProductVolumePrice as bp, type ProductsQuery as bq, type QuizAnswerInput as br, type QuizAnswerResult as bs, type QuizQuestion as bt, type QuizResult as bu, type QuoteItem as bv, type QuoteRequest as bw, type RegisterInput as bx, type RegisterResult as by, type RequestInterceptor as bz, type AddToCartInput as c, type StorefrontForm as c0, type StorefrontFormFieldErrorCode as c1, type StorefrontFormFile as c2, type StorefrontFormSettings as c3, type StorefrontFormSubmitInput as c4, type StorefrontFormSubmitResult as c5, type StorefrontFormUpload as c6, type SubmitQuoteInput as c7, type SubmitReturnInput as c8, type SubmitReviewInput as c9, type Subscription as ca, type SubscriptionAction as cb, type SubscriptionFrequency as cc, type SubscriptionItem as cd, type SubscriptionStatus as ce, type TaxBreakdownLine as cf, type VariantAxis as cg, type VariantAxisValue as ch, type WishlistItem as ci, err as cj, ok as ck, publishCartSummary as cl, toSdkError as cm, type AddressDetail as d, type AddressSuggestion as e, type AddressType as f, AddressTypes as g, type AuthTokens as h, type BackInStockSubscription as i, type BadgeTone as j, BehioApiError as k, type BehioErrorCode as l, type BehioEventHandler as m, type BehioEventType as n, BehioNetworkError as o, type BehioStorefrontConfig as p, type Blog as q, type BlogPostDetail as r, type BlogPostListItem as s, type BlogPostsPage as t, type BlogPostsQuery as u, type BlogSettings as v, type BlogTag as w, type Bundle as x, type BundleCatalogQuery as y, type BundleItem as z };
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-BhdlZIGe.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 CartPromotion, K as Category, L as CategoryDetail, M as CertificateVerification, N as CheckoutAddress, O as CheckoutInput, Q as CheckoutPaymentMethod, R as CheckoutPreview, T as CheckoutResult, U as CheckoutSettings, V as CookieConsentInput, W as CourseAttachment, X as CourseCertificate, Y as CourseComment, Z as CourseCommentReply, _ as CourseCommentsList, $ as CourseDetail, a0 as CourseLesson, a1 as CourseListItem, a2 as CourseModule, a3 as CoursePostedComment, a4 as CourseProgress, a5 as CourseTutorMessage, a6 as CourseTutorThread, a7 as CrossSellItem, a8 as CurrencyDisplayFormat, a9 as CustomerAddress, aa as CustomerProfile, ab as DigitalDownload, ac as DownloadUrl, ad as Facet, ae as FacetAvailability, af as FacetCategory, ag as FacetLabel, ah as FacetPriceRange, ai as FacetRange, aj as FacetRatingBucket, ak as FacetValue, al as FacetsResponse, am as FilterField, an as FulfillmentStatus, ao as FulfillmentStatuses, ap as GiftCardBalance, aq as GiftCardPurchaseInput, ar as GiftCardPurchaseResult, as as GiftCardSummary, at as LessonNote, au as LessonQuiz, av as LoginInput, aw as LoyaltyBalance, ax as LoyaltyNextTier, ay as LoyaltyProgram, az as LoyaltySummary, aA as LoyaltyTier, aB as LoyaltyTierPerks, aC as LoyaltyTransaction, aD as Menu, aE as MenuItem, aF as MenuItemRef, aG as MenuItemType, aH as MessageResponse, aI as NewsletterOptInDefault, aJ as NewsletterSubscribeInput, aK as NewsletterSubscribeResult, aL as NewsletterUnsubscribeResult, aM as OrderAccessRequestResponse, aN as OrderAccessVerifyResponse, aO as OrderDetail, aP as OrderItem, aQ as OrderListItem, aR as OrderStatus, aS as OrderStatusHistory, aT as OrderStatuses, aU as OrderTracking, aV as Page, aW as PageAttachment, aX as PageDetail, aY as PaginatedResponse, aZ as PaymentInstrument, a_ as PaymentStatus, a$ as PaymentStatuses, b0 as PaymentSwift, b1 as PickupPoint, b2 as PickupPointHours, b3 as PickupPointsInput, b4 as PickupWidgetConfig, b5 as PriceDisplay, b6 as ProductAssetGroup, b7 as ProductAssetItem, b8 as ProductAvailability, b9 as ProductGroup, ba as ProductLabel, bb as ProductListItem, bc as ProductMedia, bd as ProductMediaVariant, be as ProductParameter, bf as ProductParameterGroup, bg as ProductParametersResponse, bh as ProductPrice, bi as ProductPromotionSummary, bj as ProductReview, bk as ProductReviewsResponse, bl as ProductSibling, bm as ProductSort, bn as ProductSortValue, bo as ProductVolumePrice, bp as ProductsQuery, bq as QuizAnswerInput, br as QuizAnswerResult, bs as QuizQuestion, bt as QuizResult, bu as QuoteItem, bv as QuoteRequest, bw as RegisterInput, bx as RegisterResult, by as RequestInterceptor, bz as RequestInterceptorConfig, bA as ResponseInterceptor, bB as ResponseInterceptorData, bC as ReturnRequest, bD as ReturnRequestItem, bE as ReturnStatus, bF as ReturnStatusItem, bG as ReturnableOrder, bH as ReturnableOrderItem, bI as SdkError, bJ as ShippingMethodSummary, bK as ShippingQuote, bL as ShippingQuoteInput, bM as ShopAppearance, bN as ShopInfo, bO as ShopScript, bP as ShopScriptPlacement, bQ as ShopScriptType, bR as ShopScripts, bS as ShopSeo, bT as ShopSeoIdentity, bU as SiteFormField, bV as SiteFormFieldOption, bW as SiteFormFieldType, bX as Sitemap, bY as SitemapEntry, bZ as StockBehavior, b_ as StockMode, b$ as StorefrontForm, c0 as StorefrontFormFieldErrorCode, c1 as StorefrontFormFile, c2 as StorefrontFormSettings, c3 as StorefrontFormSubmitInput, c4 as StorefrontFormSubmitResult, c5 as StorefrontFormUpload, c6 as SubmitQuoteInput, c7 as SubmitReturnInput, c8 as SubmitReviewInput, c9 as Subscription, ca as SubscriptionAction, cb as SubscriptionFrequency, cc as SubscriptionItem, cd as SubscriptionStatus, ce as TaxBreakdownLine, cf as VariantAxis, cg as VariantAxisValue, ch as WishlistItem, ci as err, cj as ok, ck as toSdkError } from './client-BhdlZIGe.mjs';
1
+ import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-CDpkw2Qv.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 CartPromotion, K as CartSummaryEvent, L as Category, M as CategoryDetail, N as CertificateVerification, O as CheckoutAddress, Q as CheckoutInput, R as CheckoutPaymentMethod, T as CheckoutPreview, U as CheckoutResult, V as CheckoutSettings, W as CookieConsentInput, X as CourseAttachment, Y as CourseCertificate, Z as CourseComment, _ as CourseCommentReply, $ as CourseCommentsList, a0 as CourseDetail, a1 as CourseLesson, a2 as CourseListItem, a3 as CourseModule, a4 as CoursePostedComment, a5 as CourseProgress, a6 as CourseTutorMessage, a7 as CourseTutorThread, a8 as CrossSellItem, a9 as CurrencyDisplayFormat, aa as CustomerAddress, ab as CustomerProfile, ac as DigitalDownload, ad as DownloadUrl, ae as Facet, af as FacetAvailability, ag as FacetCategory, ah as FacetLabel, ai as FacetPriceRange, aj as FacetRange, ak as FacetRatingBucket, al as FacetValue, am as FacetsResponse, an as FilterField, ao as FulfillmentStatus, ap as FulfillmentStatuses, aq as GiftCardBalance, ar as GiftCardPurchaseInput, as as GiftCardPurchaseResult, at as GiftCardSummary, au as LessonNote, av as LessonQuiz, aw as LoginInput, ax as LoyaltyBalance, ay as LoyaltyNextTier, az as LoyaltyProgram, aA as LoyaltySummary, aB as LoyaltyTier, aC as LoyaltyTierPerks, aD as LoyaltyTransaction, aE as Menu, aF as MenuItem, aG as MenuItemRef, aH as MenuItemType, aI as MessageResponse, aJ as NewsletterOptInDefault, aK as NewsletterSubscribeInput, aL as NewsletterSubscribeResult, aM as NewsletterUnsubscribeResult, aN as OrderAccessRequestResponse, aO as OrderAccessVerifyResponse, aP as OrderDetail, aQ as OrderItem, aR as OrderListItem, aS as OrderStatus, aT as OrderStatusHistory, aU as OrderStatuses, aV as OrderTracking, aW as Page, aX as PageAttachment, aY as PageDetail, aZ as PaginatedResponse, a_ as PaymentInstrument, a$ as PaymentStatus, b0 as PaymentStatuses, b1 as PaymentSwift, b2 as PickupPoint, b3 as PickupPointHours, b4 as PickupPointsInput, b5 as PickupWidgetConfig, b6 as PriceDisplay, b7 as ProductAssetGroup, b8 as ProductAssetItem, b9 as ProductAvailability, ba as ProductGroup, bb as ProductLabel, bc as ProductListItem, bd as ProductMedia, be as ProductMediaVariant, bf as ProductParameter, bg as ProductParameterGroup, bh as ProductParametersResponse, bi as ProductPrice, bj as ProductPromotionSummary, bk as ProductReview, bl as ProductReviewsResponse, bm as ProductSibling, bn as ProductSort, bo as ProductSortValue, bp as ProductVolumePrice, bq as ProductsQuery, br as QuizAnswerInput, bs as QuizAnswerResult, bt as QuizQuestion, bu as QuizResult, bv as QuoteItem, bw as QuoteRequest, bx as RegisterInput, by as RegisterResult, bz as RequestInterceptor, bA as RequestInterceptorConfig, bB as ResponseInterceptor, bC as ResponseInterceptorData, bD as ReturnRequest, bE as ReturnRequestItem, bF as ReturnStatus, bG as ReturnStatusItem, bH as ReturnableOrder, bI as ReturnableOrderItem, bJ as SdkError, bK as ShippingMethodSummary, bL as ShippingQuote, bM as ShippingQuoteInput, bN as ShopAppearance, bO as ShopInfo, bP as ShopScript, bQ as ShopScriptPlacement, bR as ShopScriptType, bS as ShopScripts, bT as ShopSeo, bU as ShopSeoIdentity, bV as SiteFormField, bW as SiteFormFieldOption, bX as SiteFormFieldType, bY as Sitemap, bZ as SitemapEntry, b_ as StockBehavior, b$ as StockMode, c0 as StorefrontForm, c1 as StorefrontFormFieldErrorCode, c2 as StorefrontFormFile, c3 as StorefrontFormSettings, c4 as StorefrontFormSubmitInput, c5 as StorefrontFormSubmitResult, c6 as StorefrontFormUpload, c7 as SubmitQuoteInput, c8 as SubmitReturnInput, c9 as SubmitReviewInput, ca as Subscription, cb as SubscriptionAction, cc as SubscriptionFrequency, cd as SubscriptionItem, ce as SubscriptionStatus, cf as TaxBreakdownLine, cg as VariantAxis, ch as VariantAxisValue, ci as WishlistItem, cj as err, ck as ok, cl as publishCartSummary, cm as toSdkError } from './client-CDpkw2Qv.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-BhdlZIGe.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 CartPromotion, K as Category, L as CategoryDetail, M as CertificateVerification, N as CheckoutAddress, O as CheckoutInput, Q as CheckoutPaymentMethod, R as CheckoutPreview, T as CheckoutResult, U as CheckoutSettings, V as CookieConsentInput, W as CourseAttachment, X as CourseCertificate, Y as CourseComment, Z as CourseCommentReply, _ as CourseCommentsList, $ as CourseDetail, a0 as CourseLesson, a1 as CourseListItem, a2 as CourseModule, a3 as CoursePostedComment, a4 as CourseProgress, a5 as CourseTutorMessage, a6 as CourseTutorThread, a7 as CrossSellItem, a8 as CurrencyDisplayFormat, a9 as CustomerAddress, aa as CustomerProfile, ab as DigitalDownload, ac as DownloadUrl, ad as Facet, ae as FacetAvailability, af as FacetCategory, ag as FacetLabel, ah as FacetPriceRange, ai as FacetRange, aj as FacetRatingBucket, ak as FacetValue, al as FacetsResponse, am as FilterField, an as FulfillmentStatus, ao as FulfillmentStatuses, ap as GiftCardBalance, aq as GiftCardPurchaseInput, ar as GiftCardPurchaseResult, as as GiftCardSummary, at as LessonNote, au as LessonQuiz, av as LoginInput, aw as LoyaltyBalance, ax as LoyaltyNextTier, ay as LoyaltyProgram, az as LoyaltySummary, aA as LoyaltyTier, aB as LoyaltyTierPerks, aC as LoyaltyTransaction, aD as Menu, aE as MenuItem, aF as MenuItemRef, aG as MenuItemType, aH as MessageResponse, aI as NewsletterOptInDefault, aJ as NewsletterSubscribeInput, aK as NewsletterSubscribeResult, aL as NewsletterUnsubscribeResult, aM as OrderAccessRequestResponse, aN as OrderAccessVerifyResponse, aO as OrderDetail, aP as OrderItem, aQ as OrderListItem, aR as OrderStatus, aS as OrderStatusHistory, aT as OrderStatuses, aU as OrderTracking, aV as Page, aW as PageAttachment, aX as PageDetail, aY as PaginatedResponse, aZ as PaymentInstrument, a_ as PaymentStatus, a$ as PaymentStatuses, b0 as PaymentSwift, b1 as PickupPoint, b2 as PickupPointHours, b3 as PickupPointsInput, b4 as PickupWidgetConfig, b5 as PriceDisplay, b6 as ProductAssetGroup, b7 as ProductAssetItem, b8 as ProductAvailability, b9 as ProductGroup, ba as ProductLabel, bb as ProductListItem, bc as ProductMedia, bd as ProductMediaVariant, be as ProductParameter, bf as ProductParameterGroup, bg as ProductParametersResponse, bh as ProductPrice, bi as ProductPromotionSummary, bj as ProductReview, bk as ProductReviewsResponse, bl as ProductSibling, bm as ProductSort, bn as ProductSortValue, bo as ProductVolumePrice, bp as ProductsQuery, bq as QuizAnswerInput, br as QuizAnswerResult, bs as QuizQuestion, bt as QuizResult, bu as QuoteItem, bv as QuoteRequest, bw as RegisterInput, bx as RegisterResult, by as RequestInterceptor, bz as RequestInterceptorConfig, bA as ResponseInterceptor, bB as ResponseInterceptorData, bC as ReturnRequest, bD as ReturnRequestItem, bE as ReturnStatus, bF as ReturnStatusItem, bG as ReturnableOrder, bH as ReturnableOrderItem, bI as SdkError, bJ as ShippingMethodSummary, bK as ShippingQuote, bL as ShippingQuoteInput, bM as ShopAppearance, bN as ShopInfo, bO as ShopScript, bP as ShopScriptPlacement, bQ as ShopScriptType, bR as ShopScripts, bS as ShopSeo, bT as ShopSeoIdentity, bU as SiteFormField, bV as SiteFormFieldOption, bW as SiteFormFieldType, bX as Sitemap, bY as SitemapEntry, bZ as StockBehavior, b_ as StockMode, b$ as StorefrontForm, c0 as StorefrontFormFieldErrorCode, c1 as StorefrontFormFile, c2 as StorefrontFormSettings, c3 as StorefrontFormSubmitInput, c4 as StorefrontFormSubmitResult, c5 as StorefrontFormUpload, c6 as SubmitQuoteInput, c7 as SubmitReturnInput, c8 as SubmitReviewInput, c9 as Subscription, ca as SubscriptionAction, cb as SubscriptionFrequency, cc as SubscriptionItem, cd as SubscriptionStatus, ce as TaxBreakdownLine, cf as VariantAxis, cg as VariantAxisValue, ch as WishlistItem, ci as err, cj as ok, ck as toSdkError } from './client-BhdlZIGe.js';
1
+ import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-CDpkw2Qv.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 CartPromotion, K as CartSummaryEvent, L as Category, M as CategoryDetail, N as CertificateVerification, O as CheckoutAddress, Q as CheckoutInput, R as CheckoutPaymentMethod, T as CheckoutPreview, U as CheckoutResult, V as CheckoutSettings, W as CookieConsentInput, X as CourseAttachment, Y as CourseCertificate, Z as CourseComment, _ as CourseCommentReply, $ as CourseCommentsList, a0 as CourseDetail, a1 as CourseLesson, a2 as CourseListItem, a3 as CourseModule, a4 as CoursePostedComment, a5 as CourseProgress, a6 as CourseTutorMessage, a7 as CourseTutorThread, a8 as CrossSellItem, a9 as CurrencyDisplayFormat, aa as CustomerAddress, ab as CustomerProfile, ac as DigitalDownload, ad as DownloadUrl, ae as Facet, af as FacetAvailability, ag as FacetCategory, ah as FacetLabel, ai as FacetPriceRange, aj as FacetRange, ak as FacetRatingBucket, al as FacetValue, am as FacetsResponse, an as FilterField, ao as FulfillmentStatus, ap as FulfillmentStatuses, aq as GiftCardBalance, ar as GiftCardPurchaseInput, as as GiftCardPurchaseResult, at as GiftCardSummary, au as LessonNote, av as LessonQuiz, aw as LoginInput, ax as LoyaltyBalance, ay as LoyaltyNextTier, az as LoyaltyProgram, aA as LoyaltySummary, aB as LoyaltyTier, aC as LoyaltyTierPerks, aD as LoyaltyTransaction, aE as Menu, aF as MenuItem, aG as MenuItemRef, aH as MenuItemType, aI as MessageResponse, aJ as NewsletterOptInDefault, aK as NewsletterSubscribeInput, aL as NewsletterSubscribeResult, aM as NewsletterUnsubscribeResult, aN as OrderAccessRequestResponse, aO as OrderAccessVerifyResponse, aP as OrderDetail, aQ as OrderItem, aR as OrderListItem, aS as OrderStatus, aT as OrderStatusHistory, aU as OrderStatuses, aV as OrderTracking, aW as Page, aX as PageAttachment, aY as PageDetail, aZ as PaginatedResponse, a_ as PaymentInstrument, a$ as PaymentStatus, b0 as PaymentStatuses, b1 as PaymentSwift, b2 as PickupPoint, b3 as PickupPointHours, b4 as PickupPointsInput, b5 as PickupWidgetConfig, b6 as PriceDisplay, b7 as ProductAssetGroup, b8 as ProductAssetItem, b9 as ProductAvailability, ba as ProductGroup, bb as ProductLabel, bc as ProductListItem, bd as ProductMedia, be as ProductMediaVariant, bf as ProductParameter, bg as ProductParameterGroup, bh as ProductParametersResponse, bi as ProductPrice, bj as ProductPromotionSummary, bk as ProductReview, bl as ProductReviewsResponse, bm as ProductSibling, bn as ProductSort, bo as ProductSortValue, bp as ProductVolumePrice, bq as ProductsQuery, br as QuizAnswerInput, bs as QuizAnswerResult, bt as QuizQuestion, bu as QuizResult, bv as QuoteItem, bw as QuoteRequest, bx as RegisterInput, by as RegisterResult, bz as RequestInterceptor, bA as RequestInterceptorConfig, bB as ResponseInterceptor, bC as ResponseInterceptorData, bD as ReturnRequest, bE as ReturnRequestItem, bF as ReturnStatus, bG as ReturnStatusItem, bH as ReturnableOrder, bI as ReturnableOrderItem, bJ as SdkError, bK as ShippingMethodSummary, bL as ShippingQuote, bM as ShippingQuoteInput, bN as ShopAppearance, bO as ShopInfo, bP as ShopScript, bQ as ShopScriptPlacement, bR as ShopScriptType, bS as ShopScripts, bT as ShopSeo, bU as ShopSeoIdentity, bV as SiteFormField, bW as SiteFormFieldOption, bX as SiteFormFieldType, bY as Sitemap, bZ as SitemapEntry, b_ as StockBehavior, b$ as StockMode, c0 as StorefrontForm, c1 as StorefrontFormFieldErrorCode, c2 as StorefrontFormFile, c3 as StorefrontFormSettings, c4 as StorefrontFormSubmitInput, c5 as StorefrontFormSubmitResult, c6 as StorefrontFormUpload, c7 as SubmitQuoteInput, c8 as SubmitReturnInput, c9 as SubmitReviewInput, ca as Subscription, cb as SubscriptionAction, cc as SubscriptionFrequency, cd as SubscriptionItem, ce as SubscriptionStatus, cf as TaxBreakdownLine, cg as VariantAxis, ch as VariantAxisValue, ci as WishlistItem, cj as err, ck as ok, cl as publishCartSummary, cm as toSdkError } from './client-CDpkw2Qv.js';
3
3
 
4
4
  /**
5
5
  * Format a price amount with currency using Intl.NumberFormat.
package/dist/index.js CHANGED
@@ -10,7 +10,8 @@
10
10
 
11
11
 
12
12
 
13
- var _chunkM6TCQUXZjs = require('./chunk-M6TCQUXZ.js');
13
+
14
+ var _chunkB6LU56ECjs = require('./chunk-B6LU56EC.js');
14
15
 
15
16
  // src/react/utils/format-price.ts
16
17
  function formatPrice(amount, currency, locale, display) {
@@ -948,7 +949,7 @@ var GENERIC = {
948
949
  en: "Something went wrong, please try again."
949
950
  };
950
951
  function bodyOf(err2) {
951
- const body = err2 instanceof _chunkM6TCQUXZjs.BehioApiError ? err2.body : err2 && typeof err2 === "object" && "body" in err2 ? err2.body : err2;
952
+ const body = err2 instanceof _chunkB6LU56ECjs.BehioApiError ? err2.body : err2 && typeof err2 === "object" && "body" in err2 ? err2.body : err2;
952
953
  return body && typeof body === "object" ? body : null;
953
954
  }
954
955
  function errorCode(err2) {
@@ -1060,4 +1061,5 @@ function formFieldErrors(err2) {
1060
1061
 
1061
1062
 
1062
1063
 
1063
- exports.AddressTypes = _chunkM6TCQUXZjs.AddressTypes; exports.BehioApiError = _chunkM6TCQUXZjs.BehioApiError; exports.BehioNetworkError = _chunkM6TCQUXZjs.BehioNetworkError; exports.BehioStorefront = _chunkM6TCQUXZjs.BehioStorefront; exports.FulfillmentStatuses = _chunkM6TCQUXZjs.FulfillmentStatuses; exports.OrderStatuses = _chunkM6TCQUXZjs.OrderStatuses; exports.PaymentStatuses = _chunkM6TCQUXZjs.PaymentStatuses; exports.ProductSort = _chunkM6TCQUXZjs.ProductSort; exports.VARIANT_QUERY_PARAM = VARIANT_QUERY_PARAM; exports.availableAxisValues = availableAxisValues; exports.buildVariantComparison = buildVariantComparison; exports.err = _chunkM6TCQUXZjs.err; exports.errorCode = errorCode; exports.errorMessage = errorMessage; exports.errorParams = errorParams; exports.findVariantByAttributes = findVariantByAttributes; exports.formFieldErrors = formFieldErrors; exports.formatPrice = formatPrice; exports.generateVisitorId = generateVisitorId; exports.getStoredVisitorId = getStoredVisitorId; exports.grantAnalyticsConsent = grantAnalyticsConsent; exports.ok = _chunkM6TCQUXZjs.ok; exports.resolveVariantContent = resolveVariantContent; exports.revokeAnalyticsConsent = revokeAnalyticsConsent; exports.toSdkError = _chunkM6TCQUXZjs.toSdkError; exports.trackEcommerceEvent = trackEcommerceEvent; exports.validationFieldMessages = validationFieldMessages; exports.variantFromQuery = variantFromQuery; exports.variantHref = variantHref;
1064
+
1065
+ exports.AddressTypes = _chunkB6LU56ECjs.AddressTypes; exports.BehioApiError = _chunkB6LU56ECjs.BehioApiError; exports.BehioNetworkError = _chunkB6LU56ECjs.BehioNetworkError; exports.BehioStorefront = _chunkB6LU56ECjs.BehioStorefront; exports.FulfillmentStatuses = _chunkB6LU56ECjs.FulfillmentStatuses; exports.OrderStatuses = _chunkB6LU56ECjs.OrderStatuses; exports.PaymentStatuses = _chunkB6LU56ECjs.PaymentStatuses; exports.ProductSort = _chunkB6LU56ECjs.ProductSort; exports.VARIANT_QUERY_PARAM = VARIANT_QUERY_PARAM; exports.availableAxisValues = availableAxisValues; exports.buildVariantComparison = buildVariantComparison; exports.err = _chunkB6LU56ECjs.err; exports.errorCode = errorCode; exports.errorMessage = errorMessage; exports.errorParams = errorParams; exports.findVariantByAttributes = findVariantByAttributes; exports.formFieldErrors = formFieldErrors; exports.formatPrice = formatPrice; exports.generateVisitorId = generateVisitorId; exports.getStoredVisitorId = getStoredVisitorId; exports.grantAnalyticsConsent = grantAnalyticsConsent; exports.ok = _chunkB6LU56ECjs.ok; exports.publishCartSummary = _chunkB6LU56ECjs.publishCartSummary; exports.resolveVariantContent = resolveVariantContent; exports.revokeAnalyticsConsent = revokeAnalyticsConsent; exports.toSdkError = _chunkB6LU56ECjs.toSdkError; exports.trackEcommerceEvent = trackEcommerceEvent; exports.validationFieldMessages = validationFieldMessages; exports.variantFromQuery = variantFromQuery; exports.variantHref = variantHref;
package/dist/index.mjs CHANGED
@@ -9,8 +9,9 @@ import {
9
9
  ProductSort,
10
10
  err,
11
11
  ok,
12
+ publishCartSummary,
12
13
  toSdkError
13
- } from "./chunk-EXHIA7ST.mjs";
14
+ } from "./chunk-ET7SLTHN.mjs";
14
15
 
15
16
  // src/react/utils/format-price.ts
16
17
  function formatPrice(amount, currency, locale, display) {
@@ -1053,6 +1054,7 @@ export {
1053
1054
  getStoredVisitorId,
1054
1055
  grantAnalyticsConsent,
1055
1056
  ok,
1057
+ publishCartSummary,
1056
1058
  resolveVariantContent,
1057
1059
  revokeAnalyticsConsent,
1058
1060
  toSdkError,
package/dist/next.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-BhdlZIGe.mjs';
1
+ import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-CDpkw2Qv.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-BhdlZIGe.js';
1
+ import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-CDpkw2Qv.js';
2
2
 
3
3
  interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
4
4
  /** Override the cart session cookie name (default: "behio_cart_session"). */
package/dist/next.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkM6TCQUXZjs = require('./chunk-M6TCQUXZ.js');
3
+ var _chunkB6LU56ECjs = require('./chunk-B6LU56EC.js');
4
4
 
5
5
  // src/next.ts
6
6
  var _headers = require('next/headers');
@@ -19,7 +19,7 @@ async function getBehio(options = {}) {
19
19
  const locale = _nullishCoalesce(options.locale, () => ( process.env.BEHIO_LOCALE));
20
20
  const currency = _nullishCoalesce(options.currency, () => ( process.env.BEHIO_CURRENCY));
21
21
  const cookieName = _nullishCoalesce(options.cartCookieName, () => ( CART_COOKIE_NAME));
22
- const client = new (0, _chunkM6TCQUXZjs.BehioStorefront)({
22
+ const client = new (0, _chunkB6LU56ECjs.BehioStorefront)({
23
23
  apiKey,
24
24
  ...baseUrl ? { baseUrl } : {},
25
25
  ...locale ? { locale } : {},
package/dist/next.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BehioStorefront
3
- } from "./chunk-EXHIA7ST.mjs";
3
+ } from "./chunk-ET7SLTHN.mjs";
4
4
 
5
5
  // src/next.ts
6
6
  import { cookies, headers } from "next/headers";
package/dist/react.js CHANGED
@@ -557,6 +557,7 @@ var BehioStorefront = class {
557
557
  async request(method, path, options) {
558
558
  try {
559
559
  const data = await this.rawRequest(method, path, options);
560
+ if (path === "/cart" || path.startsWith("/cart/")) emitCartEvent(data);
560
561
  return ok(data);
561
562
  } catch (err) {
562
563
  if (this.throwOnAvailabilityError && isAvailabilityFailure(err)) {
@@ -2182,6 +2183,29 @@ var NewsletterModule = class {
2182
2183
  );
2183
2184
  }
2184
2185
  };
2186
+ function publishCartSummary(summary) {
2187
+ if (typeof window === "undefined" || typeof window.dispatchEvent !== "function") return;
2188
+ if (!Number.isFinite(summary.total) || !Number.isFinite(summary.itemCount)) return;
2189
+ const detail = { total: summary.total, currency: summary.currency ?? null, itemCount: summary.itemCount };
2190
+ try {
2191
+ window.__behioCart = detail;
2192
+ window.dispatchEvent(new CustomEvent("behio:cart", { detail }));
2193
+ } catch {
2194
+ }
2195
+ }
2196
+ function emitCartEvent(data) {
2197
+ if (typeof window === "undefined") return;
2198
+ const cart = data;
2199
+ if (!cart || typeof cart !== "object" || !Array.isArray(cart.items)) return;
2200
+ if (cart.totalsAvailable === false) return;
2201
+ const items = cart.items;
2202
+ const total = typeof cart.grandTotal === "number" ? cart.grandTotal : typeof cart.subtotal === "number" ? cart.subtotal : 0;
2203
+ publishCartSummary({
2204
+ total,
2205
+ currency: typeof cart.currency === "string" ? cart.currency : null,
2206
+ itemCount: items.reduce((n, i) => n + (typeof i?.quantity === "number" ? i.quantity : 1), 0)
2207
+ });
2208
+ }
2185
2209
 
2186
2210
  // src/react/context.ts
2187
2211
  var import_react = require("react");
package/dist/react.mjs CHANGED
@@ -447,6 +447,7 @@ var BehioStorefront = class {
447
447
  async request(method, path, options) {
448
448
  try {
449
449
  const data = await this.rawRequest(method, path, options);
450
+ if (path === "/cart" || path.startsWith("/cart/")) emitCartEvent(data);
450
451
  return ok(data);
451
452
  } catch (err) {
452
453
  if (this.throwOnAvailabilityError && isAvailabilityFailure(err)) {
@@ -2072,6 +2073,29 @@ var NewsletterModule = class {
2072
2073
  );
2073
2074
  }
2074
2075
  };
2076
+ function publishCartSummary(summary) {
2077
+ if (typeof window === "undefined" || typeof window.dispatchEvent !== "function") return;
2078
+ if (!Number.isFinite(summary.total) || !Number.isFinite(summary.itemCount)) return;
2079
+ const detail = { total: summary.total, currency: summary.currency ?? null, itemCount: summary.itemCount };
2080
+ try {
2081
+ window.__behioCart = detail;
2082
+ window.dispatchEvent(new CustomEvent("behio:cart", { detail }));
2083
+ } catch {
2084
+ }
2085
+ }
2086
+ function emitCartEvent(data) {
2087
+ if (typeof window === "undefined") return;
2088
+ const cart = data;
2089
+ if (!cart || typeof cart !== "object" || !Array.isArray(cart.items)) return;
2090
+ if (cart.totalsAvailable === false) return;
2091
+ const items = cart.items;
2092
+ const total = typeof cart.grandTotal === "number" ? cart.grandTotal : typeof cart.subtotal === "number" ? cart.subtotal : 0;
2093
+ publishCartSummary({
2094
+ total,
2095
+ currency: typeof cart.currency === "string" ? cart.currency : null,
2096
+ itemCount: items.reduce((n, i) => n + (typeof i?.quantity === "number" ? i.quantity : 1), 0)
2097
+ });
2098
+ }
2075
2099
 
2076
2100
  // src/react/context.ts
2077
2101
  import { createContext, useContext } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@behio/storefront-sdk",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "TypeScript SDK for Behio headless e-commerce: core client + React hooks",
5
5
  "author": "Behio",
6
6
  "license": "MIT",