Liferay.Loader.define("data-engine-js-components-web@1.0.55/js/custom/form-report/components/card/CardList",["module","exports","require","liferay!frontend-js-react-web$react","../../utils/data","../../utils/fieldTypes","../chart/bar/MultiBarChart","../chart/bar/SimpleBarChart","../chart/pie/PieChart","../empty-state/EmptyState","../list/List","./Card"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({data:t,fields:r}){let u=!1;const c=r.map(((r,c)=>{var s,i,o;const d=null!==(s=null!==(i=null===(o=t[r.parentFieldName])||void 0===o?void 0:o[r.name])&&void 0!==i?i:t[r.name])&&void 0!==s?s:{},{values:p={},structure:y={},summary:b={},totalEntries:O}=d,j=(0,n.sumTotalEntries)(p);r=m(m({},r),l.default[r.type]);const E=e({field:r,structure:y,sumTotalValues:j,summary:b,totalEntries:O,values:p});return null===E?null:(u=!0,a.default.createElement(f.default,{field:r,index:c,key:c,summary:b,totalEntries:O||j},E))}));if(!u)return a.default.createElement(i.default,null);return c};var a=p(r("liferay!frontend-js-react-web$react")),n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();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 l=a?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(r,n,l):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("../../utils/data")),l=p(r("../../utils/fieldTypes")),u=p(r("../chart/bar/MultiBarChart")),c=p(r("../chart/bar/SimpleBarChart")),s=p(r("../chart/pie/PieChart")),i=p(r("../empty-state/EmptyState")),o=p(r("../list/List")),f=p(r("./Card"));function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function p(e){return e&&e.__esModule?e:{default:e}}function y(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 m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e=({field:e,structure:t,sumTotalValues:r,summary:l,totalEntries:i,values:f})=>{const{options:d,type:p}=e;switch(p){case"address":case"city":case"color":case"country":case"date":case"date_time":case"place":case"postal-code":case"state":case"text":return Array.isArray(f)?a.default.createElement(o.default,{data:(0,n.toArray)(f),field:e,totalEntries:i,type:p}):"";case"checkbox":{const e={};for(const[t,r]of Object.entries(f)){e["true"===t?Liferay.Language.get("true"):Liferay.Language.get("false")]=r}return a.default.createElement(s.default,{data:(0,n.default)(d,e),totalEntries:r})}case"checkbox_multiple":return a.default.createElement(c.default,{data:(0,n.default)(d,f),totalEntries:i});case"grid":return a.default.createElement(u.default,{data:f,field:e,structure:t,totalEntries:r});case"numeric":return Array.isArray(f)?a.default.createElement(o.default,{data:(0,n.toArray)(f),field:e,summary:l,totalEntries:i}):"";case"object-relationship":case"radio":case"select":return a.default.createElement(s.default,{data:(0,n.default)(d,f),totalEntries:r});default:return null}}}}));
//# sourceMappingURL=CardList.js.map