Liferay.Loader.define("portal-search-ranking-web@3.0.58/js/utils/util.es",["module","exports","require"],(function(e,r,t){window;{function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){_defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function insertAtIndex(e,r,t){return[...e.slice(0,r),t,...e.slice(r,e.length)]}function isArray(e){return"[object Array]"===Object.prototype.toString.call(e)}function removeAtIndex(e,r){return e.filter(((e,t)=>t!==r))}Object.defineProperty(r,"__esModule",{value:!0}),r.buildUrl=function buildUrl(e,r){const t=new URL(e),n=t.searchParams;r&&Object.keys(r).forEach((e=>n.set(e,r[e])));return t.href},r.insertAtIndex=insertAtIndex,r.isArray=isArray,r.isNil=function isNil(e){return null==e},r.isNull=function isNull(e){return null===e},r.removeAtIndex=removeAtIndex,r.move=function move(e,r,t){return removeAtIndex(insertAtIndex(e,t,e[r]),r>t?r+1:r)},r.removeIdFromList=function removeIdFromList(e=[],r){return e.filter((e=>isArray(r)?!r.includes(e):e!==r))},r.resultsDataToMap=function resultsDataToMap(e,r={}){return e.reduce(((e,r)=>e[r.id]?e:_objectSpread(_objectSpread({},e),{},{[r.id]:r})),r)},r.toggleListItem=function toggleListItem(e,r){return e.includes(r)?e.filter((e=>e!==r)):[...e,r]},r.updateDataMap=function updateDataMap(e,r,t){return r.reduce(((r,n)=>e[n]?_objectSpread(_objectSpread({},r),{},{[n]:_objectSpread(_objectSpread({},e[n]),t)}):r),e)}}}));
//# sourceMappingURL=util.es.js.map