Liferay.Loader.define("commerce-frontend-js@4.0.75/ServiceProvider/commerce-delivery-cart/v1.0/Cart",["module","exports","require","../../../utilities/AJAX/index"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function Cart(t){return{cartsByAccountIdAndChannelIdURL:(e,a)=>resolveCartsByAccountIdAndChannelIdPath(t,e,a),createCartByChannelId:(a,r)=>n.default.POST("".concat(resolveChannelsPath(t,a)).concat(e,"?nestedFields=cartItems"),r),createCouponCodeByCartId:(e,a)=>n.default.POST("".concat(resolveCartsPath(t,e),"/coupon-code"),a),deleteCartById:e=>n.default.DELETE(resolveCartsPath(t,e)),getCartById:e=>n.default.GET(resolveCartsPath(t,e)),getCartByIdWithItems:e=>n.default.GET(resolveCartsPath(t,e)+"?nestedFields=cartItems"),getCartsByAccountIdAndChannelId:(e,a,r)=>n.default.GET(resolveCartsByAccountIdAndChannelIdPath(t,e,a,r)),replaceCartById:(e,a)=>n.default.PUT(resolveCartsPath(t,e),a),updateCartById:(e,a)=>n.default.PATCH(resolveCartsPath(t,e)+"?nestedFields=cartItems",a)}};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(a("../../../utilities/AJAX/index"));const e="/carts",r="/channels",c="v1.0";function resolveCartsPath(t="",a){return"".concat(t).concat(c).concat(e,"/").concat(a)}function resolveChannelsPath(e="",t){return"".concat(e).concat(c).concat(r,"/").concat(t)}function resolveCartsByAccountIdAndChannelIdPath(t="",a,n,r){const c=new URL("".concat(Liferay.ThemeDisplay.getPathContext()).concat(resolveChannelsPath(t,n),"/account/").concat(a).concat(e),Liferay.ThemeDisplay.getPortalURL());return r&&Object.keys(r).forEach((e=>{c.searchParams.set(e,r[e])})),c.pathname+c.search}}}));
//# sourceMappingURL=Cart.js.map