"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// index.typings.ts
var index_typings_exports = {};
__export(index_typings_exports, {
  AdditionalFeeSource: () => AdditionalFeeSource,
  AppliedDiscountDiscountType: () => AppliedDiscountDiscountType,
  BalanceType: () => BalanceType,
  ChannelType: () => ChannelType,
  ChargeType: () => ChargeType,
  DescriptionLineType: () => DescriptionLineType,
  DimensionsUnit: () => DimensionsUnit,
  DiscountType: () => DiscountType,
  FallbackReason: () => FallbackReason,
  FileType: () => FileType,
  ItemAvailabilityStatus: () => ItemAvailabilityStatus,
  ItemTypePreset: () => ItemTypePreset,
  JurisdictionType: () => JurisdictionType,
  LimitedQuotaType: () => LimitedQuotaType,
  ManualCalculationReason: () => ManualCalculationReason,
  NameInLineItem: () => NameInLineItem,
  NameInOther: () => NameInOther,
  PaymentOptionType: () => PaymentOptionType,
  PickupMethod: () => PickupMethod,
  PlatformFeeChargeType: () => PlatformFeeChargeType,
  ProductPeriodAlignment: () => ProductPeriodAlignment,
  QuotaType: () => QuotaType,
  RateType: () => RateType,
  RuleType: () => RuleType,
  Severity: () => Severity,
  SubscriptionFrequency: () => SubscriptionFrequency,
  SuggestedFix: () => SuggestedFix,
  TaxableAddressType: () => TaxableAddressType,
  VatType: () => VatType,
  WebhookIdentityType: () => WebhookIdentityType,
  WeightUnit: () => WeightUnit,
  addToCurrentCart: () => addToCurrentCart2,
  createCheckoutFromCurrentCart: () => createCheckoutFromCurrentCart2,
  deleteCurrentCart: () => deleteCurrentCart2,
  estimateCurrentCartTotals: () => estimateCurrentCartTotals2,
  getCurrentCart: () => getCurrentCart,
  removeCouponFromCurrentCart: () => removeCouponFromCurrentCart2,
  removeLineItemsFromCurrentCart: () => removeLineItemsFromCurrentCart2,
  updateCurrentCart: () => updateCurrentCart2,
  updateCurrentCartLineItemQuantity: () => updateCurrentCartLineItemQuantity2
});
module.exports = __toCommonJS(index_typings_exports);

// src/ecom-v1-cart-current-cart.universal.ts
var import_transform_error = require("@wix/sdk-runtime/transform-error");
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");

