Liferay.Loader.define("commerce-frontend-js@4.0.52/components/mini_cart/CartItemsList",["module","exports","require","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$react","./MiniCartContext","./util/constants"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=l(r("@frontend-taglib-clay$clayui/icon")),n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var c=a?Object.getOwnPropertyDescriptor(e,n):null;c&&(c.get||c.set)?Object.defineProperty(r,n,c):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),c=l(r("./MiniCartContext")),i=r("./util/constants");function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function l(e){return e&&e.__esModule?e:{default:e}}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){p(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var m=function(){const{CartViews:e,cartState:t,isUpdating:r,labels:o,setCartState:l,summaryDataMapper:f}=(0,n.useContext)(c.default),{cartItems:p=[],summary:m={}}=t;return n.default.createElement("div",{className:"mini-cart-items-list"},n.default.createElement(e.ItemsListActions,null),p.length>0?n.default.createElement(n.default.Fragment,null,n.default.createElement("div",{className:"mini-cart-cart-items"},p.map(((t,r)=>n.default.createElement(e.Item,u({index:r,key:t.id,updateCartItem:e=>{const r=e(t);l((e=>s(s({},e),{},{cartItems:p.map((e=>e.id===t.id?r:e))})))}},t))))),n.default.createElement(e.Summary,{dataMapper:f,isLoading:r,summaryData:m})):n.default.createElement("div",{className:"empty-cart"},n.default.createElement("div",{className:"empty-cart-icon mb-3"},n.default.createElement(a.default,{symbol:"shopping-cart"})),n.default.createElement("p",{className:"empty-cart-label"},o[i.ADD_PRODUCT])))};t.default=m}}));
//# sourceMappingURL=CartItemsList.js.map