Liferay.Loader.define("data-engine-taglib@3.3.26/data_layout_builder/js/utils/dataConverter.es",["module","exports","require","data-engine-js-components-web","./dataDefinition.es","./normalizers.es"],(function(e,a,i){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.getDDMFormField=l,a.getDefaultDataLayout=function(e){const{dataDefinitionFields:a}=e;return{dataLayoutPages:[{dataLayoutRows:a.map((({name:e})=>({dataLayoutColumns:[{columnSize:12,fieldNames:[e]}]})))}]}},a.getFieldSetDDMForm=function({allowInvalidAvailableLocalesForProperty:e,editingLanguageId:a,fieldSet:i,fieldTypes:t}){var n,o;const{defaultDataLayout:s,defaultLanguageId:u}=i,{dataLayoutPages:g}=(0,d.normalizeDataLayout)(s,u),f=e?i:(0,d.normalizeDataDefinition)(i,u),r=g.map((e=>({rows:e.dataLayoutRows.map((e=>({columns:e.dataLayoutColumns.map((({columnSize:e,fieldNames:i})=>({fields:i.map((e=>l({dataDefinition:f,defaultLanguageId:u,editingLanguageId:a,fieldName:e,fieldTypes:t}))),size:e})))})))}))),{description:m,id:p,name:c}=f;return{description:null!==(n=m[a])&&void 0!==n?n:m[u],id:p,localizedDescription:m,localizedTitle:c,pages:r,title:null!==(o=c[a])&&void 0!==o?o:c[u]}};var t=i("data-engine-js-components-web"),n=i("./dataDefinition.es"),d=i("./normalizers.es");function l({dataDefinition:e,defaultLanguageId:a=themeDisplay.getDefaultLanguageId(),editingLanguageId:i=a,fieldName:d,fieldTypes:o}){const s=(0,n.getDataDefinitionField)(e,d),{fieldType:u,nestedDataDefinitionFields:g}=s;"ddm-text-html"===u&&(s.fieldType="rich_text");const f=(0,t.getDDMFormFieldSettingsContext)({dataDefinitionField:s,defaultLanguageId:a,editingLanguageId:i,fieldTypes:o}),r={nestedFields:g.map((({name:t})=>l({dataDefinition:e,defaultLanguageId:a,editingLanguageId:i,fieldName:t,fieldTypes:o}))),settingsContext:f};return new t.PagesVisitor(f.pages).mapFields((e=>{const{fieldName:t,localizable:n,type:d,value:l}=e;if("options"===d&&l)r[t]=l[i];else if("name"===t)r.fieldName=l;else{var o;r[t]=n?null!==(o=l[i])&&void 0!==o?o:l[a]:l}})),r.instanceId||(r.instanceId=t.FieldSupport.generateInstanceId()),r}}}));
//# sourceMappingURL=dataConverter.es.js.map