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