Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.150/admin/js/config/initialState.es",["module","exports","require","data-engine-js-components-web","data-engine-js-components-web/js/core/config/index.es"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.initState=function initState(e,{view:t}){var n;let{pages:i,paginationMode:a,rules:s,successPageSettings:c}=e,l=_objectWithoutProperties(e,["pages","paginationMode","rules","successPageSettings"]);const d=i.length?normalizePages(i):r.INITIAL_PAGES,u=s.length?o.RulesSupport.formatRules(d,s):s,p="fieldSets"===t?"single-page":a,g={body:(null==c?void 0:c.body)?null==c?void 0:c.body:{[themeDisplay.getLanguageId()]:Liferay.Language.get("your-information-was-successfully-received-thank-you-for-filling-out-the-form")},enabled:"fieldSets"!==t&&(null===(n=null==c?void 0:c.enabled)||void 0===n||n),title:(null==c?void 0:c.title)?null==c?void 0:c.title:{[themeDisplay.getLanguageId()]:Liferay.Language.get("thank-you")}};return _objectSpread({pages:[...d.map(((e,t)=>_objectSpread(_objectSpread({},e),{},{id:(0,o.getUid)(),pageIndex:t,total:d.length}))),!!g.enabled&&{contentRenderer:"success",id:(0,o.getUid)(),paginationItemRenderer:"".concat(p,"_success"),rows:[],successPageSettings:g}].filter(Boolean),paginationMode:p,rules:u,successPageSettings:g},l)},t.BUILDER_INITIAL_STATE=void 0;var o=n("data-engine-js-components-web"),r=n("data-engine-js-components-web/js/core/config/index.es");function _objectWithoutProperties(e,t){if(null==e)return{};var n,o,r=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _defineProperty(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=_objectSpread(_objectSpread({},r.INITIAL_STATE),{},{currentRuleLoc:null,editingLanguageId:themeDisplay.getDefaultLanguageId(),fieldSets:[],fieldTypes:[],formInstanceId:0,functionsMetadata:{},objectFields:[],paginationMode:"multi-pages",rules:[]});t.BUILDER_INITIAL_STATE=e;const normalizePages=e=>new o.PagesVisitor(e).mapFields((e=>{let{settingsContext:t}=e,n=_objectWithoutProperties(e,["settingsContext"]);const r=new o.PagesVisitor(t.pages);return _objectSpread(_objectSpread({},n),{},{localizedValue:{},settingsContext:_objectSpread(_objectSpread({},t),{},{pages:r.mapFields((e=>{if("options"===e.type){const t=Object.keys(e.value);return _objectSpread(_objectSpread({},e),{},{value:t.reduce(((t,n)=>_objectSpread(_objectSpread({},t),{},{[n]:e.value[n].map((e=>_objectSpread(_objectSpread({},e),{},{edited:!0})))})),{})})}return e}))}),value:void 0})}),!0,!0)}}));
//# sourceMappingURL=initialState.es.js.map