@cimplify/sdk 0.15.6 → 0.15.7

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.
@@ -1,5 +1,5 @@
1
- export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, k as CheckoutOperations, k as CheckoutService, u as CimplifyElement, t as CimplifyElements, w as ELEMENT_TYPES, E as EVENT_TYPES, D as ElementEventType, y as ElementOptions, z as ElementType, x as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, M as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, S as SearchOptions, v as createElements, l as generateIdempotencyKey } from './client-BSrq89H1.mjs';
2
- import './payment-CrNyrc-D.mjs';
1
+ export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, k as CheckoutOperations, k as CheckoutService, u as CimplifyElement, t as CimplifyElements, w as ELEMENT_TYPES, E as EVENT_TYPES, D as ElementEventType, y as ElementOptions, z as ElementType, x as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, M as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, S as SearchOptions, v as createElements, l as generateIdempotencyKey } from './client-Cx9Mfh6U.mjs';
2
+ import './payment-Dvd7nRmk.mjs';
3
3
 
4
4
  type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
5
5
  type SortOrder = "asc" | "desc";
@@ -1,5 +1,5 @@
1
- export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, k as CheckoutOperations, k as CheckoutService, u as CimplifyElement, t as CimplifyElements, w as ELEMENT_TYPES, E as EVENT_TYPES, D as ElementEventType, y as ElementOptions, z as ElementType, x as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, M as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, S as SearchOptions, v as createElements, l as generateIdempotencyKey } from './client-xBhdHLq4.js';
2
- import './payment-CrNyrc-D.js';
1
+ export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, k as CheckoutOperations, k as CheckoutService, u as CimplifyElement, t as CimplifyElements, w as ELEMENT_TYPES, E as EVENT_TYPES, D as ElementEventType, y as ElementOptions, z as ElementType, x as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, M as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, S as SearchOptions, v as createElements, l as generateIdempotencyKey } from './client-eY00I7H1.js';
2
+ import './payment-Dvd7nRmk.js';
3
3
 
4
4
  type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
5
5
  type SortOrder = "asc" | "desc";
@@ -1,4 +1,4 @@
1
- import { L as Category, r as Product, G as AddOnWithOptions, b as Pagination, g as CimplifyError, s as ProductWithDetails, t as ProductVariant, v as VariantAxis, B as VariantAxisSelection, F as AddOn, O as Collection, W as BundleSummary, U as Bundle, a7 as Composite, ae as ComponentSelectionInput, af as CompositePriceResult, aD as ChosenPrice, am as ProductTaxonomy, an as TaxonomyWithChildren, al as ProductTimeProfile, ao as ProductAvailabilityNow, aq as Deal, ar as ProductDealInfo, as as DiscountValidation, au as TagsResponse, b6 as UICart, aT as Cart, aU as CartItem, ba as CartSummary, b8 as AddToCartInput, b9 as UpdateCartItemInput, aH as DiscountDetails, M as Money, C as CurrencyCode, aS as LineConfiguration, bf as AuthorizationType, bh as PaymentMethod, bj as InitializePaymentResult, bn as SubmitAuthorizationInput, bl as PaymentStatusResponse } from './payment-CrNyrc-D.mjs';
1
+ import { L as Category, r as Product, G as AddOnWithOptions, b as Pagination, g as CimplifyError, s as ProductWithDetails, t as ProductVariant, v as VariantAxis, B as VariantAxisSelection, F as AddOn, O as Collection, W as BundleSummary, U as Bundle, a7 as Composite, ae as ComponentSelectionInput, af as CompositePriceResult, aD as ChosenPrice, am as ProductTaxonomy, an as TaxonomyWithChildren, al as ProductTimeProfile, ao as ProductAvailabilityNow, aq as Deal, ar as ProductDealInfo, as as DiscountValidation, au as TagsResponse, b6 as UICart, aT as Cart, aU as CartItem, ba as CartSummary, b8 as AddToCartInput, b9 as UpdateCartItemInput, aH as DiscountDetails, M as Money, C as CurrencyCode, aS as LineConfiguration, bf as AuthorizationType, bh as PaymentMethod, bj as InitializePaymentResult, bn as SubmitAuthorizationInput, bl as PaymentStatusResponse } from './payment-Dvd7nRmk.mjs';
2
2
 
