Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.145/util/options",["module","exports","require"],(function(e,t,r){window;{function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOptions=function normalizeOptions({editingLanguageId:e,fixedOptions:t,multiple:r,options:n,showEmptyOption:o,valueArray:i}){const a=[];o&&!r&&a.push({label:Liferay.Language.get("choose-an-option"),value:null});const populateNewOptions=t=>{t.forEach((t=>{const n=function assertOptionParameters({editingLanguageId:e,multiple:t,option:r,valueArray:n}){const o=n.includes(r.value),i="string"==typeof r.label?r.label:r.label[e];return _objectSpread(_objectSpread({},r),{},{active:!t&&o,checked:t&&o,label:i,type:t?"checkbox":"item"})}({editingLanguageId:e,multiple:r,option:t,valueArray:i});""!==n.value&&a.push(n)}))};populateNewOptions(n),t.length&&(n.length&&(a[n.length-1].separator=!0),populateNewOptions(t));return a},t.normalizeValue=function normalizeValue({localizedValueEdited:e,multiple:t,normalizedOptions:r,predefinedValueArray:n,valueArray:o}){const i=o.length||!o.length&&e?o:n,a=t?i:[i[0]],l=new Set(r.map((({value:e})=>e)));return a.filter((e=>l.has(e)))}}}));
//# sourceMappingURL=options.js.map