Liferay.Loader.define("data-engine-js-components-web@1.0.55/js/utils/dataConverter",["module","exports","require","./visitors.es"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.fieldToDataDefinition=function t({nestedFields:n=[],settingsContext:r}){const a={customProperties:{},nestedDataDefinitionFields:n.map((e=>t(e)))};return new i.PagesVisitor(r.pages).mapFields((({fieldName:t,localizable:n,localizedValue:i={},value:r})=>{"predefinedValue"===t?t="defaultValue":"type"===t&&(t="fieldType");(e.has(t)?a:a.customProperties)[t]=n?i:r}),!1),a},t.getDDMFormFieldSettingsContext=function({dataDefinitionField:t,defaultLanguageId:n=Liferay.ThemeDisplay.getDefaultLanguageId(),editingLanguageId:r=n,fieldTypes:l}){const{settingsContext:s}=l.find((({name:e})=>e===t.fieldType)),u=new i.PagesVisitor(s.pages);return a(a({},s),{},{pages:u.mapFields((i=>{const{fieldName:l,localizable:s,type:u}=i,{customProperties:d}=t,c=o(l),p=d&&!e.has(c)?d[c]:t[c],f=null!=p?p:i.value;let g={};s&&(g=a({},p)),0===Object.keys(g).length&&(g={[n]:""});const b=a(a({},i),{},{defaultLanguageId:n,locale:n,localizedValue:g,value:f});return"select"===u&&"predefinedValue"===l&&(b.multiple=t.customProperties.multiple,b.options=t.customProperties.options[r]),b}))})},t._fromDDMFormToDataDefinitionPropertyName=o;var i=n("./visitors.es");function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const e=new Set(["defaultValue","fieldType","indexable","indexType","label","localizable","name","readOnly","repeatable","required","showLabel","tip"]);function o(e){switch(e){case"fieldName":return"name";case"nestedFields":return"nestedDataDefinitionFields";case"predefinedValue":return"defaultValue";case"type":return"fieldType";default:return e}}}}));
//# sourceMappingURL=dataConverter.js.map