@liquidcommerce/cloud-sdk 1.19.0 → 1.20.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.
@@ -1 +1 @@
1
- "use strict";var LIQUID_COMMERCE_ENV,t,e,r,i,o,s,n,a,E,l,d,I,h,c,u,R,N,p,v,T,O,A,S,m,y,w,f,W,C,D=require("@stripe/stripe-js");exports.LIQUID_COMMERCE_ENV=void 0,(LIQUID_COMMERCE_ENV=exports.LIQUID_COMMERCE_ENV||(exports.LIQUID_COMMERCE_ENV={})).LOC="loc",LIQUID_COMMERCE_ENV.STAGE="stage",LIQUID_COMMERCE_ENV.PROD="prod",LIQUID_COMMERCE_ENV.DEV="dev",LIQUID_COMMERCE_ENV.BETA="beta",exports.ENUM_MODALITIES=void 0,(t=exports.ENUM_MODALITIES||(exports.ENUM_MODALITIES={})).ON_DEMAND="onDemand",t.SHIPPING="shipping",t.BOPIS="bopis",exports.DAYS_OF_WEEK=void 0,(e=exports.DAYS_OF_WEEK||(exports.DAYS_OF_WEEK={})).MONDAY="monday",e.TUESDAY="tuesday",e.WEDNESDAY="wednesday",e.THURSDAY="thursday",e.FRIDAY="friday",e.SATURDAY="saturday",e.SUNDAY="sunday",exports.STATES_CODE=void 0,(r=exports.STATES_CODE||(exports.STATES_CODE={})).AL="AL",r.AK="AK",r.AR="AR",r.AZ="AZ",r.CA="CA",r.CO="CO",r.CT="CT",r.DE="DE",r.DC="DC",r.FL="FL",r.GA="GA",r.HI="HI",r.ID="ID",r.IL="IL",r.IN="IN",r.IA="IA",r.KS="KS",r.KY="KY",r.LA="LA",r.ME="ME",r.MD="MD",r.MA="MA",r.MI="MI",r.MN="MN",r.MS="MS",r.MO="MO",r.MT="MT",r.NE="NE",r.NV="NV",r.NH="NH",r.NJ="NJ",r.NM="NM",r.NY="NY",r.NC="NC",r.ND="ND",r.OH="OH",r.OK="OK",r.OR="OR",r.PA="PA",r.RI="RI",r.SC="SC",r.SD="SD",r.TN="TN",r.TX="TX",r.UT="UT",r.VT="VT",r.VA="VA",r.WA="WA",r.WV="WV",r.WI="WI",r.WY="WY",exports.STATES_NAME=void 0,(i=exports.STATES_NAME||(exports.STATES_NAME={})).ALABAMA="AL",i.ALASKA="AK",i.ARKANSAS="AR",i.ARIZONA="AZ",i.CALIFORNIA="CA",i.COLORADO="CO",i.CONNECTICUT="CT",i.DELAWARE="DE",i.DISTRICT_OF_COLUMBIA="DC",i.FLORIDA="FL",i.GEORGIA="GA",i.HAWAII="HI",i.IDAHO="ID",i.ILLINOIS="IL",i.INDIANA="IN",i.IOWA="IA",i.KANSAS="KS",i.KENTUCKY="KY",i.LOUISIANA="LA",i.MAINE="ME",i.MARYLAND="MD",i.MASSACHUSETTS="MA",i.MICHIGAN="MI",i.MINNESOTA="MN",i.MISSISSIPPI="MS",i.MISSOURI="MO",i.MONTANA="MT",i.NEBRASKA="NE",i.NEVADA="NV",i.NEW_HAMPSHIRE="NH",i.NEW_JERSEY="NJ",i.NEW_MEXICO="NM",i.NEW_YORK="NY",i.NORTH_CAROLINA="NC",i.NORTH_DAKOTA="ND",i.OHIO="OH",i.OKLAHOMA="OK",i.OREGON="OR",i.PENNSYLVANIA="PA",i.RHODE_ISLAND="RI",i.SOUTH_CAROLINA="SC",i.SOUTH_DAKOTA="SD",i.TENNESSEE="TN",i.TEXAS="TX",i.UTAH="UT",i.VERMONT="VT",i.VIRGINIA="VA",i.WASHINGTON="WA",i.WEST_VIRGINIA="WV",i.WISCONSIN="WI",i.WYOMING="WY",exports.ENUM_ENGRAVING=void 0,(o=exports.ENUM_ENGRAVING||(exports.ENUM_ENGRAVING={})).YES="YES",o.NO="NO",exports.ENUM_BINARY_FILTER=void 0,(s=exports.ENUM_BINARY_FILTER||(exports.ENUM_BINARY_FILTER={})).YES="YES",s.NO="NO",exports.ENUM_FILTER_KEYS=void 0,(n=exports.ENUM_FILTER_KEYS||(exports.ENUM_FILTER_KEYS={})).BRANDS="brands",n.FLAVOR="flavor",n.FULFILLMENT="fulfillment",n.TAGS="tags",n.REGION="region",n.VARIETY="variety",n.ENGRAVING="engraving",n.PRICE="price",n.PRESALE="presale",n.AVAILABILITY="availability",n.CATEGORIES="categories",n.SIZES="sizes",n.COLORS="colors",n.APPELLATION="appellation",n.COUNTRY="country",n.VINTAGE="vintage",n.MATERIALS="materials",n.COLLECTION_TAGS="collectionTags",exports.ENUM_NAVIGATION_ORDER_DIRECTION_TYPE=void 0,(a=exports.ENUM_NAVIGATION_ORDER_DIRECTION_TYPE||(exports.ENUM_NAVIGATION_ORDER_DIRECTION_TYPE={})).ASC="asc",a.DESC="desc",exports.ENUM_ORDER_BY=void 0,(exports.ENUM_ORDER_BY||(exports.ENUM_ORDER_BY={})).PRICE="price",exports.ENUM_AVAILABILITY_VALUE=void 0,(E=exports.ENUM_AVAILABILITY_VALUE||(exports.ENUM_AVAILABILITY_VALUE={})).UNSPECIFIED="AVAILABILITY_UNSPECIFIED",E.IN_STOCK="IN_STOCK",E.OUT_OF_STOCK="OUT_OF_STOCK",E.PREORDER="PREORDER",E.BACKORDER="BACKORDER",exports.CART_PARAM_ERROR_ENUM=void 0,(l=exports.CART_PARAM_ERROR_ENUM||(exports.CART_PARAM_ERROR_ENUM={})).INVALID_ITEMS_TYPE="Items must be a non-empty array",l.INVALID_ITEMS_MAX="You can only send up to 25 items at a time!",l.INVALID_PART_NUMBER="The partnerNumber provided is invalid",l.INVALID_FULFILLMENT_ID="The fulfillmentId provided is invalid",exports.CART_EVENT_ENUM=void 0,(d=exports.CART_EVENT_ENUM||(exports.CART_EVENT_ENUM={})).OOS="OutOfStock",d.ITEMS_NOT_ADDED="ItemsNotAdded",d.ITEMS_REQUESTED_NOT_ADDED="ItemsRequestedNotAdded",d.ITEM_NOT_ENGRAVED="ItemEngravingError",d.ITEM_ENGRAVING_FONT_REPLACED="ItemEngravingFontReplaced",d.ADDRESS_CHANGE="AddressChange",d.LOCATION_AVAILABILITY="LocationAvailability",d.PARTNER_PRODUCT_CONFIGS="PartnerProductConfigs",d.REMOVED_EXISTING_ITEMS="RemovedExistingCartItems",d.RETAILER_MIN="RetailerMinNotMet",d.NO_ITEMS_IN_CART="NoItemsInCart",d.INVALID_ID="InvalidId",d.NO_ID="NoId",d.CART_CHECKOUT_PROCESSED="CartCheckoutProcessed",d.NEW_CART="NewCart",d.DEFAULT="CartError",d.ITEM_QTY_CHANGE="ItemQuantityChange",d.ITEM_ID_NOT_FOUND="ItemIdNotFound",d.ITEMS_REMOVED="ItemsRemoved",d.RETAILER_FULFILLMENT_INVALID="RetailerFulfillmentInvalid",d.RETAILER_ONDEMAND_HOURS_NOT_AVAILABLE="RetailerOnDemandHoursNotAvailable",d.MAX_QUANTITY_PER_ORDER_EXCEEDED="MaxQuantityPerOrderExceeded",d.COUPON_PROCESSING_ERROR="CouponProcessingError",d.COUPON_NOT_FOUND="CouponNotFound",d.COUPON_EXPIRED="CouponExpired",d.NO_APPLICABLE_DISCOUNT="NoApplicableDiscount",d.COUPON_NOT_STARTED="CouponNotStarted",d.MINIMUM_ORDER_VALUE_NOT_MET="MinimumOrderValueNotMet",d.MINIMUM_ORDER_UNITS_NOT_MET="MinimumOrderUnitsNotMet",d.MINIMUM_DISTINCT_ITEMS_NOT_MET="MinimumDistinctItemsNotMet",d.QUOTA_EXCEEDED="QuotaExceeded",d.USER_LIMIT_EXCEEDED="UserLimitExceeded",d.NOT_FIRST_PURCHASE="NotFirstPurchase",d.INVALID_COUPON="InvalidCoupon",d.INVALID_MEMBERSHIP="InvalidMembership",d.INVALID_DOMAIN="InvalidDomain",d.INVALID_REQUIREMENTS="InvalidRequirements",d.INVALID_ORGANIZATION="InvalidOrganization",d.PRODUCT_NOT_ELIGIBLE="ProductNotEligible",d.NOT_ENOUGH_PREVIOUS_ORDERS="NotEnoughPreviousOrders",d.PRESALE_ITEMS_NOT_ALLOWED="PresaleItemsNotAllowed",d.PRESALE_LIMIT_EXCEEDED="PresaleLimitExceeded",d.PRESALE_NOT_STARTED="PresaleNotStarted",d.PRESALE_EXPIRED="PresaleExpired",d.PRESALE_MIXED_CART="PresaleMixedCart",d.RETAILER_DOES_NOT_ALLOW_PROMOS="RetailerDoesNotAllowPromos",d.RETAILERS_DO_NOT_ALLOW_PROMOS="RetailersDoNotAllowPromos",d.BOPIS_CONTACT_REQUIRED="BopisContactRequired",d.BOPIS_PARENT_FULFILLMENT_REQUIRED="BopisParentFulfillmentRequired",d.BOPIS_INVALID_PARENT_FULFILLMENT="BopisInvalidParentFulfillment",d.BOPIS_PARENT_RETAILER_MISMATCH="BopisParentRetailerMismatch",d.BOPIS_NOT_APPLICABLE="BopisNotApplicable",d.BOPIS_NOT_ALLOWED="BopisNotAllowed",d.BOPIS_PRODUCT_NOT_OPTED_IN="BopisProductNotOptedIn",d.BOPIS_NOT_AVAILABLE="BopisNotAvailable",d.BOPIS_SCHEDULE_IN_PAST="BopisScheduleInPast",d.BOPIS_SCHEDULE_OUTSIDE_HOURS="BopisScheduleOutsideHours",d.BOPIS_FALLBACK="BopisFallback",exports.ENUM_ADDRESS_TYPE=void 0,(I=exports.ENUM_ADDRESS_TYPE||(exports.ENUM_ADDRESS_TYPE={})).SHIPPING="shipping",I.BILLING="billing",exports.ENUM_CHECKOUT_STATUS_CODE_ERROR=void 0,(h=exports.ENUM_CHECKOUT_STATUS_CODE_ERROR||(exports.ENUM_CHECKOUT_STATUS_CODE_ERROR={}))[h.REQUEST_DEFAULT_ERROR=5480]="REQUEST_DEFAULT_ERROR",h[h.REQUEST_LOCATION_OOS_ERROR=5481]="REQUEST_LOCATION_OOS_ERROR",h[h.REQUEST_LOCATION_MISMATCH_ERROR=5482]="REQUEST_LOCATION_MISMATCH_ERROR",h[h.REQUEST_BIRTHDATE_ERROR=5483]="REQUEST_BIRTHDATE_ERROR",h[h.REQUEST_CART_NOT_AVAILABLE_ERROR=5484]="REQUEST_CART_NOT_AVAILABLE_ERROR",h[h.REQUEST_CART_ID_ERROR=5485]="REQUEST_CART_ID_ERROR",h[h.REQUEST_CART_ITEM_ERROR=5486]="REQUEST_CART_ITEM_ERROR",h[h.REQUEST_VALIDATION_ERROR=5487]="REQUEST_VALIDATION_ERROR",h[h.REQUEST_TAX_ERROR=5488]="REQUEST_TAX_ERROR",h[h.REQUEST_COMPLETE_TOKEN=5489]="REQUEST_COMPLETE_TOKEN",h[h.REQUEST_DEFAULT_COMPLETE_ERROR=5490]="REQUEST_DEFAULT_COMPLETE_ERROR",h[h.REQUEST_CHECKOUT_COMPLETE_UPDATE_ERROR=5491]="REQUEST_CHECKOUT_COMPLETE_UPDATE_ERROR",h[h.REQUEST_CHECKOUT_COMPLETE_SAVE_ERROR=5492]="REQUEST_CHECKOUT_COMPLETE_SAVE_ERROR",h[h.REQUEST_CHECKOUT_HAS_COMPLETE_ERROR=5493]="REQUEST_CHECKOUT_HAS_COMPLETE_ERROR",h[h.REQUEST_NO_CART_ITEM_ERROR=5494]="REQUEST_NO_CART_ITEM_ERROR",h[h.REQUEST_NO_CUSTOMER_FOUND_ERROR=5495]="REQUEST_NO_CUSTOMER_FOUND_ERROR",h[h.REQUEST_PAYMENT_ATTACHED_ERROR=5496]="REQUEST_PAYMENT_ATTACHED_ERROR",h[h.REQUEST_SHIPPING_ADDRESS_ERROR=5497]="REQUEST_SHIPPING_ADDRESS_ERROR",h[h.REQUEST_BILLING_ADDRESS_ERROR=5498]="REQUEST_BILLING_ADDRESS_ERROR",h[h.REQUEST_PAYMENT_NOT_FOUND_ERROR=5499]="REQUEST_PAYMENT_NOT_FOUND_ERROR",h[h.REQUEST_CART_UPDATED_ERROR=5501]="REQUEST_CART_UPDATED_ERROR",h[h.REQUEST_ADDRESS_DEFAULT_ERROR=5502]="REQUEST_ADDRESS_DEFAULT_ERROR",h[h.REQUEST_TIPS_ERROR=5503]="REQUEST_TIPS_ERROR",h[h.REQUEST_COMPLETE_CUSTOMER_MISSING_FIELDS=5504]="REQUEST_COMPLETE_CUSTOMER_MISSING_FIELDS",h[h.REQUEST_RETAILER_HOURS_ERROR=5505]="REQUEST_RETAILER_HOURS_ERROR",h[h.REQUEST_ITEM_QUANTITY_CHANGE_ERROR=5506]="REQUEST_ITEM_QUANTITY_CHANGE_ERROR",h[h.REQUEST_MAX_QUANTITY_PER_ORDER_ERROR=5507]="REQUEST_MAX_QUANTITY_PER_ORDER_ERROR",h[h.REQUEST_PRESALE_NOT_STARTED_ERROR=5508]="REQUEST_PRESALE_NOT_STARTED_ERROR",h[h.REQUEST_CART_MIN_RETAILER_NOT_MET_ERROR=5509]="REQUEST_CART_MIN_RETAILER_NOT_MET_ERROR",h[h.REQUEST_CHECKOUT_PROCESSING_LOCK_NOT_ACQUIRED_ERROR=5510]="REQUEST_CHECKOUT_PROCESSING_LOCK_NOT_ACQUIRED_ERROR",h[h.REQUEST_BOPIS_PRODUCT_NOT_OPTED_IN_ERROR=5511]="REQUEST_BOPIS_PRODUCT_NOT_OPTED_IN_ERROR",exports.ENUM_CHECKOUT_STATUS_CODE_MESSAGE=void 0,(c=exports.ENUM_CHECKOUT_STATUS_CODE_MESSAGE||(exports.ENUM_CHECKOUT_STATUS_CODE_MESSAGE={})).REQUEST_DEFAULT_ERROR="There's been an error with your checkout request.",c.REQUEST_LOCATION_OOS_ERROR="The requested items are out of stock at this location.",c.REQUEST_LOCATION_MISMATCH_ERROR="The selected location doesn't match your cart items.",c.REQUEST_BIRTHDATE_ERROR="Please verify your birthdate and try again.",c.REQUEST_CART_NOT_AVAILABLE_ERROR="This cart is no longer available.",c.REQUEST_CART_ID_ERROR="The cartId requested is invalid, check and try again.",c.REQUEST_CART_ITEM_ERROR="There's an issue with one or more items in your cart.",c.REQUEST_VALIDATION_ERROR="There's been an error with your request parameters, check and try again.",c.REQUEST_TAX_ERROR="There was an error calculating tax for your order.",c.REQUEST_COMPLETE_TOKEN="The checkout token provided is invalid, check and try again.",c.REQUEST_DEFAULT_COMPLETE_ERROR="There was an error completing your checkout, confirm through the (prepare) method and try again.",c.REQUEST_CHECKOUT_COMPLETE_UPDATE_ERROR="Unable to update your checkout status.",c.REQUEST_CHECKOUT_COMPLETE_SAVE_ERROR="Unable to save your completed checkout.",c.REQUEST_CHECKOUT_HAS_COMPLETE_ERROR="This checkout has already been processed, create a new cart to process a new checkout.",c.REQUEST_NO_CART_ITEM_ERROR="Item(s) in your cart are no longer available",c.REQUEST_NO_CUSTOMER_FOUND_ERROR="The customer account was not found.",c.REQUEST_PAYMENT_ATTACHED_ERROR="The payment attached to the checkout is not a valid payment method for this customer.",c.REQUEST_SHIPPING_ADDRESS_ERROR="The address in your cart has changed, check and try again.",c.REQUEST_BILLING_ADDRESS_ERROR="The billing address in your checkout is not valid, check and try again.",c.REQUEST_PAYMENT_NOT_FOUND_ERROR="The payment method provided was not found.",c.REQUEST_CART_UPDATED_ERROR="The cart requested was updated during your checkout.",c.REQUEST_ADDRESS_DEFAULT_ERROR="There's been an error with your address configurations in cart and/or billing address, check and try again.",c.REQUEST_TIPS_ERROR="There's been an error applying your tips to the checkout.",c.REQUEST_COMPLETE_CUSTOMER_MISSING_FIELDS="Customer profile information is incomplete. Please provide all required details.",c.REQUEST_RETAILER_HOURS_ERROR="The retailer is currently closed or on-demand hours are not available.",c.REQUEST_ITEM_QUANTITY_CHANGE_ERROR="Some items in your cart exceed available stock quantities. Please adjust your cart and try again.",c.REQUEST_MAX_QUANTITY_PER_ORDER_ERROR="You have exceeded the maximum quantity allowed per order for one or more items in your cart.",c.REQUEST_PRESALE_NOT_STARTED_ERROR="The presale for this item has not started yet. Please check back later.",c.REQUEST_CART_MIN_RETAILER_NOT_MET_ERROR="Some items in your cart do not meet the minimum retailer requirements per order quantity. Please adjust your cart and try again.",c.REQUEST_CHECKOUT_PROCESSING_LOCK_NOT_ACQUIRED_ERROR="This checkout is currently being processed, please try again later.",c.REQUEST_BOPIS_PRODUCT_NOT_OPTED_IN_ERROR="One or more items in your cart are no longer eligible for in-store pickup (BOPIS) and were removed. Please review your cart and try again.",exports.CHECKOUT_EVENT_ENUM=void 0,(u=exports.CHECKOUT_EVENT_ENUM||(exports.CHECKOUT_EVENT_ENUM={})).ERROR_PROCESSING_GIFT_CARDS="ErrorProcessingGiftCards",u.INVALID_GIFT_CARD_CODE="InvalidGiftCardCodes",u.INVALID_GIFT_CARD_PARTNER="InvalidGiftCardPartner",u.INACTIVE_GIFT_CARD="InactiveGiftCard",u.GIFT_CARD_ALREADY_IN_USE="GiftCardAlreadyInUse",u.GIFT_CARD_EXPIRED="GiftCardExpired",u.GIFT_CARD_BALANCE_DEPLETED="GiftCardBalanceDepleted",u.RETAILER_ONDEMAND_HOURS_NOT_AVAILABLE="RetailerOnDemandHoursNotAvailable",u.ITEM_QTY_CHANGE="ItemQuantityChange",u.MAX_QUANTITY_PER_ORDER_EXCEEDED="MaxQuantityPerOrderExceeded",u.COUPON_PROCESSING_ERROR="CouponProcessingError",u.COUPON_NOT_FOUND="CouponNotFound",u.COUPON_EXPIRED="CouponExpired",u.NO_APPLICABLE_DISCOUNT="NoApplicableDiscount",u.COUPON_NOT_STARTED="CouponNotStarted",u.MINIMUM_ORDER_VALUE_NOT_MET="MinimumOrderValueNotMet",u.MINIMUM_ORDER_UNITS_NOT_MET="MinimumOrderUnitsNotMet",u.MINIMUM_DISTINCT_ITEMS_NOT_MET="MinimumDistinctItemsNotMet",u.QUOTA_EXCEEDED="QuotaExceeded",u.USER_LIMIT_EXCEEDED="UserLimitExceeded",u.NOT_FIRST_PURCHASE="NotFirstPurchase",u.INVALID_COUPON="InvalidCoupon",u.INVALID_MEMBERSHIP="InvalidMembership",u.INVALID_DOMAIN="InvalidDomain",u.INVALID_REQUIREMENTS="InvalidRequirements",u.INVALID_ORGANIZATION="InvalidOrganization",u.PRESALE_ITEMS_NOT_ALLOWED="PresaleItemsNotAllowed",u.PRODUCT_NOT_ELIGIBLE="ProductNotEligible",u.NOT_ENOUGH_PREVIOUS_ORDERS="NotEnoughPreviousOrders",u.RETAILER_DOES_NOT_ALLOW_PROMOS="RetailerDoesNotAllowPromos",u.RETAILERS_DO_NOT_ALLOW_PROMOS="RetailersDoNotAllowPromos",u.RETAILER_DOES_NOT_ALLOW_GIFT_CARDS="RetailerDoesNotAllowGiftCards",u.RETAILERS_DO_NOT_ALLOW_GIFT_CARDS="RetailersDoNotAllowGiftCards",exports.ENUM_ORDER_STATUS=void 0,(R=exports.ENUM_ORDER_STATUS||(exports.ENUM_ORDER_STATUS={})).CREATED="created",R.PROCESSING="processing",R.IN_TRANSIT="inTransit",R.CANCELED="canceled",R.DELIVERED="delivered",R.TEST="test",exports.ENUM_ORDER_SYSTEM=void 0,(N=exports.ENUM_ORDER_SYSTEM||(exports.ENUM_ORDER_SYSTEM={})).LIQUIDCOMMERCE="LiquidCommerce OMS",N.RESERVEBAR="ReserveBar OMS",exports.ENUM_ORDER_PACKAGE_STATUS=void 0,(p=exports.ENUM_ORDER_PACKAGE_STATUS||(exports.ENUM_ORDER_PACKAGE_STATUS={})).PENDING="pending",p.SHIPPED="shipped",p.DELIVERED="delivered",p.CANCELED="canceled",p.RETURNED="returned",p.EXCEPTION="exception",exports.ENUM_ORDER_FULFILLMENT_TYPE=void 0,(v=exports.ENUM_ORDER_FULFILLMENT_TYPE||(exports.ENUM_ORDER_FULFILLMENT_TYPE={})).SHIPPING="shipping",v.ON_DEMAND="onDemand",v.DIGITAL="digital",v.BOPIS="bopis",exports.ENUM_CUSTOMER_PLACEMENT=void 0,(T=exports.ENUM_CUSTOMER_PLACEMENT||(exports.ENUM_CUSTOMER_PLACEMENT={})).STANDARD="standard",T.PRE_SALE="pre_sale",T.BACK_ORDER="back_order",exports.SHIPPING_CATEGORY_TYPE=void 0,(O=exports.SHIPPING_CATEGORY_TYPE||(exports.SHIPPING_CATEGORY_TYPE={})).SPIRITS="SPIRITS",O.WINE="WINE",O.BEER="BEER",O.NON_ALCOHOLIC="NON ALCOHOLIC",O.MISCELLANEOUS="MISCELLANEOUS",O.MERCHANDISE="MERCHANDISE",O.OTHER="OTHER",exports.ENUM_BEER=void 0,(A=exports.ENUM_BEER||(exports.ENUM_BEER={})).ALE="BEER > ALE",A.LAGER="BEER > LAGER",A.BASE="BEER",A.NON_ALCOHOLIC="BEER > NON-ALCOHOLIC",A.OTHER_BEER="BEER > OTHER",A.OTHER_BEER_SOUR_BEER="BEER > SOUR BEER",A.OTHER_BEER_FLAVORED_BEER="BEER > FLAVORED BEER",A.OTHER_BEER_FRUIT_BEER="BEER > FRUIT BEER",exports.ENUM_FOOD=void 0,(S=exports.ENUM_FOOD||(exports.ENUM_FOOD={})).BASE="FOOD",S.PANTRY_OTHER="FOOD > PANTRY > OTHER",S.CANDY="FOOD > CANDY",S.CANDY_OTHER="FOOD > CANDY > OTHER",S.CBD="FOOD > CBD",S.CBD_OTHER="FOOD > CBD > OTHER",S.CHEESE="FOOD > CHEESE",S.CHEESE_OTHER="FOOD > CHEESE > OTHER",S.HOUSEHOLD="FOOD > HOUSEHOLD",S.HOUSEHOLD_SNACKS="FOOD > HOUSEHOLD > SNACKS",S.HOUSEHOLD_OTHER="FOOD > HOUSEHOLD > OTHER",S.PANTRY="FOOD > PANTRY",S.FRUIT="FOOD > FRUIT",S.OTHER="FOOD > OTHER",S.ICE="FOOD > ICE",S.ICE_CREAM="FOOD > ICE CREAM",S.PARTY_SUPPLIES="FOOD > PARTY SUPPLIES",S.PARTY_SUPPLIES_OTHER="FOOD > PARTY SUPPLIES > OTHER",S.SPIRITS_BASED="FOOD > SPIRITS BASED",S.GARNISHES="FOOD > GARNISHES",exports.ENUM_MERCHANDISE=void 0,(m=exports.ENUM_MERCHANDISE||(exports.ENUM_MERCHANDISE={})).BASE="MERCHANDISE",m.GLASSWARE="MERCHANDISE > GLASSWARE",m.GLASSWARE_OTHER="MERCHANDISE > GLASSWARE > OTHER",m.HUMIDOR="MERCHANDISE > HUMIDOR",m.ACCESSORY="MERCHANDISE > ACCESSORY",m.ACCESSORY_OTHER="MERCHANDISE > ACCESSORY > OTHER",m.GIFT_SET="MERCHANDISE > GIFT SET",m.GIFT_SET_GIFT_BAG="MERCHANDISE > GIFT SET > GIFT BAG",m.GIFT_SET_GIFT_CARD="MERCHANDISE > GIFT SET > GIFT CARD",m.BAR_TOOLS="MERCHANDISE > BAR TOOLS",m.BAR_TOOLS_ICE_BUCKET="MERCHANDISE > BAR TOOLS > ICE BUCKET",m.BAR_TOOLS_OTHER="MERCHANDISE > BAR TOOLS > OTHER",exports.ENUM_MISCELLANEOUS=void 0,(y=exports.ENUM_MISCELLANEOUS||(exports.ENUM_MISCELLANEOUS={})).BASE="MISCELLANEOUS",y.GIFT_CARD="MISCELLANEOUS > GIFT CARDS",y.PROMOTIONAL="MISCELLANEOUS > PROMOTIONAL",y.MEMBERSHIP="MISCELLANEOUS > MEMBERSHIP",exports.ENUM_NON_ALCOHOLIC=void 0,(w=exports.ENUM_NON_ALCOHOLIC||(exports.ENUM_NON_ALCOHOLIC={})).BASE="NON ALCOHOLIC",w.BITTERS="NON ALCOHOLIC > BITTERS",w.COCKTAIL_MIX="NON ALCOHOLIC > COCKTAIL MIX",w.COFFEE="NON ALCOHOLIC > COFFEE",w.ENERGY_DRINKS="NON ALCOHOLIC > ENERGY DRINKS",w.JUICE="NON ALCOHOLIC > JUICE",w.SODA="NON ALCOHOLIC > SODA",w.SPECIALTY_ITEM="NON ALCOHOLIC > SPECIALTY ITEM",w.SPECIALTY_ITEM_OTHER="NON ALCOHOLIC > SPECIALTY ITEM > OTHER",w.SPIRITS="NON ALCOHOLIC > SPIRITS",w.TEA="NON ALCOHOLIC > TEA",w.WATER="NON ALCOHOLIC > WATER",w.WINE="NON ALCOHOLIC > WINE",w.SPORTS_DRINKS="NON ALCOHOLIC > SPORTS DRINKS",w.SLURPEES="NON ALCOHOLIC > SLURPEES",w.GINGER_BEER="NON ALCOHOLIC > GINGER BEER",w.DAIRY="NON ALCOHOLIC > DAIRY",w.DAIRY_OTHER="NON ALCOHOLIC > DAIRY > OTHER",w.OTHER="NON ALCOHOLIC > OTHER",exports.ENUM_READY_TO_DRINK=void 0,(f=exports.ENUM_READY_TO_DRINK||(exports.ENUM_READY_TO_DRINK={})).BASE="READY TO DRINK",f.HARD_CIDER="READY TO DRINK > HARD CIDER",f.HARD_CIDER_PERRY_PEAR_CIDER="READY TO DRINK > HARD CIDER > PERRY (PEAR CIDER)",f.HARD_CIDER_APPLE_CIDER="READY TO DRINK > HARD CIDER > APPLE CIDER",f.HARD_CIDER_OTHER_FRUIT_CIDER="READY TO DRINK > HARD CIDER > FRUIT CIDER",f.HARD_TEA="READY TO DRINK > HARD TEA",f.HARD_SELTZER="READY TO DRINK > HARD SELTZER",f.MALT_BASED="READY TO DRINK > MALT BASED",f.SPIRITS_BASED_RTDS="READY TO DRINK > SPIRITS-BASED RTDS",f.SPIRITS_BASED_RTDS_AGAVE_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > AGAVE COCKTAILS",f.SPIRITS_BASED_RTDS_GIN_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > GIN COCKTAILS",f.SPIRITS_BASED_RTDS_RUM_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > RUM COCKTAILS",f.SPIRITS_BASED_RTDS_TEQUILA_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > TEQUILA COCKTAILS",f.SPIRITS_BASED_RTDS_VODKA_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > VODKA COCKTAILS",f.SPIRITS_BASED_RTDS_WHISKEY_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > WHISKEY COCKTAILS",f.SPIRITS_BASED_RTDS_OTHER="READY TO DRINK > SPIRITS-BASED RTDS > OTHER",f.SPIRITS_BASED_RTDS_FROZEN_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > FROZEN COCKTAILS",f.SPIRITS_BASED_RTDS_APERITIF_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > APERITIF COCKTAILS",f.SPIRITS_BASED_RTDS_DESSERT_COFFEE_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > DESSERT & COFFEE COCKTAILS",f.SPIRITS_BASED_RTDS_TEA_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > TEA COCKTAILS",f.WINE_COCKTAILS="READY TO DRINK > WINE COCKTAILS",f.OTHER="READY TO DRINK > OTHER",exports.ENUM_SPIRITS=void 0,(W=exports.ENUM_SPIRITS||(exports.ENUM_SPIRITS={})).BASE="SPIRITS",W.AMARO_APERITIF_VERMOUTH="SPIRITS > AMARO APERITIF & VERMOUTH",W.AMARO_APERITIF_VERMOUTH_OTHER="SPIRITS > AMARO APERITIF & VERMOUTH > OTHER",W.BAIJIU="SPIRITS > BAIJIU",W.BITTERS="SPIRITS > BITTERS",W.BRANDY="SPIRITS > BRANDY",W.BRANDY_COGNAC="SPIRITS > BRANDY > COGNAC",W.CACHACA="SPIRITS > CACHACA",W.GIN="SPIRITS > GIN",W.GIN_DRY_GIN="SPIRITS > GIN > DRY GIN",W.GIN_FLAVORED_GIN="SPIRITS > GIN > FLAVORED GIN",W.GIN_OLD_TOM_GIN="SPIRITS > GIN > OLD TOM GIN",W.GIN_OTHER="SPIRITS > GIN > OTHER",W.GRAIN_ALCOHOL="SPIRITS > GRAIN ALCOHOL",W.LIQUEUR="SPIRITS > LIQUEUR",W.MEZCAL="SPIRITS > MEZCAL",W.OTHER_SPIRITS="SPIRITS > OTHER SPIRITS",W.RUM="SPIRITS > RUM",W.RUM_AGED_RUM="SPIRITS > RUM > AGED RUM",W.RUM_DARK_RUM="SPIRITS > RUM > DARK RUM",W.RUM_FLAVORED_RUM="SPIRITS > RUM > FLAVORED RUM",W.RUM_GOLD_RUM="SPIRITS > RUM > GOLD RUM",W.RUM_OTHER="SPIRITS > RUM > OTHER",W.RUM_SPICED="SPIRITS > RUM > SPICED",W.RUM_WHITE_RUM="SPIRITS > RUM > WHITE RUM",W.SHOCHU="SPIRITS > SHOCHU",W.SOJU="SPIRITS > SOJU",W.SOTOL="SPIRITS > SOTOL",W.TEQUILA="SPIRITS > TEQUILA",W.TEQUILA_ANEJO="SPIRITS > TEQUILA > AÑEJO",W.TEQUILA_BLANCO="SPIRITS > TEQUILA > BLANCO",W.TEQUILA_CRISTALINO="SPIRITS > TEQUILA > CRISTALINO",W.TEQUILA_EXTRA_ANEJO="SPIRITS > TEQUILA > EXTRA AÑEJO",W.TEQUILA_OTHER="SPIRITS > TEQUILA > OTHER",W.TEQUILA_REPOSADO="SPIRITS > TEQUILA > REPOSADO",W.VODKA="SPIRITS > VODKA",W.VODKA_FLAVORED_VODKA="SPIRITS > VODKA > FLAVORED VODKA",W.VODKA_OTHER="SPIRITS > VODKA > OTHER",W.VODKA_REGULAR_VODKA="SPIRITS > VODKA > REGULAR VODKA",W.WHISKEY="SPIRITS > WHISKEY",W.WHISKEY_AMERICAN_WHISKEY="SPIRITS > WHISKEY > AMERICAN WHISKEY",W.WHISKEY_BOURBON="SPIRITS > WHISKEY > BOURBON",W.WHISKEY_CANADIAN_WHISKEY="SPIRITS > WHISKEY > CANADIAN WHISKEY",W.WHISKEY_IRISH_WHISKEY="SPIRITS > WHISKEY > IRISH WHISKEY",W.WHISKEY_MOONSHINE="SPIRITS > WHISKEY > MOONSHINE",W.WHISKEY_FLAVORED="SPIRITS > WHISKEY > FLAVORED WHISKEY",W.WHISKEY_OTHER="SPIRITS > WHISKEY > OTHER",W.WHISKEY_SCOTCH="SPIRITS > WHISKEY > SCOTCH",exports.ENUM_WINE=void 0,(C=exports.ENUM_WINE||(exports.ENUM_WINE={})).BASE="WINE",C.CHAMPAGNE_SPARKLING="WINE > CHAMPAGNE & SPARKLING",C.CHAMPAGNE_SPARKLING_CAVA="WINE > CHAMPAGNE & SPARKLING > CAVA",C.CHAMPAGNE_SPARKLING_CHAMPAGNE="WINE > CHAMPAGNE & SPARKLING > CHAMPAGNE",C.CHAMPAGNE_SPARKLING_PROSECCO="WINE > CHAMPAGNE & SPARKLING > PROSECCO",C.CHAMPAGNE_SPARKLING_SPARKLING_WINE="WINE > CHAMPAGNE & SPARKLING > SPARKLING WINE",C.CHAMPAGNE_SPARKLING_OTHER="WINE > CHAMPAGNE & SPARKLING > OTHER",C.COOKING="WINE > COOKING",C.DESSERT_FORTIFIED_WINE="WINE > DESSERT & FORTIFIED WINE",C.DESSERT_FORTIFIED_WINE_MEAD="WINE > DESSERT & FORTIFIED WINE > MEAD",C.DESSERT_FORTIFIED_WINE_PORT="WINE > DESSERT & FORTIFIED WINE > PORT",C.DESSERT_FORTIFIED_WINE_SHERRY="WINE > DESSERT & FORTIFIED WINE > SHERRY",C.DESSERT_FORTIFIED_WINE_OTHER="WINE > DESSERT & FORTIFIED WINE > OTHER",C.RED_WINE="WINE > RED WINE",C.RED_WINE_AGIORGITIKO="WINE > RED WINE > AGIORGITIKO",C.RED_WINE_AGLIANICO="WINE > RED WINE > AGLIANICO",C.RED_WINE_ALICANTE_BOUSCHET="WINE > RED WINE > ALICANTE BOUSCHET",C.RED_WINE_BARBERA="WINE > RED WINE > BARBERA",C.RED_WINE_BARBARESCO="WINE > RED WINE > BARBARESCO",C.RED_WINE_BAROLO="WINE > RED WINE > BAROLO",C.RED_WINE_BEAUJOLAIS="WINE > RED WINE > BEAUJOLAIS",C.RED_WINE_BLAUER_ZWEIGELT="WINE > RED WINE > BLAUER ZWEIGELT",C.RED_WINE_BOBAL="WINE > RED WINE > BOBAL",C.RED_WINE_BONARDA="WINE > RED WINE > BONARDA",C.RED_WINE_BORDEAUX="WINE > RED WINE > BORDEAUX",C.RED_WINE_BORDEAUX_BLEND="WINE > RED WINE > BORDEAUX BLEND",C.RED_WINE_BURGUNDY="WINE > RED WINE > BURGUNDY",C.RED_WINE_CABERNET_FRANC="WINE > RED WINE > CABERNET FRANC",C.RED_WINE_CABERNET_SAUVIGNON="WINE > RED WINE > CABERNET SAUVIGNON",C.RED_WINE_CANNONAU="WINE > RED WINE > CANNONAU",C.RED_WINE_CARMENERE="WINE > RED WINE > CARMENERE",C.RED_WINE_CHAMBOURCIN="WINE > RED WINE > CHAMBOURCIN",C.RED_WINE_CHIANTI="WINE > RED WINE > CHIANTI",C.RED_WINE_CINSAULT="WINE > RED WINE > CINSAULT",C.RED_WINE_CORVINA="WINE > RED WINE > CORVINA",C.RED_WINE_DOLCETTO="WINE > RED WINE > DOLCETTO",C.RED_WINE_DORNFELDER="WINE > RED WINE > DORNFELDER",C.RED_WINE_FETEASCA_NEAGRA="WINE > RED WINE > FETEASCA NEAGRA",C.RED_WINE_GAMAY="WINE > RED WINE > GAMAY",C.RED_WINE_GRACIANO="WINE > RED WINE > GRACIANO",C.RED_WINE_GRENACHE="WINE > RED WINE > GRENACHE",C.RED_WINE_LIMNIO="WINE > RED WINE > LIMNIO",C.RED_WINE_MACABEO="WINE > RED WINE > MACABEO",C.RED_WINE_MALBEC="WINE > RED WINE > MALBEC",C.RED_WINE_MENCIA="WINE > RED WINE > MENCIA",C.RED_WINE_MERLOT="WINE > RED WINE > MERLOT",C.RED_WINE_MONICA="WINE > RED WINE > MONICA",C.RED_WINE_MONTEPULCIANO="WINE > RED WINE > MONTEPULCIANO",C.RED_WINE_MOURVEDRE_MONASTRELL="WINE > RED WINE > MOURVEDRE/MONASTRELL",C.RED_WINE_NEBBIOLO="WINE > RED WINE > NEBBIOLO",C.RED_WINE_NEGROAMARO="WINE > RED WINE > NEGROAMARO",C.RED_WINE_NERELLO_MASCALESE="WINE > RED WINE > NERELLO MASCALESE",C.RED_WINE_NERO_DAVOLA="WINE > RED WINE > NERO D'AVOLA",C.RED_WINE_PETIT_VERDOT="WINE > RED WINE > PETIT VERDOT",C.RED_WINE_PETITE_SIRAH="WINE > RED WINE > PETITE SIRAH",C.RED_WINE_PINOT_NOIR="WINE > RED WINE > PINOT NOIR",C.RED_WINE_PINOTAGE="WINE > RED WINE > PINOTAGE",C.RED_WINE_PRIMITIVO="WINE > RED WINE > PRIMITIVO",C.RED_WINE_RED_BLEND="WINE > RED WINE > RED BLEND",C.RED_WINE_RHONE_BLEND="WINE > RED WINE > RHONE BLEND",C.RED_WINE_RIOJA="WINE > RED WINE > RIOJA",C.RED_WINE_SAGRANTINO="WINE > RED WINE > SAGRANTINO",C.RED_WINE_SANGIOVESE="WINE > RED WINE > SANGIOVESE",C.RED_WINE_SAPERAVI="WINE > RED WINE > SAPERAVI",C.RED_WINE_SCHIAVA_TROLLINGER="WINE > RED WINE > SCHIAVA/TROLLINGER",C.RED_WINE_SYRAH_SHIRAZ="WINE > RED WINE > SYRAH/SHIRAZ",C.RED_WINE_TANNAT="WINE > RED WINE > TANNAT",C.RED_WINE_TEMPRANILLO="WINE > RED WINE > TEMPRANILLO",C.RED_WINE_TEROLDEGO="WINE > RED WINE > TEROLDEGO",C.RED_WINE_TINTA_DEL_TORO="WINE > RED WINE > TINTA DEL TORO",C.RED_WINE_TOURIGA_NACIONAL="WINE > RED WINE > TOURIGA NACIONAL",C.RED_WINE_VALPOLICELLA="WINE > RED WINE > VALPOLICELLA",C.RED_WINE_XINOMAVRO="WINE > RED WINE > XINOMAVRO",C.RED_WINE_ZINFANDEL="WINE > RED WINE > ZINFANDEL",C.RED_WINE_ZWEIGELT="WINE > RED WINE > ZWEIGELT",C.RED_WINE_OTHER="WINE > RED WINE > OTHER",C.ROSE_WINE="WINE > ROSE WINE",C.SAKE="WINE > SAKE",C.WHITE_WINE="WINE > WHITE WINE",C.WHITE_WINE_ALBARINO_ALVARINHO="WINE > WHITE WINE > ALBARINO/ALVARINHO",C.WHITE_WINE_ARNEIS="WINE > WHITE WINE > ARNEIS",C.WHITE_WINE_ASTI="WINE > WHITE WINE > ASTI",C.WHITE_WINE_ASSYRTIKO="WINE > WHITE WINE > ASSYRTIKO",C.WHITE_WINE_BURGUNDY="WINE > WHITE WINE > BURGUNDY",C.WHITE_WINE_CARRICANTE="WINE > WHITE WINE > CARRICANTE",C.WHITE_WINE_CATARRATTO="WINE > WHITE WINE > CATARRATTO",C.WHITE_WINE_CHABLIS="WINE > WHITE WINE > CHABLIS",C.WHITE_WINE_CHARDONNAY="WINE > WHITE WINE > CHARDONNAY",C.WHITE_WINE_CHENIN_BLANC="WINE > WHITE WINE > CHENIN BLANC",C.WHITE_WINE_CORTESE="WINE > WHITE WINE > CORTESE",C.WHITE_WINE_FALANGHINA="WINE > WHITE WINE > FALANGHINA",C.WHITE_WINE_FIANO="WINE > WHITE WINE > FIANO",C.WHITE_WINE_FRIULANO="WINE > WHITE WINE > FRIULANO",C.WHITE_WINE_FURMINT="WINE > WHITE WINE > FURMINT",C.WHITE_WINE_GARGANEGA="WINE > WHITE WINE > GARGANEGA",C.WHITE_WINE_GAVI="WINE > WHITE WINE > GAVI",C.WHITE_WINE_GEWURZTRAMINER="WINE > WHITE WINE > GEWURZTRAMINER",C.WHITE_WINE_GRECO_DI_TUFO="WINE > WHITE WINE > GRECO DI TUFO",C.WHITE_WINE_GRENACHE_BLANC="WINE > WHITE WINE > GRENACHE BLANC",C.WHITE_WINE_GRUNER_VELTLINER="WINE > WHITE WINE > GRUNER VELTLINER",C.WHITE_WINE_HUXELREBE="WINE > WHITE WINE > HUXELREBE",C.WHITE_WINE_INZOLIA="WINE > WHITE WINE > INZOLIA",C.WHITE_WINE_MALVASIA="WINE > WHITE WINE > MALVASIA",C.WHITE_WINE_MELON_DE_BOURGOGNE="WINE > WHITE WINE > MELON DE BOURGOGNE",C.WHITE_WINE_MOSCATO_BIANCO="WINE > WHITE WINE > MOSCATO BIANCO",C.WHITE_WINE_MOSCHOFILERO_FILERI="WINE > WHITE WINE > MOSCHOFILERO/FILERI",C.WHITE_WINE_MULLER_THURGAU_RIVANER="WINE > WHITE WINE > MULLER-THURGAU/RIVANER",C.WHITE_WINE_MUSCAT_MOSCATO="WINE > WHITE WINE > MUSCAT/MOSCATO",C.WHITE_WINE_PECORINO="WINE > WHITE WINE > PECORINO",C.WHITE_WINE_PICPOUL="WINE > WHITE WINE > PICPOUL",C.WHITE_WINE_PINOT_BLANC="WINE > WHITE WINE > PINOT BLANC",C.WHITE_WINE_PINOT_GRIGIO_PINOT_GRIS="WINE > WHITE WINE > PINOT GRIGIO/PINOT GRIS",C.WHITE_WINE_POUILLY_FUISSE="WINE > WHITE WINE > POUILLY-FUISSE",C.WHITE_WINE_POUILLY_FUME="WINE > WHITE WINE > POUILLY-FUME",C.WHITE_WINE_RIESLING="WINE > WHITE WINE > RIESLING",C.WHITE_WINE_RIOJA="WINE > WHITE WINE > RIOJA",C.WHITE_WINE_RODITIS="WINE > WHITE WINE > RODITIS",C.WHITE_WINE_SANCERRE="WINE > WHITE WINE > SANCERRE",C.WHITE_WINE_SAUVIGNON_BLANC="WINE > WHITE WINE > SAUVIGNON BLANC",C.WHITE_WINE_SEMILLON="WINE > WHITE WINE > SEMILLON",C.WHITE_WINE_SOAVE="WINE > WHITE WINE > SOAVE",C.WHITE_WINE_SYLVANER="WINE > WHITE WINE > SYLVANER",C.WHITE_WINE_TORRONTES="WINE > WHITE WINE > TORRONTES",C.WHITE_WINE_TREBBIANO_UGNI_BLANC="WINE > WHITE WINE > TREBBIANO/UGNI BLANC",C.WHITE_WINE_TURBIANA="WINE > WHITE WINE > TURBIANA",C.WHITE_WINE_TXAKOLINA="WINE > WHITE WINE > TXAKOLINA",C.WHITE_WINE_VERDEJO="WINE > WHITE WINE > VERDEJO",C.WHITE_WINE_VERDICCHIO="WINE > WHITE WINE > VERDICCHIO",C.WHITE_WINE_VERMENTINO="WINE > WHITE WINE > VERMENTINO",C.WHITE_WINE_VERNACCIA="WINE > WHITE WINE > VERNACCIA",C.WHITE_WINE_VIDIANO="WINE > WHITE WINE > VIDIANO",C.WHITE_WINE_VINHO_VERDE="WINE > WHITE WINE > VINHO VERDE",C.WHITE_WINE_VIOGNIER="WINE > WHITE WINE > VIOGNIER",C.WHITE_WINE_VIURA="WINE > WHITE WINE > VIURA",C.WHITE_WINE_OTHER="WINE > WHITE WINE > OTHER",C.WINE_OTHER="WINE > OTHER";const g={[exports.LIQUID_COMMERCE_ENV.LOC]:"http://0.0.0.0:8000/api",[exports.LIQUID_COMMERCE_ENV.DEV]:"https://dev.api.liquidcommerce.cloud/api",[exports.LIQUID_COMMERCE_ENV.STAGE]:"https://staging.api.liquidcommerce.cloud/api",[exports.LIQUID_COMMERCE_ENV.PROD]:"https://api.liquidcommerce.cloud/api",[exports.LIQUID_COMMERCE_ENV.BETA]:"https://cloud-apis-beta-948630220003.us-central1.run.app/api"};function P(t){return async(e,r)=>{var i;const o=await t(e,r);let s;return"function"==typeof(null===(i=o.headers)||void 0===i?void 0:i.entries)?s=Object.fromEntries(o.headers.entries()):(s={},o.headers.forEach((t,e)=>{s[e]=t})),{ok:o.ok,status:o.status,statusText:o.statusText,headers:s,json:()=>o.json(),text:()=>o.text()}}}const L=(t,e)=>new Promise((r,i)=>{const o=new XMLHttpRequest;o.open(e.method||"GET",t),Object.entries(e.headers).forEach(([t,e])=>{o.setRequestHeader(t,e)}),o.onload=()=>{r({ok:o.status>=200&&o.status<300,status:o.status,statusText:o.statusText,headers:o.getAllResponseHeaders().split("\r\n").reduce((t,e)=>{const[r,i]=e.split(": ");return r&&(t[r]=i),t},{}),json:()=>Promise.resolve(JSON.parse(o.responseText)),text:()=>Promise.resolve(o.responseText)})},o.onerror=()=>{i(new TypeError("Network request failed"))},o.send(e.body)});function b(){return"undefined"!=typeof fetch?P(fetch):"undefined"!=typeof global&&global.fetch?P(global.fetch):L}class H{constructor(t){this.accessToken=null,this.tokenExpiration=null,this.isAuthenticating=!1,this.apiKey=t.apiKey,this.env=t.env,this.baseURL=t.baseURL,this.httpClient=b()}getUniqueKey(){return`${this.apiKey}_${this.baseURL}`}async authenticate(){var t,e;if(this.isAuthenticating)await new Promise(t=>{const e=()=>{this.isAuthenticating?setTimeout(e,100):t(void 0)};e()});else{this.isAuthenticating=!0;try{const r=await this.requestWithoutAuth("/authentication",{method:"GET"});this.accessToken=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t.token,this.tokenExpiration=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.exp}catch(t){throw new Error("Failed to authenticate with LiquidCommerce API")}finally{this.isAuthenticating=!1}}}async getAuth(){const t=await this.requestWithoutAuth("/authentication",{method:"GET"});return null==t?void 0:t.data}async requestWithoutAuth(t,e){const r=new URL(`api${t}`,this.baseURL),i={"Content-Type":"application/json","X-LIQUID-API-KEY":this.apiKey,"X-LIQUID-API-OBF":"true",...e.headers},o={method:e.method,headers:i,body:e.body?JSON.stringify(e.body):void 0},s=await this.httpClient(r.toString(),o);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}isTokenExpired(){return!this.tokenExpiration||Date.now()>=this.tokenExpiration}async request(t,e){try{this.accessToken&&!this.isTokenExpired()||await this.authenticate();const r=new URL(`api${t}`,this.baseURL),i={"Content-Type":"application/json","X-LIQUID-API-KEY":this.apiKey,"X-LIQUID-API-OBF":"true","X-LIQUID-API-SDK":"true","X-LIQUID-SDK-VERSION":"1.19.0",Authorization:`Bearer ${this.accessToken}`,...e.headers},o={method:e.method,headers:i,body:e.body?JSON.stringify(e.body):void 0},s=await this.httpClient(r.toString(),o);let n;try{n=await s.json()}catch(t){n={message:await s.text().catch(()=>`HTTP error! status: ${s.status}`)||t}}if(!s.ok)throw{...n,status:s.status,message:(null==n?void 0:n.message)||`HTTP error! status: ${s.status}`};return n}catch(t){throw t}}async get(t,e){return this.request(t,{method:"GET",headers:e})}async post(t,e,r){return this.request(t,{method:"POST",body:e,headers:r})}async put(t,e,r){return this.request(t,{method:"PUT",body:e,headers:r})}async delete(t,e){return this.request(t,{method:"DELETE",headers:e})}}class U{constructor(t){this.locationHelperService=t}validateAndNormalizeParams(t){const e={...t};return e.id=this.validateId(e.id),e.items=this.validateAndNormalizeItems(e.items),this.locationHelperService.validateAndNormalizeLocation(e.loc),e.refresh=Boolean(e.refresh),e}validateId(t){return t&&"string"==typeof t&&0!==t.trim().length?t.trim():""}validateAndNormalizeItems(t){if(!Array.isArray(t)||0===t.length)throw new Error(exports.CART_PARAM_ERROR_ENUM.INVALID_ITEMS_TYPE);if(t.length>25)throw new Error(exports.CART_PARAM_ERROR_ENUM.INVALID_ITEMS_MAX);return t.map(t=>this.validateAndNormalizeItem(t))}validateAndNormalizeItem(t){const e={...t};if(!this.validatePartNumber(e.partNumber))throw new Error(exports.CART_PARAM_ERROR_ENUM.INVALID_PART_NUMBER);if(!e.fulfillmentId||"string"!=typeof e.fulfillmentId||0===e.fulfillmentId.trim().length)throw new Error(exports.CART_PARAM_ERROR_ENUM.INVALID_FULFILLMENT_ID);return e.quantity=Math.max(0,Math.floor(e.quantity)),e.engravingLines&&(e.engravingLines=e.engravingLines.map(t=>t.trim()).filter(t=>t.length>0)),e}validatePartNumber(t){if(!t||"string"!=typeof t)return!1;const e=t.split("_");return 2===e.length&&e[0].length>0&&e[1].length>0}}class x{constructor(t){this.locationServiceHelper=t,this.taxonomyValues=new Set([...Object.values(exports.ENUM_BEER),...Object.values(exports.ENUM_FOOD),...Object.values(exports.ENUM_MERCHANDISE),...Object.values(exports.ENUM_NON_ALCOHOLIC),...Object.values(exports.ENUM_READY_TO_DRINK),...Object.values(exports.ENUM_SPIRITS),...Object.values(exports.ENUM_WINE),...Object.values(exports.ENUM_MISCELLANEOUS)])}validateAndNormalizeParams(t){var e,r,i,o,s,n,a,E,l;const d={...t},I=null!==(e=null==d?void 0:d.upcs)&&void 0!==e?e:[],h=null!==(r=null==d?void 0:d.grouping)&&void 0!==r?r:[],c=null!==(i=null==d?void 0:d.ids)&&void 0!==i?i:[];if([I,h,c].every(t=>this.validateIdsExist(t)))throw new Error("Product identifiers must be a non-empty array of strings");return I.length>0&&(this.validateIds(null!==(o=null==d?void 0:d.upcs)&&void 0!==o?o:[]),d.upcs=I),h.length>0&&(this.validateIds(null!==(s=null==d?void 0:d.grouping)&&void 0!==s?s:[]),d.grouping=h),c.length>0&&(this.validateIds(null!==(n=null==d?void 0:d.ids)&&void 0!==n?n:[]),d.ids=c),this.validateIds(null!==(l=null!==(E=null!==(a=null==d?void 0:d.upcs)&&void 0!==a?a:null==d?void 0:d.grouping)&&void 0!==E?E:null==d?void 0:d.ids)&&void 0!==l?l:[]),this.locationServiceHelper.validateAndNormalizeLocation(d.loc),d}isValidObjectId(t){return!(!t||"string"!=typeof t)&&/^[0-9a-fA-F]{24}$/.test(t)}validateRetailers(t,e){void 0!==t&&(Array.isArray(t)?(t.length>20&&e.push("Retailers array can have a maximum of 20 values"),t.forEach((t,r)=>{"string"!=typeof t?e.push(`Retailer at index ${r} must be a string`):this.isValidObjectId(t)||e.push(`Retailer ID at index ${r} must be a valid ObjectId string`)})):e.push("Retailers must be an array"))}validateAndNormalizeSearchParams(t){const e=[],r={...t};return void 0!==r.deliveryFirst&&"boolean"!=typeof r.deliveryFirst?e.push("deliveryFirst must be a boolean"):!0!==r.deliveryFirst&&delete r.deliveryFirst,this.validateRetailers(r.retailers,e),this.validateOrderBy(r.orderBy,e),this.validateOrderDirection(r.orderDirection,e),this.validateFilters(r.filters,e),this.validatePagination(r.page,r.perPage,e),this.locationServiceHelper.validateAndNormalizeLocation(r.loc),e.length>0?{...r,error:e.join(". ")}:r}validateIds(t){if(!t.every(t=>"string"==typeof t&&t.trim().length>0))throw new Error("All product identifiers must be non-empty strings")}validateIdsExist(t){return!Array.isArray(t)||0===t.length}validateOrderBy(t,e){t&&!Object.values(exports.ENUM_ORDER_BY).includes(t)&&e.push(`Invalid orderBy value: ${t}`)}validateOrderDirection(t,e){t&&!Object.values(exports.ENUM_NAVIGATION_ORDER_DIRECTION_TYPE).includes(t)&&e.push(`Invalid orderDirection value: ${t}`)}validateFilters(t,e){t&&(t.length>10&&e.push("Maximum of 10 filters allowed"),t.forEach(t=>{switch(Object.values(exports.ENUM_FILTER_KEYS).includes(t.key)||e.push(`Invalid filter key: ${t.key}`),t.key){case exports.ENUM_FILTER_KEYS.AVAILABILITY:this.validateAvailabilityFilter(t.values,e);break;case exports.ENUM_FILTER_KEYS.FULFILLMENT:this.validateFulfillmentFilter(t.values,e);break;case exports.ENUM_FILTER_KEYS.ENGRAVING:case exports.ENUM_FILTER_KEYS.PRESALE:this.validateBinaryFilter(t.values,e);break;case exports.ENUM_FILTER_KEYS.BRANDS:this.validateArrayFilter(t.values,75,"brands",e);break;case exports.ENUM_FILTER_KEYS.FLAVOR:this.validateArrayFilter(t.values,25,"flavor",e);break;case exports.ENUM_FILTER_KEYS.REGION:this.validateArrayFilter(t.values,25,"region",e);break;case exports.ENUM_FILTER_KEYS.VARIETY:this.validateArrayFilter(t.values,25,"variety",e);break;case exports.ENUM_FILTER_KEYS.SIZES:this.validateArrayFilter(t.values,25,"sizes",e);break;case exports.ENUM_FILTER_KEYS.APPELLATION:this.validateArrayFilter(t.values,25,"appellation",e);break;case exports.ENUM_FILTER_KEYS.COUNTRY:this.validateArrayFilter(t.values,25,"country",e);break;case exports.ENUM_FILTER_KEYS.VINTAGE:this.validateArrayFilter(t.values,25,"vintage",e);break;case exports.ENUM_FILTER_KEYS.MATERIALS:this.validateArrayFilter(t.values,25,"materials",e);break;case exports.ENUM_FILTER_KEYS.COLORS:this.validateArrayFilter(t.values,25,"colors",e);break;case exports.ENUM_FILTER_KEYS.TAGS:this.validateArrayFilter(t.values,25,"tags",e)}}))}validateAvailabilityFilter(t,e){Object.values(exports.ENUM_AVAILABILITY_VALUE).includes(t)||e.push(`Invalid availability value: ${t}`)}validateFulfillmentFilter(t,e){if(!Array.isArray(t))return void e.push("Fulfillment filter must be an array");const r=Object.values(exports.ENUM_MODALITIES);t.forEach(t=>{r.includes(t)||e.push(`Invalid fulfillment value: ${t}`)})}validateBinaryFilter(t,e){Object.values(exports.ENUM_BINARY_FILTER).includes(t)||e.push(`Invalid availability value: ${t}`)}validateArrayFilter(t,e,r,i){Array.isArray(t)?t.length>e&&i.push(`${r} filter can have a maximum of ${e} values`):i.push(`${r} filter must be an array`)}validateCategoriesFilter(t,e){Array.isArray(t)?t.every(t=>this.taxonomyValues.has(t))||e.push("Invalid category value(s) in categories filter"):e.push("Categories filter must be an array")}validatePagination(t,e,r){void 0!==t&&("number"!=typeof t||t<0)&&r.push("Page must be a non-negative number"),void 0!==e&&("number"!=typeof e||e<=0)&&r.push("PerPage must be a positive number")}}class _{constructor(t){this.locationHelperService=t}validateAndNormalizePrepareParams(t){var e,r,i,o,s,n,a,E,l,d,I,h,c,u,R,N,p,v,T,O;let A={...t};if(!(null==A?void 0:A.cartId)||"string"!=typeof(null==A?void 0:A.cartId))throw new Error("Invalid cartId");return this.validateCustomer(A.customer),(null==A?void 0:A.billingAddress)&&this.validateBillingAddress(A.billingAddress),A.hasAgeVerify=Boolean(null!==(i=null!==(e=null==A?void 0:A.hasAgeVerify)&&void 0!==e?e:null===(r=null==A?void 0:A.customer)||void 0===r?void 0:r.hasAgeVerify)&&void 0!==i&&i),A.hasSubstitutionPolicy=Boolean(null==A?void 0:A.hasSubstitutionPolicy),A.acceptedAccountCreation=Boolean(null==A?void 0:A.acceptedAccountCreation),A.isGift=Boolean(null==A?void 0:A.isGift),A.billingSameAsShipping=Boolean(null==A?void 0:A.billingSameAsShipping),A&&(null==A?void 0:A.billingAddress)&&""!==(null===(o=null==A?void 0:A.billingAddress)||void 0===o?void 0:o.phone)&&(A={...A,billingAddress:{...null!==(s=null==A?void 0:A.billingAddress)&&void 0!==s?s:{},phone:null!==(a=this.formatPhoneNumber(null===(n=A.billingAddress)||void 0===n?void 0:n.phone))&&void 0!==a?a:""}}),A&&(null==A?void 0:A.customer)&&""!==(null===(E=null==A?void 0:A.customer)||void 0===E?void 0:E.phone)&&(A={...A,customer:{...null!==(l=null==A?void 0:A.customer)&&void 0!==l?l:{},phone:null!==(I=this.formatPhoneNumber(null===(d=null==A?void 0:A.customer)||void 0===d?void 0:d.phone))&&void 0!==I?I:""}}),(null==A?void 0:A.isGift)&&(this.validateGiftOptions(A.giftOptions),A&&(null==A?void 0:A.giftOptions)&&""!==(null===(c=null===(h=null==A?void 0:A.giftOptions)||void 0===h?void 0:h.recipient)||void 0===c?void 0:c.phone)&&(A={...A,giftOptions:{...null!==(u=null==A?void 0:A.giftOptions)&&void 0!==u?u:{},recipient:{...null!==(N=null===(R=null==A?void 0:A.giftOptions)||void 0===R?void 0:R.recipient)&&void 0!==N?N:{},phone:null!==(T=this.formatPhoneNumber(null===(v=null===(p=A.giftOptions)||void 0===p?void 0:p.recipient)||void 0===v?void 0:v.phone))&&void 0!==T?T:""}}})),this.validateMarketingPreferences(null==A?void 0:A.marketingPreferences),(null==A?void 0:A.giftCards)&&(A.giftCards=this.validateGiftCards(null!==(O=null==A?void 0:A.giftCards)&&void 0!==O?O:[])),(null==A?void 0:A.deliveryTips)&&this.validateDeliveryTips(A.deliveryTips),(null==A?void 0:A.refresh)&&(A.refresh=Boolean(A.refresh)),A}validateAndNormalizeCompleteParams(t){const e={...t};if(!e.token||"string"!=typeof(null==e?void 0:e.token))throw new Error("Invalid token");if(!(null==e?void 0:e.payment)||"string"!=typeof(null==e?void 0:e.payment))throw new Error("Invalid payment token");return void 0!==e.refresh&&(e.refresh=Boolean(e.refresh)),e}validateCustomer(t){if(t&&"object"==typeof t){const{firstName:e,lastName:r,phone:i,email:o}=t;if(e&&"string"!=typeof e)throw new Error("Invalid customer first name");if(r&&"string"!=typeof r)throw new Error("Invalid customer last name");if(i&&"string"!=typeof i)throw new Error("Invalid customer phone");if(o&&"string"!=typeof o)throw new Error("Invalid customer email");"hasAgeVerify"in t&&(t.hasAgeVerify=Boolean(t.hasAgeVerify))}}validateBillingAddress(t){var e;if(!t)return{};if("object"!=typeof t||null===t)throw new Error("Invalid address: must be an object if provided");const r={...t};return["one","two","city","state","zip","country","firstName","lastName","email","phone","company"].forEach(t=>{if(t in r&&"string"!=typeof r[t])throw new Error(`Invalid billing address ${t}: must be a string if provided`)}),"US"===(null!==(e=r.country)&&void 0!==e?e:"US").toUpperCase()&&"state"in r&&r.state&&(r.state=this.locationHelperService.normalizeState(r.state)),r}validateGiftCards(t){if(!t||0===t.length)return[];if(!Array.isArray(t))throw new Error("Invalid gift cards: must be a string array if provided");const e=[...t];return e.forEach(t=>{if("string"!=typeof t)throw new Error("Invalid gift cards: must be a string array if provided")}),e}validateGiftOptions(t){if(void 0!==t&&"object"!=typeof t)throw new Error("Invalid giftOptions: must be an object if provided");if(t){if("message"in t&&"string"!=typeof t.message)throw new Error("Invalid gift message: must be a string if provided");if("message"in t&&"string"==typeof t.message&&t.message.length>500)throw new Error("Invalid gift message: Gift message cannot exceed 500 characters");if("recipient"in t){if("object"!=typeof t.recipient)throw new Error("Invalid gift recipient: must be an object if provided");const{name:e,phone:r,email:i}=t.recipient;if("name"in t.recipient&&"string"!=typeof e)throw new Error("Invalid gift recipient name: must be a string if provided");if("phone"in t.recipient&&"string"!=typeof r)throw new Error("Invalid gift recipient phone: must be a string if provided");if("email"in t.recipient&&"string"!=typeof i)throw new Error("Invalid gift recipient email: must be a string if provided")}}}formatPhoneNumber(t){if(!t)return null;const e=t.replace(/[\s().\-_]/g,"").replace(/[^\d+]/g,"");if(e.startsWith("+1")){const t=e.substring(2);if(10===t.length)return`(${t.substring(0,3)}) ${t.substring(3,6)}-${t.substring(6)}`}if(11===e.length&&e.startsWith("1")){const t=e.substring(1);return`(${t.substring(0,3)}) ${t.substring(3,6)}-${t.substring(6)}`}return 10===e.length?`(${e.substring(0,3)}) ${e.substring(3,6)}-${e.substring(6)}`:e.startsWith("+")?e:t}validateMarketingPreferences(t){if(void 0!==t&&"object"!=typeof t)throw new Error("Invalid marketingPreferences: must be an object if provided");t&&("canEmail"in t&&(t.canEmail=Boolean(t.canEmail)),"canSms"in t&&(t.canSms=Boolean(t.canSms)))}validateDeliveryTips(t){if(!Array.isArray(t))throw new Error("Invalid deliveryTips");t.forEach(t=>{if(!t.fulfillmentId||"string"!=typeof t.fulfillmentId)throw new Error("Invalid fulfillmentId in deliveryTip");if("number"!=typeof t.tip||t.tip<0)throw new Error("Invalid tip amount in deliveryTip")})}}class M{validateAndNormalizeLocation(t){if(!t)return;if("object"!=typeof t)throw new Error("Location must be a valid object");const{coords:e,address:r}=t;e?this.validateCoordinates(e):r&&this.validateAndNormalizeAddress(r)}validateCoordinates(t){if("number"!=typeof t.lat||"number"!=typeof t.long)throw new Error("Coordinates must be valid numbers");if(t.lat<-90||t.lat>90||t.long<-180||t.long>180)throw new Error("Coordinates are out of valid range")}validateAndNormalizeAddress(t){var e;if("US"===(null!==(e=null==t?void 0:t.country)&&void 0!==e?e:"US").toUpperCase()){if(!(null==t?void 0:t.state)||"string"!=typeof(null==t?void 0:t.state))throw new Error("State is required and must be a string");t.state=this.normalizeState(t.state)}else if((null==t?void 0:t.state)&&"string"!=typeof t.state)throw new Error("State must be a string if provided");if(!t.city||"string"!=typeof t.city)throw new Error("City is required and must be a string");if(!t.zip||"string"!=typeof t.zip)throw new Error("ZIP code is required and must be a string")}normalizeState(t){const e=t.toUpperCase();if(exports.STATES_CODE[e])return exports.STATES_CODE[e];const r=t.toUpperCase();if(exports.STATES_NAME[r])return exports.STATES_NAME[r];throw new Error(`Invalid state: ${t}`)}}class B{constructor(t){this.accessToken=null,this.tokenExpiration=null,this.isAuthenticating=!1,this.userID=t.userID,this.password=t.password,this.baseURL=t.baseURL,this.httpClient=b()}getUniqueKey(){return`${this.userID}_${this.password}_${this.baseURL}`}async authenticate(){var t,e;if(this.isAuthenticating)await new Promise(t=>{const e=()=>{this.isAuthenticating?setTimeout(e,100):t(void 0)};e()});else{this.isAuthenticating=!0;try{const r=await this.requestWithoutAuth("/order-authentication",{method:"GET"});this.accessToken=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t.token,this.tokenExpiration=Date.now()+1e3*(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.exp)}catch(t){throw new Error("Failed to authenticate with LiquidCommerce Order API")}finally{this.isAuthenticating=!1}}}async requestWithoutAuth(t,e){const r=new URL(`api${t}`,this.baseURL),i={"Content-Type":"application/json",Authorization:`Basic ${btoa(`${this.userID}:${this.password}`)}`,...e.headers},o={method:e.method,headers:i,body:e.body?JSON.stringify(e.body):void 0},s=await this.httpClient(r.toString(),o);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}isTokenExpired(){return!this.tokenExpiration||Date.now()>=this.tokenExpiration}async request(t,e){try{this.accessToken&&!this.isTokenExpired()||await this.authenticate();const r=new URL(`api${t}`,this.baseURL),i={"Content-Type":"application/json","X-LIQUID-API-SDK":"true","X-LIQUID-SDK-VERSION":"1.19.0",Authorization:`Bearer ${this.accessToken}`,...e.headers},o={method:e.method,headers:i,body:e.body?JSON.stringify(e.body):void 0},s=await this.httpClient(r.toString(),o);let n;try{n=await s.json()}catch(t){n={message:await s.text().catch(()=>`HTTP error! status: ${s.status}`)||t}}if(!s.ok)throw{...n,status:s.status,message:(null==n?void 0:n.message)||`HTTP error! status: ${s.status}`};return n}catch(t){throw t}}async get(t,e){return this.request(t,{method:"GET",headers:e})}async post(t,e,r){return this.request(t,{method:"POST",body:e,headers:r})}async put(t,e,r){return this.request(t,{method:"PUT",body:e,headers:r})}async delete(t,e){return this.request(t,{method:"DELETE",headers:e})}}class ${constructor(t){this.client=t}async autocomplete(t,e){try{return await this.client.post("/address/autocomplete",{...t,key:e})}catch(t){throw t}}async details(t,e){try{return await this.client.post("/address/details",{...t,key:e})}catch(t){throw t}}}class G{constructor(t,e){this.client=t,this.cartHelperService=e,this.servicePath="/cart/update"}async get(t,e){try{let r=this.cartHelperService.validateId(t);if(r=""!==r&&r,r){const t={id:r};return"boolean"==typeof e&&(t.refresh=e),await this.client.post(this.servicePath,t)}return await this.client.post(this.servicePath)}catch(t){throw t}}async update(t){try{const e=this.cartHelperService.validateAndNormalizeParams(t);return await this.client.post(this.servicePath,e)}catch(t){throw t}}}class F{constructor(t,e){this.client=t,this.catalogHelperService=e,this.servicePath="/catalog/"}async availability(t){try{const e=this.catalogHelperService.validateAndNormalizeParams(t);return await this.client.post(`${this.servicePath}availability`,e)}catch(t){throw t}}async search(t){try{const e=this.catalogHelperService.validateAndNormalizeSearchParams(t);if(null==e?void 0:e.error)throw new Error(null==e?void 0:e.error);return await this.client.post(`${this.servicePath}search`,e)}catch(t){throw t}}async autocomplete(t){try{const e="string"==typeof(null==t?void 0:t.term)?t.term.replace(/^\s+/,""):"";if(0===e.trim().length)throw new Error("term must be a non-empty string");if(void 0!==t.limit&&(!Number.isInteger(t.limit)||t.limit<1||t.limit>25))throw new Error("limit must be an integer between 1 and 25");const r=void 0===t.limit?{term:e}:{term:e,limit:t.limit};return await this.client.post(`${this.servicePath}autocomplete`,r)}catch(t){throw t}}async listProducts(t={}){try{if(void 0!==t.pageSize&&!Number.isInteger(t.pageSize))throw new Error("pageSize must be an integer");const e=new URLSearchParams;void 0!==t.pageSize&&e.append("pageSize",t.pageSize.toString()),"string"==typeof t.cursor&&t.cursor.length>0&&e.append("cursor",t.cursor);const r=e.toString();return await this.client.get(`${this.servicePath}products${r?`?${r}`:""}`)}catch(t){throw t}}async*iterateProducts(t={}){var e;let r;do{const i=await this.listProducts({...t,cursor:r}),o=null==i?void 0:i.data;yield*null!==(e=null==o?void 0:o.items)&&void 0!==e?e:[],r=null==o?void 0:o.nextCursor}while("string"==typeof r&&r.length>0)}async createLocationContext(t){var e;const r=null===(e=null==t?void 0:t.loc)||void 0===e?void 0:e.coords;if(!r||!Number.isFinite(r.lat)||!Number.isFinite(r.long)||Math.abs(r.lat)>90||Math.abs(r.long)>180)throw new Error("Location context requires valid coordinates");return this.client.post(`${this.servicePath}location-context`,{loc:{coords:{lat:r.lat,long:r.long}}})}async compose(t){if(!Array.isArray(null==t?void 0:t.sections)||t.sections.length<1||t.sections.length>16)throw new Error("Catalog composition requires between 1 and 16 sections");const e=new Set;for(const r of t.sections){if(this.validateComposeSection(r),e.has(r.sectionId))throw new Error("Catalog composition section IDs must be unique");e.add(r.sectionId)}if(void 0!==t.retailers&&(!Array.isArray(t.retailers)||t.retailers.length>1))throw new Error("Catalog composition retailers must be an array containing at most one retailer ID");if(void 0!==t.locationContext&&("string"!=typeof t.locationContext||!t.locationContext||t.locationContext.length>256))throw new Error("Catalog composition locationContext must be a non-empty string of at most 256 characters");if(void 0!==t.locationContext&&void 0!==t.loc)throw new Error("Catalog composition accepts either locationContext or loc, not both");return this.client.post(`${this.servicePath}compose`,t)}validateComposeSection(t){if("string"!=typeof(null==t?void 0:t.sectionId)||!t.sectionId||t.sectionId.length>100)throw new Error("Catalog composition sectionId must be a non-empty string of at most 100 characters");if(void 0!==t.perPage&&(!Number.isInteger(t.perPage)||t.perPage<1||t.perPage>24))throw new Error("Catalog composition section perPage must be an integer between 1 and 24");if(void 0!==t.filters&&(!Array.isArray(t.filters)||t.filters.length>10))throw new Error("Catalog composition section filters must be an array of at most 10 filters")}}class K{constructor(t,e){this.client=t,this.checkoutHelperService=e,this.servicePath="/checkout"}async prepare(t){try{const e=this.checkoutHelperService.validateAndNormalizePrepareParams(t);return await this.client.post(`${this.servicePath}/prepare`,e)}catch(t){throw t}}async complete(t){try{const e=this.checkoutHelperService.validateAndNormalizeCompleteParams(t);return await this.client.post(`${this.servicePath}/complete`,e)}catch(t){throw t}}}class Y{constructor(t){this.client=t}async fetch(t){try{return await this.client.get(`/orders/${t}`)}catch(t){throw t}}async list(t){try{const e=new URLSearchParams;if(!t.startDate||!t.endDate)throw new Error("startDate and endDate are required parameters");return e.append("startDate",t.startDate),e.append("endDate",t.endDate),"number"==typeof t.page&&e.append("page",t.page.toString()),"number"==typeof t.limit&&e.append("limit",t.limit.toString()),"string"==typeof t.customerEmail&&e.append("customerEmail",t.customerEmail),await this.client.get(`/orders?${e.toString()}`)}catch(t){throw t}}}class k{constructor(t){this.paymentProvider=t,this.collapse=()=>this.paymentProvider.collapse(),this.unmount=()=>this.paymentProvider.unmount(),this.destroy=()=>this.paymentProvider.destroy()}async mount(t){try{await this.paymentProvider.mount(t)}catch(t){throw t}}async generateToken(){return this.paymentProvider.generateToken()}subscribe(t,e){this.paymentProvider.subscribe(t,e)}unsubscribe(t,e){this.paymentProvider.unsubscribe(t,e)}}class V{constructor(t,e){this.client=t,this.paymentSessionHelperService=e,this.servicePath="/users",this.env=t.env}async createOrUpdateSession(t){try{if(!(null==t?void 0:t.id)&&!(null==t?void 0:t.email))throw new Error("Either id or email must be provided");return await this.client.post(`${this.servicePath}/session`,t)}catch(t){throw t}}async createPaymentSession(t){try{const e=await this.client.post(`${this.servicePath}/payment-session`,t),r=this.paymentSessionHelperService.rcd(null==e?void 0:e.data,this.env);return{...e,data:r}}catch(t){throw t}}async finalizePaymentSession(t){try{if(!t)throw new Error("Token is required");const e=await this.client.get(`${this.servicePath}/finalize-payment-session/${t}`),r=this.paymentSessionHelperService.dd(null==e?void 0:e.data,t);return{...e,data:r}}catch(t){throw t}}async fetchUser(t){try{if(!t)throw new Error("Id is required");return await this.client.get(`${this.servicePath}/fetch/${t}`)}catch(t){throw t}}async purge(t){try{if(!t)throw new Error("User identifier (ID or email) must be provided");return await this.client.delete(`${this.servicePath}/purge/${t}`)}catch(t){throw t}}async addAddress(t){try{return this.validateAddressParams(t),await this.client.post(`${this.servicePath}/addresses/add`,t)}catch(t){throw t}}async updateAddress(t){try{const e=this.validateAddressParams(t);return await this.client.post(`${this.servicePath}/addresses/update`,e)}catch(t){throw t}}validateAddressParams(t){const e=this.hasUser(t),r=this.hasUserAddressObj(t),i=this.hasUserAddressCoords(t),o=this.hasUserAddressPlacesId(t);if(e)throw new Error("Missing required parameter customerId for address update.");if(r&&i&&o)throw new Error("Missing required parameters for address update, you need at least, an address object or lat and long, or a google placesId");return i||(t.lat=Number(null==t?void 0:t.lat),t.long=Number(null==t?void 0:t.long)),t}hasUser(t){return!(null==t?void 0:t.customerId)||"string"!=typeof(null==t?void 0:t.customerId)}hasUserAddressObj(t){return!((null==t?void 0:t.one)&&"string"==typeof(null==t?void 0:t.one)&&(null==t?void 0:t.city)&&"string"==typeof(null==t?void 0:t.city)&&(null==t?void 0:t.state)&&"string"==typeof(null==t?void 0:t.state)&&(null==t?void 0:t.zip)&&"string"==typeof(null==t?void 0:t.zip)&&(null==t?void 0:t.type)&&"string"==typeof(null==t?void 0:t.type))}hasUserAddressCoords(t){return!(null==t?void 0:t.lat)&&!(null==t?void 0:t.long)||"number"!=typeof Number(null==t?void 0:t.lat)&&"number"!=typeof Number(null==t?void 0:t.long)}hasUserAddressPlacesId(t){return!(null==t?void 0:t.placesId)||"string"!=typeof(null==t?void 0:t.placesId)}async purgeAddress(t){try{if(!t)throw new Error("Address ID must be provided");return await this.client.delete(`${this.servicePath}/addresses/purge/${t}`)}catch(t){throw t}}async addPayment(t){try{if(!t.customerId||!t.paymentMethodId)throw new Error("Missing required parameters to add payment");return void 0===(null==t?void 0:t.isDefault)&&(null==t||delete t.isDefault),await this.client.post(`${this.servicePath}/payments/add`,t)}catch(t){throw t}}async updatePayment(t){try{if(!t.customerId||!t.paymentMethodId)throw new Error("Missing required parameters to add payment");const{customerId:e,paymentMethodId:r}=t;return await this.client.get(`${this.servicePath}/payments/updateDefault/${e}/${r}`)}catch(t){throw t}}async purgePayment(t,e){try{if(!t||!e)throw new Error("Missing required parameters for payment purge");return await this.client.delete(`${this.servicePath}/payments/purge/${t}/${e}`)}catch(t){throw t}}}class Q{constructor(t){this.client=t}async test(t){try{return 200===(await this.client.post("/webhook/test",{endpoint:t})).statusCode}catch(t){throw t}}}class q{constructor(){this.services=new Map,this.liquidCommerceOrderClientConstructor=null}static getInstance(){return q.instance||(q.instance=new q),q.instance}setLiquidCommerceOrderClientConstructor(t){this.liquidCommerceOrderClientConstructor=t}async getClient(t){const e=`LiquidCommerceOrderClient_${JSON.stringify(t)}`;if(!this.services.has(e)){if(!this.liquidCommerceOrderClientConstructor)throw new Error("LiquidCommerceOrderClient constructor not set");const r=new this.liquidCommerceOrderClientConstructor(t);await r.init(),this.services.set(e,r)}return this.services.get(e)}getOrCreateService(t,e,...r){if(!this.services.has(t)){const i="getInstance"in e?e.getInstance(...r):new e(...r);this.services.set(t,i)}return this.services.get(t)}getAuthenticatedClient(t){return this.getOrCreateService(`OrderAuthenticatedClient_${JSON.stringify(t)}`,B,t)}getOrderService(t){return this.getOrCreateService(`OrderService_${t.getUniqueKey()}`,Y,t)}}q.instance=null;class j{constructor(t){this.client=t,this.stripe=null,this.elements=null,this.paymentElement=null,this.events=["ready","change","loaderror","loaderstart"],this.eventsErrorMsg="The only Payment Element events allowed (change, ready, loaderstart, loadererror)",this.clientSecret=null,this.isHybrid=!0}async mount(t){var e;if(!document.getElementById(t.elementId))throw new Error(`Element with id "${t.elementId}" not found`);try{this.stripe=await D.loadStripe(t.key)}catch(t){throw new Error("Failed to initialize Stripe")}if(!this.stripe)throw new Error("Failed to initialize Stripe");this.clientSecret=t.clientSecret;try{const{setupIntent:r}=await this.stripe.retrieveSetupIntent(this.clientSecret);if("succeeded"===(null==r?void 0:r.status))throw new Error(`The client secret (${this.clientSecret}) has already been used previously. Generate a new one through a use session.`);this.isHybrid=null!==(e=t.isHybrid)&&void 0!==e?e:"on_session"===(null==r?void 0:r.usage)}catch(t){throw t}const r={clientSecret:t.clientSecret,appearance:this.mapAppearance(t.appearance),paymentMethodCreation:"manual"};this.elements=this.stripe.elements(r);const i=this.mapElementOptions(t.elementOptions);this.paymentElement=this.elements.create("payment",i),this.paymentElement.mount(`#${t.elementId}`)}async generateToken(){var t,e,r,i,o,s,n,a,E,l,d,I,h,c,u,R,N,p,v,T,O,A;if(!this.stripe||!this.elements||!this.clientSecret)return{type:"client_error",message:"Payment form has not been initialized"};const{error:S}=await this.elements.submit();if(S)return{type:"validation_error",message:S.message,code:S.code};if(this.isHybrid){const{error:d,paymentMethod:I}=await this.stripe.createPaymentMethod({elements:this.elements});if(d)return{type:"validation_error"===d.type?"validation_error":"api_error",message:d.message,code:d.code,param:d.param};const{setupIntent:h}=await this.stripe.retrieveSetupIntent(this.clientSecret);if(!h)return{type:"confirm_error",message:"There's been an error during your session confirmation",code:"7190"};const{data:c}=await this.confirmSession({paymentMethodId:null!==(t=null==I?void 0:I.id)&&void 0!==t?t:"",sessionSecret:null!==(e=null==h?void 0:h.id)&&void 0!==e?e:""});return c?I?{id:I.id,type:I.type,card:(null==I?void 0:I.card)?{brand:null!==(i=null===(r=I.card)||void 0===r?void 0:r.brand)&&void 0!==i?i:"",country:null!==(o=I.card.country)&&void 0!==o?o:"",expMonth:null!==(s=I.card.exp_month)&&void 0!==s?s:0,expYear:null!==(n=I.card.exp_year)&&void 0!==n?n:0,last4:null!==(a=I.card.last4)&&void 0!==a?a:"",funding:null!==(E=I.card.funding)&&void 0!==E?E:""}:void 0,created:null!==(l=null==I?void 0:I.created)&&void 0!==l?l:0}:{type:"client_error",message:"Failed to generate payment token"}:{type:"confirm_error",message:"There's been an error during your session confirmation",code:"7191"}}const{error:m,confirmationToken:y}=await this.stripe.createConfirmationToken({elements:this.elements});if(m)return{type:"validation_error"===m.type?"validation_error":"api_error",message:m.message,code:m.code};if(!(null==y?void 0:y.id))return{type:"confirm_error",message:"There's been an error during your session confirmation",code:"7190"};const{error:w,setupIntent:f}=await this.stripe.confirmSetup({clientSecret:this.clientSecret,confirmParams:{confirmation_token:y.id,return_url:window.location.href},redirect:"if_required"});if(w)return{type:"validation_error"===w.type?"validation_error":"confirm_error",message:w.message,code:w.code};if(!f||"succeeded"!==f.status)return{type:"confirm_error",message:"There's been an error during your session confirmation",code:"7190"};const W="string"==typeof f.payment_method?f.payment_method:null!==(I=null===(d=f.payment_method)||void 0===d?void 0:d.id)&&void 0!==I?I:"",{data:C}=await this.confirmSession({paymentMethodId:W,sessionSecret:f.id});if(!C)return{type:"confirm_error",message:"There's been an error during your session confirmation",code:"7191"};const D=null===(h=y.payment_method_preview)||void 0===h?void 0:h.card;return{id:W,type:null!==(u=null===(c=y.payment_method_preview)||void 0===c?void 0:c.type)&&void 0!==u?u:"card",card:D?{brand:null!==(R=D.brand)&&void 0!==R?R:"",country:null!==(N=D.country)&&void 0!==N?N:"",expMonth:null!==(p=D.exp_month)&&void 0!==p?p:0,expYear:null!==(v=D.exp_year)&&void 0!==v?v:0,last4:null!==(T=D.last4)&&void 0!==T?T:"",funding:null!==(O=D.funding)&&void 0!==O?O:""}:void 0,created:null!==(A=y.created)&&void 0!==A?A:0}}async confirmSession({sessionSecret:t,paymentMethodId:e}){try{if(!t||!e)throw new Error("customerId, sessionSecret, paymentMethodId are required");return await this.client.post("/users/payments/confirm",{sessionSecret:t,paymentMethodId:e})}catch(t){throw t}}subscribe(t,e){if(!this.paymentElement)throw new Error("Payment Element has not been initialized");if(!this.events.includes(t))throw new Error(this.eventsErrorMsg);this.paymentElement.on(t,e)}unsubscribe(t,e){if(!this.paymentElement)throw new Error("Payment Element has not been initialized");if(!this.events.includes(t))throw new Error(this.eventsErrorMsg);this.paymentElement.off(t,e)}mapAppearance(t){if(t)return{theme:"night"===t.theme?"night":"stripe",...t.variables&&{variables:t.variables}}}mapElementOptions(t){return{layout:null==t?void 0:t.layout,wallets:{applePay:"auto",googlePay:"auto"}}}unmount(){if(!this.paymentElement)throw new Error("Payment Element has not been initialized");this.paymentElement.unmount()}collapse(){if(!this.paymentElement)throw new Error("Payment Element has not been initialized");this.paymentElement.collapse()}destroy(){if(!this.paymentElement)throw new Error("Payment Element has not been initialized");this.paymentElement.destroy()}}var z,J,X,Z,tt;!function(t){t[t.X=0]="X",t[t.Y=1]="Y"}(z||(z={})),function(t){t[t.I=0]="I",t[t.J=1]="J"}(J||(J={})),function(t){t.V="values",t.T="createdAt"}(X||(X={})),function(t){t.P="pk_live_",t.Q="pk_test_",t.R="seti_",t.S="_secret_",t.T_C="ctoken_",t.U="prod"}(Z||(Z={})),function(t){t[t.M=2]="M",t.N="string",t.O="object"}(tt||(tt={}));class et{rcd(t,e){var r;try{const i=null==t?void 0:t[X.V];this.v(i,Array.isArray,tt.M,et.F.G);const o=i[z.X];this.v(o,t=>typeof t===tt.N,null,et.F.H);const s=i[z.Y];return this.v(s,Array.isArray,tt.M,et.F.I),{key:this.a(o,e),secret:this.b(s[J.I],s[J.J]),createdAt:(null==t?void 0:t[X.T])||new Date,isHybrid:null===(r=null==t?void 0:t.isHybrid)||void 0===r||r}}catch(t){throw new Error(`${et.F.J}${null==t?void 0:t.message}`)}}v(t,e,r,i){if(!e(t)||null!==r&&t.length<r)throw new Error(i)}a(t,e){return`${e===Z.U?"":Z.Q}${t}`}b(t,e){return t&&e?`${Z.R}${t}${Z.S}${e}`:""}ocd(t,e){const r=this.gsi(e).replace(Z.R,""),i=t.replace(Z.T_C,""),o=JSON.stringify([i,r]);return"function"==typeof btoa?btoa(o):Buffer.from(o).toString("base64")}gsi(t){return t.split(Z.S)[0]}gdk(t){try{const e="function"==typeof atob?atob(t):Buffer.from(t,"base64").toString("ascii"),[r,i]=JSON.parse(e);return`${Z.T_C}${r}${Z.R}${i}`}catch(t){throw new Error(`Failed to reconstruct the response data: ${t.message}`)}}dd(t,e){var r,i;const o=this.gdk(e);if(t&&o)try{const e="function"==typeof atob?atob(t):Buffer.from(t,"base64").toString("binary");let s="";for(let t=0;t<e.length;t++)s+=String.fromCharCode((null===(r=null==e?void 0:e.charCodeAt)||void 0===r?void 0:r.call(e,t))^(null===(i=null==o?void 0:o.charCodeAt)||void 0===i?void 0:i.call(o,t%o.length)));return JSON.parse(s)}catch(t){throw new Error(`Failed to reconstruct the response data: ${t.message}`)}return t}}et.F={G:"Invalid response structure",H:"Invalid primary component",I:"Invalid secondary component",J:"Failed to reconstruct payment session data: "};class rt{constructor(){this.services=new Map,this.liquidCommerceClientConstructor=null,this.paymentElementConstructor=null}static getInstance(){return rt.instance||(rt.instance=new rt),rt.instance}setLiquidCommerceClientConstructor(t){this.liquidCommerceClientConstructor=t}setPaymentElementConstructor(t){this.paymentElementConstructor=t}async getClient(t,e){const r=`LiquidCommerceClient_${t}_${JSON.stringify(e)}`;if(!this.services.has(r)){if(!this.liquidCommerceClientConstructor)throw new Error("LiquidCommerceClient constructor not set");const i=new this.liquidCommerceClientConstructor(t,e);await i.init(),this.services.set(r,i)}return this.services.get(r)}getPaymentElement(t){var e,r;const i=`PaymentElement_${null===(e=t.session)||void 0===e?void 0:e.key}_${null===(r=null==t?void 0:t.session)||void 0===r?void 0:r.secret}`;if(!this.services.has(i)){if(!this.paymentElementConstructor)throw new Error("PaymentElement constructor not set");const e=new this.paymentElementConstructor(t);this.services.set(i,e)}return this.services.get(i)}getOrCreateService(t,e,...r){if(!this.services.has(t)){const i="getInstance"in e?e.getInstance(...r):new e(...r);this.services.set(t,i)}return this.services.get(t)}getAuthenticatedClient(t){return this.getOrCreateService(`AuthenticatedClient_${JSON.stringify(t)}`,H,t)}getLocationHelperService(){return this.getOrCreateService("LocationHelperService",M)}getAddressService(t){return this.getOrCreateService(`AddressService_${t.getUniqueKey()}`,$,t)}getCatalogHelperService(){return this.getOrCreateService("CatalogHelperService",x,this.getLocationHelperService())}getCatalogService(t){return this.getOrCreateService(`CatalogService_${t.getUniqueKey()}`,F,t,this.getCatalogHelperService())}getCartHelperService(){return this.getOrCreateService("CartHelperService",U,this.getLocationHelperService())}getPaymentSessionHelperService(){return this.getOrCreateService("PaymentSessionHelperService",et)}getCartService(t){return this.getOrCreateService(`CartService_${t.getUniqueKey()}`,G,t,this.getCartHelperService())}getUserService(t){return this.getOrCreateService(`UserService_${t.getUniqueKey()}`,V,t,this.getPaymentSessionHelperService())}getPaymentProviderService(t){return this.getOrCreateService(`PaymentProviderService_${t.getUniqueKey()}`,j,t)}getPaymentService(t){return this.getOrCreateService(`PaymentService_${t.getUniqueKey()}`,k,this.getPaymentProviderService(t))}getCheckoutHelperService(){return this.getOrCreateService("CheckoutHelperService",_,this.getLocationHelperService())}getCheckoutService(t){return this.getOrCreateService(`CheckoutService_${t.getUniqueKey()}`,K,t,this.getCheckoutHelperService())}getWebhookService(t){return this.getOrCreateService(`WebhookService_${t.getUniqueKey()}`,Q,t)}}rt.instance=null;class it{constructor(t,e){this.address={autocomplete:async t=>(await this.ensureAuthenticated(),this.addressService.autocomplete(t,this.config.googlePlacesApiKey)),details:async t=>(await this.ensureAuthenticated(),this.addressService.details(t,this.config.googlePlacesApiKey))},this.catalog={availability:async t=>(await this.ensureAuthenticated(),this.catalogService.availability(t)),search:async t=>(await this.ensureAuthenticated(),this.catalogService.search(t)),autocomplete:async t=>(await this.ensureAuthenticated(),this.catalogService.autocomplete(t)),listProducts:async(t={})=>(await this.ensureAuthenticated(),this.catalogService.listProducts(t)),iterateProducts:(t={})=>this.iterateCatalogProducts(t),createLocationContext:async t=>(await this.ensureAuthenticated(),this.catalogService.createLocationContext(t)),compose:async t=>(await this.ensureAuthenticated(),this.catalogService.compose(t))},this.cart={get:async(t,e)=>(await this.ensureAuthenticated(),this.cartService.get(t,e)),update:async t=>(await this.ensureAuthenticated(),this.cartService.update(t))},this.user={session:async t=>(await this.ensureAuthenticated(),this.userService.createOrUpdateSession(t)),paymentSession:async t=>(await this.ensureAuthenticated(),this.userService.createPaymentSession(t)),confirmPaymentSession:async t=>(await this.ensureAuthenticated(),this.userService.finalizePaymentSession(t)),fetch:async t=>(await this.ensureAuthenticated(),this.userService.fetchUser(t)),purge:async t=>(await this.ensureAuthenticated(),this.userService.purge(t)),addAddress:async t=>(await this.ensureAuthenticated(),this.userService.addAddress(t)),updateAddress:async t=>(await this.ensureAuthenticated(),this.userService.updateAddress(t)),purgeAddress:async t=>(await this.ensureAuthenticated(),this.userService.purgeAddress(t)),addPayment:async t=>(await this.ensureAuthenticated(),this.userService.addPayment(t)),updatePayment:async t=>(await this.ensureAuthenticated(),this.userService.updatePayment(t)),purgePayment:async(t,e)=>(await this.ensureAuthenticated(),this.userService.purgePayment(t,e))},this.payment={mount:async t=>(await this.ensureAuthenticated(),this.paymentService.mount(t)),generateToken:async()=>(await this.ensureAuthenticated(),this.paymentService.generateToken()),subscribe:(t,e)=>{this.paymentService.subscribe(t,e)},unsubscribe:(t,e)=>{this.paymentService.unsubscribe(t,e)},collapse:()=>{this.paymentService.collapse()},unmount:()=>{this.paymentService.unmount()},destroy:()=>{this.paymentService.destroy()}},this.checkout={prepare:async t=>(await this.ensureAuthenticated(),this.checkoutService.prepare(t)),complete:async t=>(await this.ensureAuthenticated(),this.checkoutService.complete(t))},this.webhook={test:async t=>(await this.ensureAuthenticated(),this.webhookService.test(t))},this.config=e,this.singletonManager=rt.getInstance();const r=this.determineBaseURL(e);this.authenticatedClient=this.singletonManager.getAuthenticatedClient({apiKey:t,baseURL:r,env:e.env}),this.addressService=this.singletonManager.getAddressService(this.authenticatedClient),this.catalogService=this.singletonManager.getCatalogService(this.authenticatedClient),this.cartService=this.singletonManager.getCartService(this.authenticatedClient),this.userService=this.singletonManager.getUserService(this.authenticatedClient),this.paymentService=this.singletonManager.getPaymentService(this.authenticatedClient),this.checkoutService=this.singletonManager.getCheckoutService(this.authenticatedClient),this.webhookService=this.singletonManager.getWebhookService(this.authenticatedClient)}determineBaseURL(t){const e=t.env||exports.LIQUID_COMMERCE_ENV.STAGE;return g[e]}async init(){try{await this.authenticatedClient.authenticate()}catch(t){throw new Error("Authentication failed during initialization")}}async ensureAuthenticated(){this.authenticatedClient.isTokenExpired()&&await this.authenticatedClient.authenticate()}async auth(){try{return await this.authenticatedClient.getAuth()}catch(t){throw new Error("Authentication failed during initialization")}}async*iterateCatalogProducts(t){await this.ensureAuthenticated(),yield*this.catalogService.iterateProducts(t)}}class ot{constructor(t){this.order={fetch:async t=>(await this.ensureOrderAuthenticated(),this.orderService.fetch(t)),list:async t=>(await this.ensureOrderAuthenticated(),this.orderService.list(t))},this.config=t,this.singletonManager=q.getInstance();const e=this.determineBaseURL(t);this.orderAuthenticatedClient=this.singletonManager.getAuthenticatedClient({userID:t.userID,password:t.password,baseURL:e}),this.orderService=this.singletonManager.getOrderService(this.orderAuthenticatedClient)}determineBaseURL(t){const e=t.env||exports.LIQUID_COMMERCE_ENV.STAGE;return g[e]}async init(){try{await this.orderAuthenticatedClient.authenticate()}catch(t){throw new Error("Order Authentication failed during initialization")}}async ensureOrderAuthenticated(){this.orderAuthenticatedClient.isTokenExpired()&&await this.orderAuthenticatedClient.authenticate()}}class st{constructor(t){var e,r,i,o;if(this.provider=null,this.componentSet=null,this.uiComponent=null,this.isProviderLoading=!1,this.providerLoadPromise=null,this.allowedEvents=["ready","change","focus","blur","loaderror","loaderstart"],!(null==t?void 0:t.session.key)||!(null===(e=null==t?void 0:t.session)||void 0===e?void 0:e.secret))throw new Error("Authentication credentials are required.");this.k=t.session.key,this.s=null===(r=t.session)||void 0===r?void 0:r.secret,this.isHybrid=null!==(o=null===(i=t.session)||void 0===i?void 0:i.isHybrid)&&void 0!==o?o:null,this.paymentSessionHelperService=new et}async ensureProviderReady(){return this.provider?this.provider:(this.isProviderLoading&&this.providerLoadPromise||(this.isProviderLoading=!0,this.providerLoadPromise=D.loadStripe(this.k).then(t=>{if(this.isProviderLoading=!1,!t)throw new Error("Failed to initialize payment provider");return this.provider=t,this.provider}).catch(t=>{throw this.isProviderLoading=!1,this.providerLoadPromise=null,t})),this.providerLoadPromise)}async mount(t){var e,r;if("undefined"==typeof document)throw new Error("Payment UI requires a browser environment.");const i=document.getElementById(t.elementId);if(!i)throw new Error(`Container element "${t.elementId}" not found.`);try{const o=await this.ensureProviderReady();if(!o)throw new Error("Provider initialization failed");if(null===this.isHybrid)try{const{setupIntent:t}=await o.retrieveSetupIntent(this.s);this.isHybrid="on_session"===(null==t?void 0:t.usage)}catch(t){this.isHybrid=!0}const s=null!==(e=null==t?void 0:t.appearance)&&void 0!==e?e:{theme:"stripe"},n={clientSecret:this.s,appearance:s};this.componentSet=o.elements(n);const a={layout:(null===(r=t.elementOptions)||void 0===r?void 0:r.layout)||"tabs",...t.elementOptions||{},defaultValues:{billingDetails:{name:"Guest",...this.isHybrid?{address:{country:"US"}}:{}}},fields:{billingDetails:{address:{postalCode:"auto",country:this.isHybrid?"never":"auto"}}},terms:{applePay:"never",auBecsDebit:"never",bancontact:"never",card:"never",cashapp:"never",googlePay:"never",ideal:"never",paypal:"never",sepaDebit:"never",sofort:"never",usBankAccount:"never"}};this.uiComponent=this.componentSet.create("payment",a),this.uiComponent.mount(i)}catch(t){throw this.logger.error("UI initialization failed:",t),new Error(`Failed to initialize payment UI: ${null==t?void 0:t.message}`)}}async createConfirmationToken(t){var e,r;if(!this.provider||!this.componentSet||!this.uiComponent)return{type:"client_error",message:"Payment component not initialized. Call mount() first."};try{const{error:i}=await this.componentSet.submit();if(i)return{type:"validation_error",message:i.message||"Form validation failed",code:i.code};const o={elements:this.componentSet,params:{return_url:null!==(e=null==t?void 0:t.returnUrl)&&void 0!==e?e:window.location.href,payment_method_data:{allow_redisplay:"always",...this.isHybrid?{billing_details:{name:"Guest",address:{country:"US"}}}:{}},...this.isHybrid?{shipping:{name:"Guest",address:{country:"US",city:null,line1:null,line2:null,postal_code:null,state:null}}}:{}}},{error:s,confirmationToken:n}=await this.provider.createConfirmationToken(o);if(s)return{type:"validation_error"===s.type?"validation_error":"api_error",message:s.message||"Token generation failed",code:s.code};if(!n||!n.id)return{type:"api_error",message:"Token generation incomplete."};if(!this.isHybrid){const{error:e}=await this.provider.confirmSetup({clientSecret:this.s,confirmParams:{confirmation_token:n.id,return_url:null!==(r=null==t?void 0:t.returnUrl)&&void 0!==r?r:window.location.href},redirect:"if_required"});if(e)return{type:"validation_error"===e.type?"validation_error":"confirm_error",message:e.message||"Payment authentication failed",code:e.code}}return{token:this.paymentSessionHelperService.ocd(n.id,this.s)}}catch(t){return this.logger.error("Token generation error:",t),{type:"client_error",message:`Unexpected error: ${null==t?void 0:t.message}`}}}get logger(){return{log:(...t)=>{},error:(...t)=>{}}}subscribe(t,e){this.uiComponent?this.allowedEvents.includes(t)?this.uiComponent.on(t,e):this.logger.error(`Event "${t}" not supported. Available: ${this.allowedEvents.join(", ")}`):this.logger.error("Cannot subscribe: Component not initialized.")}unsubscribe(t,e){this.uiComponent?this.allowedEvents.includes(t)?this.uiComponent.off(t,e):this.logger.error(`Event "${t}" not supported.`):this.logger.error("Cannot unsubscribe: Component not initialized.")}unmount(){this.uiComponent&&(this.uiComponent.unmount(),this.logger.log("Component unmounted."))}destroy(){this.uiComponent&&(this.uiComponent.destroy(),this.uiComponent=null,this.componentSet=null,this.logger.log("Component destroyed."))}collapse(){this.uiComponent&&"function"==typeof this.uiComponent.collapse?this.uiComponent.collapse():this.logger.error("Cannot collapse: Component not initialized or action not supported.")}}exports.LiquidCommerce=async function(t,e){const r=rt.getInstance();return r.setLiquidCommerceClientConstructor(it),await r.getClient(t,e)},exports.LiquidCommerceOrders=async function(t){const e=q.getInstance();return e.setLiquidCommerceOrderClientConstructor(ot),await e.getClient(t)},exports.LiquidCommercePaymentElement=function(t){const e=rt.getInstance();return"function"!=typeof e.setPaymentElementConstructor||"function"!=typeof e.getPaymentElement?(e.t||(e.t=new st(t)),e.t):(e.setPaymentElementConstructor(st),e.getPaymentElement(t))};
1
+ "use strict";var LIQUID_COMMERCE_ENV,t,e,r,i,o,s,n,a,E,l,d,I,h,c,u,R,N,p,T,A,v,O,m,S,y,w,f,C,D,W,P,g,L=require("@stripe/stripe-js");exports.LIQUID_COMMERCE_ENV=void 0,(LIQUID_COMMERCE_ENV=exports.LIQUID_COMMERCE_ENV||(exports.LIQUID_COMMERCE_ENV={})).LOC="loc",LIQUID_COMMERCE_ENV.STAGE="stage",LIQUID_COMMERCE_ENV.PROD="prod",LIQUID_COMMERCE_ENV.DEV="dev",LIQUID_COMMERCE_ENV.BETA="beta",exports.ENUM_MODALITIES=void 0,(t=exports.ENUM_MODALITIES||(exports.ENUM_MODALITIES={})).ON_DEMAND="onDemand",t.SHIPPING="shipping",t.BOPIS="bopis",exports.DAYS_OF_WEEK=void 0,(e=exports.DAYS_OF_WEEK||(exports.DAYS_OF_WEEK={})).MONDAY="monday",e.TUESDAY="tuesday",e.WEDNESDAY="wednesday",e.THURSDAY="thursday",e.FRIDAY="friday",e.SATURDAY="saturday",e.SUNDAY="sunday",exports.STATES_CODE=void 0,(r=exports.STATES_CODE||(exports.STATES_CODE={})).AL="AL",r.AK="AK",r.AR="AR",r.AZ="AZ",r.CA="CA",r.CO="CO",r.CT="CT",r.DE="DE",r.DC="DC",r.FL="FL",r.GA="GA",r.HI="HI",r.ID="ID",r.IL="IL",r.IN="IN",r.IA="IA",r.KS="KS",r.KY="KY",r.LA="LA",r.ME="ME",r.MD="MD",r.MA="MA",r.MI="MI",r.MN="MN",r.MS="MS",r.MO="MO",r.MT="MT",r.NE="NE",r.NV="NV",r.NH="NH",r.NJ="NJ",r.NM="NM",r.NY="NY",r.NC="NC",r.ND="ND",r.OH="OH",r.OK="OK",r.OR="OR",r.PA="PA",r.RI="RI",r.SC="SC",r.SD="SD",r.TN="TN",r.TX="TX",r.UT="UT",r.VT="VT",r.VA="VA",r.WA="WA",r.WV="WV",r.WI="WI",r.WY="WY",exports.STATES_NAME=void 0,(i=exports.STATES_NAME||(exports.STATES_NAME={})).ALABAMA="AL",i.ALASKA="AK",i.ARKANSAS="AR",i.ARIZONA="AZ",i.CALIFORNIA="CA",i.COLORADO="CO",i.CONNECTICUT="CT",i.DELAWARE="DE",i.DISTRICT_OF_COLUMBIA="DC",i.FLORIDA="FL",i.GEORGIA="GA",i.HAWAII="HI",i.IDAHO="ID",i.ILLINOIS="IL",i.INDIANA="IN",i.IOWA="IA",i.KANSAS="KS",i.KENTUCKY="KY",i.LOUISIANA="LA",i.MAINE="ME",i.MARYLAND="MD",i.MASSACHUSETTS="MA",i.MICHIGAN="MI",i.MINNESOTA="MN",i.MISSISSIPPI="MS",i.MISSOURI="MO",i.MONTANA="MT",i.NEBRASKA="NE",i.NEVADA="NV",i.NEW_HAMPSHIRE="NH",i.NEW_JERSEY="NJ",i.NEW_MEXICO="NM",i.NEW_YORK="NY",i.NORTH_CAROLINA="NC",i.NORTH_DAKOTA="ND",i.OHIO="OH",i.OKLAHOMA="OK",i.OREGON="OR",i.PENNSYLVANIA="PA",i.RHODE_ISLAND="RI",i.SOUTH_CAROLINA="SC",i.SOUTH_DAKOTA="SD",i.TENNESSEE="TN",i.TEXAS="TX",i.UTAH="UT",i.VERMONT="VT",i.VIRGINIA="VA",i.WASHINGTON="WA",i.WEST_VIRGINIA="WV",i.WISCONSIN="WI",i.WYOMING="WY",exports.ENUM_ENGRAVING=void 0,(o=exports.ENUM_ENGRAVING||(exports.ENUM_ENGRAVING={})).YES="YES",o.NO="NO",exports.ENUM_BINARY_FILTER=void 0,(s=exports.ENUM_BINARY_FILTER||(exports.ENUM_BINARY_FILTER={})).YES="YES",s.NO="NO",exports.ENUM_FILTER_KEYS=void 0,(n=exports.ENUM_FILTER_KEYS||(exports.ENUM_FILTER_KEYS={})).BRANDS="brands",n.FLAVOR="flavor",n.FULFILLMENT="fulfillment",n.TAGS="tags",n.REGION="region",n.VARIETY="variety",n.ENGRAVING="engraving",n.PRICE="price",n.PRESALE="presale",n.AVAILABILITY="availability",n.CATEGORIES="categories",n.SIZES="sizes",n.COLORS="colors",n.APPELLATION="appellation",n.COUNTRY="country",n.VINTAGE="vintage",n.MATERIALS="materials",n.COLLECTION_TAGS="collectionTags",exports.ENUM_NAVIGATION_ORDER_DIRECTION_TYPE=void 0,(a=exports.ENUM_NAVIGATION_ORDER_DIRECTION_TYPE||(exports.ENUM_NAVIGATION_ORDER_DIRECTION_TYPE={})).ASC="asc",a.DESC="desc",exports.ENUM_ORDER_BY=void 0,(exports.ENUM_ORDER_BY||(exports.ENUM_ORDER_BY={})).PRICE="price",exports.ENUM_AVAILABILITY_VALUE=void 0,(E=exports.ENUM_AVAILABILITY_VALUE||(exports.ENUM_AVAILABILITY_VALUE={})).UNSPECIFIED="AVAILABILITY_UNSPECIFIED",E.IN_STOCK="IN_STOCK",E.OUT_OF_STOCK="OUT_OF_STOCK",E.PREORDER="PREORDER",E.BACKORDER="BACKORDER",exports.CART_PARAM_ERROR_ENUM=void 0,(l=exports.CART_PARAM_ERROR_ENUM||(exports.CART_PARAM_ERROR_ENUM={})).INVALID_ITEMS_TYPE="Items must be a non-empty array",l.INVALID_ITEMS_MAX="You can only send up to 25 items at a time!",l.INVALID_PART_NUMBER="The partnerNumber provided is invalid",l.INVALID_FULFILLMENT_ID="The fulfillmentId provided is invalid",exports.CART_EVENT_ENUM=void 0,(d=exports.CART_EVENT_ENUM||(exports.CART_EVENT_ENUM={})).OOS="OutOfStock",d.ITEMS_NOT_ADDED="ItemsNotAdded",d.ITEMS_REQUESTED_NOT_ADDED="ItemsRequestedNotAdded",d.ITEM_NOT_ENGRAVED="ItemEngravingError",d.ITEM_ENGRAVING_FONT_REPLACED="ItemEngravingFontReplaced",d.ADDRESS_CHANGE="AddressChange",d.LOCATION_AVAILABILITY="LocationAvailability",d.PARTNER_PRODUCT_CONFIGS="PartnerProductConfigs",d.REMOVED_EXISTING_ITEMS="RemovedExistingCartItems",d.RETAILER_MIN="RetailerMinNotMet",d.NO_ITEMS_IN_CART="NoItemsInCart",d.INVALID_ID="InvalidId",d.NO_ID="NoId",d.CART_CHECKOUT_PROCESSED="CartCheckoutProcessed",d.NEW_CART="NewCart",d.DEFAULT="CartError",d.ITEM_QTY_CHANGE="ItemQuantityChange",d.ITEM_ID_NOT_FOUND="ItemIdNotFound",d.ITEMS_REMOVED="ItemsRemoved",d.RETAILER_FULFILLMENT_INVALID="RetailerFulfillmentInvalid",d.RETAILER_ONDEMAND_HOURS_NOT_AVAILABLE="RetailerOnDemandHoursNotAvailable",d.MAX_QUANTITY_PER_ORDER_EXCEEDED="MaxQuantityPerOrderExceeded",d.COUPON_PROCESSING_ERROR="CouponProcessingError",d.COUPON_NOT_FOUND="CouponNotFound",d.COUPON_EXPIRED="CouponExpired",d.NO_APPLICABLE_DISCOUNT="NoApplicableDiscount",d.COUPON_NOT_STARTED="CouponNotStarted",d.MINIMUM_ORDER_VALUE_NOT_MET="MinimumOrderValueNotMet",d.MINIMUM_ORDER_UNITS_NOT_MET="MinimumOrderUnitsNotMet",d.MINIMUM_DISTINCT_ITEMS_NOT_MET="MinimumDistinctItemsNotMet",d.QUOTA_EXCEEDED="QuotaExceeded",d.USER_LIMIT_EXCEEDED="UserLimitExceeded",d.NOT_FIRST_PURCHASE="NotFirstPurchase",d.INVALID_COUPON="InvalidCoupon",d.INVALID_MEMBERSHIP="InvalidMembership",d.INVALID_DOMAIN="InvalidDomain",d.INVALID_REQUIREMENTS="InvalidRequirements",d.INVALID_ORGANIZATION="InvalidOrganization",d.PRODUCT_NOT_ELIGIBLE="ProductNotEligible",d.NOT_ENOUGH_PREVIOUS_ORDERS="NotEnoughPreviousOrders",d.PRESALE_ITEMS_NOT_ALLOWED="PresaleItemsNotAllowed",d.PRESALE_LIMIT_EXCEEDED="PresaleLimitExceeded",d.PRESALE_NOT_STARTED="PresaleNotStarted",d.PRESALE_EXPIRED="PresaleExpired",d.PRESALE_MIXED_CART="PresaleMixedCart",d.RETAILER_DOES_NOT_ALLOW_PROMOS="RetailerDoesNotAllowPromos",d.RETAILERS_DO_NOT_ALLOW_PROMOS="RetailersDoNotAllowPromos",d.BOPIS_CONTACT_REQUIRED="BopisContactRequired",d.BOPIS_PARENT_FULFILLMENT_REQUIRED="BopisParentFulfillmentRequired",d.BOPIS_INVALID_PARENT_FULFILLMENT="BopisInvalidParentFulfillment",d.BOPIS_PARENT_RETAILER_MISMATCH="BopisParentRetailerMismatch",d.BOPIS_NOT_APPLICABLE="BopisNotApplicable",d.BOPIS_NOT_ALLOWED="BopisNotAllowed",d.BOPIS_PRODUCT_NOT_OPTED_IN="BopisProductNotOptedIn",d.BOPIS_NOT_AVAILABLE="BopisNotAvailable",d.BOPIS_SCHEDULE_IN_PAST="BopisScheduleInPast",d.BOPIS_SCHEDULE_OUTSIDE_HOURS="BopisScheduleOutsideHours",d.BOPIS_FALLBACK="BopisFallback",exports.ENUM_ADDRESS_TYPE=void 0,(I=exports.ENUM_ADDRESS_TYPE||(exports.ENUM_ADDRESS_TYPE={})).SHIPPING="shipping",I.BILLING="billing",exports.ENUM_CHECKOUT_STATUS_CODE_ERROR=void 0,(h=exports.ENUM_CHECKOUT_STATUS_CODE_ERROR||(exports.ENUM_CHECKOUT_STATUS_CODE_ERROR={}))[h.REQUEST_DEFAULT_ERROR=5480]="REQUEST_DEFAULT_ERROR",h[h.REQUEST_LOCATION_OOS_ERROR=5481]="REQUEST_LOCATION_OOS_ERROR",h[h.REQUEST_LOCATION_MISMATCH_ERROR=5482]="REQUEST_LOCATION_MISMATCH_ERROR",h[h.REQUEST_BIRTHDATE_ERROR=5483]="REQUEST_BIRTHDATE_ERROR",h[h.REQUEST_CART_NOT_AVAILABLE_ERROR=5484]="REQUEST_CART_NOT_AVAILABLE_ERROR",h[h.REQUEST_CART_ID_ERROR=5485]="REQUEST_CART_ID_ERROR",h[h.REQUEST_CART_ITEM_ERROR=5486]="REQUEST_CART_ITEM_ERROR",h[h.REQUEST_VALIDATION_ERROR=5487]="REQUEST_VALIDATION_ERROR",h[h.REQUEST_TAX_ERROR=5488]="REQUEST_TAX_ERROR",h[h.REQUEST_COMPLETE_TOKEN=5489]="REQUEST_COMPLETE_TOKEN",h[h.REQUEST_DEFAULT_COMPLETE_ERROR=5490]="REQUEST_DEFAULT_COMPLETE_ERROR",h[h.REQUEST_CHECKOUT_COMPLETE_UPDATE_ERROR=5491]="REQUEST_CHECKOUT_COMPLETE_UPDATE_ERROR",h[h.REQUEST_CHECKOUT_COMPLETE_SAVE_ERROR=5492]="REQUEST_CHECKOUT_COMPLETE_SAVE_ERROR",h[h.REQUEST_CHECKOUT_HAS_COMPLETE_ERROR=5493]="REQUEST_CHECKOUT_HAS_COMPLETE_ERROR",h[h.REQUEST_NO_CART_ITEM_ERROR=5494]="REQUEST_NO_CART_ITEM_ERROR",h[h.REQUEST_NO_CUSTOMER_FOUND_ERROR=5495]="REQUEST_NO_CUSTOMER_FOUND_ERROR",h[h.REQUEST_PAYMENT_ATTACHED_ERROR=5496]="REQUEST_PAYMENT_ATTACHED_ERROR",h[h.REQUEST_SHIPPING_ADDRESS_ERROR=5497]="REQUEST_SHIPPING_ADDRESS_ERROR",h[h.REQUEST_BILLING_ADDRESS_ERROR=5498]="REQUEST_BILLING_ADDRESS_ERROR",h[h.REQUEST_PAYMENT_NOT_FOUND_ERROR=5499]="REQUEST_PAYMENT_NOT_FOUND_ERROR",h[h.REQUEST_CART_UPDATED_ERROR=5501]="REQUEST_CART_UPDATED_ERROR",h[h.REQUEST_ADDRESS_DEFAULT_ERROR=5502]="REQUEST_ADDRESS_DEFAULT_ERROR",h[h.REQUEST_TIPS_ERROR=5503]="REQUEST_TIPS_ERROR",h[h.REQUEST_COMPLETE_CUSTOMER_MISSING_FIELDS=5504]="REQUEST_COMPLETE_CUSTOMER_MISSING_FIELDS",h[h.REQUEST_RETAILER_HOURS_ERROR=5505]="REQUEST_RETAILER_HOURS_ERROR",h[h.REQUEST_ITEM_QUANTITY_CHANGE_ERROR=5506]="REQUEST_ITEM_QUANTITY_CHANGE_ERROR",h[h.REQUEST_MAX_QUANTITY_PER_ORDER_ERROR=5507]="REQUEST_MAX_QUANTITY_PER_ORDER_ERROR",h[h.REQUEST_PRESALE_NOT_STARTED_ERROR=5508]="REQUEST_PRESALE_NOT_STARTED_ERROR",h[h.REQUEST_CART_MIN_RETAILER_NOT_MET_ERROR=5509]="REQUEST_CART_MIN_RETAILER_NOT_MET_ERROR",h[h.REQUEST_CHECKOUT_PROCESSING_LOCK_NOT_ACQUIRED_ERROR=5510]="REQUEST_CHECKOUT_PROCESSING_LOCK_NOT_ACQUIRED_ERROR",h[h.REQUEST_BOPIS_PRODUCT_NOT_OPTED_IN_ERROR=5511]="REQUEST_BOPIS_PRODUCT_NOT_OPTED_IN_ERROR",h[h.REQUEST_PAYMENT_PLATFORM_MISMATCH_ERROR=5512]="REQUEST_PAYMENT_PLATFORM_MISMATCH_ERROR",h[h.REQUEST_PAYMENT_VERIFICATION_ERROR=5513]="REQUEST_PAYMENT_VERIFICATION_ERROR",exports.ENUM_CHECKOUT_STATUS_CODE_MESSAGE=void 0,(c=exports.ENUM_CHECKOUT_STATUS_CODE_MESSAGE||(exports.ENUM_CHECKOUT_STATUS_CODE_MESSAGE={})).REQUEST_DEFAULT_ERROR="There's been an error with your checkout request.",c.REQUEST_LOCATION_OOS_ERROR="The requested items are out of stock at this location.",c.REQUEST_LOCATION_MISMATCH_ERROR="The selected location doesn't match your cart items.",c.REQUEST_BIRTHDATE_ERROR="Please verify your birthdate and try again.",c.REQUEST_CART_NOT_AVAILABLE_ERROR="This cart is no longer available.",c.REQUEST_CART_ID_ERROR="The cartId requested is invalid, check and try again.",c.REQUEST_CART_ITEM_ERROR="There's an issue with one or more items in your cart.",c.REQUEST_VALIDATION_ERROR="There's been an error with your request parameters, check and try again.",c.REQUEST_TAX_ERROR="There was an error calculating tax for your order.",c.REQUEST_COMPLETE_TOKEN="The checkout token provided is invalid, check and try again.",c.REQUEST_DEFAULT_COMPLETE_ERROR="There was an error completing your checkout, please try again later.",c.REQUEST_CHECKOUT_COMPLETE_UPDATE_ERROR="Unable to update your checkout status.",c.REQUEST_CHECKOUT_COMPLETE_SAVE_ERROR="Unable to save your completed checkout.",c.REQUEST_CHECKOUT_HAS_COMPLETE_ERROR="This checkout has already been processed, create a new cart to process a new checkout.",c.REQUEST_NO_CART_ITEM_ERROR="Item(s) in your cart are no longer available.",c.REQUEST_NO_CUSTOMER_FOUND_ERROR="The customer account was not found.",c.REQUEST_PAYMENT_ATTACHED_ERROR="The payment attached to the checkout is not a valid payment method for this customer.",c.REQUEST_SHIPPING_ADDRESS_ERROR="The address in your cart has changed, check and try again.",c.REQUEST_BILLING_ADDRESS_ERROR="The billing address in your checkout is not valid, check and try again.",c.REQUEST_PAYMENT_NOT_FOUND_ERROR="The payment method provided was not found.",c.REQUEST_CART_UPDATED_ERROR="The cart requested was updated during your checkout.",c.REQUEST_ADDRESS_DEFAULT_ERROR="There's been an error with your address configurations in cart and/or billing address, check and try again.",c.REQUEST_TIPS_ERROR="There's been an error applying your tips to the checkout.",c.REQUEST_COMPLETE_CUSTOMER_MISSING_FIELDS="Customer profile information is incomplete. Please provide all required details.",c.REQUEST_RETAILER_HOURS_ERROR="The retailer is currently closed or on-demand hours are not available.",c.REQUEST_ITEM_QUANTITY_CHANGE_ERROR="Some items in your cart exceed available stock quantities. Please adjust your cart and try again.",c.REQUEST_MAX_QUANTITY_PER_ORDER_ERROR="You have exceeded the maximum quantity allowed per order for one or more items in your cart.",c.REQUEST_PRESALE_NOT_STARTED_ERROR="The presale for this item has not started yet. Please check back later.",c.REQUEST_CART_MIN_RETAILER_NOT_MET_ERROR="Some items in your cart do not meet the minimum retailer requirements per order quantity. Please adjust your cart and try again.",c.REQUEST_CHECKOUT_PROCESSING_LOCK_NOT_ACQUIRED_ERROR="This checkout is currently being processed, please try again later.",c.REQUEST_BOPIS_PRODUCT_NOT_OPTED_IN_ERROR="One or more items in your cart are no longer eligible for in-store pickup (BOPIS) and were removed. Please review your cart and try again.",c.REQUEST_PAYMENT_PLATFORM_MISMATCH_ERROR="This payment method is not available for this checkout. Please re-enter your card details.",c.REQUEST_PAYMENT_VERIFICATION_ERROR="We couldn't verify your payment information. Please check your card details and billing address, then try again.",exports.ENUM_PAYMENT_STATUS_CODE_ERROR=void 0,(u=exports.ENUM_PAYMENT_STATUS_CODE_ERROR||(exports.ENUM_PAYMENT_STATUS_CODE_ERROR={}))[u.PAYMENT_METHOD_INVALID=8100]="PAYMENT_METHOD_INVALID",u[u.PAYMENT_METHOD_NOT_ON_FILE=8101]="PAYMENT_METHOD_NOT_ON_FILE",u[u.PAYMENT_METHOD_EXPIRED=8102]="PAYMENT_METHOD_EXPIRED",u[u.PAYMENT_DECLINED=8103]="PAYMENT_DECLINED",u[u.PAYMENT_AUTHENTICATION_REQUIRED=8104]="PAYMENT_AUTHENTICATION_REQUIRED",u[u.PAYMENT_CARD_ERROR=8105]="PAYMENT_CARD_ERROR",u[u.PAYMENT_INSUFFICIENT_FUNDS=8106]="PAYMENT_INSUFFICIENT_FUNDS",u[u.PAYMENT_CURRENCY_MISMATCH=8107]="PAYMENT_CURRENCY_MISMATCH",u[u.PAYMENT_AMOUNT_TOO_LARGE=8108]="PAYMENT_AMOUNT_TOO_LARGE",u[u.PAYMENT_AMOUNT_TOO_SMALL=8109]="PAYMENT_AMOUNT_TOO_SMALL",u[u.PAYMENT_INVALID_CVC=8110]="PAYMENT_INVALID_CVC",u[u.PAYMENT_INVALID_EXPIRY=8111]="PAYMENT_INVALID_EXPIRY",u[u.PAYMENT_CARD_DECLINED=8112]="PAYMENT_CARD_DECLINED",u[u.PAYMENT_CARD_RESTRICTED=8113]="PAYMENT_CARD_RESTRICTED",u[u.PAYMENT_PROCESSING_ERROR=8114]="PAYMENT_PROCESSING_ERROR",u[u.PAYMENT_CUSTOMER_MAX_PAYMENT_ATTEMPTS=8115]="PAYMENT_CUSTOMER_MAX_PAYMENT_ATTEMPTS",u[u.PAYMENT_INVALID_ACCOUNT=8116]="PAYMENT_INVALID_ACCOUNT",u[u.PAYMENT_RISK_LEVEL_HIGH=8117]="PAYMENT_RISK_LEVEL_HIGH",u[u.PAYMENT_STRIPE_ACCOUNT_ERROR=8118]="PAYMENT_STRIPE_ACCOUNT_ERROR",u[u.PAYMENT_STRIPE_API_ERROR=8119]="PAYMENT_STRIPE_API_ERROR",u[u.PAYMENT_STRIPE_RATE_LIMIT=8120]="PAYMENT_STRIPE_RATE_LIMIT",u[u.PAYMENT_METHOD_UNSUPPORTED=8121]="PAYMENT_METHOD_UNSUPPORTED",u[u.PAYMENT_METHOD_NOT_FOUND=40003]="PAYMENT_METHOD_NOT_FOUND",exports.ENUM_PAYMENT_STATUS_CODE_MESSAGE=void 0,(R=exports.ENUM_PAYMENT_STATUS_CODE_MESSAGE||(exports.ENUM_PAYMENT_STATUS_CODE_MESSAGE={})).PAYMENT_METHOD_INVALID="Invalid payment method provided",R.PAYMENT_METHOD_NOT_ON_FILE="Payment method not found",R.PAYMENT_METHOD_EXPIRED="Payment method has expired",R.PAYMENT_DECLINED="Payment was declined",R.PAYMENT_AUTHENTICATION_REQUIRED="Payment requires authentication",R.PAYMENT_CARD_ERROR="There was an error processing the card",R.PAYMENT_INSUFFICIENT_FUNDS="Insufficient funds in the account",R.PAYMENT_CURRENCY_MISMATCH="Currency mismatch in the payment",R.PAYMENT_AMOUNT_TOO_LARGE="Payment amount exceeds the maximum allowed",R.PAYMENT_AMOUNT_TOO_SMALL="Payment amount is below the minimum allowed",R.PAYMENT_INVALID_CVC="Invalid card CVC provided",R.PAYMENT_INVALID_EXPIRY="Invalid card expiry date",R.PAYMENT_CARD_DECLINED="The card was declined",R.PAYMENT_CARD_RESTRICTED="The card has restrictions preventing this payment",R.PAYMENT_PROCESSING_ERROR="An error occurred while processing the payment",R.PAYMENT_CUSTOMER_MAX_PAYMENT_ATTEMPTS="Maximum payment attempts reached for this customer",R.PAYMENT_INVALID_ACCOUNT="The account provided is invalid",R.PAYMENT_RISK_LEVEL_HIGH="The payment was flagged as high risk",R.PAYMENT_STRIPE_ACCOUNT_ERROR="There was an error with the Stripe account",R.PAYMENT_STRIPE_API_ERROR="An error occurred with the Stripe API",R.PAYMENT_STRIPE_RATE_LIMIT="Stripe rate limit exceeded",R.PAYMENT_METHOD_UNSUPPORTED="The payment method is not supported for this transaction",R.PAYMENT_METHOD_NOT_FOUND="Payment method not found",exports.ENUM_DISCOUNT_STATUS_CODE_ERROR=void 0,(N=exports.ENUM_DISCOUNT_STATUS_CODE_ERROR||(exports.ENUM_DISCOUNT_STATUS_CODE_ERROR={}))[N.REQUEST_COUPON_REJECTED_AT_COMPLETE_ERROR=5600]="REQUEST_COUPON_REJECTED_AT_COMPLETE_ERROR",exports.CHECKOUT_EVENT_ENUM=void 0,(p=exports.CHECKOUT_EVENT_ENUM||(exports.CHECKOUT_EVENT_ENUM={})).ERROR_PROCESSING_GIFT_CARDS="ErrorProcessingGiftCards",p.INVALID_GIFT_CARD_CODE="InvalidGiftCardCodes",p.INVALID_GIFT_CARD_PARTNER="InvalidGiftCardPartner",p.INACTIVE_GIFT_CARD="InactiveGiftCard",p.GIFT_CARD_ALREADY_IN_USE="GiftCardAlreadyInUse",p.GIFT_CARD_EXPIRED="GiftCardExpired",p.GIFT_CARD_BALANCE_DEPLETED="GiftCardBalanceDepleted",p.RETAILER_ONDEMAND_HOURS_NOT_AVAILABLE="RetailerOnDemandHoursNotAvailable",p.ITEM_QTY_CHANGE="ItemQuantityChange",p.MAX_QUANTITY_PER_ORDER_EXCEEDED="MaxQuantityPerOrderExceeded",p.COUPON_PROCESSING_ERROR="CouponProcessingError",p.COUPON_NOT_FOUND="CouponNotFound",p.COUPON_EXPIRED="CouponExpired",p.NO_APPLICABLE_DISCOUNT="NoApplicableDiscount",p.COUPON_NOT_STARTED="CouponNotStarted",p.MINIMUM_ORDER_VALUE_NOT_MET="MinimumOrderValueNotMet",p.MINIMUM_ORDER_UNITS_NOT_MET="MinimumOrderUnitsNotMet",p.MINIMUM_DISTINCT_ITEMS_NOT_MET="MinimumDistinctItemsNotMet",p.QUOTA_EXCEEDED="QuotaExceeded",p.USER_LIMIT_EXCEEDED="UserLimitExceeded",p.NOT_FIRST_PURCHASE="NotFirstPurchase",p.INVALID_COUPON="InvalidCoupon",p.INVALID_MEMBERSHIP="InvalidMembership",p.INVALID_DOMAIN="InvalidDomain",p.INVALID_REQUIREMENTS="InvalidRequirements",p.INVALID_ORGANIZATION="InvalidOrganization",p.PRESALE_ITEMS_NOT_ALLOWED="PresaleItemsNotAllowed",p.PRODUCT_NOT_ELIGIBLE="ProductNotEligible",p.NOT_ENOUGH_PREVIOUS_ORDERS="NotEnoughPreviousOrders",p.RETAILER_DOES_NOT_ALLOW_PROMOS="RetailerDoesNotAllowPromos",p.RETAILERS_DO_NOT_ALLOW_PROMOS="RetailersDoNotAllowPromos",p.RETAILER_DOES_NOT_ALLOW_GIFT_CARDS="RetailerDoesNotAllowGiftCards",p.RETAILERS_DO_NOT_ALLOW_GIFT_CARDS="RetailersDoNotAllowGiftCards",exports.ENUM_ORDER_STATUS=void 0,(T=exports.ENUM_ORDER_STATUS||(exports.ENUM_ORDER_STATUS={})).CREATED="created",T.PROCESSING="processing",T.IN_TRANSIT="inTransit",T.CANCELED="canceled",T.DELIVERED="delivered",T.TEST="test",exports.ENUM_ORDER_SYSTEM=void 0,(A=exports.ENUM_ORDER_SYSTEM||(exports.ENUM_ORDER_SYSTEM={})).LIQUIDCOMMERCE="LiquidCommerce OMS",A.RESERVEBAR="ReserveBar OMS",exports.ENUM_ORDER_PACKAGE_STATUS=void 0,(v=exports.ENUM_ORDER_PACKAGE_STATUS||(exports.ENUM_ORDER_PACKAGE_STATUS={})).PENDING="pending",v.SHIPPED="shipped",v.DELIVERED="delivered",v.CANCELED="canceled",v.RETURNED="returned",v.EXCEPTION="exception",exports.ENUM_ORDER_FULFILLMENT_TYPE=void 0,(O=exports.ENUM_ORDER_FULFILLMENT_TYPE||(exports.ENUM_ORDER_FULFILLMENT_TYPE={})).SHIPPING="shipping",O.ON_DEMAND="onDemand",O.DIGITAL="digital",O.BOPIS="bopis",exports.ENUM_CUSTOMER_PLACEMENT=void 0,(m=exports.ENUM_CUSTOMER_PLACEMENT||(exports.ENUM_CUSTOMER_PLACEMENT={})).STANDARD="standard",m.PRE_SALE="pre_sale",m.BACK_ORDER="back_order",exports.SHIPPING_CATEGORY_TYPE=void 0,(S=exports.SHIPPING_CATEGORY_TYPE||(exports.SHIPPING_CATEGORY_TYPE={})).SPIRITS="SPIRITS",S.WINE="WINE",S.BEER="BEER",S.NON_ALCOHOLIC="NON ALCOHOLIC",S.MISCELLANEOUS="MISCELLANEOUS",S.MERCHANDISE="MERCHANDISE",S.OTHER="OTHER",exports.ENUM_BEER=void 0,(y=exports.ENUM_BEER||(exports.ENUM_BEER={})).ALE="BEER > ALE",y.LAGER="BEER > LAGER",y.BASE="BEER",y.NON_ALCOHOLIC="BEER > NON-ALCOHOLIC",y.OTHER_BEER="BEER > OTHER",y.OTHER_BEER_SOUR_BEER="BEER > SOUR BEER",y.OTHER_BEER_FLAVORED_BEER="BEER > FLAVORED BEER",y.OTHER_BEER_FRUIT_BEER="BEER > FRUIT BEER",exports.ENUM_FOOD=void 0,(w=exports.ENUM_FOOD||(exports.ENUM_FOOD={})).BASE="FOOD",w.PANTRY_OTHER="FOOD > PANTRY > OTHER",w.CANDY="FOOD > CANDY",w.CANDY_OTHER="FOOD > CANDY > OTHER",w.CBD="FOOD > CBD",w.CBD_OTHER="FOOD > CBD > OTHER",w.CHEESE="FOOD > CHEESE",w.CHEESE_OTHER="FOOD > CHEESE > OTHER",w.HOUSEHOLD="FOOD > HOUSEHOLD",w.HOUSEHOLD_SNACKS="FOOD > HOUSEHOLD > SNACKS",w.HOUSEHOLD_OTHER="FOOD > HOUSEHOLD > OTHER",w.PANTRY="FOOD > PANTRY",w.FRUIT="FOOD > FRUIT",w.OTHER="FOOD > OTHER",w.ICE="FOOD > ICE",w.ICE_CREAM="FOOD > ICE CREAM",w.PARTY_SUPPLIES="FOOD > PARTY SUPPLIES",w.PARTY_SUPPLIES_OTHER="FOOD > PARTY SUPPLIES > OTHER",w.SPIRITS_BASED="FOOD > SPIRITS BASED",w.GARNISHES="FOOD > GARNISHES",exports.ENUM_MERCHANDISE=void 0,(f=exports.ENUM_MERCHANDISE||(exports.ENUM_MERCHANDISE={})).BASE="MERCHANDISE",f.GLASSWARE="MERCHANDISE > GLASSWARE",f.GLASSWARE_OTHER="MERCHANDISE > GLASSWARE > OTHER",f.HUMIDOR="MERCHANDISE > HUMIDOR",f.ACCESSORY="MERCHANDISE > ACCESSORY",f.ACCESSORY_OTHER="MERCHANDISE > ACCESSORY > OTHER",f.GIFT_SET="MERCHANDISE > GIFT SET",f.GIFT_SET_GIFT_BAG="MERCHANDISE > GIFT SET > GIFT BAG",f.GIFT_SET_GIFT_CARD="MERCHANDISE > GIFT SET > GIFT CARD",f.BAR_TOOLS="MERCHANDISE > BAR TOOLS",f.BAR_TOOLS_ICE_BUCKET="MERCHANDISE > BAR TOOLS > ICE BUCKET",f.BAR_TOOLS_OTHER="MERCHANDISE > BAR TOOLS > OTHER",exports.ENUM_MISCELLANEOUS=void 0,(C=exports.ENUM_MISCELLANEOUS||(exports.ENUM_MISCELLANEOUS={})).BASE="MISCELLANEOUS",C.GIFT_CARD="MISCELLANEOUS > GIFT CARDS",C.PROMOTIONAL="MISCELLANEOUS > PROMOTIONAL",C.MEMBERSHIP="MISCELLANEOUS > MEMBERSHIP",exports.ENUM_NON_ALCOHOLIC=void 0,(D=exports.ENUM_NON_ALCOHOLIC||(exports.ENUM_NON_ALCOHOLIC={})).BASE="NON ALCOHOLIC",D.BITTERS="NON ALCOHOLIC > BITTERS",D.COCKTAIL_MIX="NON ALCOHOLIC > COCKTAIL MIX",D.COFFEE="NON ALCOHOLIC > COFFEE",D.ENERGY_DRINKS="NON ALCOHOLIC > ENERGY DRINKS",D.JUICE="NON ALCOHOLIC > JUICE",D.SODA="NON ALCOHOLIC > SODA",D.SPECIALTY_ITEM="NON ALCOHOLIC > SPECIALTY ITEM",D.SPECIALTY_ITEM_OTHER="NON ALCOHOLIC > SPECIALTY ITEM > OTHER",D.SPIRITS="NON ALCOHOLIC > SPIRITS",D.TEA="NON ALCOHOLIC > TEA",D.WATER="NON ALCOHOLIC > WATER",D.WINE="NON ALCOHOLIC > WINE",D.SPORTS_DRINKS="NON ALCOHOLIC > SPORTS DRINKS",D.SLURPEES="NON ALCOHOLIC > SLURPEES",D.GINGER_BEER="NON ALCOHOLIC > GINGER BEER",D.DAIRY="NON ALCOHOLIC > DAIRY",D.DAIRY_OTHER="NON ALCOHOLIC > DAIRY > OTHER",D.OTHER="NON ALCOHOLIC > OTHER",exports.ENUM_READY_TO_DRINK=void 0,(W=exports.ENUM_READY_TO_DRINK||(exports.ENUM_READY_TO_DRINK={})).BASE="READY TO DRINK",W.HARD_CIDER="READY TO DRINK > HARD CIDER",W.HARD_CIDER_PERRY_PEAR_CIDER="READY TO DRINK > HARD CIDER > PERRY (PEAR CIDER)",W.HARD_CIDER_APPLE_CIDER="READY TO DRINK > HARD CIDER > APPLE CIDER",W.HARD_CIDER_OTHER_FRUIT_CIDER="READY TO DRINK > HARD CIDER > FRUIT CIDER",W.HARD_TEA="READY TO DRINK > HARD TEA",W.HARD_SELTZER="READY TO DRINK > HARD SELTZER",W.MALT_BASED="READY TO DRINK > MALT BASED",W.SPIRITS_BASED_RTDS="READY TO DRINK > SPIRITS-BASED RTDS",W.SPIRITS_BASED_RTDS_AGAVE_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > AGAVE COCKTAILS",W.SPIRITS_BASED_RTDS_GIN_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > GIN COCKTAILS",W.SPIRITS_BASED_RTDS_RUM_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > RUM COCKTAILS",W.SPIRITS_BASED_RTDS_TEQUILA_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > TEQUILA COCKTAILS",W.SPIRITS_BASED_RTDS_VODKA_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > VODKA COCKTAILS",W.SPIRITS_BASED_RTDS_WHISKEY_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > WHISKEY COCKTAILS",W.SPIRITS_BASED_RTDS_OTHER="READY TO DRINK > SPIRITS-BASED RTDS > OTHER",W.SPIRITS_BASED_RTDS_FROZEN_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > FROZEN COCKTAILS",W.SPIRITS_BASED_RTDS_APERITIF_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > APERITIF COCKTAILS",W.SPIRITS_BASED_RTDS_DESSERT_COFFEE_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > DESSERT & COFFEE COCKTAILS",W.SPIRITS_BASED_RTDS_TEA_COCKTAILS="READY TO DRINK > SPIRITS-BASED RTDS > TEA COCKTAILS",W.WINE_COCKTAILS="READY TO DRINK > WINE COCKTAILS",W.OTHER="READY TO DRINK > OTHER",exports.ENUM_SPIRITS=void 0,(P=exports.ENUM_SPIRITS||(exports.ENUM_SPIRITS={})).BASE="SPIRITS",P.AMARO_APERITIF_VERMOUTH="SPIRITS > AMARO APERITIF & VERMOUTH",P.AMARO_APERITIF_VERMOUTH_OTHER="SPIRITS > AMARO APERITIF & VERMOUTH > OTHER",P.BAIJIU="SPIRITS > BAIJIU",P.BITTERS="SPIRITS > BITTERS",P.BRANDY="SPIRITS > BRANDY",P.BRANDY_COGNAC="SPIRITS > BRANDY > COGNAC",P.CACHACA="SPIRITS > CACHACA",P.GIN="SPIRITS > GIN",P.GIN_DRY_GIN="SPIRITS > GIN > DRY GIN",P.GIN_FLAVORED_GIN="SPIRITS > GIN > FLAVORED GIN",P.GIN_OLD_TOM_GIN="SPIRITS > GIN > OLD TOM GIN",P.GIN_OTHER="SPIRITS > GIN > OTHER",P.GRAIN_ALCOHOL="SPIRITS > GRAIN ALCOHOL",P.LIQUEUR="SPIRITS > LIQUEUR",P.MEZCAL="SPIRITS > MEZCAL",P.OTHER_SPIRITS="SPIRITS > OTHER SPIRITS",P.RUM="SPIRITS > RUM",P.RUM_AGED_RUM="SPIRITS > RUM > AGED RUM",P.RUM_DARK_RUM="SPIRITS > RUM > DARK RUM",P.RUM_FLAVORED_RUM="SPIRITS > RUM > FLAVORED RUM",P.RUM_GOLD_RUM="SPIRITS > RUM > GOLD RUM",P.RUM_OTHER="SPIRITS > RUM > OTHER",P.RUM_SPICED="SPIRITS > RUM > SPICED",P.RUM_WHITE_RUM="SPIRITS > RUM > WHITE RUM",P.SHOCHU="SPIRITS > SHOCHU",P.SOJU="SPIRITS > SOJU",P.SOTOL="SPIRITS > SOTOL",P.TEQUILA="SPIRITS > TEQUILA",P.TEQUILA_ANEJO="SPIRITS > TEQUILA > AÑEJO",P.TEQUILA_BLANCO="SPIRITS > TEQUILA > BLANCO",P.TEQUILA_CRISTALINO="SPIRITS > TEQUILA > CRISTALINO",P.TEQUILA_EXTRA_ANEJO="SPIRITS > TEQUILA > EXTRA AÑEJO",P.TEQUILA_OTHER="SPIRITS > TEQUILA > OTHER",P.TEQUILA_REPOSADO="SPIRITS > TEQUILA > REPOSADO",P.VODKA="SPIRITS > VODKA",P.VODKA_FLAVORED_VODKA="SPIRITS > VODKA > FLAVORED VODKA",P.VODKA_OTHER="SPIRITS > VODKA > OTHER",P.VODKA_REGULAR_VODKA="SPIRITS > VODKA > REGULAR VODKA",P.WHISKEY="SPIRITS > WHISKEY",P.WHISKEY_AMERICAN_WHISKEY="SPIRITS > WHISKEY > AMERICAN WHISKEY",P.WHISKEY_BOURBON="SPIRITS > WHISKEY > BOURBON",P.WHISKEY_CANADIAN_WHISKEY="SPIRITS > WHISKEY > CANADIAN WHISKEY",P.WHISKEY_IRISH_WHISKEY="SPIRITS > WHISKEY > IRISH WHISKEY",P.WHISKEY_MOONSHINE="SPIRITS > WHISKEY > MOONSHINE",P.WHISKEY_FLAVORED="SPIRITS > WHISKEY > FLAVORED WHISKEY",P.WHISKEY_OTHER="SPIRITS > WHISKEY > OTHER",P.WHISKEY_SCOTCH="SPIRITS > WHISKEY > SCOTCH",exports.ENUM_WINE=void 0,(g=exports.ENUM_WINE||(exports.ENUM_WINE={})).BASE="WINE",g.CHAMPAGNE_SPARKLING="WINE > CHAMPAGNE & SPARKLING",g.CHAMPAGNE_SPARKLING_CAVA="WINE > CHAMPAGNE & SPARKLING > CAVA",g.CHAMPAGNE_SPARKLING_CHAMPAGNE="WINE > CHAMPAGNE & SPARKLING > CHAMPAGNE",g.CHAMPAGNE_SPARKLING_PROSECCO="WINE > CHAMPAGNE & SPARKLING > PROSECCO",g.CHAMPAGNE_SPARKLING_SPARKLING_WINE="WINE > CHAMPAGNE & SPARKLING > SPARKLING WINE",g.CHAMPAGNE_SPARKLING_OTHER="WINE > CHAMPAGNE & SPARKLING > OTHER",g.COOKING="WINE > COOKING",g.DESSERT_FORTIFIED_WINE="WINE > DESSERT & FORTIFIED WINE",g.DESSERT_FORTIFIED_WINE_MEAD="WINE > DESSERT & FORTIFIED WINE > MEAD",g.DESSERT_FORTIFIED_WINE_PORT="WINE > DESSERT & FORTIFIED WINE > PORT",g.DESSERT_FORTIFIED_WINE_SHERRY="WINE > DESSERT & FORTIFIED WINE > SHERRY",g.DESSERT_FORTIFIED_WINE_OTHER="WINE > DESSERT & FORTIFIED WINE > OTHER",g.RED_WINE="WINE > RED WINE",g.RED_WINE_AGIORGITIKO="WINE > RED WINE > AGIORGITIKO",g.RED_WINE_AGLIANICO="WINE > RED WINE > AGLIANICO",g.RED_WINE_ALICANTE_BOUSCHET="WINE > RED WINE > ALICANTE BOUSCHET",g.RED_WINE_BARBERA="WINE > RED WINE > BARBERA",g.RED_WINE_BARBARESCO="WINE > RED WINE > BARBARESCO",g.RED_WINE_BAROLO="WINE > RED WINE > BAROLO",g.RED_WINE_BEAUJOLAIS="WINE > RED WINE > BEAUJOLAIS",g.RED_WINE_BLAUER_ZWEIGELT="WINE > RED WINE > BLAUER ZWEIGELT",g.RED_WINE_BOBAL="WINE > RED WINE > BOBAL",g.RED_WINE_BONARDA="WINE > RED WINE > BONARDA",g.RED_WINE_BORDEAUX="WINE > RED WINE > BORDEAUX",g.RED_WINE_BORDEAUX_BLEND="WINE > RED WINE > BORDEAUX BLEND",g.RED_WINE_BURGUNDY="WINE > RED WINE > BURGUNDY",g.RED_WINE_CABERNET_FRANC="WINE > RED WINE > CABERNET FRANC",g.RED_WINE_CABERNET_SAUVIGNON="WINE > RED WINE > CABERNET SAUVIGNON",g.RED_WINE_CANNONAU="WINE > RED WINE > CANNONAU",g.RED_WINE_CARMENERE="WINE > RED WINE > CARMENERE",g.RED_WINE_CHAMBOURCIN="WINE > RED WINE > CHAMBOURCIN",g.RED_WINE_CHIANTI="WINE > RED WINE > CHIANTI",g.RED_WINE_CINSAULT="WINE > RED WINE > CINSAULT",g.RED_WINE_CORVINA="WINE > RED WINE > CORVINA",g.RED_WINE_DOLCETTO="WINE > RED WINE > DOLCETTO",g.RED_WINE_DORNFELDER="WINE > RED WINE > DORNFELDER",g.RED_WINE_FETEASCA_NEAGRA="WINE > RED WINE > FETEASCA NEAGRA",g.RED_WINE_GAMAY="WINE > RED WINE > GAMAY",g.RED_WINE_GRACIANO="WINE > RED WINE > GRACIANO",g.RED_WINE_GRENACHE="WINE > RED WINE > GRENACHE",g.RED_WINE_LIMNIO="WINE > RED WINE > LIMNIO",g.RED_WINE_MACABEO="WINE > RED WINE > MACABEO",g.RED_WINE_MALBEC="WINE > RED WINE > MALBEC",g.RED_WINE_MENCIA="WINE > RED WINE > MENCIA",g.RED_WINE_MERLOT="WINE > RED WINE > MERLOT",g.RED_WINE_MONICA="WINE > RED WINE > MONICA",g.RED_WINE_MONTEPULCIANO="WINE > RED WINE > MONTEPULCIANO",g.RED_WINE_MOURVEDRE_MONASTRELL="WINE > RED WINE > MOURVEDRE/MONASTRELL",g.RED_WINE_NEBBIOLO="WINE > RED WINE > NEBBIOLO",g.RED_WINE_NEGROAMARO="WINE > RED WINE > NEGROAMARO",g.RED_WINE_NERELLO_MASCALESE="WINE > RED WINE > NERELLO MASCALESE",g.RED_WINE_NERO_DAVOLA="WINE > RED WINE > NERO D'AVOLA",g.RED_WINE_PETIT_VERDOT="WINE > RED WINE > PETIT VERDOT",g.RED_WINE_PETITE_SIRAH="WINE > RED WINE > PETITE SIRAH",g.RED_WINE_PINOT_NOIR="WINE > RED WINE > PINOT NOIR",g.RED_WINE_PINOTAGE="WINE > RED WINE > PINOTAGE",g.RED_WINE_PRIMITIVO="WINE > RED WINE > PRIMITIVO",g.RED_WINE_RED_BLEND="WINE > RED WINE > RED BLEND",g.RED_WINE_RHONE_BLEND="WINE > RED WINE > RHONE BLEND",g.RED_WINE_RIOJA="WINE > RED WINE > RIOJA",g.RED_WINE_SAGRANTINO="WINE > RED WINE > SAGRANTINO",g.RED_WINE_SANGIOVESE="WINE > RED WINE > SANGIOVESE",g.RED_WINE_SAPERAVI="WINE > RED WINE > SAPERAVI",g.RED_WINE_SCHIAVA_TROLLINGER="WINE > RED WINE > SCHIAVA/TROLLINGER",g.RED_WINE_SYRAH_SHIRAZ="WINE > RED WINE > SYRAH/SHIRAZ",g.RED_WINE_TANNAT="WINE > RED WINE > TANNAT",g.RED_WINE_TEMPRANILLO="WINE > RED WINE > TEMPRANILLO",g.RED_WINE_TEROLDEGO="WINE > RED WINE > TEROLDEGO",g.RED_WINE_TINTA_DEL_TORO="WINE > RED WINE > TINTA DEL TORO",g.RED_WINE_TOURIGA_NACIONAL="WINE > RED WINE > TOURIGA NACIONAL",g.RED_WINE_VALPOLICELLA="WINE > RED WINE > VALPOLICELLA",g.RED_WINE_XINOMAVRO="WINE > RED WINE > XINOMAVRO",g.RED_WINE_ZINFANDEL="WINE > RED WINE > ZINFANDEL",g.RED_WINE_ZWEIGELT="WINE > RED WINE > ZWEIGELT",g.RED_WINE_OTHER="WINE > RED WINE > OTHER",g.ROSE_WINE="WINE > ROSE WINE",g.SAKE="WINE > SAKE",g.WHITE_WINE="WINE > WHITE WINE",g.WHITE_WINE_ALBARINO_ALVARINHO="WINE > WHITE WINE > ALBARINO/ALVARINHO",g.WHITE_WINE_ARNEIS="WINE > WHITE WINE > ARNEIS",g.WHITE_WINE_ASTI="WINE > WHITE WINE > ASTI",g.WHITE_WINE_ASSYRTIKO="WINE > WHITE WINE > ASSYRTIKO",g.WHITE_WINE_BURGUNDY="WINE > WHITE WINE > BURGUNDY",g.WHITE_WINE_CARRICANTE="WINE > WHITE WINE > CARRICANTE",g.WHITE_WINE_CATARRATTO="WINE > WHITE WINE > CATARRATTO",g.WHITE_WINE_CHABLIS="WINE > WHITE WINE > CHABLIS",g.WHITE_WINE_CHARDONNAY="WINE > WHITE WINE > CHARDONNAY",g.WHITE_WINE_CHENIN_BLANC="WINE > WHITE WINE > CHENIN BLANC",g.WHITE_WINE_CORTESE="WINE > WHITE WINE > CORTESE",g.WHITE_WINE_FALANGHINA="WINE > WHITE WINE > FALANGHINA",g.WHITE_WINE_FIANO="WINE > WHITE WINE > FIANO",g.WHITE_WINE_FRIULANO="WINE > WHITE WINE > FRIULANO",g.WHITE_WINE_FURMINT="WINE > WHITE WINE > FURMINT",g.WHITE_WINE_GARGANEGA="WINE > WHITE WINE > GARGANEGA",g.WHITE_WINE_GAVI="WINE > WHITE WINE > GAVI",g.WHITE_WINE_GEWURZTRAMINER="WINE > WHITE WINE > GEWURZTRAMINER",g.WHITE_WINE_GRECO_DI_TUFO="WINE > WHITE WINE > GRECO DI TUFO",g.WHITE_WINE_GRENACHE_BLANC="WINE > WHITE WINE > GRENACHE BLANC",g.WHITE_WINE_GRUNER_VELTLINER="WINE > WHITE WINE > GRUNER VELTLINER",g.WHITE_WINE_HUXELREBE="WINE > WHITE WINE > HUXELREBE",g.WHITE_WINE_INZOLIA="WINE > WHITE WINE > INZOLIA",g.WHITE_WINE_MALVASIA="WINE > WHITE WINE > MALVASIA",g.WHITE_WINE_MELON_DE_BOURGOGNE="WINE > WHITE WINE > MELON DE BOURGOGNE",g.WHITE_WINE_MOSCATO_BIANCO="WINE > WHITE WINE > MOSCATO BIANCO",g.WHITE_WINE_MOSCHOFILERO_FILERI="WINE > WHITE WINE > MOSCHOFILERO/FILERI",g.WHITE_WINE_MULLER_THURGAU_RIVANER="WINE > WHITE WINE > MULLER-THURGAU/RIVANER",g.WHITE_WINE_MUSCAT_MOSCATO="WINE > WHITE WINE > MUSCAT/MOSCATO",g.WHITE_WINE_PECORINO="WINE > WHITE WINE > PECORINO",g.WHITE_WINE_PICPOUL="WINE > WHITE WINE > PICPOUL",g.WHITE_WINE_PINOT_BLANC="WINE > WHITE WINE > PINOT BLANC",g.WHITE_WINE_PINOT_GRIGIO_PINOT_GRIS="WINE > WHITE WINE > PINOT GRIGIO/PINOT GRIS",g.WHITE_WINE_POUILLY_FUISSE="WINE > WHITE WINE > POUILLY-FUISSE",g.WHITE_WINE_POUILLY_FUME="WINE > WHITE WINE > POUILLY-FUME",g.WHITE_WINE_RIESLING="WINE > WHITE WINE > RIESLING",g.WHITE_WINE_RIOJA="WINE > WHITE WINE > RIOJA",g.WHITE_WINE_RODITIS="WINE > WHITE WINE > RODITIS",g.WHITE_WINE_SANCERRE="WINE > WHITE WINE > SANCERRE",g.WHITE_WINE_SAUVIGNON_BLANC="WINE > WHITE WINE > SAUVIGNON BLANC",g.WHITE_WINE_SEMILLON="WINE > WHITE WINE > SEMILLON",g.WHITE_WINE_SOAVE="WINE > WHITE WINE > SOAVE",g.WHITE_WINE_SYLVANER="WINE > WHITE WINE > SYLVANER",g.WHITE_WINE_TORRONTES="WINE > WHITE WINE > TORRONTES",g.WHITE_WINE_TREBBIANO_UGNI_BLANC="WINE > WHITE WINE > TREBBIANO/UGNI BLANC",g.WHITE_WINE_TURBIANA="WINE > WHITE WINE > TURBIANA",g.WHITE_WINE_TXAKOLINA="WINE > WHITE WINE > TXAKOLINA",g.WHITE_WINE_VERDEJO="WINE > WHITE WINE > VERDEJO",g.WHITE_WINE_VERDICCHIO="WINE > WHITE WINE > VERDICCHIO",g.WHITE_WINE_VERMENTINO="WINE > WHITE WINE > VERMENTINO",g.WHITE_WINE_VERNACCIA="WINE > WHITE WINE > VERNACCIA",g.WHITE_WINE_VIDIANO="WINE > WHITE WINE > VIDIANO",g.WHITE_WINE_VINHO_VERDE="WINE > WHITE WINE > VINHO VERDE",g.WHITE_WINE_VIOGNIER="WINE > WHITE WINE > VIOGNIER",g.WHITE_WINE_VIURA="WINE > WHITE WINE > VIURA",g.WHITE_WINE_OTHER="WINE > WHITE WINE > OTHER",g.WINE_OTHER="WINE > OTHER";const _={[exports.LIQUID_COMMERCE_ENV.LOC]:"http://0.0.0.0:8000/api",[exports.LIQUID_COMMERCE_ENV.DEV]:"https://dev.api.liquidcommerce.cloud/api",[exports.LIQUID_COMMERCE_ENV.STAGE]:"https://staging.api.liquidcommerce.cloud/api",[exports.LIQUID_COMMERCE_ENV.PROD]:"https://api.liquidcommerce.cloud/api",[exports.LIQUID_COMMERCE_ENV.BETA]:"https://cloud-apis-beta-948630220003.us-central1.run.app/api"};function b(t){return async(e,r)=>{var i;const o=await t(e,r);let s;return"function"==typeof(null===(i=o.headers)||void 0===i?void 0:i.entries)?s=Object.fromEntries(o.headers.entries()):(s={},o.headers.forEach((t,e)=>{s[e]=t})),{ok:o.ok,status:o.status,statusText:o.statusText,headers:s,json:()=>o.json(),text:()=>o.text()}}}const H=(t,e)=>new Promise((r,i)=>{const o=new XMLHttpRequest;o.open(e.method||"GET",t),Object.entries(e.headers).forEach(([t,e])=>{o.setRequestHeader(t,e)}),o.onload=()=>{r({ok:o.status>=200&&o.status<300,status:o.status,statusText:o.statusText,headers:o.getAllResponseHeaders().split("\r\n").reduce((t,e)=>{const[r,i]=e.split(": ");return r&&(t[r]=i),t},{}),json:()=>Promise.resolve(JSON.parse(o.responseText)),text:()=>Promise.resolve(o.responseText)})},o.onerror=()=>{i(new TypeError("Network request failed"))},o.send(e.body)});function M(){return"undefined"!=typeof fetch?b(fetch):"undefined"!=typeof global&&global.fetch?b(global.fetch):H}function U(...t){for(const e of t)if("string"==typeof e&&""!==e.trim())return e;return""}function x(t,e){var r,i;const o=null!==t&&"object"==typeof t?t:{};return{...o,status:e,message:o.message||U("string"==typeof t?t:"",o.error,null===(i=null===(r=o.errors)||void 0===r?void 0:r[0])||void 0===i?void 0:i.message)||`HTTP error! status: ${e}`}}class B{constructor(t){this.accessToken=null,this.tokenExpiration=null,this.isAuthenticating=!1,this.apiKey=t.apiKey,this.env=t.env,this.baseURL=t.baseURL,this.httpClient=M()}getUniqueKey(){return`${this.apiKey}_${this.baseURL}`}async authenticate(){var t,e;if(this.isAuthenticating)await new Promise(t=>{const e=()=>{this.isAuthenticating?setTimeout(e,100):t(void 0)};e()});else{this.isAuthenticating=!0;try{const r=await this.requestWithoutAuth("/authentication",{method:"GET"});this.accessToken=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t.token,this.tokenExpiration=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.exp}catch(t){throw new Error("Failed to authenticate with LiquidCommerce API")}finally{this.isAuthenticating=!1}}}async getAuth(){const t=await this.requestWithoutAuth("/authentication",{method:"GET"});return null==t?void 0:t.data}async requestWithoutAuth(t,e){const r=new URL(`api${t}`,this.baseURL),i={"Content-Type":"application/json","X-LIQUID-API-KEY":this.apiKey,"X-LIQUID-API-OBF":"true",...e.headers},o={method:e.method,headers:i,body:e.body?JSON.stringify(e.body):void 0},s=await this.httpClient(r.toString(),o);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}isTokenExpired(){return!this.tokenExpiration||Date.now()>=this.tokenExpiration}async request(t,e){try{this.accessToken&&!this.isTokenExpired()||await this.authenticate();const r=new URL(`api${t}`,this.baseURL),i={"Content-Type":"application/json","X-LIQUID-API-KEY":this.apiKey,"X-LIQUID-API-OBF":"true","X-LIQUID-API-SDK":"true","X-LIQUID-SDK-VERSION":"1.20.0",Authorization:`Bearer ${this.accessToken}`,...e.headers},o={method:e.method,headers:i,body:e.body?JSON.stringify(e.body):void 0},s=await this.httpClient(r.toString(),o);let n;try{n=await s.json()}catch(t){n={message:await s.text().catch(()=>`HTTP error! status: ${s.status}`)||t}}if(!s.ok)throw x(n,s.status);return n}catch(t){throw t}}async get(t,e){return this.request(t,{method:"GET",headers:e})}async post(t,e,r){return this.request(t,{method:"POST",body:e,headers:r})}async put(t,e,r){return this.request(t,{method:"PUT",body:e,headers:r})}async delete(t,e){return this.request(t,{method:"DELETE",headers:e})}}class F{constructor(t){this.locationHelperService=t}validateAndNormalizeParams(t){const e={...t};return e.id=this.validateId(e.id),e.items=this.validateAndNormalizeItems(e.items),this.locationHelperService.validateAndNormalizeLocation(e.loc),e.refresh=Boolean(e.refresh),e}validateId(t){return t&&"string"==typeof t&&0!==t.trim().length?t.trim():""}validateAndNormalizeItems(t){if(!Array.isArray(t)||0===t.length)throw new Error(exports.CART_PARAM_ERROR_ENUM.INVALID_ITEMS_TYPE);if(t.length>25)throw new Error(exports.CART_PARAM_ERROR_ENUM.INVALID_ITEMS_MAX);return t.map(t=>this.validateAndNormalizeItem(t))}validateAndNormalizeItem(t){const e={...t};if(!this.validatePartNumber(e.partNumber))throw new Error(exports.CART_PARAM_ERROR_ENUM.INVALID_PART_NUMBER);if(!e.fulfillmentId||"string"!=typeof e.fulfillmentId||0===e.fulfillmentId.trim().length)throw new Error(exports.CART_PARAM_ERROR_ENUM.INVALID_FULFILLMENT_ID);return e.quantity=Math.max(0,Math.floor(e.quantity)),e.engravingLines&&(e.engravingLines=e.engravingLines.map(t=>t.trim()).filter(t=>t.length>0)),e}validatePartNumber(t){if(!t||"string"!=typeof t)return!1;const e=t.split("_");return 2===e.length&&e[0].length>0&&e[1].length>0}}class G{constructor(t){this.locationServiceHelper=t,this.taxonomyValues=new Set([...Object.values(exports.ENUM_BEER),...Object.values(exports.ENUM_FOOD),...Object.values(exports.ENUM_MERCHANDISE),...Object.values(exports.ENUM_NON_ALCOHOLIC),...Object.values(exports.ENUM_READY_TO_DRINK),...Object.values(exports.ENUM_SPIRITS),...Object.values(exports.ENUM_WINE),...Object.values(exports.ENUM_MISCELLANEOUS)])}validateAndNormalizeParams(t){var e,r,i,o,s,n,a,E,l;const d={...t},I=null!==(e=null==d?void 0:d.upcs)&&void 0!==e?e:[],h=null!==(r=null==d?void 0:d.grouping)&&void 0!==r?r:[],c=null!==(i=null==d?void 0:d.ids)&&void 0!==i?i:[];if([I,h,c].every(t=>this.validateIdsExist(t)))throw new Error("Product identifiers must be a non-empty array of strings");return I.length>0&&(this.validateIds(null!==(o=null==d?void 0:d.upcs)&&void 0!==o?o:[]),d.upcs=I),h.length>0&&(this.validateIds(null!==(s=null==d?void 0:d.grouping)&&void 0!==s?s:[]),d.grouping=h),c.length>0&&(this.validateIds(null!==(n=null==d?void 0:d.ids)&&void 0!==n?n:[]),d.ids=c),this.validateIds(null!==(l=null!==(E=null!==(a=null==d?void 0:d.upcs)&&void 0!==a?a:null==d?void 0:d.grouping)&&void 0!==E?E:null==d?void 0:d.ids)&&void 0!==l?l:[]),this.locationServiceHelper.validateAndNormalizeLocation(d.loc),d}isValidObjectId(t){return!(!t||"string"!=typeof t)&&/^[0-9a-fA-F]{24}$/.test(t)}validateRetailers(t,e){void 0!==t&&(Array.isArray(t)?(t.length>20&&e.push("Retailers array can have a maximum of 20 values"),t.forEach((t,r)=>{"string"!=typeof t?e.push(`Retailer at index ${r} must be a string`):this.isValidObjectId(t)||e.push(`Retailer ID at index ${r} must be a valid ObjectId string`)})):e.push("Retailers must be an array"))}validateAndNormalizeSearchParams(t){const e=[],r={...t};return void 0!==r.deliveryFirst&&"boolean"!=typeof r.deliveryFirst?e.push("deliveryFirst must be a boolean"):!0!==r.deliveryFirst&&delete r.deliveryFirst,this.validateRetailers(r.retailers,e),this.validateOrderBy(r.orderBy,e),this.validateOrderDirection(r.orderDirection,e),this.validateFilters(r.filters,e),this.validatePagination(r.page,r.perPage,e),this.locationServiceHelper.validateAndNormalizeLocation(r.loc),e.length>0?{...r,error:e.join(". ")}:r}validateIds(t){if(!t.every(t=>"string"==typeof t&&t.trim().length>0))throw new Error("All product identifiers must be non-empty strings")}validateIdsExist(t){return!Array.isArray(t)||0===t.length}validateOrderBy(t,e){t&&!Object.values(exports.ENUM_ORDER_BY).includes(t)&&e.push(`Invalid orderBy value: ${t}`)}validateOrderDirection(t,e){t&&!Object.values(exports.ENUM_NAVIGATION_ORDER_DIRECTION_TYPE).includes(t)&&e.push(`Invalid orderDirection value: ${t}`)}validateFilters(t,e){t&&(t.length>10&&e.push("Maximum of 10 filters allowed"),t.forEach(t=>{switch(Object.values(exports.ENUM_FILTER_KEYS).includes(t.key)||e.push(`Invalid filter key: ${t.key}`),t.key){case exports.ENUM_FILTER_KEYS.AVAILABILITY:this.validateAvailabilityFilter(t.values,e);break;case exports.ENUM_FILTER_KEYS.FULFILLMENT:this.validateFulfillmentFilter(t.values,e);break;case exports.ENUM_FILTER_KEYS.ENGRAVING:case exports.ENUM_FILTER_KEYS.PRESALE:this.validateBinaryFilter(t.values,e);break;case exports.ENUM_FILTER_KEYS.BRANDS:this.validateArrayFilter(t.values,75,"brands",e);break;case exports.ENUM_FILTER_KEYS.FLAVOR:this.validateArrayFilter(t.values,25,"flavor",e);break;case exports.ENUM_FILTER_KEYS.REGION:this.validateArrayFilter(t.values,25,"region",e);break;case exports.ENUM_FILTER_KEYS.VARIETY:this.validateArrayFilter(t.values,25,"variety",e);break;case exports.ENUM_FILTER_KEYS.SIZES:this.validateArrayFilter(t.values,25,"sizes",e);break;case exports.ENUM_FILTER_KEYS.APPELLATION:this.validateArrayFilter(t.values,25,"appellation",e);break;case exports.ENUM_FILTER_KEYS.COUNTRY:this.validateArrayFilter(t.values,25,"country",e);break;case exports.ENUM_FILTER_KEYS.VINTAGE:this.validateArrayFilter(t.values,25,"vintage",e);break;case exports.ENUM_FILTER_KEYS.MATERIALS:this.validateArrayFilter(t.values,25,"materials",e);break;case exports.ENUM_FILTER_KEYS.COLORS:this.validateArrayFilter(t.values,25,"colors",e);break;case exports.ENUM_FILTER_KEYS.TAGS:this.validateArrayFilter(t.values,25,"tags",e)}}))}validateAvailabilityFilter(t,e){Object.values(exports.ENUM_AVAILABILITY_VALUE).includes(t)||e.push(`Invalid availability value: ${t}`)}validateFulfillmentFilter(t,e){if(!Array.isArray(t))return void e.push("Fulfillment filter must be an array");const r=Object.values(exports.ENUM_MODALITIES);t.forEach(t=>{r.includes(t)||e.push(`Invalid fulfillment value: ${t}`)})}validateBinaryFilter(t,e){Object.values(exports.ENUM_BINARY_FILTER).includes(t)||e.push(`Invalid availability value: ${t}`)}validateArrayFilter(t,e,r,i){Array.isArray(t)?t.length>e&&i.push(`${r} filter can have a maximum of ${e} values`):i.push(`${r} filter must be an array`)}validateCategoriesFilter(t,e){Array.isArray(t)?t.every(t=>this.taxonomyValues.has(t))||e.push("Invalid category value(s) in categories filter"):e.push("Categories filter must be an array")}validatePagination(t,e,r){void 0!==t&&("number"!=typeof t||t<0)&&r.push("Page must be a non-negative number"),void 0!==e&&("number"!=typeof e||e<=0)&&r.push("PerPage must be a positive number")}}class ${constructor(t){this.locationHelperService=t}validateAndNormalizePrepareParams(t){var e,r,i,o,s,n,a,E,l,d,I,h,c,u,R,N,p,T,A,v;let O={...t};if(!(null==O?void 0:O.cartId)||"string"!=typeof(null==O?void 0:O.cartId))throw new Error("Invalid cartId");return this.validateCustomer(O.customer),(null==O?void 0:O.billingAddress)&&this.validateBillingAddress(O.billingAddress),O.hasAgeVerify=Boolean(null!==(i=null!==(e=null==O?void 0:O.hasAgeVerify)&&void 0!==e?e:null===(r=null==O?void 0:O.customer)||void 0===r?void 0:r.hasAgeVerify)&&void 0!==i&&i),O.hasSubstitutionPolicy=Boolean(null==O?void 0:O.hasSubstitutionPolicy),O.acceptedAccountCreation=Boolean(null==O?void 0:O.acceptedAccountCreation),O.isGift=Boolean(null==O?void 0:O.isGift),O.billingSameAsShipping=Boolean(null==O?void 0:O.billingSameAsShipping),O&&(null==O?void 0:O.billingAddress)&&""!==(null===(o=null==O?void 0:O.billingAddress)||void 0===o?void 0:o.phone)&&(O={...O,billingAddress:{...null!==(s=null==O?void 0:O.billingAddress)&&void 0!==s?s:{},phone:null!==(a=this.formatPhoneNumber(null===(n=O.billingAddress)||void 0===n?void 0:n.phone))&&void 0!==a?a:""}}),O&&(null==O?void 0:O.customer)&&""!==(null===(E=null==O?void 0:O.customer)||void 0===E?void 0:E.phone)&&(O={...O,customer:{...null!==(l=null==O?void 0:O.customer)&&void 0!==l?l:{},phone:null!==(I=this.formatPhoneNumber(null===(d=null==O?void 0:O.customer)||void 0===d?void 0:d.phone))&&void 0!==I?I:""}}),(null==O?void 0:O.isGift)&&(this.validateGiftOptions(O.giftOptions),O&&(null==O?void 0:O.giftOptions)&&""!==(null===(c=null===(h=null==O?void 0:O.giftOptions)||void 0===h?void 0:h.recipient)||void 0===c?void 0:c.phone)&&(O={...O,giftOptions:{...null!==(u=null==O?void 0:O.giftOptions)&&void 0!==u?u:{},recipient:{...null!==(N=null===(R=null==O?void 0:O.giftOptions)||void 0===R?void 0:R.recipient)&&void 0!==N?N:{},phone:null!==(A=this.formatPhoneNumber(null===(T=null===(p=O.giftOptions)||void 0===p?void 0:p.recipient)||void 0===T?void 0:T.phone))&&void 0!==A?A:""}}})),this.validateMarketingPreferences(null==O?void 0:O.marketingPreferences),(null==O?void 0:O.giftCards)&&(O.giftCards=this.validateGiftCards(null!==(v=null==O?void 0:O.giftCards)&&void 0!==v?v:[])),(null==O?void 0:O.deliveryTips)&&this.validateDeliveryTips(O.deliveryTips),(null==O?void 0:O.refresh)&&(O.refresh=Boolean(O.refresh)),O}validateAndNormalizeCompleteParams(t){const e={...t};if(!e.token||"string"!=typeof(null==e?void 0:e.token))throw new Error("Invalid token");if(!(null==e?void 0:e.payment)||"string"!=typeof(null==e?void 0:e.payment))throw new Error("Invalid payment token");return void 0!==e.refresh&&(e.refresh=Boolean(e.refresh)),e}validateCustomer(t){if(t&&"object"==typeof t){const{firstName:e,lastName:r,phone:i,email:o}=t;if(e&&"string"!=typeof e)throw new Error("Invalid customer first name");if(r&&"string"!=typeof r)throw new Error("Invalid customer last name");if(i&&"string"!=typeof i)throw new Error("Invalid customer phone");if(o&&"string"!=typeof o)throw new Error("Invalid customer email");"hasAgeVerify"in t&&(t.hasAgeVerify=Boolean(t.hasAgeVerify))}}validateBillingAddress(t){var e;if(!t)return{};if("object"!=typeof t||null===t)throw new Error("Invalid address: must be an object if provided");const r={...t};return["one","two","city","state","zip","country","firstName","lastName","email","phone","company"].forEach(t=>{if(t in r&&"string"!=typeof r[t])throw new Error(`Invalid billing address ${t}: must be a string if provided`)}),"US"===(null!==(e=r.country)&&void 0!==e?e:"US").toUpperCase()&&"state"in r&&r.state&&(r.state=this.locationHelperService.normalizeState(r.state)),r}validateGiftCards(t){if(!t||0===t.length)return[];if(!Array.isArray(t))throw new Error("Invalid gift cards: must be a string array if provided");const e=[...t];return e.forEach(t=>{if("string"!=typeof t)throw new Error("Invalid gift cards: must be a string array if provided")}),e}validateGiftOptions(t){if(void 0!==t&&"object"!=typeof t)throw new Error("Invalid giftOptions: must be an object if provided");if(t){if("message"in t&&"string"!=typeof t.message)throw new Error("Invalid gift message: must be a string if provided");if("message"in t&&"string"==typeof t.message&&t.message.length>500)throw new Error("Invalid gift message: Gift message cannot exceed 500 characters");if("recipient"in t){if("object"!=typeof t.recipient)throw new Error("Invalid gift recipient: must be an object if provided");const{name:e,phone:r,email:i}=t.recipient;if("name"in t.recipient&&"string"!=typeof e)throw new Error("Invalid gift recipient name: must be a string if provided");if("phone"in t.recipient&&"string"!=typeof r)throw new Error("Invalid gift recipient phone: must be a string if provided");if("email"in t.recipient&&"string"!=typeof i)throw new Error("Invalid gift recipient email: must be a string if provided")}}}formatPhoneNumber(t){if(!t)return null;const e=t.replace(/[\s().\-_]/g,"").replace(/[^\d+]/g,"");if(e.startsWith("+1")){const t=e.substring(2);if(10===t.length)return`(${t.substring(0,3)}) ${t.substring(3,6)}-${t.substring(6)}`}if(11===e.length&&e.startsWith("1")){const t=e.substring(1);return`(${t.substring(0,3)}) ${t.substring(3,6)}-${t.substring(6)}`}return 10===e.length?`(${e.substring(0,3)}) ${e.substring(3,6)}-${e.substring(6)}`:e.startsWith("+")?e:t}validateMarketingPreferences(t){if(void 0!==t&&"object"!=typeof t)throw new Error("Invalid marketingPreferences: must be an object if provided");t&&("canEmail"in t&&(t.canEmail=Boolean(t.canEmail)),"canSms"in t&&(t.canSms=Boolean(t.canSms)))}validateDeliveryTips(t){if(!Array.isArray(t))throw new Error("Invalid deliveryTips");t.forEach(t=>{if(!t.fulfillmentId||"string"!=typeof t.fulfillmentId)throw new Error("Invalid fulfillmentId in deliveryTip");if("number"!=typeof t.tip||t.tip<0)throw new Error("Invalid tip amount in deliveryTip")})}}class Y{validateAndNormalizeLocation(t){if(!t)return;if("object"!=typeof t)throw new Error("Location must be a valid object");const{coords:e,address:r}=t;e?this.validateCoordinates(e):r&&this.validateAndNormalizeAddress(r)}validateCoordinates(t){if("number"!=typeof t.lat||"number"!=typeof t.long)throw new Error("Coordinates must be valid numbers");if(t.lat<-90||t.lat>90||t.long<-180||t.long>180)throw new Error("Coordinates are out of valid range")}validateAndNormalizeAddress(t){var e;if("US"===(null!==(e=null==t?void 0:t.country)&&void 0!==e?e:"US").toUpperCase()){if(!(null==t?void 0:t.state)||"string"!=typeof(null==t?void 0:t.state))throw new Error("State is required and must be a string");t.state=this.normalizeState(t.state)}else if((null==t?void 0:t.state)&&"string"!=typeof t.state)throw new Error("State must be a string if provided");if(!t.city||"string"!=typeof t.city)throw new Error("City is required and must be a string");if(!t.zip||"string"!=typeof t.zip)throw new Error("ZIP code is required and must be a string")}normalizeState(t){const e=t.toUpperCase();if(exports.STATES_CODE[e])return exports.STATES_CODE[e];const r=t.toUpperCase();if(exports.STATES_NAME[r])return exports.STATES_NAME[r];throw new Error(`Invalid state: ${t}`)}}class K{constructor(t){this.accessToken=null,this.tokenExpiration=null,this.isAuthenticating=!1,this.userID=t.userID,this.password=t.password,this.baseURL=t.baseURL,this.httpClient=M()}getUniqueKey(){return`${this.userID}_${this.password}_${this.baseURL}`}async authenticate(){var t,e;if(this.isAuthenticating)await new Promise(t=>{const e=()=>{this.isAuthenticating?setTimeout(e,100):t(void 0)};e()});else{this.isAuthenticating=!0;try{const r=await this.requestWithoutAuth("/order-authentication",{method:"GET"});this.accessToken=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t.token,this.tokenExpiration=Date.now()+1e3*(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.exp)}catch(t){throw new Error("Failed to authenticate with LiquidCommerce Order API")}finally{this.isAuthenticating=!1}}}async requestWithoutAuth(t,e){const r=new URL(`api${t}`,this.baseURL),i={"Content-Type":"application/json",Authorization:`Basic ${btoa(`${this.userID}:${this.password}`)}`,...e.headers},o={method:e.method,headers:i,body:e.body?JSON.stringify(e.body):void 0},s=await this.httpClient(r.toString(),o);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}isTokenExpired(){return!this.tokenExpiration||Date.now()>=this.tokenExpiration}async request(t,e){try{this.accessToken&&!this.isTokenExpired()||await this.authenticate();const r=new URL(`api${t}`,this.baseURL),i={"Content-Type":"application/json","X-LIQUID-API-SDK":"true","X-LIQUID-SDK-VERSION":"1.20.0",Authorization:`Bearer ${this.accessToken}`,...e.headers},o={method:e.method,headers:i,body:e.body?JSON.stringify(e.body):void 0},s=await this.httpClient(r.toString(),o);let n;try{n=await s.json()}catch(t){n={message:await s.text().catch(()=>`HTTP error! status: ${s.status}`)||t}}if(!s.ok)throw x(n,s.status);return n}catch(t){throw t}}async get(t,e){return this.request(t,{method:"GET",headers:e})}async post(t,e,r){return this.request(t,{method:"POST",body:e,headers:r})}async put(t,e,r){return this.request(t,{method:"PUT",body:e,headers:r})}async delete(t,e){return this.request(t,{method:"DELETE",headers:e})}}class k{constructor(t){this.client=t}async autocomplete(t,e){try{return await this.client.post("/address/autocomplete",{...t,key:e})}catch(t){throw t}}async details(t,e){try{return await this.client.post("/address/details",{...t,key:e})}catch(t){throw t}}}class V{constructor(t,e){this.client=t,this.cartHelperService=e,this.servicePath="/cart/update"}async get(t,e){try{let r=this.cartHelperService.validateId(t);if(r=""!==r&&r,r){const t={id:r};return"boolean"==typeof e&&(t.refresh=e),await this.client.post(this.servicePath,t)}return await this.client.post(this.servicePath)}catch(t){throw t}}async update(t){try{const e=this.cartHelperService.validateAndNormalizeParams(t);return await this.client.post(this.servicePath,e)}catch(t){throw t}}}class Q{constructor(t,e){this.client=t,this.catalogHelperService=e,this.servicePath="/catalog/"}async availability(t){try{const e=this.catalogHelperService.validateAndNormalizeParams(t);return await this.client.post(`${this.servicePath}availability`,e)}catch(t){throw t}}async search(t){try{const e=this.catalogHelperService.validateAndNormalizeSearchParams(t);if(null==e?void 0:e.error)throw new Error(null==e?void 0:e.error);return await this.client.post(`${this.servicePath}search`,e)}catch(t){throw t}}async autocomplete(t){try{const e="string"==typeof(null==t?void 0:t.term)?t.term.replace(/^\s+/,""):"";if(0===e.trim().length)throw new Error("term must be a non-empty string");if(void 0!==t.limit&&(!Number.isInteger(t.limit)||t.limit<1||t.limit>25))throw new Error("limit must be an integer between 1 and 25");const r=void 0===t.limit?{term:e}:{term:e,limit:t.limit};return await this.client.post(`${this.servicePath}autocomplete`,r)}catch(t){throw t}}async listProducts(t={}){try{if(void 0!==t.pageSize&&!Number.isInteger(t.pageSize))throw new Error("pageSize must be an integer");const e=new URLSearchParams;void 0!==t.pageSize&&e.append("pageSize",t.pageSize.toString()),"string"==typeof t.cursor&&t.cursor.length>0&&e.append("cursor",t.cursor);const r=e.toString();return await this.client.get(`${this.servicePath}products${r?`?${r}`:""}`)}catch(t){throw t}}async*iterateProducts(t={}){var e;let r;do{const i=await this.listProducts({...t,cursor:r}),o=null==i?void 0:i.data;yield*null!==(e=null==o?void 0:o.items)&&void 0!==e?e:[],r=null==o?void 0:o.nextCursor}while("string"==typeof r&&r.length>0)}async createLocationContext(t){var e;const r=null===(e=null==t?void 0:t.loc)||void 0===e?void 0:e.coords;if(!r||!Number.isFinite(r.lat)||!Number.isFinite(r.long)||Math.abs(r.lat)>90||Math.abs(r.long)>180)throw new Error("Location context requires valid coordinates");return this.client.post(`${this.servicePath}location-context`,{loc:{coords:{lat:r.lat,long:r.long}}})}async compose(t){if(!Array.isArray(null==t?void 0:t.sections)||t.sections.length<1||t.sections.length>16)throw new Error("Catalog composition requires between 1 and 16 sections");const e=new Set;for(const r of t.sections){if(this.validateComposeSection(r),e.has(r.sectionId))throw new Error("Catalog composition section IDs must be unique");e.add(r.sectionId)}if(void 0!==t.retailers&&(!Array.isArray(t.retailers)||t.retailers.length>1))throw new Error("Catalog composition retailers must be an array containing at most one retailer ID");if(void 0!==t.locationContext&&("string"!=typeof t.locationContext||!t.locationContext||t.locationContext.length>256))throw new Error("Catalog composition locationContext must be a non-empty string of at most 256 characters");if(void 0!==t.locationContext&&void 0!==t.loc)throw new Error("Catalog composition accepts either locationContext or loc, not both");return this.client.post(`${this.servicePath}compose`,t)}validateComposeSection(t){if("string"!=typeof(null==t?void 0:t.sectionId)||!t.sectionId||t.sectionId.length>100)throw new Error("Catalog composition sectionId must be a non-empty string of at most 100 characters");if(void 0!==t.perPage&&(!Number.isInteger(t.perPage)||t.perPage<1||t.perPage>24))throw new Error("Catalog composition section perPage must be an integer between 1 and 24");if(void 0!==t.filters&&(!Array.isArray(t.filters)||t.filters.length>10))throw new Error("Catalog composition section filters must be an array of at most 10 filters")}}class q{constructor(t,e){this.client=t,this.checkoutHelperService=e,this.servicePath="/checkout"}async prepare(t){try{const e=this.checkoutHelperService.validateAndNormalizePrepareParams(t);return await this.client.post(`${this.servicePath}/prepare`,e)}catch(t){throw t}}async complete(t){try{const e=this.checkoutHelperService.validateAndNormalizeCompleteParams(t);return await this.client.post(`${this.servicePath}/complete`,e)}catch(t){throw t}}}class j{constructor(t){this.client=t}async fetch(t){try{return await this.client.get(`/orders/${t}`)}catch(t){throw t}}async list(t){try{const e=new URLSearchParams;if(!t.startDate||!t.endDate)throw new Error("startDate and endDate are required parameters");return e.append("startDate",t.startDate),e.append("endDate",t.endDate),"number"==typeof t.page&&e.append("page",t.page.toString()),"number"==typeof t.limit&&e.append("limit",t.limit.toString()),"string"==typeof t.customerEmail&&e.append("customerEmail",t.customerEmail),await this.client.get(`/orders?${e.toString()}`)}catch(t){throw t}}}class z{constructor(t){this.paymentProvider=t,this.collapse=()=>this.paymentProvider.collapse(),this.unmount=()=>this.paymentProvider.unmount(),this.destroy=()=>this.paymentProvider.destroy()}async mount(t){try{await this.paymentProvider.mount(t)}catch(t){throw t}}async generateToken(){return this.paymentProvider.generateToken()}subscribe(t,e){this.paymentProvider.subscribe(t,e)}unsubscribe(t,e){this.paymentProvider.unsubscribe(t,e)}}class J{constructor(t,e){this.client=t,this.paymentSessionHelperService=e,this.servicePath="/users",this.env=t.env}async createOrUpdateSession(t){try{if(!(null==t?void 0:t.id)&&!(null==t?void 0:t.email))throw new Error("Either id or email must be provided");return await this.client.post(`${this.servicePath}/session`,t)}catch(t){throw t}}async createPaymentSession(t){try{const e=await this.client.post(`${this.servicePath}/payment-session`,t),r=this.paymentSessionHelperService.rcd(null==e?void 0:e.data,this.env);return{...e,data:r}}catch(t){throw t}}async finalizePaymentSession(t){try{if(!t)throw new Error("Token is required");const e=await this.client.get(`${this.servicePath}/finalize-payment-session/${t}`),r=this.paymentSessionHelperService.dd(null==e?void 0:e.data,t);return{...e,data:r}}catch(t){throw t}}async fetchUser(t){try{if(!t)throw new Error("Id is required");return await this.client.get(`${this.servicePath}/fetch/${t}`)}catch(t){throw t}}async purge(t){try{if(!t)throw new Error("User identifier (ID or email) must be provided");return await this.client.delete(`${this.servicePath}/purge/${t}`)}catch(t){throw t}}async addAddress(t){try{return this.validateAddressParams(t),await this.client.post(`${this.servicePath}/addresses/add`,t)}catch(t){throw t}}async updateAddress(t){try{const e=this.validateAddressParams(t);return await this.client.post(`${this.servicePath}/addresses/update`,e)}catch(t){throw t}}validateAddressParams(t){const e=this.hasUser(t),r=this.hasUserAddressObj(t),i=this.hasUserAddressCoords(t),o=this.hasUserAddressPlacesId(t);if(e)throw new Error("Missing required parameter customerId for address update.");if(r&&i&&o)throw new Error("Missing required parameters for address update, you need at least, an address object or lat and long, or a google placesId");return i||(t.lat=Number(null==t?void 0:t.lat),t.long=Number(null==t?void 0:t.long)),t}hasUser(t){return!(null==t?void 0:t.customerId)||"string"!=typeof(null==t?void 0:t.customerId)}hasUserAddressObj(t){return!((null==t?void 0:t.one)&&"string"==typeof(null==t?void 0:t.one)&&(null==t?void 0:t.city)&&"string"==typeof(null==t?void 0:t.city)&&(null==t?void 0:t.state)&&"string"==typeof(null==t?void 0:t.state)&&(null==t?void 0:t.zip)&&"string"==typeof(null==t?void 0:t.zip)&&(null==t?void 0:t.type)&&"string"==typeof(null==t?void 0:t.type))}hasUserAddressCoords(t){return!(null==t?void 0:t.lat)&&!(null==t?void 0:t.long)||"number"!=typeof Number(null==t?void 0:t.lat)&&"number"!=typeof Number(null==t?void 0:t.long)}hasUserAddressPlacesId(t){return!(null==t?void 0:t.placesId)||"string"!=typeof(null==t?void 0:t.placesId)}async purgeAddress(t){try{if(!t)throw new Error("Address ID must be provided");return await this.client.delete(`${this.servicePath}/addresses/purge/${t}`)}catch(t){throw t}}async addPayment(t){try{if(!t.customerId||!t.paymentMethodId)throw new Error("Missing required parameters to add payment");return void 0===(null==t?void 0:t.isDefault)&&(null==t||delete t.isDefault),await this.client.post(`${this.servicePath}/payments/add`,t)}catch(t){throw t}}async updatePayment(t){try{if(!t.customerId||!t.paymentMethodId)throw new Error("Missing required parameters to add payment");const{customerId:e,paymentMethodId:r}=t;return await this.client.get(`${this.servicePath}/payments/updateDefault/${e}/${r}`)}catch(t){throw t}}async purgePayment(t,e){try{if(!t||!e)throw new Error("Missing required parameters for payment purge");return await this.client.delete(`${this.servicePath}/payments/purge/${t}/${e}`)}catch(t){throw t}}}class X{constructor(t){this.client=t}async test(t){try{return 200===(await this.client.post("/webhook/test",{endpoint:t})).statusCode}catch(t){throw t}}}class Z{constructor(){this.services=new Map,this.liquidCommerceOrderClientConstructor=null}static getInstance(){return Z.instance||(Z.instance=new Z),Z.instance}setLiquidCommerceOrderClientConstructor(t){this.liquidCommerceOrderClientConstructor=t}async getClient(t){const e=`LiquidCommerceOrderClient_${JSON.stringify(t)}`;if(!this.services.has(e)){if(!this.liquidCommerceOrderClientConstructor)throw new Error("LiquidCommerceOrderClient constructor not set");const r=new this.liquidCommerceOrderClientConstructor(t);await r.init(),this.services.set(e,r)}return this.services.get(e)}getOrCreateService(t,e,...r){if(!this.services.has(t)){const i="getInstance"in e?e.getInstance(...r):new e(...r);this.services.set(t,i)}return this.services.get(t)}getAuthenticatedClient(t){return this.getOrCreateService(`OrderAuthenticatedClient_${JSON.stringify(t)}`,K,t)}getOrderService(t){return this.getOrCreateService(`OrderService_${t.getUniqueKey()}`,j,t)}}Z.instance=null;class tt{constructor(t){this.client=t,this.stripe=null,this.elements=null,this.paymentElement=null,this.events=["ready","change","loaderror","loaderstart"],this.eventsErrorMsg="The only Payment Element events allowed (change, ready, loaderstart, loadererror)",this.clientSecret=null,this.isHybrid=!0}async mount(t){var e;if(!document.getElementById(t.elementId))throw new Error(`Element with id "${t.elementId}" not found`);try{this.stripe=await L.loadStripe(t.key)}catch(t){throw new Error("Failed to initialize Stripe")}if(!this.stripe)throw new Error("Failed to initialize Stripe");this.clientSecret=t.clientSecret;try{const{setupIntent:r}=await this.stripe.retrieveSetupIntent(this.clientSecret);if("succeeded"===(null==r?void 0:r.status))throw new Error(`The client secret (${this.clientSecret}) has already been used previously. Generate a new one through a use session.`);this.isHybrid=null!==(e=t.isHybrid)&&void 0!==e?e:"on_session"===(null==r?void 0:r.usage)}catch(t){throw t}const r={clientSecret:t.clientSecret,appearance:this.mapAppearance(t.appearance),paymentMethodCreation:"manual"};this.elements=this.stripe.elements(r);const i=this.mapElementOptions(t.elementOptions);this.paymentElement=this.elements.create("payment",i),this.paymentElement.mount(`#${t.elementId}`)}async generateToken(){var t,e,r,i,o,s,n,a,E,l,d,I,h,c,u,R,N,p,T,A,v,O;if(!this.stripe||!this.elements||!this.clientSecret)return{type:"client_error",message:"Payment form has not been initialized"};const{error:m}=await this.elements.submit();if(m)return{type:"validation_error",message:m.message,code:m.code};if(this.isHybrid){const{error:d,paymentMethod:I}=await this.stripe.createPaymentMethod({elements:this.elements});if(d)return{type:"validation_error"===d.type?"validation_error":"api_error",message:d.message,code:d.code,param:d.param};const{setupIntent:h}=await this.stripe.retrieveSetupIntent(this.clientSecret);if(!h)return{type:"confirm_error",message:"There's been an error during your session confirmation",code:"7190"};const{data:c}=await this.confirmSession({paymentMethodId:null!==(t=null==I?void 0:I.id)&&void 0!==t?t:"",sessionSecret:null!==(e=null==h?void 0:h.id)&&void 0!==e?e:""});return c?I?{id:I.id,type:I.type,card:(null==I?void 0:I.card)?{brand:null!==(i=null===(r=I.card)||void 0===r?void 0:r.brand)&&void 0!==i?i:"",country:null!==(o=I.card.country)&&void 0!==o?o:"",expMonth:null!==(s=I.card.exp_month)&&void 0!==s?s:0,expYear:null!==(n=I.card.exp_year)&&void 0!==n?n:0,last4:null!==(a=I.card.last4)&&void 0!==a?a:"",funding:null!==(E=I.card.funding)&&void 0!==E?E:""}:void 0,created:null!==(l=null==I?void 0:I.created)&&void 0!==l?l:0}:{type:"client_error",message:"Failed to generate payment token"}:{type:"confirm_error",message:"There's been an error during your session confirmation",code:"7191"}}const{error:S,confirmationToken:y}=await this.stripe.createConfirmationToken({elements:this.elements});if(S)return{type:"validation_error"===S.type?"validation_error":"api_error",message:S.message,code:S.code};if(!(null==y?void 0:y.id))return{type:"confirm_error",message:"There's been an error during your session confirmation",code:"7190"};const{error:w,setupIntent:f}=await this.stripe.confirmSetup({clientSecret:this.clientSecret,confirmParams:{confirmation_token:y.id,return_url:window.location.href},redirect:"if_required"});if(w)return{type:"validation_error"===w.type?"validation_error":"confirm_error",message:w.message,code:w.code};if(!f||"succeeded"!==f.status)return{type:"confirm_error",message:"There's been an error during your session confirmation",code:"7190"};const C="string"==typeof f.payment_method?f.payment_method:null!==(I=null===(d=f.payment_method)||void 0===d?void 0:d.id)&&void 0!==I?I:"",{data:D}=await this.confirmSession({paymentMethodId:C,sessionSecret:f.id});if(!D)return{type:"confirm_error",message:"There's been an error during your session confirmation",code:"7191"};const W=null===(h=y.payment_method_preview)||void 0===h?void 0:h.card;return{id:C,type:null!==(u=null===(c=y.payment_method_preview)||void 0===c?void 0:c.type)&&void 0!==u?u:"card",card:W?{brand:null!==(R=W.brand)&&void 0!==R?R:"",country:null!==(N=W.country)&&void 0!==N?N:"",expMonth:null!==(p=W.exp_month)&&void 0!==p?p:0,expYear:null!==(T=W.exp_year)&&void 0!==T?T:0,last4:null!==(A=W.last4)&&void 0!==A?A:"",funding:null!==(v=W.funding)&&void 0!==v?v:""}:void 0,created:null!==(O=y.created)&&void 0!==O?O:0}}async confirmSession({sessionSecret:t,paymentMethodId:e}){try{if(!t||!e)throw new Error("customerId, sessionSecret, paymentMethodId are required");return await this.client.post("/users/payments/confirm",{sessionSecret:t,paymentMethodId:e})}catch(t){throw t}}subscribe(t,e){if(!this.paymentElement)throw new Error("Payment Element has not been initialized");if(!this.events.includes(t))throw new Error(this.eventsErrorMsg);this.paymentElement.on(t,e)}unsubscribe(t,e){if(!this.paymentElement)throw new Error("Payment Element has not been initialized");if(!this.events.includes(t))throw new Error(this.eventsErrorMsg);this.paymentElement.off(t,e)}mapAppearance(t){if(t)return{theme:"night"===t.theme?"night":"stripe",...t.variables&&{variables:t.variables}}}mapElementOptions(t){return{layout:null==t?void 0:t.layout,wallets:{applePay:"auto",googlePay:"auto"}}}unmount(){if(!this.paymentElement)throw new Error("Payment Element has not been initialized");this.paymentElement.unmount()}collapse(){if(!this.paymentElement)throw new Error("Payment Element has not been initialized");this.paymentElement.collapse()}destroy(){if(!this.paymentElement)throw new Error("Payment Element has not been initialized");this.paymentElement.destroy()}}var et,rt,it,ot,st;!function(t){t[t.X=0]="X",t[t.Y=1]="Y"}(et||(et={})),function(t){t[t.I=0]="I",t[t.J=1]="J"}(rt||(rt={})),function(t){t.V="values",t.T="createdAt"}(it||(it={})),function(t){t.P="pk_live_",t.Q="pk_test_",t.R="seti_",t.S="_secret_",t.T_C="ctoken_",t.U="prod"}(ot||(ot={})),function(t){t[t.M=2]="M",t.N="string",t.O="object"}(st||(st={}));class nt{rcd(t,e){var r;try{const i=null==t?void 0:t[it.V];this.v(i,Array.isArray,st.M,nt.F.G);const o=i[et.X];this.v(o,t=>typeof t===st.N,null,nt.F.H);const s=i[et.Y];return this.v(s,Array.isArray,st.M,nt.F.I),{key:this.a(o,e),secret:this.b(s[rt.I],s[rt.J]),createdAt:(null==t?void 0:t[it.T])||new Date,isHybrid:null===(r=null==t?void 0:t.isHybrid)||void 0===r||r}}catch(t){throw new Error(`${nt.F.J}${null==t?void 0:t.message}`)}}v(t,e,r,i){if(!e(t)||null!==r&&t.length<r)throw new Error(i)}a(t,e){return`${e===ot.U?"":ot.Q}${t}`}b(t,e){return t&&e?`${ot.R}${t}${ot.S}${e}`:""}ocd(t,e){const r=this.gsi(e).replace(ot.R,""),i=t.replace(ot.T_C,""),o=JSON.stringify([i,r]);return"function"==typeof btoa?btoa(o):Buffer.from(o).toString("base64")}gsi(t){return t.split(ot.S)[0]}gdk(t){try{const e="function"==typeof atob?atob(t):Buffer.from(t,"base64").toString("ascii"),[r,i]=JSON.parse(e);return`${ot.T_C}${r}${ot.R}${i}`}catch(t){throw new Error(`Failed to reconstruct the response data: ${t.message}`)}}dd(t,e){var r,i;const o=this.gdk(e);if(t&&o)try{const e="function"==typeof atob?atob(t):Buffer.from(t,"base64").toString("binary");let s="";for(let t=0;t<e.length;t++)s+=String.fromCharCode((null===(r=null==e?void 0:e.charCodeAt)||void 0===r?void 0:r.call(e,t))^(null===(i=null==o?void 0:o.charCodeAt)||void 0===i?void 0:i.call(o,t%o.length)));return JSON.parse(s)}catch(t){throw new Error(`Failed to reconstruct the response data: ${t.message}`)}return t}}nt.F={G:"Invalid response structure",H:"Invalid primary component",I:"Invalid secondary component",J:"Failed to reconstruct payment session data: "};class at{constructor(){this.services=new Map,this.liquidCommerceClientConstructor=null,this.paymentElementConstructor=null}static getInstance(){return at.instance||(at.instance=new at),at.instance}setLiquidCommerceClientConstructor(t){this.liquidCommerceClientConstructor=t}setPaymentElementConstructor(t){this.paymentElementConstructor=t}async getClient(t,e){const r=`LiquidCommerceClient_${t}_${JSON.stringify(e)}`;if(!this.services.has(r)){if(!this.liquidCommerceClientConstructor)throw new Error("LiquidCommerceClient constructor not set");const i=new this.liquidCommerceClientConstructor(t,e);await i.init(),this.services.set(r,i)}return this.services.get(r)}getPaymentElement(t){var e,r;const i=`PaymentElement_${null===(e=t.session)||void 0===e?void 0:e.key}_${null===(r=null==t?void 0:t.session)||void 0===r?void 0:r.secret}`;if(!this.services.has(i)){if(!this.paymentElementConstructor)throw new Error("PaymentElement constructor not set");const e=new this.paymentElementConstructor(t);this.services.set(i,e)}return this.services.get(i)}getOrCreateService(t,e,...r){if(!this.services.has(t)){const i="getInstance"in e?e.getInstance(...r):new e(...r);this.services.set(t,i)}return this.services.get(t)}getAuthenticatedClient(t){return this.getOrCreateService(`AuthenticatedClient_${JSON.stringify(t)}`,B,t)}getLocationHelperService(){return this.getOrCreateService("LocationHelperService",Y)}getAddressService(t){return this.getOrCreateService(`AddressService_${t.getUniqueKey()}`,k,t)}getCatalogHelperService(){return this.getOrCreateService("CatalogHelperService",G,this.getLocationHelperService())}getCatalogService(t){return this.getOrCreateService(`CatalogService_${t.getUniqueKey()}`,Q,t,this.getCatalogHelperService())}getCartHelperService(){return this.getOrCreateService("CartHelperService",F,this.getLocationHelperService())}getPaymentSessionHelperService(){return this.getOrCreateService("PaymentSessionHelperService",nt)}getCartService(t){return this.getOrCreateService(`CartService_${t.getUniqueKey()}`,V,t,this.getCartHelperService())}getUserService(t){return this.getOrCreateService(`UserService_${t.getUniqueKey()}`,J,t,this.getPaymentSessionHelperService())}getPaymentProviderService(t){return this.getOrCreateService(`PaymentProviderService_${t.getUniqueKey()}`,tt,t)}getPaymentService(t){return this.getOrCreateService(`PaymentService_${t.getUniqueKey()}`,z,this.getPaymentProviderService(t))}getCheckoutHelperService(){return this.getOrCreateService("CheckoutHelperService",$,this.getLocationHelperService())}getCheckoutService(t){return this.getOrCreateService(`CheckoutService_${t.getUniqueKey()}`,q,t,this.getCheckoutHelperService())}getWebhookService(t){return this.getOrCreateService(`WebhookService_${t.getUniqueKey()}`,X,t)}}at.instance=null;class Et{constructor(t,e){this.address={autocomplete:async t=>(await this.ensureAuthenticated(),this.addressService.autocomplete(t,this.config.googlePlacesApiKey)),details:async t=>(await this.ensureAuthenticated(),this.addressService.details(t,this.config.googlePlacesApiKey))},this.catalog={availability:async t=>(await this.ensureAuthenticated(),this.catalogService.availability(t)),search:async t=>(await this.ensureAuthenticated(),this.catalogService.search(t)),autocomplete:async t=>(await this.ensureAuthenticated(),this.catalogService.autocomplete(t)),listProducts:async(t={})=>(await this.ensureAuthenticated(),this.catalogService.listProducts(t)),iterateProducts:(t={})=>this.iterateCatalogProducts(t),createLocationContext:async t=>(await this.ensureAuthenticated(),this.catalogService.createLocationContext(t)),compose:async t=>(await this.ensureAuthenticated(),this.catalogService.compose(t))},this.cart={get:async(t,e)=>(await this.ensureAuthenticated(),this.cartService.get(t,e)),update:async t=>(await this.ensureAuthenticated(),this.cartService.update(t))},this.user={session:async t=>(await this.ensureAuthenticated(),this.userService.createOrUpdateSession(t)),paymentSession:async t=>(await this.ensureAuthenticated(),this.userService.createPaymentSession(t)),confirmPaymentSession:async t=>(await this.ensureAuthenticated(),this.userService.finalizePaymentSession(t)),fetch:async t=>(await this.ensureAuthenticated(),this.userService.fetchUser(t)),purge:async t=>(await this.ensureAuthenticated(),this.userService.purge(t)),addAddress:async t=>(await this.ensureAuthenticated(),this.userService.addAddress(t)),updateAddress:async t=>(await this.ensureAuthenticated(),this.userService.updateAddress(t)),purgeAddress:async t=>(await this.ensureAuthenticated(),this.userService.purgeAddress(t)),addPayment:async t=>(await this.ensureAuthenticated(),this.userService.addPayment(t)),updatePayment:async t=>(await this.ensureAuthenticated(),this.userService.updatePayment(t)),purgePayment:async(t,e)=>(await this.ensureAuthenticated(),this.userService.purgePayment(t,e))},this.payment={mount:async t=>(await this.ensureAuthenticated(),this.paymentService.mount(t)),generateToken:async()=>(await this.ensureAuthenticated(),this.paymentService.generateToken()),subscribe:(t,e)=>{this.paymentService.subscribe(t,e)},unsubscribe:(t,e)=>{this.paymentService.unsubscribe(t,e)},collapse:()=>{this.paymentService.collapse()},unmount:()=>{this.paymentService.unmount()},destroy:()=>{this.paymentService.destroy()}},this.checkout={prepare:async t=>(await this.ensureAuthenticated(),this.checkoutService.prepare(t)),complete:async t=>(await this.ensureAuthenticated(),this.checkoutService.complete(t))},this.webhook={test:async t=>(await this.ensureAuthenticated(),this.webhookService.test(t))},this.config=e,this.singletonManager=at.getInstance();const r=this.determineBaseURL(e);this.authenticatedClient=this.singletonManager.getAuthenticatedClient({apiKey:t,baseURL:r,env:e.env}),this.addressService=this.singletonManager.getAddressService(this.authenticatedClient),this.catalogService=this.singletonManager.getCatalogService(this.authenticatedClient),this.cartService=this.singletonManager.getCartService(this.authenticatedClient),this.userService=this.singletonManager.getUserService(this.authenticatedClient),this.paymentService=this.singletonManager.getPaymentService(this.authenticatedClient),this.checkoutService=this.singletonManager.getCheckoutService(this.authenticatedClient),this.webhookService=this.singletonManager.getWebhookService(this.authenticatedClient)}determineBaseURL(t){const e=t.env||exports.LIQUID_COMMERCE_ENV.STAGE;return _[e]}async init(){try{await this.authenticatedClient.authenticate()}catch(t){throw new Error("Authentication failed during initialization")}}async ensureAuthenticated(){this.authenticatedClient.isTokenExpired()&&await this.authenticatedClient.authenticate()}async auth(){try{return await this.authenticatedClient.getAuth()}catch(t){throw new Error("Authentication failed during initialization")}}async*iterateCatalogProducts(t){await this.ensureAuthenticated(),yield*this.catalogService.iterateProducts(t)}}class lt{constructor(t){this.order={fetch:async t=>(await this.ensureOrderAuthenticated(),this.orderService.fetch(t)),list:async t=>(await this.ensureOrderAuthenticated(),this.orderService.list(t))},this.config=t,this.singletonManager=Z.getInstance();const e=this.determineBaseURL(t);this.orderAuthenticatedClient=this.singletonManager.getAuthenticatedClient({userID:t.userID,password:t.password,baseURL:e}),this.orderService=this.singletonManager.getOrderService(this.orderAuthenticatedClient)}determineBaseURL(t){const e=t.env||exports.LIQUID_COMMERCE_ENV.STAGE;return _[e]}async init(){try{await this.orderAuthenticatedClient.authenticate()}catch(t){throw new Error("Order Authentication failed during initialization")}}async ensureOrderAuthenticated(){this.orderAuthenticatedClient.isTokenExpired()&&await this.orderAuthenticatedClient.authenticate()}}class dt{constructor(t){var e,r,i,o;if(this.provider=null,this.componentSet=null,this.uiComponent=null,this.isProviderLoading=!1,this.providerLoadPromise=null,this.allowedEvents=["ready","change","focus","blur","loaderror","loaderstart"],!(null==t?void 0:t.session.key)||!(null===(e=null==t?void 0:t.session)||void 0===e?void 0:e.secret))throw new Error("Authentication credentials are required.");this.k=t.session.key,this.s=null===(r=t.session)||void 0===r?void 0:r.secret,this.isHybrid=null!==(o=null===(i=t.session)||void 0===i?void 0:i.isHybrid)&&void 0!==o?o:null,this.paymentSessionHelperService=new nt}async ensureProviderReady(){return this.provider?this.provider:(this.isProviderLoading&&this.providerLoadPromise||(this.isProviderLoading=!0,this.providerLoadPromise=L.loadStripe(this.k).then(t=>{if(this.isProviderLoading=!1,!t)throw new Error("Failed to initialize payment provider");return this.provider=t,this.provider}).catch(t=>{throw this.isProviderLoading=!1,this.providerLoadPromise=null,t})),this.providerLoadPromise)}async mount(t){var e,r;if("undefined"==typeof document)throw new Error("Payment UI requires a browser environment.");const i=document.getElementById(t.elementId);if(!i)throw new Error(`Container element "${t.elementId}" not found.`);try{const o=await this.ensureProviderReady();if(!o)throw new Error("Provider initialization failed");if(null===this.isHybrid)try{const{setupIntent:t}=await o.retrieveSetupIntent(this.s);this.isHybrid="on_session"===(null==t?void 0:t.usage)}catch(t){this.isHybrid=!0}const s=null!==(e=null==t?void 0:t.appearance)&&void 0!==e?e:{theme:"stripe"},n={clientSecret:this.s,appearance:s};this.componentSet=o.elements(n);const a={layout:(null===(r=t.elementOptions)||void 0===r?void 0:r.layout)||"tabs",...t.elementOptions||{},defaultValues:{billingDetails:{name:"Guest",...this.isHybrid?{address:{country:"US"}}:{}}},fields:{billingDetails:{address:{postalCode:"auto",country:this.isHybrid?"never":"auto"}}},terms:{applePay:"never",auBecsDebit:"never",bancontact:"never",card:"never",cashapp:"never",googlePay:"never",ideal:"never",paypal:"never",sepaDebit:"never",sofort:"never",usBankAccount:"never"}};this.uiComponent=this.componentSet.create("payment",a),this.uiComponent.mount(i)}catch(t){throw this.logger.error("UI initialization failed:",t),new Error(`Failed to initialize payment UI: ${null==t?void 0:t.message}`)}}async createConfirmationToken(t){var e,r;if(!this.provider||!this.componentSet||!this.uiComponent)return{type:"client_error",message:"Payment component not initialized. Call mount() first."};try{const{error:i}=await this.componentSet.submit();if(i)return{type:"validation_error",message:i.message||"Form validation failed",code:i.code};const o={elements:this.componentSet,params:{return_url:null!==(e=null==t?void 0:t.returnUrl)&&void 0!==e?e:window.location.href,payment_method_data:{allow_redisplay:"always",...this.isHybrid?{billing_details:{name:"Guest",address:{country:"US"}}}:{}},...this.isHybrid?{shipping:{name:"Guest",address:{country:"US",city:null,line1:null,line2:null,postal_code:null,state:null}}}:{}}},{error:s,confirmationToken:n}=await this.provider.createConfirmationToken(o);if(s)return{type:"validation_error"===s.type?"validation_error":"api_error",message:s.message||"Token generation failed",code:s.code};if(!n||!n.id)return{type:"api_error",message:"Token generation incomplete."};if(!this.isHybrid){const{error:e}=await this.provider.confirmSetup({clientSecret:this.s,confirmParams:{confirmation_token:n.id,return_url:null!==(r=null==t?void 0:t.returnUrl)&&void 0!==r?r:window.location.href},redirect:"if_required"});if(e)return{type:"validation_error"===e.type?"validation_error":"confirm_error",message:e.message||"Payment authentication failed",code:e.code}}return{token:this.paymentSessionHelperService.ocd(n.id,this.s)}}catch(t){return this.logger.error("Token generation error:",t),{type:"client_error",message:`Unexpected error: ${null==t?void 0:t.message}`}}}get logger(){return{log:(...t)=>{},error:(...t)=>{}}}subscribe(t,e){this.uiComponent?this.allowedEvents.includes(t)?this.uiComponent.on(t,e):this.logger.error(`Event "${t}" not supported. Available: ${this.allowedEvents.join(", ")}`):this.logger.error("Cannot subscribe: Component not initialized.")}unsubscribe(t,e){this.uiComponent?this.allowedEvents.includes(t)?this.uiComponent.off(t,e):this.logger.error(`Event "${t}" not supported.`):this.logger.error("Cannot unsubscribe: Component not initialized.")}unmount(){this.uiComponent&&(this.uiComponent.unmount(),this.logger.log("Component unmounted."))}destroy(){this.uiComponent&&(this.uiComponent.destroy(),this.uiComponent=null,this.componentSet=null,this.logger.log("Component destroyed."))}collapse(){this.uiComponent&&"function"==typeof this.uiComponent.collapse?this.uiComponent.collapse():this.logger.error("Cannot collapse: Component not initialized or action not supported.")}}exports.LiquidCommerce=async function(t,e){const r=at.getInstance();return r.setLiquidCommerceClientConstructor(Et),await r.getClient(t,e)},exports.LiquidCommerceOrders=async function(t){const e=Z.getInstance();return e.setLiquidCommerceOrderClientConstructor(lt),await e.getClient(t)},exports.LiquidCommercePaymentElement=function(t){const e=at.getInstance();return"function"!=typeof e.setPaymentElementConstructor||"function"!=typeof e.getPaymentElement?(e.t||(e.t=new dt(t)),e.t):(e.setPaymentElementConstructor(dt),e.getPaymentElement(t))};
@@ -46,3 +46,10 @@ export declare const xhrFetch: HttpClient;
46
46
  * @return The appropriate implementation of the `HttpClient` interface.