// src/ecom-v1-cart-current-cart.http.ts
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
var import_float = require("@wix/sdk-runtime/transformations/float");
var import_float2 = require("@wix/sdk-runtime/transformations/float");
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
function resolveComWixEcomCartApiV1CurrentCartServiceUrl(opts) {
  const domainToMappings = {
    "www.wixapis.com": [
      {
        srcPath: "/ecom/v1/carts",
        destPath: "/v1/carts"
      }
    ],
    "www.wixgateway.com": [
      {
        srcPath: "/ecom/v1/carts",
        destPath: "/v1/carts"
      }
    ],
    _: [
      {
        srcPath: "/_api/ecom-cart",
        destPath: ""
      },
      {
        srcPath: "/_api/cart",
        destPath: ""
      },
      {
        srcPath: "/ecom/v1/carts",
        destPath: "/v1/carts"
      }
    ],
    "manage._base_domain_": [
      {
        srcPath: "/ecom/v1/carts",
        destPath: "/v1/carts"
      }
    ],
    "editor._base_domain_": [
      {
        srcPath: "/_api/ecom-cart",
        destPath: ""
      }
    ],
    "blocks._base_domain_": [
      {
        srcPath: "/_api/ecom-cart",
        destPath: ""
      }
    ],
    "create.editorx": [
      {
        srcPath: "/_api/ecom-cart",
        destPath: ""
      }
    ],
    "*.dev.wix-code.com": [
      {
        srcPath: "/_api/ecom-cart",
        destPath: ""
      }
    ],
    "www._base_domain_": [
      {
        srcPath: "/_api/ecom-cart",
        destPath: ""
      }
    ],
    "bo._base_domain_": [
      {
        srcPath: "/ecom/v1/carts",
        destPath: "/v1/carts"
      }
    ],
    "wixbo.ai": [
      {
        srcPath: "/ecom/v1/carts",
        destPath: "/v1/carts"
      }
    ],
    "wix-bo.com": [
      {
        srcPath: "/ecom/v1/carts",
        destPath: "/v1/carts"
      }
    ],
    "editor.wixapps.net": [
      {
        srcPath: "/_api/ecom-cart",
        destPath: ""
      }
    ],
    "apps._base_domain_": [
      {
        srcPath: "/ecom/v1/carts",
        destPath: "/v1/carts"
      }
    ],
    "api._api_base_domain_": [
      {
        srcPath: "/cart-v1-proxy",
        destPath: ""
      }
    ],
    "ecom.wixapps.net": [
      {
        srcPath: "/_api/ecom-cart",
        destPath: ""
      }
    ]
  };
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
}
var PACKAGE_NAME = "@wix/auto_sdk_ecom_current-cart";
function currentCartGetCurrentCart(payload) {
  function __currentCartGetCurrentCart({ host }) {
    const metadata = {
      entityFqdn: "wix.ecom.v1.cart",
      method: "GET",
      methodFqn: "com.wix.ecom.cart.api.v1.CurrentCartService.GetCurrentCart",
      packageName: PACKAGE_NAME,
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveComWixEcomCartApiV1CurrentCartServiceUrl({
        protoPath: "/v1/carts/current",
        data: payload,
        host
      }),
      params: (0, import_rest_modules.toURLSearchParams)(payload),
      transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
        {
          transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "cart.createdDate" },
            { path: "cart.updatedDate" },
            { path: "cart.lineItems.image.urlExpirationDate" },
            {
              path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
            },
            { path: "cart.lineItems.serviceProperties.scheduledDate" },
            { path: "cart.lineItems.serviceProperties.endDate" }
          ]
        },
        {
          transformFn: import_float2.transformRESTFloatToSDKFloat,
          paths: [
            { path: "cart.lineItems.image.focalPoint.x" },
            { path: "cart.lineItems.image.focalPoint.y" },
            { path: "cart.lineItems.physicalProperties.weight" },
            {
              path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
            },
            { path: "cart.contactInfo.address.geocode.latitude" },
            { path: "cart.contactInfo.address.geocode.longitude" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __currentCartGetCurrentCart;
}
function updateCurrentCart(payload) {
  function __updateCurrentCart({ host }) {
    const serializedData = (0, import_transform_paths.transformPaths)(payload, [
      {
        transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
        paths: [{ path: "cartFieldmask" }]
      },
      {
        transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
        paths: [
          { path: "cartInfo.createdDate" },
          { path: "cartInfo.updatedDate" },
          { path: "cartInfo.lineItems.image.urlExpirationDate" },
          {
            path: "cartInfo.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
          },
          { path: "cartInfo.lineItems.serviceProperties.scheduledDate" },
          { path: "cartInfo.lineItems.serviceProperties.endDate" },
          { path: "lineItems.image.urlExpirationDate" },
          {
            path: "lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
          },
          { path: "lineItems.serviceProperties.scheduledDate" },
          { path: "lineItems.serviceProperties.endDate" },
          {
            path: "customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
          },
          { path: "customLineItems.serviceProperties.scheduledDate" },
          { path: "customLineItems.serviceProperties.endDate" }
        ]
      },
      {
        transformFn: import_float.transformSDKFloatToRESTFloat,
        paths: [
          { path: "cartInfo.lineItems.image.focalPoint.x" },
          { path: "cartInfo.lineItems.image.focalPoint.y" },
          { path: "lineItems.image.focalPoint.x" },
          { path: "lineItems.image.focalPoint.y" },
          { path: "cartInfo.lineItems.physicalProperties.weight" },
          {
            path: "cartInfo.lineItems.catalogOverrideFields.physicalProperties.weight"
          },
          { path: "cartInfo.contactInfo.address.geocode.latitude" },
          { path: "cartInfo.contactInfo.address.geocode.longitude" },
          { path: "lineItems.physicalProperties.weight" },
          { path: "lineItems.catalogOverrideFields.physicalProperties.weight" },
          { path: "customLineItems.physicalProperties.weight" }
        ]
      }
    ]);
    const metadata = {
      entityFqdn: "wix.ecom.v1.cart",
      method: "PATCH",
      methodFqn: "com.wix.ecom.cart.api.v1.CurrentCartService.UpdateCurrentCart",
      packageName: PACKAGE_NAME,
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveComWixEcomCartApiV1CurrentCartServiceUrl({
        protoPath: "/v1/carts/current",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
        {
          transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "cart.createdDate" },
            { path: "cart.updatedDate" },
            { path: "cart.lineItems.image.urlExpirationDate" },
            {
              path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
            },
            { path: "cart.lineItems.serviceProperties.scheduledDate" },
            { path: "cart.lineItems.serviceProperties.endDate" }
          ]
        },
        {
          transformFn: import_float2.transformRESTFloatToSDKFloat,
          paths: [
            { path: "cart.lineItems.image.focalPoint.x" },
            { path: "cart.lineItems.image.focalPoint.y" },
            { path: "cart.lineItems.physicalProperties.weight" },
            {
              path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
            },
            { path: "cart.contactInfo.address.geocode.latitude" },
            { path: "cart.contactInfo.address.geocode.longitude" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __updateCurrentCart;
}
function addToCurrentCart(payload) {
  function __addToCurrentCart({ host }) {
    const serializedData = (0, import_transform_paths.transformPaths)(payload, [
      {
        transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
        paths: [
          { path: "lineItems.image.urlExpirationDate" },
          {
            path: "lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
          },
          { path: "lineItems.serviceProperties.scheduledDate" },
          { path: "lineItems.serviceProperties.endDate" },
          {
            path: "customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
          },
          { path: "customLineItems.serviceProperties.scheduledDate" },
          { path: "customLineItems.serviceProperties.endDate" }
        ]
      },
      {
        transformFn: import_float.transformSDKFloatToRESTFloat,
        paths: [
          { path: "lineItems.image.focalPoint.x" },
          { path: "lineItems.image.focalPoint.y" },
          { path: "lineItems.physicalProperties.weight" },
          { path: "lineItems.catalogOverrideFields.physicalProperties.weight" },
          { path: "customLineItems.physicalProperties.weight" }
        ]
      }
    ]);
    const metadata = {
      entityFqdn: "wix.ecom.v1.cart",
      method: "POST",
      methodFqn: "com.wix.ecom.cart.api.v1.CurrentCartService.AddToCurrentCart",
      packageName: PACKAGE_NAME,
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveComWixEcomCartApiV1CurrentCartServiceUrl({
        protoPath: "/v1/carts/current/add-to-cart",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
        {
          transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "cart.createdDate" },
            { path: "cart.updatedDate" },
            { path: "cart.lineItems.image.urlExpirationDate" },
            {
              path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
            },
            { path: "cart.lineItems.serviceProperties.scheduledDate" },
            { path: "cart.lineItems.serviceProperties.endDate" }
          ]
        },
        {
          transformFn: import_float2.transformRESTFloatToSDKFloat,
          paths: [
            { path: "cart.lineItems.image.focalPoint.x" },
            { path: "cart.lineItems.image.focalPoint.y" },
            { path: "cart.lineItems.physicalProperties.weight" },
            {
              path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
            },
            { path: "cart.contactInfo.address.geocode.latitude" },
            { path: "cart.contactInfo.address.geocode.longitude" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __addToCurrentCart;
}
function removeLineItemsFromCurrentCart(payload) {
  function __removeLineItemsFromCurrentCart({ host }) {
    const metadata = {
      entityFqdn: "wix.ecom.v1.cart",
      method: "POST",
      methodFqn: "com.wix.ecom.cart.api.v1.CurrentCartService.RemoveLineItemsFromCurrentCart",
      packageName: PACKAGE_NAME,
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveComWixEcomCartApiV1CurrentCartServiceUrl({
        protoPath: "/v1/carts/current/remove-line-items",
        data: payload,
        host
      }),
      data: payload,
      transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
        {
          transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "cart.createdDate" },
            { path: "cart.updatedDate" },
            { path: "cart.lineItems.image.urlExpirationDate" },
            {
              path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
            },
            { path: "cart.lineItems.serviceProperties.scheduledDate" },
            { path: "cart.lineItems.serviceProperties.endDate" }
          ]
        },
        {
          transformFn: import_float2.transformRESTFloatToSDKFloat,
          paths: [
            { path: "cart.lineItems.image.focalPoint.x" },
            { path: "cart.lineItems.image.focalPoint.y" },
            { path: "cart.lineItems.physicalProperties.weight" },
            {
              path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
            },
            { path: "cart.contactInfo.address.geocode.latitude" },
            { path: "cart.contactInfo.address.geocode.longitude" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __removeLineItemsFromCurrentCart;
}
function createCheckoutFromCurrentCart(payload) {
  function __createCheckoutFromCurrentCart({ host }) {
    const serializedData = (0, import_transform_paths.transformPaths)(payload, [
      {
        transformFn: import_float.transformSDKFloatToRESTFloat,
        paths: [
          { path: "shippingAddress.geocode.latitude" },
          { path: "shippingAddress.geocode.longitude" },
          { path: "billingAddress.geocode.latitude" },
          { path: "billingAddress.geocode.longitude" }
        ]
      }
    ]);
    const metadata = {
      entityFqdn: "wix.ecom.v1.cart",
      method: "POST",
      methodFqn: "com.wix.ecom.cart.api.v1.CurrentCartService.CreateCheckoutFromCurrentCart",
      packageName: PACKAGE_NAME,
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveComWixEcomCartApiV1CurrentCartServiceUrl({
        protoPath: "/v1/carts/current/create-checkout",
        data: serializedData,
        host
      }),
      data: serializedData
    };
    return metadata;
  }
  return __createCheckoutFromCurrentCart;
}
function removeCouponFromCurrentCart(payload) {
  function __removeCouponFromCurrentCart({ host }) {
    const metadata = {
      entityFqdn: "wix.ecom.v1.cart",
      method: "POST",
      methodFqn: "com.wix.ecom.cart.api.v1.CurrentCartService.RemoveCouponFromCurrentCart",
      packageName: PACKAGE_NAME,
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveComWixEcomCartApiV1CurrentCartServiceUrl({
        protoPath: "/v1/carts/current/remove-coupon",
        data: payload,
        host
      }),
      data: payload,
      transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
        {
          transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "cart.createdDate" },
            { path: "cart.updatedDate" },
            { path: "cart.lineItems.image.urlExpirationDate" },
            {
              path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
            },
            { path: "cart.lineItems.serviceProperties.scheduledDate" },
            { path: "cart.lineItems.serviceProperties.endDate" }
          ]
        },
        {
          transformFn: import_float2.transformRESTFloatToSDKFloat,
          paths: [
            { path: "cart.lineItems.image.focalPoint.x" },
            { path: "cart.lineItems.image.focalPoint.y" },
            { path: "cart.lineItems.physicalProperties.weight" },
            {
              path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
            },
            { path: "cart.contactInfo.address.geocode.latitude" },
            { path: "cart.contactInfo.address.geocode.longitude" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __removeCouponFromCurrentCart;
}
function updateCurrentCartLineItemQuantity(payload) {
  function __updateCurrentCartLineItemQuantity({ host }) {
    const metadata = {
      entityFqdn: "wix.ecom.v1.cart",
      method: "POST",
      methodFqn: "com.wix.ecom.cart.api.v1.CurrentCartService.UpdateCurrentCartLineItemQuantity",
      packageName: PACKAGE_NAME,
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveComWixEcomCartApiV1CurrentCartServiceUrl({
        protoPath: "/v1/carts/current/update-line-items-quantity",
        data: payload,
        host
      }),
      data: payload,
      transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
        {
          transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "cart.createdDate" },
            { path: "cart.updatedDate" },
            { path: "cart.lineItems.image.urlExpirationDate" },
            {
              path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
            },
            { path: "cart.lineItems.serviceProperties.scheduledDate" },
            { path: "cart.lineItems.serviceProperties.endDate" }
          ]
        },
        {
          transformFn: import_float2.transformRESTFloatToSDKFloat,
          paths: [
            { path: "cart.lineItems.image.focalPoint.x" },
            { path: "cart.lineItems.image.focalPoint.y" },
            { path: "cart.lineItems.physicalProperties.weight" },
            {
              path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
            },
            { path: "cart.contactInfo.address.geocode.latitude" },
            { path: "cart.contactInfo.address.geocode.longitude" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __updateCurrentCartLineItemQuantity;
}
function estimateCurrentCartTotals(payload) {
  function __estimateCurrentCartTotals({ host }) {
    const serializedData = (0, import_transform_paths.transformPaths)(payload, [
      {
        transformFn: import_float.transformSDKFloatToRESTFloat,
        paths: [
          { path: "shippingAddress.geocode.latitude" },
          { path: "shippingAddress.geocode.longitude" },
          { path: "billingAddress.geocode.latitude" },
          { path: "billingAddress.geocode.longitude" }
        ]
      }
    ]);
    const metadata = {
      entityFqdn: "wix.ecom.v1.cart",
      method: "POST",
      methodFqn: "com.wix.ecom.cart.api.v1.CurrentCartService.EstimateCurrentCartTotals",
      packageName: PACKAGE_NAME,
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveComWixEcomCartApiV1CurrentCartServiceUrl({
        protoPath: "/v1/carts/current/estimate-totals",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
        {
          transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "cart.createdDate" },
            { path: "cart.updatedDate" },
            { path: "cart.lineItems.image.urlExpirationDate" },
            {
              path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
            },
            { path: "cart.lineItems.serviceProperties.scheduledDate" },
            { path: "cart.lineItems.serviceProperties.endDate" },
            {
              path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from"
            },
            {
              path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to"
            },
            {
              path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from"
            },
            {
              path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to"
            },
            { path: "membershipOptions.eligibleMemberships.expirationDate" },
            {
              path: "membershipOptions.invalidMemberships.membership.expirationDate"
            }
          ]
        },
        {
          transformFn: import_float2.transformRESTFloatToSDKFloat,
          paths: [
            { path: "cart.lineItems.image.focalPoint.x" },
            { path: "cart.lineItems.image.focalPoint.y" },
            { path: "cart.lineItems.physicalProperties.weight" },
            {
              path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
            },
            { path: "cart.contactInfo.address.geocode.latitude" },
            { path: "cart.contactInfo.address.geocode.longitude" },
            {
              path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude"
            },
            {
              path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude"
            },
            {
              path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude"
            },
            {
              path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude"
            },
            { path: "appliedDiscounts.merchantDiscount.percentage" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __estimateCurrentCartTotals;
}
function deleteCurrentCart(payload) {
  function __deleteCurrentCart({ host }) {
    const metadata = {
      entityFqdn: "wix.ecom.v1.cart",
      method: "DELETE",
      methodFqn: "com.wix.ecom.cart.api.v1.CurrentCartService.DeleteCurrentCart",
      packageName: PACKAGE_NAME,
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveComWixEcomCartApiV1CurrentCartServiceUrl({
        protoPath: "/v1/carts/current",
        data: payload,
        host
      }),
      params: (0, import_rest_modules.toURLSearchParams)(payload)
    };
    return metadata;
  }
  return __deleteCurrentCart;
}

// src/ecom-v1-cart-current-cart.universal.ts
var import_address = require("@wix/sdk-runtime/transformations/address");
var import_address2 = require("@wix/sdk-runtime/transformations/address");
var import_image = require("@wix/sdk-runtime/transformations/image");
var import_image2 = require("@wix/sdk-runtime/transformations/image");
var import_page_url_v2 = require("@wix/sdk-runtime/transformations/page-url-v2");
var import_page_url_v22 = require("@wix/sdk-runtime/transformations/page-url-v2");
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
var DescriptionLineType = /* @__PURE__ */ ((DescriptionLineType2) => {
  DescriptionLineType2["UNRECOGNISED"] = "UNRECOGNISED";
  DescriptionLineType2["PLAIN_TEXT"] = "PLAIN_TEXT";
  DescriptionLineType2["COLOR"] = "COLOR";
  return DescriptionLineType2;
})(DescriptionLineType || {});
var ItemAvailabilityStatus = /* @__PURE__ */ ((ItemAvailabilityStatus2) => {
  ItemAvailabilityStatus2["AVAILABLE"] = "AVAILABLE";
  ItemAvailabilityStatus2["NOT_FOUND"] = "NOT_FOUND";
  ItemAvailabilityStatus2["NOT_AVAILABLE"] = "NOT_AVAILABLE";
  ItemAvailabilityStatus2["PARTIALLY_AVAILABLE"] = "PARTIALLY_AVAILABLE";
  return ItemAvailabilityStatus2;
})(ItemAvailabilityStatus || {});
var DimensionsUnit = /* @__PURE__ */ ((DimensionsUnit2) => {
  DimensionsUnit2["UNKNOWN_DIMENSIONS_UNIT"] = "UNKNOWN_DIMENSIONS_UNIT";
  DimensionsUnit2["MM"] = "MM";
  DimensionsUnit2["CM"] = "CM";
  DimensionsUnit2["M"] = "M";
  DimensionsUnit2["IN"] = "IN";
  DimensionsUnit2["FT"] = "FT";
  DimensionsUnit2["YD"] = "YD";
  return DimensionsUnit2;
})(DimensionsUnit || {});
var ItemTypePreset = /* @__PURE__ */ ((ItemTypePreset2) => {
  ItemTypePreset2["UNRECOGNISED"] = "UNRECOGNISED";
  ItemTypePreset2["PHYSICAL"] = "PHYSICAL";
  ItemTypePreset2["DIGITAL"] = "DIGITAL";
  ItemTypePreset2["GIFT_CARD"] = "GIFT_CARD";
  ItemTypePreset2["SERVICE"] = "SERVICE";
  return ItemTypePreset2;
})(ItemTypePreset || {});
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
  SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
  SubscriptionFrequency2["DAY"] = "DAY";
  SubscriptionFrequency2["WEEK"] = "WEEK";
  SubscriptionFrequency2["MONTH"] = "MONTH";
  SubscriptionFrequency2["YEAR"] = "YEAR";
  return SubscriptionFrequency2;
})(SubscriptionFrequency || {});
var ProductPeriodAlignment = /* @__PURE__ */ ((ProductPeriodAlignment2) => {
  ProductPeriodAlignment2["ALIGNED_WITH_BILLING_PERIOD"] = "ALIGNED_WITH_BILLING_PERIOD";
  ProductPeriodAlignment2["NOT_ALIGNED_WITH_BILLING_PERIOD"] = "NOT_ALIGNED_WITH_BILLING_PERIOD";
  return ProductPeriodAlignment2;
})(ProductPeriodAlignment || {});
var FileType = /* @__PURE__ */ ((FileType2) => {
  FileType2["UNSPECIFIED"] = "UNSPECIFIED";
  FileType2["SECURE_PICTURE"] = "SECURE_PICTURE";
  FileType2["SECURE_VIDEO"] = "SECURE_VIDEO";
  FileType2["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
  FileType2["SECURE_MUSIC"] = "SECURE_MUSIC";
  FileType2["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
  FileType2["SECURE_RAW"] = "SECURE_RAW";
  return FileType2;
})(FileType || {});
var PaymentOptionType = /* @__PURE__ */ ((PaymentOptionType2) => {
  PaymentOptionType2["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
  PaymentOptionType2["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
  PaymentOptionType2["MEMBERSHIP"] = "MEMBERSHIP";
  PaymentOptionType2["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
  PaymentOptionType2["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
  PaymentOptionType2["MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"] = "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER";
  return PaymentOptionType2;
})(PaymentOptionType || {});
var TaxableAddressType = /* @__PURE__ */ ((TaxableAddressType2) => {
  TaxableAddressType2["BUSINESS"] = "BUSINESS";
  TaxableAddressType2["BILLING"] = "BILLING";
  TaxableAddressType2["SHIPPING"] = "SHIPPING";
  return TaxableAddressType2;
})(TaxableAddressType || {});
var PlatformFeeChargeType = /* @__PURE__ */ ((PlatformFeeChargeType2) => {
  PlatformFeeChargeType2["PASS_ON"] = "PASS_ON";
  PlatformFeeChargeType2["ABSORBED"] = "ABSORBED";
  return PlatformFeeChargeType2;
})(PlatformFeeChargeType || {});
var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
  WeightUnit2["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
  WeightUnit2["KG"] = "KG";
  WeightUnit2["LB"] = "LB";
  return WeightUnit2;
})(WeightUnit || {});
var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
  DiscountType2["GLOBAL"] = "GLOBAL";
  DiscountType2["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
  DiscountType2["SHIPPING"] = "SHIPPING";
  return DiscountType2;
})(DiscountType || {});
var VatType = /* @__PURE__ */ ((VatType2) => {
  VatType2["UNSPECIFIED"] = "UNSPECIFIED";
  VatType2["CPF"] = "CPF";
  VatType2["CNPJ"] = "CNPJ";
  return VatType2;
})(VatType || {});
var JurisdictionType = /* @__PURE__ */ ((JurisdictionType2) => {
  JurisdictionType2["UNDEFINED"] = "UNDEFINED";
  JurisdictionType2["COUNTRY"] = "COUNTRY";
  JurisdictionType2["STATE"] = "STATE";
  JurisdictionType2["COUNTY"] = "COUNTY";
  JurisdictionType2["CITY"] = "CITY";
  JurisdictionType2["SPECIAL"] = "SPECIAL";
  return JurisdictionType2;
})(JurisdictionType || {});
var RateType = /* @__PURE__ */ ((RateType2) => {
  RateType2["NO_TAX_COLLECTED"] = "NO_TAX_COLLECTED";
  RateType2["MANUAL_RATE"] = "MANUAL_RATE";
  RateType2["AUTO_RATE"] = "AUTO_RATE";
  RateType2["FALLBACK_RATE"] = "FALLBACK_RATE";
  return RateType2;
})(RateType || {});
var ManualCalculationReason = /* @__PURE__ */ ((ManualCalculationReason2) => {
  ManualCalculationReason2["GLOBAL_SETTING_TO_MANUAL"] = "GLOBAL_SETTING_TO_MANUAL";
  ManualCalculationReason2["REGION_SETTING_TO_MANUAL"] = "REGION_SETTING_TO_MANUAL";
  return ManualCalculationReason2;
})(ManualCalculationReason || {});
var FallbackReason = /* @__PURE__ */ ((FallbackReason2) => {
  FallbackReason2["AUTO_TAX_FAILED"] = "AUTO_TAX_FAILED";
  FallbackReason2["AUTO_TAX_DEACTIVATED"] = "AUTO_TAX_DEACTIVATED";
  return FallbackReason2;
})(FallbackReason || {});
var PickupMethod = /* @__PURE__ */ ((PickupMethod2) => {
  PickupMethod2["STORE_PICKUP"] = "STORE_PICKUP";
  PickupMethod2["PICKUP_POINT"] = "PICKUP_POINT";
  return PickupMethod2;
})(PickupMethod || {});
var ChargeType = /* @__PURE__ */ ((ChargeType2) => {
  ChargeType2["HANDLING_FEE"] = "HANDLING_FEE";
  ChargeType2["INSURANCE"] = "INSURANCE";
  return ChargeType2;
})(ChargeType || {});
var AppliedDiscountDiscountType = /* @__PURE__ */ ((AppliedDiscountDiscountType2) => {
  AppliedDiscountDiscountType2["GLOBAL"] = "GLOBAL";
  AppliedDiscountDiscountType2["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
  AppliedDiscountDiscountType2["SHIPPING"] = "SHIPPING";
  return AppliedDiscountDiscountType2;
})(AppliedDiscountDiscountType || {});
var RuleType = /* @__PURE__ */ ((RuleType2) => {
  RuleType2["VALIDATION"] = "VALIDATION";
  RuleType2["OTHER"] = "OTHER";
  RuleType2["MAX"] = "MAX";
  RuleType2["MIN"] = "MIN";
  RuleType2["MAX_LENGTH"] = "MAX_LENGTH";
  RuleType2["MIN_LENGTH"] = "MIN_LENGTH";
  RuleType2["MAX_SIZE"] = "MAX_SIZE";
  RuleType2["MIN_SIZE"] = "MIN_SIZE";
  RuleType2["FORMAT"] = "FORMAT";
  RuleType2["DECIMAL_LTE"] = "DECIMAL_LTE";
  RuleType2["DECIMAL_GTE"] = "DECIMAL_GTE";
  RuleType2["DECIMAL_LT"] = "DECIMAL_LT";
  RuleType2["DECIMAL_GT"] = "DECIMAL_GT";
  RuleType2["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
  RuleType2["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
  RuleType2["REQUIRED_FIELD"] = "REQUIRED_FIELD";
  RuleType2["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
  RuleType2["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
  RuleType2["EXACT_LENGTH"] = "EXACT_LENGTH";
  RuleType2["EXACT_SIZE"] = "EXACT_SIZE";
  RuleType2["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
  return RuleType2;
})(RuleType || {});
var BalanceType = /* @__PURE__ */ ((BalanceType2) => {
  BalanceType2["PUNCH_CARD"] = "PUNCH_CARD";
  BalanceType2["CREDIT"] = "CREDIT";
  return BalanceType2;
})(BalanceType || {});
var QuotaType = /* @__PURE__ */ ((QuotaType2) => {
  QuotaType2["LIMITED"] = "LIMITED";
  QuotaType2["UNLIMITED"] = "UNLIMITED";
  return QuotaType2;
})(QuotaType || {});
var LimitedQuotaType = /* @__PURE__ */ ((LimitedQuotaType2) => {
  LimitedQuotaType2["PUNCH_CARD"] = "PUNCH_CARD";
  LimitedQuotaType2["CREDIT"] = "CREDIT";
  return LimitedQuotaType2;
})(LimitedQuotaType || {});
var AdditionalFeeSource = /* @__PURE__ */ ((AdditionalFeeSource2) => {
  AdditionalFeeSource2["UNKNOWN_ADDITIONAL_FEE_SOURCE"] = "UNKNOWN_ADDITIONAL_FEE_SOURCE";
  AdditionalFeeSource2["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
  AdditionalFeeSource2["ITEM"] = "ITEM";
  AdditionalFeeSource2["MANUAL"] = "MANUAL";
  AdditionalFeeSource2["SHIPPING"] = "SHIPPING";
  AdditionalFeeSource2["PLATFORM"] = "PLATFORM";
  return AdditionalFeeSource2;
})(AdditionalFeeSource || {});
var Severity = /* @__PURE__ */ ((Severity2) => {
  Severity2["WARNING"] = "WARNING";
  Severity2["ERROR"] = "ERROR";
  return Severity2;
})(Severity || {});
var NameInOther = /* @__PURE__ */ ((NameInOther2) => {
  NameInOther2["OTHER_DEFAULT"] = "OTHER_DEFAULT";
  return NameInOther2;
})(NameInOther || {});
var NameInLineItem = /* @__PURE__ */ ((NameInLineItem2) => {
  NameInLineItem2["LINE_ITEM_DEFAULT"] = "LINE_ITEM_DEFAULT";
  return NameInLineItem2;
})(NameInLineItem || {});
var SuggestedFix = /* @__PURE__ */ ((SuggestedFix2) => {
  SuggestedFix2["UNKNOWN_SUGGESTED_FIX"] = "UNKNOWN_SUGGESTED_FIX";
  SuggestedFix2["REMOVE_LINE_ITEM"] = "REMOVE_LINE_ITEM";
  return SuggestedFix2;
})(SuggestedFix || {});
var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
  ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
  ChannelType2["WEB"] = "WEB";
  ChannelType2["POS"] = "POS";
  ChannelType2["EBAY"] = "EBAY";
  ChannelType2["AMAZON"] = "AMAZON";
  ChannelType2["OTHER_PLATFORM"] = "OTHER_PLATFORM";
  ChannelType2["WIX_APP_STORE"] = "WIX_APP_STORE";
  ChannelType2["WIX_INVOICES"] = "WIX_INVOICES";
  ChannelType2["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
  ChannelType2["WISH"] = "WISH";
  ChannelType2["CLASS_PASS"] = "CLASS_PASS";
  ChannelType2["GLOBAL_E"] = "GLOBAL_E";
  ChannelType2["FACEBOOK"] = "FACEBOOK";
  ChannelType2["ETSY"] = "ETSY";
  ChannelType2["TIKTOK"] = "TIKTOK";
  ChannelType2["FAIRE_COM"] = "FAIRE_COM";
  ChannelType2["PAYPAL_AGENTIC_CHECKOUT"] = "PAYPAL_AGENTIC_CHECKOUT";
  ChannelType2["STRIPE_AGENTIC_CHECKOUT"] = "STRIPE_AGENTIC_CHECKOUT";
  ChannelType2["WIX_INVOICES_PLATFORM"] = "WIX_INVOICES_PLATFORM";
  ChannelType2["UCP_AGENTIC_CHECKOUT"] = "UCP_AGENTIC_CHECKOUT";
  return ChannelType2;
})(ChannelType || {});
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
  WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
  WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
  WebhookIdentityType2["MEMBER"] = "MEMBER";
  WebhookIdentityType2["WIX_USER"] = "WIX_USER";
  WebhookIdentityType2["APP"] = "APP";
  return WebhookIdentityType2;
})(WebhookIdentityType || {});
async function getCurrentCart() {
  const { httpClient, sideEffects } = arguments[0];
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
  const reqOpts = currentCartGetCurrentCart(payload);
  sideEffects?.onSiteCall?.();
  try {
    const result = await httpClient.request(reqOpts);
    sideEffects?.onSuccess?.(result);
    return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
      (0, import_transform_paths2.transformPaths)(result.data, [
        {
          transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
          paths: [{ path: "cart.lineItems.url" }]
        },
        {
          transformFn: import_image2.transformRESTImageToSDKImage,
          paths: [
            { path: "cart.lineItems.image" },
            { path: "cart.lineItems.catalogOverrideFields.image" }
          ]
        },
        {
          transformFn: import_address2.transformRESTAddressToSDKAddress,
          paths: [{ path: "cart.contactInfo.address" }]
        }
      ])
    )?.cart;
  } catch (err) {
    const transformedError = (0, import_transform_error.transformError)(
      err,
      {
        spreadPathsToArguments: {},
        explicitPathsToArguments: {},
        singleArgumentUnchanged: false
      },
      []
    );
    sideEffects?.onError?.(err);
    throw transformedError;
  }
}
async function updateCurrentCart2(options) {
  const { httpClient, sideEffects } = arguments[1];
  const payload = (0, import_transform_paths2.transformPaths)(
    (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
      cartInfo: options?.cartInfo,
      couponCode: options?.couponCode,
      lineItems: options?.lineItems,
      customLineItems: options?.customLineItems
    }),
    [
      {
        transformFn: import_page_url_v2.transformSDKPageURLV2ToRESTPageURLV2,
        paths: [
          { path: "cartInfo.lineItems.url" },
          { path: "lineItems.url" },
          { path: "customLineItems.url" }
        ]
      },
      {
        transformFn: import_image.transformSDKImageToRESTImage,
        paths: [
          { path: "cartInfo.lineItems.image" },
          { path: "cartInfo.lineItems.catalogOverrideFields.image" },
          { path: "lineItems.image" },
          { path: "lineItems.catalogOverrideFields.image" },
          { path: "customLineItems.media" }
        ]
      },
      {
        transformFn: import_address.transformSDKAddressToRESTAddress,
        paths: [{ path: "cartInfo.contactInfo.address" }]
      }
    ]
  );
  const reqOpts = updateCurrentCart(payload);
  sideEffects?.onSiteCall?.();
  try {
    const result = await httpClient.request(reqOpts);
    sideEffects?.onSuccess?.(result);
    return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
      (0, import_transform_paths2.transformPaths)(result.data, [
        {
          transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
          paths: [{ path: "cart.lineItems.url" }]
        },
        {
          transformFn: import_image2.transformRESTImageToSDKImage,
          paths: [
            { path: "cart.lineItems.image" },
            { path: "cart.lineItems.catalogOverrideFields.image" }
          ]
        },
        {
          transformFn: import_address2.transformRESTAddressToSDKAddress,
          paths: [{ path: "cart.contactInfo.address" }]
        }
      ])
    )?.cart;
  } catch (err) {
    const transformedError = (0, import_transform_error.transformError)(
      err,
      {
        spreadPathsToArguments: {},
        explicitPathsToArguments: {
          cartInfo: "$[0].cartInfo",
          couponCode: "$[0].couponCode",
          lineItems: "$[0].lineItems",
          customLineItems: "$[0].customLineItems"
        },
        singleArgumentUnchanged: false
      },
      ["options"]
    );
    sideEffects?.onError?.(err);
    throw transformedError;
  }
}
async function addToCurrentCart2(options) {
  const { httpClient, sideEffects } = arguments[1];
  const payload = (0, import_transform_paths2.transformPaths)(
    (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
      lineItems: options?.lineItems,
      customLineItems: options?.customLineItems,
      businessLocationId: options?.businessLocationId
    }),
    [
      {
        transformFn: import_page_url_v2.transformSDKPageURLV2ToRESTPageURLV2,
        paths: [{ path: "lineItems.url" }, { path: "customLineItems.url" }]
      },
      {
        transformFn: import_image.transformSDKImageToRESTImage,
        paths: [
          { path: "lineItems.image" },
          { path: "lineItems.catalogOverrideFields.image" },
          { path: "customLineItems.media" }
        ]
      }
    ]
  );
  const reqOpts = addToCurrentCart(payload);
  sideEffects?.onSiteCall?.();
  try {
    const result = await httpClient.request(reqOpts);
    sideEffects?.onSuccess?.(result);
    return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
      (0, import_transform_paths2.transformPaths)(result.data, [
        {
          transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
          paths: [{ path: "cart.lineItems.url" }]
        },
        {
          transformFn: import_image2.transformRESTImageToSDKImage,
          paths: [
            { path: "cart.lineItems.image" },
            { path: "cart.lineItems.catalogOverrideFields.image" }
          ]
        },
        {
          transformFn: import_address2.transformRESTAddressToSDKAddress,
          paths: [{ path: "cart.contactInfo.address" }]
        }
      ])
    );
  } catch (err) {
    const transformedError = (0, import_transform_error.transformError)(
      err,
      {
        spreadPathsToArguments: {},
        explicitPathsToArguments: {
          lineItems: "$[0].lineItems",
          customLineItems: "$[0].customLineItems",
          businessLocationId: "$[0].businessLocationId"
        },
        singleArgumentUnchanged: false
      },
      ["options"]
    );
    sideEffects?.onError?.(err);
    throw transformedError;
  }
}
async function removeLineItemsFromCurrentCart2(lineItemIds) {
  const { httpClient, sideEffects } = arguments[1];
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
    lineItemIds
  });
  const reqOpts = removeLineItemsFromCurrentCart(payload);
  sideEffects?.onSiteCall?.();
  try {
    const result = await httpClient.request(reqOpts);
    sideEffects?.onSuccess?.(result);
    return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
      (0, import_transform_paths2.transformPaths)(result.data, [
        {
          transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
          paths: [{ path: "cart.lineItems.url" }]
        },
        {
          transformFn: import_image2.transformRESTImageToSDKImage,
          paths: [
            { path: "cart.lineItems.image" },
            { path: "cart.lineItems.catalogOverrideFields.image" }
          ]
        },
        {
          transformFn: import_address2.transformRESTAddressToSDKAddress,
          paths: [{ path: "cart.contactInfo.address" }]
        }
      ])
    );
  } catch (err) {
    const transformedError = (0, import_transform_error.transformError)(
      err,
      {
        spreadPathsToArguments: {},
        explicitPathsToArguments: { lineItemIds: "$[0]" },
        singleArgumentUnchanged: false
      },
      ["lineItemIds"]
    );
    sideEffects?.onError?.(err);
    throw transformedError;
  }
}
async function createCheckoutFromCurrentCart2(options) {
  const { httpClient, sideEffects } = arguments[1];
  const payload = (0, import_transform_paths2.transformPaths)(
    (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
      channelType: options?.channelType,
      shippingAddress: options?.shippingAddress,
      billingAddress: options?.billingAddress,
      selectedShippingOption: options?.selectedShippingOption,
      email: options?.email
    }),
    [
      {
        transformFn: import_address.transformSDKAddressToRESTAddress,
        paths: [{ path: "shippingAddress" }, { path: "billingAddress" }]
      }
    ]
  );
  const reqOpts = createCheckoutFromCurrentCart(payload);
  sideEffects?.onSiteCall?.();
  try {
    const result = await httpClient.request(reqOpts);
    sideEffects?.onSuccess?.(result);
    return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
  } catch (err) {
    const transformedError = (0, import_transform_error.transformError)(
      err,
      {
        spreadPathsToArguments: {},
        explicitPathsToArguments: {
          channelType: "$[0].channelType",
          shippingAddress: "$[0].shippingAddress",
          billingAddress: "$[0].billingAddress",
          selectedShippingOption: "$[0].selectedShippingOption",
          email: "$[0].email"
        },
        singleArgumentUnchanged: false
      },
      ["options"]
    );
    sideEffects?.onError?.(err);
    throw transformedError;
  }
}
async function removeCouponFromCurrentCart2() {
  const { httpClient, sideEffects } = arguments[0];
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
  const reqOpts = removeCouponFromCurrentCart(payload);
  sideEffects?.onSiteCall?.();
  try {
    const result = await httpClient.request(reqOpts);
    sideEffects?.onSuccess?.(result);
    return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
      (0, import_transform_paths2.transformPaths)(result.data, [
        {
          transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
          paths: [{ path: "cart.lineItems.url" }]
        },
        {
          transformFn: import_image2.transformRESTImageToSDKImage,
          paths: [
            { path: "cart.lineItems.image" },
            { path: "cart.lineItems.catalogOverrideFields.image" }
          ]
        },
        {
          transformFn: import_address2.transformRESTAddressToSDKAddress,
          paths: [{ path: "cart.contactInfo.address" }]
        }
      ])
    );
  } catch (err) {
    const transformedError = (0, import_transform_error.transformError)(
      err,
      {
        spreadPathsToArguments: {},
        explicitPathsToArguments: {},
        singleArgumentUnchanged: false
      },
      []
    );
    sideEffects?.onError?.(err);
    throw transformedError;
  }
}
async function updateCurrentCartLineItemQuantity2(lineItems) {
  const { httpClient, sideEffects } = arguments[1];
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
    lineItems
  });
  const reqOpts = updateCurrentCartLineItemQuantity(payload);
  sideEffects?.onSiteCall?.();
  try {
    const result = await httpClient.request(reqOpts);
    sideEffects?.onSuccess?.(result);
    return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
      (0, import_transform_paths2.transformPaths)(result.data, [
        {
          transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
          paths: [{ path: "cart.lineItems.url" }]
        },
        {
          transformFn: import_image2.transformRESTImageToSDKImage,
          paths: [
            { path: "cart.lineItems.image" },
            { path: "cart.lineItems.catalogOverrideFields.image" }
          ]
        },
        {
          transformFn: import_address2.transformRESTAddressToSDKAddress,
          paths: [{ path: "cart.contactInfo.address" }]
        }
      ])
    );
  } catch (err) {
    const transformedError = (0, import_transform_error.transformError)(
      err,
      {
        spreadPathsToArguments: {},
        explicitPathsToArguments: { lineItems: "$[0]" },
        singleArgumentUnchanged: false
      },
      ["lineItems"]
    );
    sideEffects?.onError?.(err);
    throw transformedError;
  }
}
async function estimateCurrentCartTotals2(options) {
  const { httpClient, sideEffects } = arguments[1];
  const payload = (0, import_transform_paths2.transformPaths)(
    (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
      selectedShippingOption: options?.selectedShippingOption,
      shippingAddress: options?.shippingAddress,
      billingAddress: options?.billingAddress,
      selectedMemberships: options?.selectedMemberships,
      calculateTax: options?.calculateTax,
      calculateShipping: options?.calculateShipping,
      calculateAdditionalFees: options?.calculateAdditionalFees
    }),
    [
      {
        transformFn: import_address.transformSDKAddressToRESTAddress,
        paths: [{ path: "shippingAddress" }, { path: "billingAddress" }]
      }
    ]
  );
  const reqOpts = estimateCurrentCartTotals(payload);
  sideEffects?.onSiteCall?.();
  try {
    const result = await httpClient.request(reqOpts);
    sideEffects?.onSuccess?.(result);
    return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
      (0, import_transform_paths2.transformPaths)(result.data, [
        {
          transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
          paths: [{ path: "cart.lineItems.url" }]
        },
        {
          transformFn: import_image2.transformRESTImageToSDKImage,
          paths: [
            { path: "cart.lineItems.image" },
            { path: "cart.lineItems.catalogOverrideFields.image" }
          ]
        },
        {
          transformFn: import_address2.transformRESTAddressToSDKAddress,
          paths: [
            { path: "cart.contactInfo.address" },
            {
              path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address"
            },
            {
              path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address"
            }
          ]
        }
      ])
    );
  } catch (err) {
    const transformedError = (0, import_transform_error.transformError)(
      err,
      {
        spreadPathsToArguments: {},
        explicitPathsToArguments: {
          selectedShippingOption: "$[0].selectedShippingOption",
          shippingAddress: "$[0].shippingAddress",
          billingAddress: "$[0].billingAddress",
          selectedMemberships: "$[0].selectedMemberships",
          calculateTax: "$[0].calculateTax",
          calculateShipping: "$[0].calculateShipping",
          calculateAdditionalFees: "$[0].calculateAdditionalFees"
        },
        singleArgumentUnchanged: false
      },
      ["options"]
    );
    sideEffects?.onError?.(err);
    throw transformedError;
  }
}
async function deleteCurrentCart2() {
  const { httpClient, sideEffects } = arguments[0];
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
  const reqOpts = deleteCurrentCart(payload);
  sideEffects?.onSiteCall?.();
  try {
    const result = await httpClient.request(reqOpts);
    sideEffects?.onSuccess?.(result);
  } catch (err) {
    const transformedError = (0, import_transform_error.transformError)(
      err,
      {
        spreadPathsToArguments: {},
        explicitPathsToArguments: {},
        singleArgumentUnchanged: false
      },
      []
    );
    sideEffects?.onError?.(err);
    throw transformedError;
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  AdditionalFeeSource,
  AppliedDiscountDiscountType,
  BalanceType,
  ChannelType,
  ChargeType,
  DescriptionLineType,
  DimensionsUnit,
  DiscountType,
  FallbackReason,
  FileType,
  ItemAvailabilityStatus,
  ItemTypePreset,
  JurisdictionType,
  LimitedQuotaType,
  ManualCalculationReason,
  NameInLineItem,
  NameInOther,
  PaymentOptionType,
  PickupMethod,
  PlatformFeeChargeType,
  ProductPeriodAlignment,
  QuotaType,
  RateType,
  RuleType,
  Severity,
  SubscriptionFrequency,
  SuggestedFix,
  TaxableAddressType,
  VatType,
  WebhookIdentityType,
  WeightUnit,
  addToCurrentCart,
  createCheckoutFromCurrentCart,
  deleteCurrentCart,
  estimateCurrentCartTotals,
  getCurrentCart,
  removeCouponFromCurrentCart,
  removeLineItemsFromCurrentCart,
  updateCurrentCart,
  updateCurrentCartLineItemQuantity
});
//# sourceMappingURL=index.typings.js.map