3
3
  interface RequestContext {
4
4
  method: "GET" | "POST" | "PATCH" | "DELETE";
@@ -1,4 +1,4 @@
1
- import { L as Category, r as Product, G as AddOnWithOptions, b as Pagination, g as CimplifyError, s as ProductWithDetails, t as ProductVariant, v as VariantAxis, B as VariantAxisSelection, F as AddOn, O as Collection, W as BundleSummary, U as Bundle, a7 as Composite, ae as ComponentSelectionInput, af as CompositePriceResult, aD as ChosenPrice, am as ProductTaxonomy, an as TaxonomyWithChildren, al as ProductTimeProfile, ao as ProductAvailabilityNow, aq as Deal, ar as ProductDealInfo, as as DiscountValidation, au as TagsResponse, b6 as UICart, aT as Cart, aU as CartItem, ba as CartSummary, b8 as AddToCartInput, b9 as UpdateCartItemInput, aH as DiscountDetails, M as Money, C as CurrencyCode, aS as LineConfiguration, bf as AuthorizationType, bh as PaymentMethod, bj as InitializePaymentResult, bn as SubmitAuthorizationInput, bl as PaymentStatusResponse } from './payment-CrNyrc-D.js';
1
+ import { L as Category, r as Product, G as AddOnWithOptions, b as Pagination, g as CimplifyError, s as ProductWithDetails, t as ProductVariant, v as VariantAxis, B as VariantAxisSelection, F as AddOn, O as Collection, W as BundleSummary, U as Bundle, a7 as Composite, ae as ComponentSelectionInput, af as CompositePriceResult, aD as ChosenPrice, am as ProductTaxonomy, an as TaxonomyWithChildren, al as ProductTimeProfile, ao as ProductAvailabilityNow, aq as Deal, ar as ProductDealInfo, as as DiscountValidation, au as TagsResponse, b6 as UICart, aT as Cart, aU as CartItem, ba as CartSummary, b8 as AddToCartInput, b9 as UpdateCartItemInput, aH as DiscountDetails, M as Money, C as CurrencyCode, aS as LineConfiguration, bf as AuthorizationType, bh as PaymentMethod, bj as InitializePaymentResult, bn as SubmitAuthorizationInput, bl as PaymentStatusResponse } from './payment-Dvd7nRmk.js';
2
2
 
3
3
  interface RequestContext {
4
4
  method: "GET" | "POST" | "PATCH" | "DELETE";
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- export { ac as AUTHORIZATION_TYPE, ah as AUTH_MUTATION, a1 as AbortablePromise, ca as AddressData, cD as AddressInfo, aR as AmountToPay, cl as AuthResponse, A as AuthService, n as AuthStatus, cF as AuthenticatedCustomer, cH as AuthenticatedData, c0 as AvailabilityResult, bH as AvailableSlot, bK as Booking, bJ as BookingStatus, bL as BookingWithDetails, b9 as BufferTimes, bo as Business, bC as BusinessHours, bn as BusinessPreferences, B as BusinessService, bB as BusinessSettings, bm as BusinessType, bz as BusinessWithLocations, a5 as CHECKOUT_MODE, ai as CHECKOUT_MUTATION, a8 as CHECKOUT_STEP, ae as CONTACT_TYPE, bS as CancelBookingInput, bT as CancelBookingResult, b3 as CancelOrderInput, bb as CancellationPolicy, j as CartOperations, b as CatalogueQueries, aE as CatalogueResult, aF as CatalogueSnapshot, bD as CategoryInfo, bP as CheckSlotAvailabilityInput, bQ as CheckSlotAvailabilityResult, co as CheckoutAddressInfo, cL as CheckoutCartData, cK as CheckoutCartItem, cq as CheckoutCustomerInfo, V as CheckoutFormData, b1 as CheckoutInput, H as CheckoutMode, k as CheckoutOperations, J as CheckoutOrderType, K as CheckoutPaymentMethod, W as CheckoutResult, k as CheckoutService, $ as CheckoutStatus, a0 as CheckoutStatusContext, N as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, u as CimplifyElement, t as CimplifyElements, a4 as ContactType, c6 as CreateAddressInput, c8 as CreateMobileMoneyInput, c1 as Customer, c2 as CustomerAddress, bN as CustomerBooking, bM as CustomerBookingServiceItem, c4 as CustomerLinkPreferences, c3 as CustomerMobileMoney, b8 as CustomerServicePreferences, am as DEFAULT_COUNTRY, al as DEFAULT_CURRENCY, ad as DEVICE_TYPE, bI as DayAvailability, bi as DepositResult, a3 as DeviceType, w as ELEMENT_TYPES, E as EVENT_TYPES, cC as ElementAppearance, cO as ElementEventHandler, D as ElementEventType, y as ElementOptions, z as ElementType, cI as ElementsCheckoutData, cJ as ElementsCheckoutResult, cG as ElementsCustomerInfo, x as ElementsOptions, cc as EnrollAndLinkOrderInput, cf as EnrollAndLinkOrderResult, c9 as EnrollmentData, ap as Err, aQ as FeeBearerType, F as FetchQuoteInput, aO as FulfillmentLink, aN as FulfillmentStatus, aM as FulfillmentType, cs as FxQuote, cr as FxQuoteRequest, ct as FxRateResponse, r as FxService, bO as GetAvailableSlotsInput, m as GetOrdersOptions, G as GetProductsOptions, cN as IframeToParentMessage, I as InventoryService, ag as LINK_MUTATION, af as LINK_QUERY, aS as LineItem, aJ as LineType, c5 as LinkData, ce as LinkEnrollResult, L as LinkService, cg as LinkSession, cd as LinkStatusResult, s as LiteBootstrap, q as LiteService, br as Location, bl as LocationAppointment, b$ as LocationStock, bp as LocationTaxBehavior, bq as LocationTaxOverrides, bu as LocationTimeProfile, bA as LocationWithDetails, M as MESSAGE_TYPES, ab as MOBILE_MONEY_PROVIDER, cb as MobileMoneyData, cp as MobileMoneyDetails, a2 as MobileMoneyProvider, X as NextAction, ak as ORDER_MUTATION, a6 as ORDER_TYPE, cA as ObservabilityHooks, ao as Ok, aT as Order, aI as OrderChannel, b0 as OrderFilter, aP as OrderFulfillmentSummary, aW as OrderGroup, a_ as OrderGroupDetails, aX as OrderGroupPayment, aV as OrderGroupPaymentState, aZ as OrderGroupPaymentSummary, aU as OrderHistory, aK as OrderLineState, aL as OrderLineStatus, a$ as OrderPaymentEvent, O as OrderQueries, aY as OrderSplitDetail, aG as OrderStatus, cB as OrderType, o as OtpResult, a7 as PAYMENT_METHOD, aj as PAYMENT_MUTATION, a9 as PAYMENT_STATE, aa as PICKUP_TIME_TYPE, cM as ParentToIframeMessage, cE as PaymentMethodInfo, aH as PaymentState, cn as PickupTime, cm as PickupTimeType, P as PriceQuote, bd as PricingOverrides, _ as ProcessAndResolveOptions, Y as ProcessCheckoutOptions, Z as ProcessCheckoutResult, bZ as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, b4 as RefundOrderInput, b7 as ReminderMethod, ba as ReminderSettings, cu as RequestContext, cx as RequestErrorEvent, cj as RequestOtpInput, h as RequestSource, cv as RequestStartEvent, cw as RequestSuccessEvent, bR as RescheduleBookingInput, bU as RescheduleBookingResult, bg as ResourceAssignment, an as Result, cy as RetryEvent, ci as RevokeAllSessionsResult, ch as RevokeSessionResult, bw as Room, be as SchedulingMetadata, bh as SchedulingResult, p as SchedulingService, S as SearchOptions, bE as Service, bV as ServiceAvailabilityParams, bW as ServiceAvailabilityResult, bx as ServiceCharge, bc as ServiceNotes, bj as ServiceScheduleRequest, b5 as ServiceStatus, cz as SessionChangeEvent, bF as Staff, bf as StaffAssignment, b6 as StaffRole, bk as StaffScheduleItem, bY as StockLevel, bX as StockStatus, by as StorefrontBootstrap, bv as Table, T as TableInfo, bs as TimeRange, bt as TimeRanges, bG as TimeSlot, c7 as UpdateAddressInput, b2 as UpdateOrderStatusInput, U as UpdateProfileInput, b_ as VariantStock, ck as VerifyOtpInput, aC as combine, aD as combineObject, c as createCimplifyClient, v as createElements, ar as err, aw as flatMap, aA as fromPromise, l as generateIdempotencyKey, ax as getOrElse, at as isErr, as as isOk, av as mapError, au as mapResult, aq as ok, az as toNullable, aB as tryCatch, ay as unwrap } from './client-BSrq89H1.mjs';
1
+ export { ac as AUTHORIZATION_TYPE, ah as AUTH_MUTATION, a1 as AbortablePromise, ca as AddressData, cD as AddressInfo, aR as AmountToPay, cl as AuthResponse, A as AuthService, n as AuthStatus, cF as AuthenticatedCustomer, cH as AuthenticatedData, c0 as AvailabilityResult, bH as AvailableSlot, bK as Booking, bJ as BookingStatus, bL as BookingWithDetails, b9 as BufferTimes, bo as Business, bC as BusinessHours, bn as BusinessPreferences, B as BusinessService, bB as BusinessSettings, bm as BusinessType, bz as BusinessWithLocations, a5 as CHECKOUT_MODE, ai as CHECKOUT_MUTATION, a8 as CHECKOUT_STEP, ae as CONTACT_TYPE, bS as CancelBookingInput, bT as CancelBookingResult, b3 as CancelOrderInput, bb as CancellationPolicy, j as CartOperations, b as CatalogueQueries, aE as CatalogueResult, aF as CatalogueSnapshot, bD as CategoryInfo, bP as CheckSlotAvailabilityInput, bQ as CheckSlotAvailabilityResult, co as CheckoutAddressInfo, cL as CheckoutCartData, cK as CheckoutCartItem, cq as CheckoutCustomerInfo, V as CheckoutFormData, b1 as CheckoutInput, H as CheckoutMode, k as CheckoutOperations, J as CheckoutOrderType, K as CheckoutPaymentMethod, W as CheckoutResult, k as CheckoutService, $ as CheckoutStatus, a0 as CheckoutStatusContext, N as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, u as CimplifyElement, t as CimplifyElements, a4 as ContactType, c6 as CreateAddressInput, c8 as CreateMobileMoneyInput, c1 as Customer, c2 as CustomerAddress, bN as CustomerBooking, bM as CustomerBookingServiceItem, c4 as CustomerLinkPreferences, c3 as CustomerMobileMoney, b8 as CustomerServicePreferences, am as DEFAULT_COUNTRY, al as DEFAULT_CURRENCY, ad as DEVICE_TYPE, bI as DayAvailability, bi as DepositResult, a3 as DeviceType, w as ELEMENT_TYPES, E as EVENT_TYPES, cC as ElementAppearance, cO as ElementEventHandler, D as ElementEventType, y as ElementOptions, z as ElementType, cI as ElementsCheckoutData, cJ as ElementsCheckoutResult, cG as ElementsCustomerInfo, x as ElementsOptions, cc as EnrollAndLinkOrderInput, cf as EnrollAndLinkOrderResult, c9 as EnrollmentData, ap as Err, aQ as FeeBearerType, F as FetchQuoteInput, aO as FulfillmentLink, aN as FulfillmentStatus, aM as FulfillmentType, cs as FxQuote, cr as FxQuoteRequest, ct as FxRateResponse, r as FxService, bO as GetAvailableSlotsInput, m as GetOrdersOptions, G as GetProductsOptions, cN as IframeToParentMessage, I as InventoryService, ag as LINK_MUTATION, af as LINK_QUERY, aS as LineItem, aJ as LineType, c5 as LinkData, ce as LinkEnrollResult, L as LinkService, cg as LinkSession, cd as LinkStatusResult, s as LiteBootstrap, q as LiteService, br as Location, bl as LocationAppointment, b$ as LocationStock, bp as LocationTaxBehavior, bq as LocationTaxOverrides, bu as LocationTimeProfile, bA as LocationWithDetails, M as MESSAGE_TYPES, ab as MOBILE_MONEY_PROVIDER, cb as MobileMoneyData, cp as MobileMoneyDetails, a2 as MobileMoneyProvider, X as NextAction, ak as ORDER_MUTATION, a6 as ORDER_TYPE, cA as ObservabilityHooks, ao as Ok, aT as Order, aI as OrderChannel, b0 as OrderFilter, aP as OrderFulfillmentSummary, aW as OrderGroup, a_ as OrderGroupDetails, aX as OrderGroupPayment, aV as OrderGroupPaymentState, aZ as OrderGroupPaymentSummary, aU as OrderHistory, aK as OrderLineState, aL as OrderLineStatus, a$ as OrderPaymentEvent, O as OrderQueries, aY as OrderSplitDetail, aG as OrderStatus, cB as OrderType, o as OtpResult, a7 as PAYMENT_METHOD, aj as PAYMENT_MUTATION, a9 as PAYMENT_STATE, aa as PICKUP_TIME_TYPE, cM as ParentToIframeMessage, cE as PaymentMethodInfo, aH as PaymentState, cn as PickupTime, cm as PickupTimeType, P as PriceQuote, bd as PricingOverrides, _ as ProcessAndResolveOptions, Y as ProcessCheckoutOptions, Z as ProcessCheckoutResult, bZ as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, b4 as RefundOrderInput, b7 as ReminderMethod, ba as ReminderSettings, cu as RequestContext, cx as RequestErrorEvent, cj as RequestOtpInput, h as RequestSource, cv as RequestStartEvent, cw as RequestSuccessEvent, bR as RescheduleBookingInput, bU as RescheduleBookingResult, bg as ResourceAssignment, an as Result, cy as RetryEvent, ci as RevokeAllSessionsResult, ch as RevokeSessionResult, bw as Room, be as SchedulingMetadata, bh as SchedulingResult, p as SchedulingService, S as SearchOptions, bE as Service, bV as ServiceAvailabilityParams, bW as ServiceAvailabilityResult, bx as ServiceCharge, bc as ServiceNotes, bj as ServiceScheduleRequest, b5 as ServiceStatus, cz as SessionChangeEvent, bF as Staff, bf as StaffAssignment, b6 as StaffRole, bk as StaffScheduleItem, bY as StockLevel, bX as StockStatus, by as StorefrontBootstrap, bv as Table, T as TableInfo, bs as TimeRange, bt as TimeRanges, bG as TimeSlot, c7 as UpdateAddressInput, b2 as UpdateOrderStatusInput, U as UpdateProfileInput, b_ as VariantStock, ck as VerifyOtpInput, aC as combine, aD as combineObject, c as createCimplifyClient, v as createElements, ar as err, aw as flatMap, aA as fromPromise, l as generateIdempotencyKey, ax as getOrElse, at as isErr, as as isOk, av as mapError, au as mapResult, aq as ok, az as toNullable, aB as tryCatch, ay as unwrap } from './client-Cx9Mfh6U.mjs';
2
2
  export { QueryBuilder, query } from './advanced.mjs';
3
- import { A as ApiError } from './payment-CrNyrc-D.mjs';
4
- export { F as AddOn, aJ as AddOnDetails, b3 as AddOnGroupDetails, H as AddOnOption, b2 as AddOnOptionDetails, J as AddOnOptionPrice, G as AddOnWithOptions, b8 as AddToCartInput, be as AddressAuthorizationData, ay as AdjustmentType, aF as AppliedDiscount, bf as AuthorizationType, aE as BenefitType, U as Bundle, _ as BundleComponentData, $ as BundleComponentInfo, a1 as BundleComponentVariantView, a0 as BundleComponentView, T as BundlePriceType, X as BundleProduct, aO as BundleSelectionData, aM as BundleSelectionInput, aN as BundleStoredSelection, W as BundleSummary, Y as BundleWithDetails, aT as Cart, aK as CartAddOn, aw as CartChannel, aU as CartItem, b5 as CartItemDetails, av as CartStatus, ba as CartSummary, aV as CartTotals, L as Category, N as CategorySummary, aD as ChosenPrice, g as CimplifyError, O as Collection, R as CollectionProduct, Q as CollectionSummary, a9 as ComponentGroup, aa as ComponentGroupWithComponents, ag as ComponentPriceBreakdown, ae as ComponentSelectionInput, a6 as ComponentSourceType, a7 as Composite, ad as CompositeComponent, ac as CompositeComponentView, ab as CompositeGroupView, aQ as CompositePriceBreakdown, af as CompositePriceResult, a4 as CompositePricingMode, aR as CompositeSelectionData, ae as CompositeSelectionInput, aP as CompositeStoredSelection, a8 as CompositeWithDetails, C as CurrencyCode, aq as Deal, ap as DealBenefitType, q as DepositType, p as DigitalProductType, aG as DiscountBreakdown, aH as DiscountDetails, as as DiscountValidation, aY as DisplayAddOn, aZ as DisplayAddOnOption, aW as DisplayCart, aX as DisplayCartItem, D as DisplayMode, f as ERROR_HINTS, E as ErrorCode, d as ErrorCodeType, e as ErrorHint, a5 as GroupPricingBehavior, bj as InitializePaymentResult, I as InventoryType, aS as LineConfiguration, aj as LocationProductPrice, M as Money, b as Pagination, P as PaginationParams, bi as Payment, bm as PaymentErrorDetails, bh as PaymentMethod, bd as PaymentMethodType, bg as PaymentProcessingState, bc as PaymentProvider, bk as PaymentResponse, bb as PaymentStatus, bl as PaymentStatusResponse, ai as Price, az as PriceAdjustment, aC as PriceDecisionPath, ah as PriceEntryType, aB as PricePathTaxInfo, ax as PriceSource, r as Product, K as ProductAddOn, ak as ProductAvailability, ao as ProductAvailabilityNow, ar as ProductDealInfo, o as ProductRenderHint, am as ProductTaxonomy, al as ProductTimeProfile, n as ProductType, t as ProductVariant, y as ProductVariantValue, s as ProductWithDetails, S as SalesChannel, aI as SelectedAddOnOption, bn as SubmitAuthorizationInput, at as Tag, au as TagsResponse, aA as TaxPathComponent, an as TaxonomyWithChildren, b6 as UICart, a_ as UICartBusiness, b0 as UICartCustomer, a$ as UICartLocation, b1 as UICartPricing, b7 as UICartResponse, b9 as UpdateCartItemInput, v as VariantAxis, B as VariantAxisSelection, x as VariantAxisValue, a3 as VariantAxisValueView, a2 as VariantAxisView, w as VariantAxisWithValues, aL as VariantDetails, b4 as VariantDetailsDTO, u as VariantDisplayAttribute, z as VariantLocationAvailability, V as VariantStrategy, Z as ZERO, c as currencyCode, k as enrichError, j as getErrorHint, h as isCimplifyError, l as isRetryableError, i as isSupportedCurrency, m as money, a as moneyFromNumber } from './payment-CrNyrc-D.mjs';
3
+ import { A as ApiError } from './payment-Dvd7nRmk.mjs';
4
+ export { F as AddOn, aJ as AddOnDetails, b3 as AddOnGroupDetails, H as AddOnOption, b2 as AddOnOptionDetails, J as AddOnOptionPrice, G as AddOnWithOptions, b8 as AddToCartInput, be as AddressAuthorizationData, ay as AdjustmentType, aF as AppliedDiscount, bf as AuthorizationType, aE as BenefitType, U as Bundle, _ as BundleComponentData, $ as BundleComponentInfo, a1 as BundleComponentVariantView, a0 as BundleComponentView, T as BundlePriceType, X as BundleProduct, aO as BundleSelectionData, aM as BundleSelectionInput, aN as BundleStoredSelection, W as BundleSummary, Y as BundleWithDetails, aT as Cart, aK as CartAddOn, aw as CartChannel, aU as CartItem, b5 as CartItemDetails, av as CartStatus, ba as CartSummary, aV as CartTotals, L as Category, N as CategorySummary, aD as ChosenPrice, g as CimplifyError, O as Collection, R as CollectionProduct, Q as CollectionSummary, a9 as ComponentGroup, aa as ComponentGroupWithComponents, ag as ComponentPriceBreakdown, ae as ComponentSelectionInput, a6 as ComponentSourceType, a7 as Composite, ad as CompositeComponent, ac as CompositeComponentView, ab as CompositeGroupView, aQ as CompositePriceBreakdown, af as CompositePriceResult, a4 as CompositePricingMode, aR as CompositeSelectionData, ae as CompositeSelectionInput, aP as CompositeStoredSelection, a8 as CompositeWithDetails, C as CurrencyCode, aq as Deal, ap as DealBenefitType, q as DepositType, p as DigitalProductType, aG as DiscountBreakdown, aH as DiscountDetails, as as DiscountValidation, aY as DisplayAddOn, aZ as DisplayAddOnOption, aW as DisplayCart, aX as DisplayCartItem, D as DisplayMode, f as ERROR_HINTS, E as ErrorCode, d as ErrorCodeType, e as ErrorHint, a5 as GroupPricingBehavior, bj as InitializePaymentResult, I as InventoryType, aS as LineConfiguration, aj as LocationProductPrice, M as Money, b as Pagination, P as PaginationParams, bi as Payment, bm as PaymentErrorDetails, bh as PaymentMethod, bd as PaymentMethodType, bg as PaymentProcessingState, bc as PaymentProvider, bk as PaymentResponse, bb as PaymentStatus, bl as PaymentStatusResponse, ai as Price, az as PriceAdjustment, aC as PriceDecisionPath, ah as PriceEntryType, aB as PricePathTaxInfo, ax as PriceSource, r as Product, K as ProductAddOn, ak as ProductAvailability, ao as ProductAvailabilityNow, ar as ProductDealInfo, o as ProductRenderHint, am as ProductTaxonomy, al as ProductTimeProfile, n as ProductType, t as ProductVariant, y as ProductVariantValue, s as ProductWithDetails, S as SalesChannel, aI as SelectedAddOnOption, bn as SubmitAuthorizationInput, at as Tag, au as TagsResponse, aA as TaxPathComponent, an as TaxonomyWithChildren, b6 as UICart, a_ as UICartBusiness, b0 as UICartCustomer, a$ as UICartLocation, b1 as UICartPricing, b7 as UICartResponse, b9 as UpdateCartItemInput, v as VariantAxis, B as VariantAxisSelection, x as VariantAxisValue, a3 as VariantAxisValueView, a2 as VariantAxisView, w as VariantAxisWithValues, aL as VariantDetails, b4 as VariantDetailsDTO, u as VariantDisplayAttribute, z as VariantLocationAvailability, V as VariantStrategy, Z as ZERO, c as currencyCode, k as enrichError, j as getErrorHint, h as isCimplifyError, l as isRetryableError, i as isSupportedCurrency, m as money, a as moneyFromNumber } from './payment-Dvd7nRmk.mjs';
5
5
  export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, getTaxAmount, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice } from './utils.mjs';
6
6
  export { c as AdConfig, e as AdContextValue, d as AdCreative, a as AdPosition, A as AdSlot, b as AdTheme, g as getVariantDisplayName } from './ads-BxbWrwqp.mjs';
7
- export { a as FormatCompactOptions, F as FormatPriceOptions, P as ProductWithPrice } from './price-C9Z-hr49.mjs';
7
+ export { a as FormatCompactOptions, F as FormatPriceOptions, P as ProductWithPrice } from './price-BDZNXiLS.mjs';
8
8
 
9
9
  interface FrontendContext {
10
10
  location_id?: string;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { ac as AUTHORIZATION_TYPE, ah as AUTH_MUTATION, a1 as AbortablePromise, ca as AddressData, cD as AddressInfo, aR as AmountToPay, cl as AuthResponse, A as AuthService, n as AuthStatus, cF as AuthenticatedCustomer, cH as AuthenticatedData, c0 as AvailabilityResult, bH as AvailableSlot, bK as Booking, bJ as BookingStatus, bL as BookingWithDetails, b9 as BufferTimes, bo as Business, bC as BusinessHours, bn as BusinessPreferences, B as BusinessService, bB as BusinessSettings, bm as BusinessType, bz as BusinessWithLocations, a5 as CHECKOUT_MODE, ai as CHECKOUT_MUTATION, a8 as CHECKOUT_STEP, ae as CONTACT_TYPE, bS as CancelBookingInput, bT as CancelBookingResult, b3 as CancelOrderInput, bb as CancellationPolicy, j as CartOperations, b as CatalogueQueries, aE as CatalogueResult, aF as CatalogueSnapshot, bD as CategoryInfo, bP as CheckSlotAvailabilityInput, bQ as CheckSlotAvailabilityResult, co as CheckoutAddressInfo, cL as CheckoutCartData, cK as CheckoutCartItem, cq as CheckoutCustomerInfo, V as CheckoutFormData, b1 as CheckoutInput, H as CheckoutMode, k as CheckoutOperations, J as CheckoutOrderType, K as CheckoutPaymentMethod, W as CheckoutResult, k as CheckoutService, $ as CheckoutStatus, a0 as CheckoutStatusContext, N as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, u as CimplifyElement, t as CimplifyElements, a4 as ContactType, c6 as CreateAddressInput, c8 as CreateMobileMoneyInput, c1 as Customer, c2 as CustomerAddress, bN as CustomerBooking, bM as CustomerBookingServiceItem, c4 as CustomerLinkPreferences, c3 as CustomerMobileMoney, b8 as CustomerServicePreferences, am as DEFAULT_COUNTRY, al as DEFAULT_CURRENCY, ad as DEVICE_TYPE, bI as DayAvailability, bi as DepositResult, a3 as DeviceType, w as ELEMENT_TYPES, E as EVENT_TYPES, cC as ElementAppearance, cO as ElementEventHandler, D as ElementEventType, y as ElementOptions, z as ElementType, cI as ElementsCheckoutData, cJ as ElementsCheckoutResult, cG as ElementsCustomerInfo, x as ElementsOptions, cc as EnrollAndLinkOrderInput, cf as EnrollAndLinkOrderResult, c9 as EnrollmentData, ap as Err, aQ as FeeBearerType, F as FetchQuoteInput, aO as FulfillmentLink, aN as FulfillmentStatus, aM as FulfillmentType, cs as FxQuote, cr as FxQuoteRequest, ct as FxRateResponse, r as FxService, bO as GetAvailableSlotsInput, m as GetOrdersOptions, G as GetProductsOptions, cN as IframeToParentMessage, I as InventoryService, ag as LINK_MUTATION, af as LINK_QUERY, aS as LineItem, aJ as LineType, c5 as LinkData, ce as LinkEnrollResult, L as LinkService, cg as LinkSession, cd as LinkStatusResult, s as LiteBootstrap, q as LiteService, br as Location, bl as LocationAppointment, b$ as LocationStock, bp as LocationTaxBehavior, bq as LocationTaxOverrides, bu as LocationTimeProfile, bA as LocationWithDetails, M as MESSAGE_TYPES, ab as MOBILE_MONEY_PROVIDER, cb as MobileMoneyData, cp as MobileMoneyDetails, a2 as MobileMoneyProvider, X as NextAction, ak as ORDER_MUTATION, a6 as ORDER_TYPE, cA as ObservabilityHooks, ao as Ok, aT as Order, aI as OrderChannel, b0 as OrderFilter, aP as OrderFulfillmentSummary, aW as OrderGroup, a_ as OrderGroupDetails, aX as OrderGroupPayment, aV as OrderGroupPaymentState, aZ as OrderGroupPaymentSummary, aU as OrderHistory, aK as OrderLineState, aL as OrderLineStatus, a$ as OrderPaymentEvent, O as OrderQueries, aY as OrderSplitDetail, aG as OrderStatus, cB as OrderType, o as OtpResult, a7 as PAYMENT_METHOD, aj as PAYMENT_MUTATION, a9 as PAYMENT_STATE, aa as PICKUP_TIME_TYPE, cM as ParentToIframeMessage, cE as PaymentMethodInfo, aH as PaymentState, cn as PickupTime, cm as PickupTimeType, P as PriceQuote, bd as PricingOverrides, _ as ProcessAndResolveOptions, Y as ProcessCheckoutOptions, Z as ProcessCheckoutResult, bZ as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, b4 as RefundOrderInput, b7 as ReminderMethod, ba as ReminderSettings, cu as RequestContext, cx as RequestErrorEvent, cj as RequestOtpInput, h as RequestSource, cv as RequestStartEvent, cw as RequestSuccessEvent, bR as RescheduleBookingInput, bU as RescheduleBookingResult, bg as ResourceAssignment, an as Result, cy as RetryEvent, ci as RevokeAllSessionsResult, ch as RevokeSessionResult, bw as Room, be as SchedulingMetadata, bh as SchedulingResult, p as SchedulingService, S as SearchOptions, bE as Service, bV as ServiceAvailabilityParams, bW as ServiceAvailabilityResult, bx as ServiceCharge, bc as ServiceNotes, bj as ServiceScheduleRequest, b5 as ServiceStatus, cz as SessionChangeEvent, bF as Staff, bf as StaffAssignment, b6 as StaffRole, bk as StaffScheduleItem, bY as StockLevel, bX as StockStatus, by as StorefrontBootstrap, bv as Table, T as TableInfo, bs as TimeRange, bt as TimeRanges, bG as TimeSlot, c7 as UpdateAddressInput, b2 as UpdateOrderStatusInput, U as UpdateProfileInput, b_ as VariantStock, ck as VerifyOtpInput, aC as combine, aD as combineObject, c as createCimplifyClient, v as createElements, ar as err, aw as flatMap, aA as fromPromise, l as generateIdempotencyKey, ax as getOrElse, at as isErr, as as isOk, av as mapError, au as mapResult, aq as ok, az as toNullable, aB as tryCatch, ay as unwrap } from './client-xBhdHLq4.js';
1
+ export { ac as AUTHORIZATION_TYPE, ah as AUTH_MUTATION, a1 as AbortablePromise, ca as AddressData, cD as AddressInfo, aR as AmountToPay, cl as AuthResponse, A as AuthService, n as AuthStatus, cF as AuthenticatedCustomer, cH as AuthenticatedData, c0 as AvailabilityResult, bH as AvailableSlot, bK as Booking, bJ as BookingStatus, bL as BookingWithDetails, b9 as BufferTimes, bo as Business, bC as BusinessHours, bn as BusinessPreferences, B as BusinessService, bB as BusinessSettings, bm as BusinessType, bz as BusinessWithLocations, a5 as CHECKOUT_MODE, ai as CHECKOUT_MUTATION, a8 as CHECKOUT_STEP, ae as CONTACT_TYPE, bS as CancelBookingInput, bT as CancelBookingResult, b3 as CancelOrderInput, bb as CancellationPolicy, j as CartOperations, b as CatalogueQueries, aE as CatalogueResult, aF as CatalogueSnapshot, bD as CategoryInfo, bP as CheckSlotAvailabilityInput, bQ as CheckSlotAvailabilityResult, co as CheckoutAddressInfo, cL as CheckoutCartData, cK as CheckoutCartItem, cq as CheckoutCustomerInfo, V as CheckoutFormData, b1 as CheckoutInput, H as CheckoutMode, k as CheckoutOperations, J as CheckoutOrderType, K as CheckoutPaymentMethod, W as CheckoutResult, k as CheckoutService, $ as CheckoutStatus, a0 as CheckoutStatusContext, N as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, u as CimplifyElement, t as CimplifyElements, a4 as ContactType, c6 as CreateAddressInput, c8 as CreateMobileMoneyInput, c1 as Customer, c2 as CustomerAddress, bN as CustomerBooking, bM as CustomerBookingServiceItem, c4 as CustomerLinkPreferences, c3 as CustomerMobileMoney, b8 as CustomerServicePreferences, am as DEFAULT_COUNTRY, al as DEFAULT_CURRENCY, ad as DEVICE_TYPE, bI as DayAvailability, bi as DepositResult, a3 as DeviceType, w as ELEMENT_TYPES, E as EVENT_TYPES, cC as ElementAppearance, cO as ElementEventHandler, D as ElementEventType, y as ElementOptions, z as ElementType, cI as ElementsCheckoutData, cJ as ElementsCheckoutResult, cG as ElementsCustomerInfo, x as ElementsOptions, cc as EnrollAndLinkOrderInput, cf as EnrollAndLinkOrderResult, c9 as EnrollmentData, ap as Err, aQ as FeeBearerType, F as FetchQuoteInput, aO as FulfillmentLink, aN as FulfillmentStatus, aM as FulfillmentType, cs as FxQuote, cr as FxQuoteRequest, ct as FxRateResponse, r as FxService, bO as GetAvailableSlotsInput, m as GetOrdersOptions, G as GetProductsOptions, cN as IframeToParentMessage, I as InventoryService, ag as LINK_MUTATION, af as LINK_QUERY, aS as LineItem, aJ as LineType, c5 as LinkData, ce as LinkEnrollResult, L as LinkService, cg as LinkSession, cd as LinkStatusResult, s as LiteBootstrap, q as LiteService, br as Location, bl as LocationAppointment, b$ as LocationStock, bp as LocationTaxBehavior, bq as LocationTaxOverrides, bu as LocationTimeProfile, bA as LocationWithDetails, M as MESSAGE_TYPES, ab as MOBILE_MONEY_PROVIDER, cb as MobileMoneyData, cp as MobileMoneyDetails, a2 as MobileMoneyProvider, X as NextAction, ak as ORDER_MUTATION, a6 as ORDER_TYPE, cA as ObservabilityHooks, ao as Ok, aT as Order, aI as OrderChannel, b0 as OrderFilter, aP as OrderFulfillmentSummary, aW as OrderGroup, a_ as OrderGroupDetails, aX as OrderGroupPayment, aV as OrderGroupPaymentState, aZ as OrderGroupPaymentSummary, aU as OrderHistory, aK as OrderLineState, aL as OrderLineStatus, a$ as OrderPaymentEvent, O as OrderQueries, aY as OrderSplitDetail, aG as OrderStatus, cB as OrderType, o as OtpResult, a7 as PAYMENT_METHOD, aj as PAYMENT_MUTATION, a9 as PAYMENT_STATE, aa as PICKUP_TIME_TYPE, cM as ParentToIframeMessage, cE as PaymentMethodInfo, aH as PaymentState, cn as PickupTime, cm as PickupTimeType, P as PriceQuote, bd as PricingOverrides, _ as ProcessAndResolveOptions, Y as ProcessCheckoutOptions, Z as ProcessCheckoutResult, bZ as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, b4 as RefundOrderInput, b7 as ReminderMethod, ba as ReminderSettings, cu as RequestContext, cx as RequestErrorEvent, cj as RequestOtpInput, h as RequestSource, cv as RequestStartEvent, cw as RequestSuccessEvent, bR as RescheduleBookingInput, bU as RescheduleBookingResult, bg as ResourceAssignment, an as Result, cy as RetryEvent, ci as RevokeAllSessionsResult, ch as RevokeSessionResult, bw as Room, be as SchedulingMetadata, bh as SchedulingResult, p as SchedulingService, S as SearchOptions, bE as Service, bV as ServiceAvailabilityParams, bW as ServiceAvailabilityResult, bx as ServiceCharge, bc as ServiceNotes, bj as ServiceScheduleRequest, b5 as ServiceStatus, cz as SessionChangeEvent, bF as Staff, bf as StaffAssignment, b6 as StaffRole, bk as StaffScheduleItem, bY as StockLevel, bX as StockStatus, by as StorefrontBootstrap, bv as Table, T as TableInfo, bs as TimeRange, bt as TimeRanges, bG as TimeSlot, c7 as UpdateAddressInput, b2 as UpdateOrderStatusInput, U as UpdateProfileInput, b_ as VariantStock, ck as VerifyOtpInput, aC as combine, aD as combineObject, c as createCimplifyClient, v as createElements, ar as err, aw as flatMap, aA as fromPromise, l as generateIdempotencyKey, ax as getOrElse, at as isErr, as as isOk, av as mapError, au as mapResult, aq as ok, az as toNullable, aB as tryCatch, ay as unwrap } from './client-eY00I7H1.js';
2
2
  export { QueryBuilder, query } from './advanced.js';
3
- import { A as ApiError } from './payment-CrNyrc-D.js';
4
- export { F as AddOn, aJ as AddOnDetails, b3 as AddOnGroupDetails, H as AddOnOption, b2 as AddOnOptionDetails, J as AddOnOptionPrice, G as AddOnWithOptions, b8 as AddToCartInput, be as AddressAuthorizationData, ay as AdjustmentType, aF as AppliedDiscount, bf as AuthorizationType, aE as BenefitType, U as Bundle, _ as BundleComponentData, $ as BundleComponentInfo, a1 as BundleComponentVariantView, a0 as BundleComponentView, T as BundlePriceType, X as BundleProduct, aO as BundleSelectionData, aM as BundleSelectionInput, aN as BundleStoredSelection, W as BundleSummary, Y as BundleWithDetails, aT as Cart, aK as CartAddOn, aw as CartChannel, aU as CartItem, b5 as CartItemDetails, av as CartStatus, ba as CartSummary, aV as CartTotals, L as Category, N as CategorySummary, aD as ChosenPrice, g as CimplifyError, O as Collection, R as CollectionProduct, Q as CollectionSummary, a9 as ComponentGroup, aa as ComponentGroupWithComponents, ag as ComponentPriceBreakdown, ae as ComponentSelectionInput, a6 as ComponentSourceType, a7 as Composite, ad as CompositeComponent, ac as CompositeComponentView, ab as CompositeGroupView, aQ as CompositePriceBreakdown, af as CompositePriceResult, a4 as CompositePricingMode, aR as CompositeSelectionData, ae as CompositeSelectionInput, aP as CompositeStoredSelection, a8 as CompositeWithDetails, C as CurrencyCode, aq as Deal, ap as DealBenefitType, q as DepositType, p as DigitalProductType, aG as DiscountBreakdown, aH as DiscountDetails, as as DiscountValidation, aY as DisplayAddOn, aZ as DisplayAddOnOption, aW as DisplayCart, aX as DisplayCartItem, D as DisplayMode, f as ERROR_HINTS, E as ErrorCode, d as ErrorCodeType, e as ErrorHint, a5 as GroupPricingBehavior, bj as InitializePaymentResult, I as InventoryType, aS as LineConfiguration, aj as LocationProductPrice, M as Money, b as Pagination, P as PaginationParams, bi as Payment, bm as PaymentErrorDetails, bh as PaymentMethod, bd as PaymentMethodType, bg as PaymentProcessingState, bc as PaymentProvider, bk as PaymentResponse, bb as PaymentStatus, bl as PaymentStatusResponse, ai as Price, az as PriceAdjustment, aC as PriceDecisionPath, ah as PriceEntryType, aB as PricePathTaxInfo, ax as PriceSource, r as Product, K as ProductAddOn, ak as ProductAvailability, ao as ProductAvailabilityNow, ar as ProductDealInfo, o as ProductRenderHint, am as ProductTaxonomy, al as ProductTimeProfile, n as ProductType, t as ProductVariant, y as ProductVariantValue, s as ProductWithDetails, S as SalesChannel, aI as SelectedAddOnOption, bn as SubmitAuthorizationInput, at as Tag, au as TagsResponse, aA as TaxPathComponent, an as TaxonomyWithChildren, b6 as UICart, a_ as UICartBusiness, b0 as UICartCustomer, a$ as UICartLocation, b1 as UICartPricing, b7 as UICartResponse, b9 as UpdateCartItemInput, v as VariantAxis, B as VariantAxisSelection, x as VariantAxisValue, a3 as VariantAxisValueView, a2 as VariantAxisView, w as VariantAxisWithValues, aL as VariantDetails, b4 as VariantDetailsDTO, u as VariantDisplayAttribute, z as VariantLocationAvailability, V as VariantStrategy, Z as ZERO, c as currencyCode, k as enrichError, j as getErrorHint, h as isCimplifyError, l as isRetryableError, i as isSupportedCurrency, m as money, a as moneyFromNumber } from './payment-CrNyrc-D.js';
3
+ import { A as ApiError } from './payment-Dvd7nRmk.js';
4
+ export { F as AddOn, aJ as AddOnDetails, b3 as AddOnGroupDetails, H as AddOnOption, b2 as AddOnOptionDetails, J as AddOnOptionPrice, G as AddOnWithOptions, b8 as AddToCartInput, be as AddressAuthorizationData, ay as AdjustmentType, aF as AppliedDiscount, bf as AuthorizationType, aE as BenefitType, U as Bundle, _ as BundleComponentData, $ as BundleComponentInfo, a1 as BundleComponentVariantView, a0 as BundleComponentView, T as BundlePriceType, X as BundleProduct, aO as BundleSelectionData, aM as BundleSelectionInput, aN as BundleStoredSelection, W as BundleSummary, Y as BundleWithDetails, aT as Cart, aK as CartAddOn, aw as CartChannel, aU as CartItem, b5 as CartItemDetails, av as CartStatus, ba as CartSummary, aV as CartTotals, L as Category, N as CategorySummary, aD as ChosenPrice, g as CimplifyError, O as Collection, R as CollectionProduct, Q as CollectionSummary, a9 as ComponentGroup, aa as ComponentGroupWithComponents, ag as ComponentPriceBreakdown, ae as ComponentSelectionInput, a6 as ComponentSourceType, a7 as Composite, ad as CompositeComponent, ac as CompositeComponentView, ab as CompositeGroupView, aQ as CompositePriceBreakdown, af as CompositePriceResult, a4 as CompositePricingMode, aR as CompositeSelectionData, ae as CompositeSelectionInput, aP as CompositeStoredSelection, a8 as CompositeWithDetails, C as CurrencyCode, aq as Deal, ap as DealBenefitType, q as DepositType, p as DigitalProductType, aG as DiscountBreakdown, aH as DiscountDetails, as as DiscountValidation, aY as DisplayAddOn, aZ as DisplayAddOnOption, aW as DisplayCart, aX as DisplayCartItem, D as DisplayMode, f as ERROR_HINTS, E as ErrorCode, d as ErrorCodeType, e as ErrorHint, a5 as GroupPricingBehavior, bj as InitializePaymentResult, I as InventoryType, aS as LineConfiguration, aj as LocationProductPrice, M as Money, b as Pagination, P as PaginationParams, bi as Payment, bm as PaymentErrorDetails, bh as PaymentMethod, bd as PaymentMethodType, bg as PaymentProcessingState, bc as PaymentProvider, bk as PaymentResponse, bb as PaymentStatus, bl as PaymentStatusResponse, ai as Price, az as PriceAdjustment, aC as PriceDecisionPath, ah as PriceEntryType, aB as PricePathTaxInfo, ax as PriceSource, r as Product, K as ProductAddOn, ak as ProductAvailability, ao as ProductAvailabilityNow, ar as ProductDealInfo, o as ProductRenderHint, am as ProductTaxonomy, al as ProductTimeProfile, n as ProductType, t as ProductVariant, y as ProductVariantValue, s as ProductWithDetails, S as SalesChannel, aI as SelectedAddOnOption, bn as SubmitAuthorizationInput, at as Tag, au as TagsResponse, aA as TaxPathComponent, an as TaxonomyWithChildren, b6 as UICart, a_ as UICartBusiness, b0 as UICartCustomer, a$ as UICartLocation, b1 as UICartPricing, b7 as UICartResponse, b9 as UpdateCartItemInput, v as VariantAxis, B as VariantAxisSelection, x as VariantAxisValue, a3 as VariantAxisValueView, a2 as VariantAxisView, w as VariantAxisWithValues, aL as VariantDetails, b4 as VariantDetailsDTO, u as VariantDisplayAttribute, z as VariantLocationAvailability, V as VariantStrategy, Z as ZERO, c as currencyCode, k as enrichError, j as getErrorHint, h as isCimplifyError, l as isRetryableError, i as isSupportedCurrency, m as money, a as moneyFromNumber } from './payment-Dvd7nRmk.js';
5
5
  export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, getTaxAmount, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice } from './utils.js';
6
6
  export { c as AdConfig, e as AdContextValue, d as AdCreative, a as AdPosition, A as AdSlot, b as AdTheme, g as getVariantDisplayName } from './ads-BxbWrwqp.js';
7
- export { a as FormatCompactOptions, F as FormatPriceOptions, P as ProductWithPrice } from './price-RKKoTz-9.js';
7
+ export { a as FormatCompactOptions, F as FormatPriceOptions, P as ProductWithPrice } from './price-DrfhwHpw.js';
8
8
 
9
9
  interface FrontendContext {
10
10
  location_id?: string;
@@ -729,6 +729,7 @@ interface ChosenPrice {
729
729
  custom_fields?: Record<string, unknown>;
730
730
  decision_path?: PriceDecisionPath;
731
731
  tax_info?: PricePathTaxInfo;
732
+ pre_tax_price?: Money;
732
733
  }
733
734
  type BenefitType = "percentage" | "fixed" | "points" | "free_item" | "buy_x_get_y_free";
734
735
  interface AppliedDiscount {
@@ -729,6 +729,7 @@ interface ChosenPrice {
729
729
  custom_fields?: Record<string, unknown>;
730
730
  decision_path?: PriceDecisionPath;
731
731
  tax_info?: PricePathTaxInfo;
732
+ pre_tax_price?: Money;
732
733
  }
733
734
  type BenefitType = "percentage" | "fixed" | "points" | "free_item" | "buy_x_get_y_free";
734
735
  interface AppliedDiscount {
@@ -1,4 +1,4 @@
1
- import { aD as ChosenPrice, C as CurrencyCode } from './payment-CrNyrc-D.mjs';
1
+ import { aD as ChosenPrice, C as CurrencyCode } from './payment-Dvd7nRmk.mjs';
2
2
 
3
3
  interface ProductWithPrice {
4
4
  price_info?: ChosenPrice;
@@ -1,4 +1,4 @@
1
- import { aD as ChosenPrice, C as CurrencyCode } from './payment-CrNyrc-D.js';
1
+ import { aD as ChosenPrice, C as CurrencyCode } from './payment-Dvd7nRmk.js';
2
2
 
3
3
  interface ProductWithPrice {
4
4
  price_info?: ChosenPrice;
package/dist/react.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-BxbWrwqp.mjs';
3
3
  export { c as AdConfig, g as getVariantDisplayName } from './ads-BxbWrwqp.mjs';
4
- import { C as CimplifyClient, Z as ProcessCheckoutResult, $ as CheckoutStatus, a0 as CheckoutStatusContext, br as Location, bo as Business, aT as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, aG as OrderStatus, bE as Service, bH as AvailableSlot, bI as DayAvailability, bN as CustomerBooking, bT as CancelBookingResult, x as ElementsOptions, cH as AuthenticatedData, cD as AddressInfo, cE as PaymentMethodInfo, t as CimplifyElements, cJ as ElementsCheckoutResult, Y as ProcessCheckoutOptions, aS as LineItem, bF as Staff } from './client-BSrq89H1.mjs';
5
- import { r as Product, b as Pagination, g as CimplifyError, s as ProductWithDetails, L as Category, M as Money, aM as BundleSelectionInput, ae as ComponentSelectionInput, O as Collection, am as ProductTaxonomy, an as TaxonomyWithChildren, al as ProductTimeProfile, aq as Deal, ar as ProductDealInfo, as as DiscountValidation, W as BundleSummary, af as CompositePriceResult, C as CurrencyCode, t as ProductVariant, w as VariantAxisWithValues, G as AddOnWithOptions, a0 as BundleComponentView, T as BundlePriceType, ab as CompositeGroupView } from './payment-CrNyrc-D.mjs';
6
- import { P as ProductWithPrice } from './price-C9Z-hr49.mjs';
4
+ import { C as CimplifyClient, Z as ProcessCheckoutResult, $ as CheckoutStatus, a0 as CheckoutStatusContext, br as Location, bo as Business, aT as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, aG as OrderStatus, bE as Service, bH as AvailableSlot, bI as DayAvailability, bN as CustomerBooking, bT as CancelBookingResult, x as ElementsOptions, cH as AuthenticatedData, cD as AddressInfo, cE as PaymentMethodInfo, t as CimplifyElements, cJ as ElementsCheckoutResult, Y as ProcessCheckoutOptions, aS as LineItem, bF as Staff } from './client-Cx9Mfh6U.mjs';
5
+ import { r as Product, b as Pagination, g as CimplifyError, s as ProductWithDetails, L as Category, M as Money, aM as BundleSelectionInput, ae as ComponentSelectionInput, O as Collection, am as ProductTaxonomy, an as TaxonomyWithChildren, al as ProductTimeProfile, aq as Deal, ar as ProductDealInfo, as as DiscountValidation, W as BundleSummary, af as CompositePriceResult, C as CurrencyCode, t as ProductVariant, w as VariantAxisWithValues, G as AddOnWithOptions, a0 as BundleComponentView, T as BundlePriceType, ab as CompositeGroupView } from './payment-Dvd7nRmk.mjs';
6
+ import { P as ProductWithPrice } from './price-BDZNXiLS.mjs';
7
7
  import { ClassValue } from 'clsx';
8
8
 
9
9
  interface UserIdentity {
package/dist/react.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-BxbWrwqp.js';
3
3
  export { c as AdConfig, g as getVariantDisplayName } from './ads-BxbWrwqp.js';
4
- import { C as CimplifyClient, Z as ProcessCheckoutResult, $ as CheckoutStatus, a0 as CheckoutStatusContext, br as Location, bo as Business, aT as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, aG as OrderStatus, bE as Service, bH as AvailableSlot, bI as DayAvailability, bN as CustomerBooking, bT as CancelBookingResult, x as ElementsOptions, cH as AuthenticatedData, cD as AddressInfo, cE as PaymentMethodInfo, t as CimplifyElements, cJ as ElementsCheckoutResult, Y as ProcessCheckoutOptions, aS as LineItem, bF as Staff } from './client-xBhdHLq4.js';
5
- import { r as Product, b as Pagination, g as CimplifyError, s as ProductWithDetails, L as Category, M as Money, aM as BundleSelectionInput, ae as ComponentSelectionInput, O as Collection, am as ProductTaxonomy, an as TaxonomyWithChildren, al as ProductTimeProfile, aq as Deal, ar as ProductDealInfo, as as DiscountValidation, W as BundleSummary, af as CompositePriceResult, C as CurrencyCode, t as ProductVariant, w as VariantAxisWithValues, G as AddOnWithOptions, a0 as BundleComponentView, T as BundlePriceType, ab as CompositeGroupView } from './payment-CrNyrc-D.js';
6
- import { P as ProductWithPrice } from './price-RKKoTz-9.js';
4
+ import { C as CimplifyClient, Z as ProcessCheckoutResult, $ as CheckoutStatus, a0 as CheckoutStatusContext, br as Location, bo as Business, aT as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, aG as OrderStatus, bE as Service, bH as AvailableSlot, bI as DayAvailability, bN as CustomerBooking, bT as CancelBookingResult, x as ElementsOptions, cH as AuthenticatedData, cD as AddressInfo, cE as PaymentMethodInfo, t as CimplifyElements, cJ as ElementsCheckoutResult, Y as ProcessCheckoutOptions, aS as LineItem, bF as Staff } from './client-eY00I7H1.js';
5
+ import { r as Product, b as Pagination, g as CimplifyError, s as ProductWithDetails, L as Category, M as Money, aM as BundleSelectionInput, ae as ComponentSelectionInput, O as Collection, am as ProductTaxonomy, an as TaxonomyWithChildren, al as ProductTimeProfile, aq as Deal, ar as ProductDealInfo, as as DiscountValidation, W as BundleSummary, af as CompositePriceResult, C as CurrencyCode, t as ProductVariant, w as VariantAxisWithValues, G as AddOnWithOptions, a0 as BundleComponentView, T as BundlePriceType, ab as CompositeGroupView } from './payment-Dvd7nRmk.js';
6
+ import { P as ProductWithPrice } from './price-DrfhwHpw.js';
7
7
  import { ClassValue } from 'clsx';
8
8
 
9
9
  interface UserIdentity {
package/dist/react.js CHANGED
@@ -9026,7 +9026,8 @@ function ProductCustomizer({
9026
9026
  const quoteId = quote?.quote_id;
9027
9027
  const quotedTotalPrice = React3.useMemo(() => {
9028
9028
  if (!quote) return void 0;
9029
- const perUnit = quote.quoted_total_price_info?.final_price ?? quote.final_price_info.final_price;
9029
+ const priceInfo = quote.quoted_total_price_info ?? quote.final_price_info;
9030
+ const perUnit = priceInfo.pre_tax_price ?? priceInfo.final_price;
9030
9031
  if (perUnit === void 0 || perUnit === null) return void 0;
9031
9032
  return parsePrice(perUnit) * quantity;
9032
9033
  }, [quote, quantity]);
package/dist/react.mjs CHANGED
@@ -9020,7 +9020,8 @@ function ProductCustomizer({
9020
9020
  const quoteId = quote?.quote_id;
9021
9021
  const quotedTotalPrice = useMemo(() => {
9022
9022
  if (!quote) return void 0;
9023
- const perUnit = quote.quoted_total_price_info?.final_price ?? quote.final_price_info.final_price;
9023
+ const priceInfo = quote.quoted_total_price_info ?? quote.final_price_info;
9024
+ const perUnit = priceInfo.pre_tax_price ?? priceInfo.final_price;
9024
9025
  if (perUnit === void 0 || perUnit === null) return void 0;
9025
9026
  return parsePrice(perUnit) * quantity;
9026
9027
  }, [quote, quantity]);
package/dist/utils.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as Money, C as CurrencyCode, aB as PricePathTaxInfo, bm as PaymentErrorDetails, bk as PaymentResponse, bl as PaymentStatusResponse } from './payment-CrNyrc-D.mjs';
2
- import { P as ProductWithPrice } from './price-C9Z-hr49.mjs';
1
+ import { M as Money, C as CurrencyCode, aB as PricePathTaxInfo, bm as PaymentErrorDetails, bk as PaymentResponse, bl as PaymentStatusResponse } from './payment-Dvd7nRmk.mjs';
2
+ import { P as ProductWithPrice } from './price-BDZNXiLS.mjs';
3
3
 
4
4
  declare const CURRENCY_SYMBOLS: Record<string, string>;
5
5
  declare function getCurrencySymbol(currencyCode: CurrencyCode): string;
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as Money, C as CurrencyCode, aB as PricePathTaxInfo, bm as PaymentErrorDetails, bk as PaymentResponse, bl as PaymentStatusResponse } from './payment-CrNyrc-D.js';
2
- import { P as ProductWithPrice } from './price-RKKoTz-9.js';
1
+ import { M as Money, C as CurrencyCode, aB as PricePathTaxInfo, bm as PaymentErrorDetails, bk as PaymentResponse, bl as PaymentStatusResponse } from './payment-Dvd7nRmk.js';
2
+ import { P as ProductWithPrice } from './price-DrfhwHpw.js';
3
3
 
4
4
  declare const CURRENCY_SYMBOLS: Record<string, string>;
5
5
  declare function getCurrencySymbol(currencyCode: CurrencyCode): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.15.6",
3
+ "version": "0.15.7",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -14,7 +14,7 @@
14
14
  "files": [
15
15
  {
16
16
  "path": "product-customizer.tsx",
17
- "content": "\"use client\";\n\nimport React, { useState, useCallback, useMemo, useEffect } from \"react\";\nimport { Button } from \"@base-ui/react/button\";\nimport type {\n ProductWithDetails,\n ProductVariant,\n AddOnOption,\n ComponentSelectionInput,\n CompositePriceResult,\n} from \"@cimplify/sdk\";\nimport type { BundleSelectionInput } from \"@cimplify/sdk\";\nimport { parsePrice } from \"@cimplify/sdk\";\nimport { useCart, useQuote } from \"@cimplify/sdk/react\";\nimport type { AddToCartOptions } from \"@cimplify/sdk/react\";\nimport { Price } from \"@cimplify/sdk/react\";\nimport { QuantitySelector } from \"@cimplify/sdk/react\";\nimport { VariantSelector } from \"@cimplify/sdk/react\";\nimport { AddOnSelector } from \"@cimplify/sdk/react\";\nimport { CompositeSelector } from \"@cimplify/sdk/react\";\nimport { BundleSelector } from \"@cimplify/sdk/react\";\nimport { cn } from \"@cimplify/sdk/react\";\n\nexport interface ProductCustomizerClassNames {\n root?: string;\n actions?: string;\n submitButton?: string;\n submitButtonAdded?: string;\n validation?: string;\n}\n\nexport interface ProductCustomizerProps {\n product: ProductWithDetails;\n onAddToCart?: (\n product: ProductWithDetails,\n quantity: number,\n options: AddToCartOptions,\n ) => void | Promise<void>;\n className?: string;\n classNames?: ProductCustomizerClassNames;\n}\n\nexport function ProductCustomizer({\n product,\n onAddToCart,\n className,\n classNames,\n}: ProductCustomizerProps): React.ReactElement {\n const [quantity, setQuantity] = useState(1);\n const [isAdded, setIsAdded] = useState(false);\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [selectedVariantId, setSelectedVariantId] = useState<string | undefined>();\n const [selectedVariant, setSelectedVariant] = useState<ProductVariant | undefined>();\n const [selectedAddOnOptionIds, setSelectedAddOnOptionIds] = useState<string[]>([]);\n\n const [compositeSelections, setCompositeSelections] = useState<ComponentSelectionInput[]>([]);\n const [compositePrice, setCompositePrice] = useState<CompositePriceResult | null>(null);\n const [compositeReady, setCompositeReady] = useState(false);\n\n const [bundleSelections, setBundleSelections] = useState<BundleSelectionInput[]>([]);\n const [bundleTotalPrice, setBundleTotalPrice] = useState<number | null>(null);\n const [bundleReady, setBundleReady] = useState(false);\n\n const cart = useCart();\n\n const productType = product.type || \"product\";\n const isComposite = productType === \"composite\";\n const isBundle = productType === \"bundle\";\n const isStandard = !isComposite && !isBundle;\n\n const hasVariants = isStandard && product.variants && product.variants.length > 0;\n const hasAddOns = isStandard && product.add_ons && product.add_ons.length > 0;\n\n useEffect(() => {\n setQuantity(1);\n setIsAdded(false);\n setIsSubmitting(false);\n setSelectedVariantId(undefined);\n setSelectedVariant(undefined);\n setSelectedAddOnOptionIds([]);\n setCompositeSelections([]);\n setCompositePrice(null);\n setCompositeReady(false);\n setBundleSelections([]);\n setBundleTotalPrice(null);\n setBundleReady(false);\n }, [product.id]);\n\n const selectedAddOnOptions = useMemo(() => {\n if (!product.add_ons) return [];\n const options: AddOnOption[] = [];\n for (const addOn of product.add_ons) {\n for (const option of addOn.options) {\n if (selectedAddOnOptionIds.includes(option.id)) {\n options.push(option);\n }\n }\n }\n return options;\n }, [product.add_ons, selectedAddOnOptionIds]);\n\n const normalizedAddOnOptionIds = useMemo(() => {\n if (selectedAddOnOptionIds.length === 0) return [];\n return Array.from(new Set(selectedAddOnOptionIds.map((id) => id.trim()).filter(Boolean))).sort();\n }, [selectedAddOnOptionIds]);\n\n const localTotalPrice = useMemo(() => {\n if (isComposite && compositePrice) {\n return parsePrice(compositePrice.final_price) * quantity;\n }\n\n if (isBundle && bundleTotalPrice != null) {\n return bundleTotalPrice * quantity;\n }\n\n let price = parsePrice(product.default_price);\n\n if (selectedVariant?.price_adjustment) {\n price += parsePrice(selectedVariant.price_adjustment);\n }\n\n for (const option of selectedAddOnOptions) {\n if (option.default_price) {\n price += parsePrice(option.default_price);\n }\n }\n\n return price * quantity;\n }, [product.default_price, selectedVariant, selectedAddOnOptions, quantity, isComposite, compositePrice, isBundle, bundleTotalPrice]);\n\n const requiredAddOnsSatisfied = useMemo(() => {\n if (!product.add_ons) return true;\n\n for (const addOn of product.add_ons) {\n if (addOn.is_required) {\n const selectedInGroup = selectedAddOnOptionIds.filter((id) =>\n addOn.options.some((opt) => opt.id === id),\n ).length;\n\n const minRequired = addOn.min_selections || 1;\n if (selectedInGroup < minRequired) {\n return false;\n }\n }\n }\n return true;\n }, [product.add_ons, selectedAddOnOptionIds]);\n\n const quoteInput = useMemo(\n () => ({\n productId: product.id,\n quantity,\n variantId: selectedVariantId,\n addOnOptionIds: normalizedAddOnOptionIds.length > 0 ? normalizedAddOnOptionIds : undefined,\n bundleSelections: isBundle && bundleSelections.length > 0 ? bundleSelections : undefined,\n compositeSelections: isComposite && compositeSelections.length > 0 ? compositeSelections : undefined,\n }),\n [product.id, quantity, selectedVariantId, normalizedAddOnOptionIds, isBundle, bundleSelections, isComposite, compositeSelections],\n );\n\n const quoteEnabled = isComposite\n ? compositeReady\n : isBundle\n ? bundleReady\n : requiredAddOnsSatisfied;\n\n const { quote } = useQuote(quoteInput, {\n enabled: quoteEnabled,\n });\n\n const quoteId = quote?.quote_id;\n const quotedTotalPrice = useMemo(() => {\n if (!quote) return undefined;\n\n // All quote prices are per-unit. quoted_total_price_info includes add-ons,\n // final_price_info does not. Prefer quoted_total_price_info when present.\n const perUnit = quote.quoted_total_price_info?.final_price\n ?? quote.final_price_info.final_price;\n if (perUnit === undefined || perUnit === null) return undefined;\n return parsePrice(perUnit) * quantity;\n }, [quote, quantity]);\n\n const displayTotalPrice = quotedTotalPrice ?? localTotalPrice;\n\n const handleVariantChange = useCallback(\n (variantId: string | undefined, variant: ProductVariant | undefined) => {\n setSelectedVariantId(variantId);\n setSelectedVariant(variant);\n },\n [],\n );\n\n const handleAddToCart = async () => {\n if (isSubmitting) return;\n\n setIsSubmitting(true);\n\n const options: AddToCartOptions = {\n variantId: selectedVariantId,\n variant: selectedVariant\n ? { id: selectedVariant.id, name: selectedVariant.name || \"\", price_adjustment: selectedVariant.price_adjustment }\n : undefined,\n quoteId,\n addOnOptionIds: normalizedAddOnOptionIds.length > 0 ? normalizedAddOnOptionIds : undefined,\n addOnOptions: selectedAddOnOptions.length > 0\n ? selectedAddOnOptions.map((opt) => ({\n id: opt.id,\n name: opt.name,\n add_on_id: opt.add_on_id,\n default_price: opt.default_price,\n }))\n : undefined,\n compositeSelections: isComposite && compositeSelections.length > 0 ? compositeSelections : undefined,\n bundleSelections: isBundle && bundleSelections.length > 0 ? bundleSelections : undefined,\n };\n\n try {\n if (onAddToCart) {\n await onAddToCart(product, quantity, options);\n } else {\n await cart.addItem(product, quantity, options);\n }\n setIsAdded(true);\n setTimeout(() => {\n setIsAdded(false);\n setQuantity(1);\n }, 2000);\n } catch {\n // Caller handles errors via onAddToCart or cart hook error state\n } finally {\n setIsSubmitting(false);\n }\n };\n\n return (\n <div data-cimplify-customizer className={cn(\"space-y-6\", className, classNames?.root)}>\n {isComposite && product.groups && product.composite_id && (\n <CompositeSelector\n compositeId={product.composite_id}\n groups={product.groups}\n onSelectionsChange={setCompositeSelections}\n onPriceChange={setCompositePrice}\n onReady={setCompositeReady}\n skipPriceFetch\n />\n )}\n\n {isBundle && product.components && (\n <BundleSelector\n components={product.components}\n bundlePrice={product.bundle_price}\n discountValue={product.discount_value}\n pricingType={product.pricing_type}\n onSelectionsChange={setBundleSelections}\n onPriceChange={setBundleTotalPrice}\n onReady={setBundleReady}\n />\n )}\n\n {hasVariants && (\n <VariantSelector\n variants={product.variants!}\n variantAxes={product.variant_axes}\n basePrice={product.default_price}\n selectedVariantId={selectedVariantId}\n onVariantChange={handleVariantChange}\n productName={product.name}\n />\n )}\n\n {hasAddOns && (\n <AddOnSelector\n addOns={product.add_ons!}\n selectedOptions={selectedAddOnOptionIds}\n onOptionsChange={setSelectedAddOnOptionIds}\n />\n )}\n\n <div\n data-cimplify-customizer-actions\n className={cn(\"pt-4 border-t border-border\", classNames?.actions)}\n >\n {!quoteEnabled && (\n <p\n id=\"cimplify-customizer-validation\"\n data-cimplify-customizer-validation\n className={cn(\"text-sm text-destructive mb-3\", classNames?.validation)}\n >\n Please select all required options\n </p>\n )}\n <div className=\"flex items-center gap-4\">\n <QuantitySelector\n value={quantity}\n onChange={setQuantity}\n min={1}\n />\n\n <Button\n onClick={handleAddToCart}\n disabled={isAdded || isSubmitting || !quoteEnabled}\n aria-describedby={!quoteEnabled ? \"cimplify-customizer-validation\" : undefined}\n data-cimplify-customizer-submit\n className={cn(\n \"flex-1 h-14 text-base bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed rounded-full\",\n isAdded && classNames?.submitButtonAdded,\n classNames?.submitButton,\n )}\n >\n {isAdded ? \"Added to Cart\" : (\n <>\n Add to Cart &middot; <Price amount={displayTotalPrice} />\n </>\n )}\n </Button>\n </div>\n </div>\n\n </div>\n );\n}\n"
17
+ "content": "\"use client\";\n\nimport React, { useState, useCallback, useMemo, useEffect } from \"react\";\nimport { Button } from \"@base-ui/react/button\";\nimport type {\n ProductWithDetails,\n ProductVariant,\n AddOnOption,\n ComponentSelectionInput,\n CompositePriceResult,\n} from \"@cimplify/sdk\";\nimport type { BundleSelectionInput } from \"@cimplify/sdk\";\nimport { parsePrice } from \"@cimplify/sdk\";\nimport { useCart, useQuote } from \"@cimplify/sdk/react\";\nimport type { AddToCartOptions } from \"@cimplify/sdk/react\";\nimport { Price } from \"@cimplify/sdk/react\";\nimport { QuantitySelector } from \"@cimplify/sdk/react\";\nimport { VariantSelector } from \"@cimplify/sdk/react\";\nimport { AddOnSelector } from \"@cimplify/sdk/react\";\nimport { CompositeSelector } from \"@cimplify/sdk/react\";\nimport { BundleSelector } from \"@cimplify/sdk/react\";\nimport { cn } from \"@cimplify/sdk/react\";\n\nexport interface ProductCustomizerClassNames {\n root?: string;\n actions?: string;\n submitButton?: string;\n submitButtonAdded?: string;\n validation?: string;\n}\n\nexport interface ProductCustomizerProps {\n product: ProductWithDetails;\n onAddToCart?: (\n product: ProductWithDetails,\n quantity: number,\n options: AddToCartOptions,\n ) => void | Promise<void>;\n className?: string;\n classNames?: ProductCustomizerClassNames;\n}\n\nexport function ProductCustomizer({\n product,\n onAddToCart,\n className,\n classNames,\n}: ProductCustomizerProps): React.ReactElement {\n const [quantity, setQuantity] = useState(1);\n const [isAdded, setIsAdded] = useState(false);\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [selectedVariantId, setSelectedVariantId] = useState<string | undefined>();\n const [selectedVariant, setSelectedVariant] = useState<ProductVariant | undefined>();\n const [selectedAddOnOptionIds, setSelectedAddOnOptionIds] = useState<string[]>([]);\n\n const [compositeSelections, setCompositeSelections] = useState<ComponentSelectionInput[]>([]);\n const [compositePrice, setCompositePrice] = useState<CompositePriceResult | null>(null);\n const [compositeReady, setCompositeReady] = useState(false);\n\n const [bundleSelections, setBundleSelections] = useState<BundleSelectionInput[]>([]);\n const [bundleTotalPrice, setBundleTotalPrice] = useState<number | null>(null);\n const [bundleReady, setBundleReady] = useState(false);\n\n const cart = useCart();\n\n const productType = product.type || \"product\";\n const isComposite = productType === \"composite\";\n const isBundle = productType === \"bundle\";\n const isStandard = !isComposite && !isBundle;\n\n const hasVariants = isStandard && product.variants && product.variants.length > 0;\n const hasAddOns = isStandard && product.add_ons && product.add_ons.length > 0;\n\n useEffect(() => {\n setQuantity(1);\n setIsAdded(false);\n setIsSubmitting(false);\n setSelectedVariantId(undefined);\n setSelectedVariant(undefined);\n setSelectedAddOnOptionIds([]);\n setCompositeSelections([]);\n setCompositePrice(null);\n setCompositeReady(false);\n setBundleSelections([]);\n setBundleTotalPrice(null);\n setBundleReady(false);\n }, [product.id]);\n\n const selectedAddOnOptions = useMemo(() => {\n if (!product.add_ons) return [];\n const options: AddOnOption[] = [];\n for (const addOn of product.add_ons) {\n for (const option of addOn.options) {\n if (selectedAddOnOptionIds.includes(option.id)) {\n options.push(option);\n }\n }\n }\n return options;\n }, [product.add_ons, selectedAddOnOptionIds]);\n\n const normalizedAddOnOptionIds = useMemo(() => {\n if (selectedAddOnOptionIds.length === 0) return [];\n return Array.from(new Set(selectedAddOnOptionIds.map((id) => id.trim()).filter(Boolean))).sort();\n }, [selectedAddOnOptionIds]);\n\n const localTotalPrice = useMemo(() => {\n if (isComposite && compositePrice) {\n return parsePrice(compositePrice.final_price) * quantity;\n }\n\n if (isBundle && bundleTotalPrice != null) {\n return bundleTotalPrice * quantity;\n }\n\n let price = parsePrice(product.default_price);\n\n if (selectedVariant?.price_adjustment) {\n price += parsePrice(selectedVariant.price_adjustment);\n }\n\n for (const option of selectedAddOnOptions) {\n if (option.default_price) {\n price += parsePrice(option.default_price);\n }\n }\n\n return price * quantity;\n }, [product.default_price, selectedVariant, selectedAddOnOptions, quantity, isComposite, compositePrice, isBundle, bundleTotalPrice]);\n\n const requiredAddOnsSatisfied = useMemo(() => {\n if (!product.add_ons) return true;\n\n for (const addOn of product.add_ons) {\n if (addOn.is_required) {\n const selectedInGroup = selectedAddOnOptionIds.filter((id) =>\n addOn.options.some((opt) => opt.id === id),\n ).length;\n\n const minRequired = addOn.min_selections || 1;\n if (selectedInGroup < minRequired) {\n return false;\n }\n }\n }\n return true;\n }, [product.add_ons, selectedAddOnOptionIds]);\n\n const quoteInput = useMemo(\n () => ({\n productId: product.id,\n quantity,\n variantId: selectedVariantId,\n addOnOptionIds: normalizedAddOnOptionIds.length > 0 ? normalizedAddOnOptionIds : undefined,\n bundleSelections: isBundle && bundleSelections.length > 0 ? bundleSelections : undefined,\n compositeSelections: isComposite && compositeSelections.length > 0 ? compositeSelections : undefined,\n }),\n [product.id, quantity, selectedVariantId, normalizedAddOnOptionIds, isBundle, bundleSelections, isComposite, compositeSelections],\n );\n\n const quoteEnabled = isComposite\n ? compositeReady\n : isBundle\n ? bundleReady\n : requiredAddOnsSatisfied;\n\n const { quote } = useQuote(quoteInput, {\n enabled: quoteEnabled,\n });\n\n const quoteId = quote?.quote_id;\n const quotedTotalPrice = useMemo(() => {\n if (!quote) return undefined;\n\n const priceInfo = quote.quoted_total_price_info ?? quote.final_price_info;\n const perUnit = priceInfo.pre_tax_price ?? priceInfo.final_price;\n if (perUnit === undefined || perUnit === null) return undefined;\n return parsePrice(perUnit) * quantity;\n }, [quote, quantity]);\n\n const displayTotalPrice = quotedTotalPrice ?? localTotalPrice;\n\n const handleVariantChange = useCallback(\n (variantId: string | undefined, variant: ProductVariant | undefined) => {\n setSelectedVariantId(variantId);\n setSelectedVariant(variant);\n },\n [],\n );\n\n const handleAddToCart = async () => {\n if (isSubmitting) return;\n\n setIsSubmitting(true);\n\n const options: AddToCartOptions = {\n variantId: selectedVariantId,\n variant: selectedVariant\n ? { id: selectedVariant.id, name: selectedVariant.name || \"\", price_adjustment: selectedVariant.price_adjustment }\n : undefined,\n quoteId,\n addOnOptionIds: normalizedAddOnOptionIds.length > 0 ? normalizedAddOnOptionIds : undefined,\n addOnOptions: selectedAddOnOptions.length > 0\n ? selectedAddOnOptions.map((opt) => ({\n id: opt.id,\n name: opt.name,\n add_on_id: opt.add_on_id,\n default_price: opt.default_price,\n }))\n : undefined,\n compositeSelections: isComposite && compositeSelections.length > 0 ? compositeSelections : undefined,\n bundleSelections: isBundle && bundleSelections.length > 0 ? bundleSelections : undefined,\n };\n\n try {\n if (onAddToCart) {\n await onAddToCart(product, quantity, options);\n } else {\n await cart.addItem(product, quantity, options);\n }\n setIsAdded(true);\n setTimeout(() => {\n setIsAdded(false);\n setQuantity(1);\n }, 2000);\n } catch {\n // Caller handles errors via onAddToCart or cart hook error state\n } finally {\n setIsSubmitting(false);\n }\n };\n\n return (\n <div data-cimplify-customizer className={cn(\"space-y-6\", className, classNames?.root)}>\n {isComposite && product.groups && product.composite_id && (\n <CompositeSelector\n compositeId={product.composite_id}\n groups={product.groups}\n onSelectionsChange={setCompositeSelections}\n onPriceChange={setCompositePrice}\n onReady={setCompositeReady}\n skipPriceFetch\n />\n )}\n\n {isBundle && product.components && (\n <BundleSelector\n components={product.components}\n bundlePrice={product.bundle_price}\n discountValue={product.discount_value}\n pricingType={product.pricing_type}\n onSelectionsChange={setBundleSelections}\n onPriceChange={setBundleTotalPrice}\n onReady={setBundleReady}\n />\n )}\n\n {hasVariants && (\n <VariantSelector\n variants={product.variants!}\n variantAxes={product.variant_axes}\n basePrice={product.default_price}\n selectedVariantId={selectedVariantId}\n onVariantChange={handleVariantChange}\n productName={product.name}\n />\n )}\n\n {hasAddOns && (\n <AddOnSelector\n addOns={product.add_ons!}\n selectedOptions={selectedAddOnOptionIds}\n onOptionsChange={setSelectedAddOnOptionIds}\n />\n )}\n\n <div\n data-cimplify-customizer-actions\n className={cn(\"pt-4 border-t border-border\", classNames?.actions)}\n >\n {!quoteEnabled && (\n <p\n id=\"cimplify-customizer-validation\"\n data-cimplify-customizer-validation\n className={cn(\"text-sm text-destructive mb-3\", classNames?.validation)}\n >\n Please select all required options\n </p>\n )}\n <div className=\"flex items-center gap-4\">\n <QuantitySelector\n value={quantity}\n onChange={setQuantity}\n min={1}\n />\n\n <Button\n onClick={handleAddToCart}\n disabled={isAdded || isSubmitting || !quoteEnabled}\n aria-describedby={!quoteEnabled ? \"cimplify-customizer-validation\" : undefined}\n data-cimplify-customizer-submit\n className={cn(\n \"flex-1 h-14 text-base bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed rounded-full\",\n isAdded && classNames?.submitButtonAdded,\n classNames?.submitButton,\n )}\n >\n {isAdded ? \"Added to Cart\" : (\n <>\n Add to Cart &middot; <Price amount={displayTotalPrice} />\n </>\n )}\n </Button>\n </div>\n </div>\n\n </div>\n );\n}\n"
18
18
  }
19
19
  ]
20
20
  }