47
47
  */
48
48
  export declare function getFetchImplementation(): HttpClient;
49
+ /**
50
+ * Builds the object thrown for a non-2xx response. Partners show `message` to shoppers, but not
51
+ * every upstream error puts its text there (Vault uses `error`, a rate limit sends a bare string),
52
+ * so fall back to those before the status. A `message` that is present is kept as sent, arrays
53
+ * included, so partners already reading it see no change.
54
+ */
55
+ export declare function toRequestError(body: unknown, status: number): Record<string, any>;
@@ -268,7 +268,9 @@ export declare enum ENUM_CHECKOUT_STATUS_CODE_ERROR {
268
268
  REQUEST_PRESALE_NOT_STARTED_ERROR = 5508,
269
269
  REQUEST_CART_MIN_RETAILER_NOT_MET_ERROR = 5509,
270
270
  REQUEST_CHECKOUT_PROCESSING_LOCK_NOT_ACQUIRED_ERROR = 5510,
271
- REQUEST_BOPIS_PRODUCT_NOT_OPTED_IN_ERROR = 5511
271
+ REQUEST_BOPIS_PRODUCT_NOT_OPTED_IN_ERROR = 5511,
272
+ REQUEST_PAYMENT_PLATFORM_MISMATCH_ERROR = 5512,
273
+ REQUEST_PAYMENT_VERIFICATION_ERROR = 5513
272
274
  }
