Liferay.Loader.define("data-engine-js-components-web@1.0.89/js/custom/form-report/utils/searchLocation",["module","exports","require","./data"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.transformSearchLocationValues=void 0;var o=a("./data");const parse=(e,t)=>{try{return JSON.parse(e)}catch(e){return console.error(e),void 0!==t?t:{}}},transformSearchLocationValues=(e,t)=>{let a={},r=[...e],s=[];return Object.values(e).forEach((({label:c,name:n,type:l})=>{if("search_location"===l){const e=parse(c,{address:"Address",city:"City",country:"Country",place:"Search Location","postal-code":"Postal Code",state:"State"}),r=Object.keys(e),l={},i={},{values:d}=t[n],u=r.map((t=>(Array.isArray(d)&&((0,o.toArray)(d).forEach((e=>{const a=l[t]||[],o=parse(e,{});l[t]=[...a,{value:o[t]}]})),i[t]={totalEntries:Object.keys(l[t]).length,type:t,values:l[t]}),{columns:{},label:e[t],name:t,options:{},parentFieldName:n,rows:{},type:t})));a[n]=i,s=s.concat([...u])}else a=t,r=e})),{data:a,fields:s.length?r.filter((e=>"search_location"!==e.type)).concat(s):r}};t.transformSearchLocationValues=transformSearchLocationValues}}));
//# sourceMappingURL=searchLocation.js.map