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