273
275
  export declare enum ENUM_CHECKOUT_STATUS_CODE_MESSAGE {
274
276
  REQUEST_DEFAULT_ERROR = "There's been an error with your checkout request.",
@@ -281,11 +283,11 @@ export declare enum ENUM_CHECKOUT_STATUS_CODE_MESSAGE {
281
283
  REQUEST_VALIDATION_ERROR = "There's been an error with your request parameters, check and try again.",
282
284
  REQUEST_TAX_ERROR = "There was an error calculating tax for your order.",
283
285
  REQUEST_COMPLETE_TOKEN = "The checkout token provided is invalid, check and try again.",
284
- REQUEST_DEFAULT_COMPLETE_ERROR = "There was an error completing your checkout, confirm through the (prepare) method and try again.",
286
+ REQUEST_DEFAULT_COMPLETE_ERROR = "There was an error completing your checkout, please try again later.",
285
287
  REQUEST_CHECKOUT_COMPLETE_UPDATE_ERROR = "Unable to update your checkout status.",
286
288
  REQUEST_CHECKOUT_COMPLETE_SAVE_ERROR = "Unable to save your completed checkout.",
287
289
  REQUEST_CHECKOUT_HAS_COMPLETE_ERROR = "This checkout has already been processed, create a new cart to process a new checkout.",
288
- REQUEST_NO_CART_ITEM_ERROR = "Item(s) in your cart are no longer available",
290
+ REQUEST_NO_CART_ITEM_ERROR = "Item(s) in your cart are no longer available.",
289
291
  REQUEST_NO_CUSTOMER_FOUND_ERROR = "The customer account was not found.",
290
292
  REQUEST_PAYMENT_ATTACHED_ERROR = "The payment attached to the checkout is not a valid payment method for this customer.",
291
293
  REQUEST_SHIPPING_ADDRESS_ERROR = "The address in your cart has changed, check and try again.",
@@ -301,7 +303,67 @@ export declare enum ENUM_CHECKOUT_STATUS_CODE_MESSAGE {
301
303
  REQUEST_PRESALE_NOT_STARTED_ERROR = "The presale for this item has not started yet. Please check back later.",
302
304
  REQUEST_CART_MIN_RETAILER_NOT_MET_ERROR = "Some items in your cart do not meet the minimum retailer requirements per order quantity. Please adjust your cart and try again.",
303
305
  REQUEST_CHECKOUT_PROCESSING_LOCK_NOT_ACQUIRED_ERROR = "This checkout is currently being processed, please try again later.",
304
- REQUEST_BOPIS_PRODUCT_NOT_OPTED_IN_ERROR = "One or more items in your cart are no longer eligible for in-store pickup (BOPIS) and were removed. Please review your cart and try again."
306
+ REQUEST_BOPIS_PRODUCT_NOT_OPTED_IN_ERROR = "One or more items in your cart are no longer eligible for in-store pickup (BOPIS) and were removed. Please review your cart and try again.",
307
+ REQUEST_PAYMENT_PLATFORM_MISMATCH_ERROR = "This payment method is not available for this checkout. Please re-enter your card details.",
308
+ REQUEST_PAYMENT_VERIFICATION_ERROR = "We couldn't verify your payment information. Please check your card details and billing address, then try again."
309
+ }
310
+ /**
311
+ * Payment errors a checkout completion can return. The payment service owns these codes and
312
+ * messages; they arrive in `statusCode` and `message` alongside the checkout codes above.
313
+ */
314
+ export declare enum ENUM_PAYMENT_STATUS_CODE_ERROR {
315
+ PAYMENT_METHOD_INVALID = 8100,
316
+ PAYMENT_METHOD_NOT_ON_FILE = 8101,
317
+ PAYMENT_METHOD_EXPIRED = 8102,
318
+ PAYMENT_DECLINED = 8103,
319
+ PAYMENT_AUTHENTICATION_REQUIRED = 8104,
320
+ PAYMENT_CARD_ERROR = 8105,
321
+ PAYMENT_INSUFFICIENT_FUNDS = 8106,
322
+ PAYMENT_CURRENCY_MISMATCH = 8107,
323
+ PAYMENT_AMOUNT_TOO_LARGE = 8108,
324
+ PAYMENT_AMOUNT_TOO_SMALL = 8109,
325
+ PAYMENT_INVALID_CVC = 8110,
326
+ PAYMENT_INVALID_EXPIRY = 8111,
327
+ PAYMENT_CARD_DECLINED = 8112,
328
+ PAYMENT_CARD_RESTRICTED = 8113,
329
+ PAYMENT_PROCESSING_ERROR = 8114,
330
+ PAYMENT_CUSTOMER_MAX_PAYMENT_ATTEMPTS = 8115,
331
+ PAYMENT_INVALID_ACCOUNT = 8116,
332
+ PAYMENT_RISK_LEVEL_HIGH = 8117,
333
+ PAYMENT_STRIPE_ACCOUNT_ERROR = 8118,
334
+ PAYMENT_STRIPE_API_ERROR = 8119,
335
+ PAYMENT_STRIPE_RATE_LIMIT = 8120,
336
+ PAYMENT_METHOD_UNSUPPORTED = 8121,
337
+ PAYMENT_METHOD_NOT_FOUND = 40003
338
+ }
339
+ export declare enum ENUM_PAYMENT_STATUS_CODE_MESSAGE {
340
+ PAYMENT_METHOD_INVALID = "Invalid payment method provided",
341
+ PAYMENT_METHOD_NOT_ON_FILE = "Payment method not found",
342
+ PAYMENT_METHOD_EXPIRED = "Payment method has expired",
343
+ PAYMENT_DECLINED = "Payment was declined",
344
+ PAYMENT_AUTHENTICATION_REQUIRED = "Payment requires authentication",
345
+ PAYMENT_CARD_ERROR = "There was an error processing the card",
346
+ PAYMENT_INSUFFICIENT_FUNDS = "Insufficient funds in the account",
347
+ PAYMENT_CURRENCY_MISMATCH = "Currency mismatch in the payment",
348
+ PAYMENT_AMOUNT_TOO_LARGE = "Payment amount exceeds the maximum allowed",
349
+ PAYMENT_AMOUNT_TOO_SMALL = "Payment amount is below the minimum allowed",
350
+ PAYMENT_INVALID_CVC = "Invalid card CVC provided",
351
+ PAYMENT_INVALID_EXPIRY = "Invalid card expiry date",
352
+ PAYMENT_CARD_DECLINED = "The card was declined",
353
+ PAYMENT_CARD_RESTRICTED = "The card has restrictions preventing this payment",
354
+ PAYMENT_PROCESSING_ERROR = "An error occurred while processing the payment",
355
+ PAYMENT_CUSTOMER_MAX_PAYMENT_ATTEMPTS = "Maximum payment attempts reached for this customer",
356
+ PAYMENT_INVALID_ACCOUNT = "The account provided is invalid",
357
+ PAYMENT_RISK_LEVEL_HIGH = "The payment was flagged as high risk",
358
+ PAYMENT_STRIPE_ACCOUNT_ERROR = "There was an error with the Stripe account",
359
+ PAYMENT_STRIPE_API_ERROR = "An error occurred with the Stripe API",
360
+ PAYMENT_STRIPE_RATE_LIMIT = "Stripe rate limit exceeded",
361
+ PAYMENT_METHOD_UNSUPPORTED = "The payment method is not supported for this transaction",
362
+ PAYMENT_METHOD_NOT_FOUND = "Payment method not found"
363
+ }
364
+ /** A coupon that stopped qualifying fails completion with HTTP 422; `message` gives the reason. */
365
+ export declare enum ENUM_DISCOUNT_STATUS_CODE_ERROR {
366
+ REQUEST_COUPON_REJECTED_AT_COMPLETE_ERROR = 5600
305
367
  }
306
368
  export declare enum CHECKOUT_EVENT_ENUM {
307
369
  ERROR_PROCESSING_GIFT_CARDS = "ErrorProcessingGiftCards",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liquidcommerce/cloud-sdk",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "LiquidCommerce Cloud SDK",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.esm.js",