Liferay.Loader.define("segments-web@3.0.68/js/utils/utils.es",["module","exports","require","segments-web$date-fns","./constants.es"],(function(e,t,n){var r;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.createNewGroup=function(e){return{conjunctionName:u.CONJUNCTIONS.AND,groupId:s(),items:e}},t.generateGroupId=s,t.getPluralMessage=function(e,t,n=0,r){return a(1===n?e:t,[n],r)},t.getChildGroupIds=function e(t){let n=[];t.items&&t.items.length&&(n=t.items.reduce(((t,n)=>n.groupId?[...t,n.groupId,...e(n)]:t),[]));return n},t.getSupportedOperatorsFromType=function(e,t,n){return e.filter((e=>{const r=t[n];return r&&r.includes(e.name)}))},t.insertAtIndex=function(e,t,n){return[...t.slice(0,n),e,...t.slice(n,t.length)]},t.objectToFormData=function(e){const t=new FormData;return Object.keys(e).forEach((n=>{t.set(n,e[n])})),t},t.removeAtIndex=function(e,t){return e.filter(((e,n)=>n!==t))},t.replaceAtIndex=function(e,t,n){return Object.assign(t,{[n]:e})},t.sub=a,t.dateToInternationalHuman=function(e,t=navigator.language){const n=new Date(e);return new Intl.DateTimeFormat(t,{day:"numeric",month:"long",year:"numeric"}).format(n)},t.jsDatetoYYYYMMDD=function(e){return o.default.format(e,"YYYY-MM-DD")};var o=(r=n("segments-web$date-fns"))&&r.__esModule?r:{default:r},u=n("./constants.es");const e="group_",i=/({\d+})/g;let c=1;function s(){return"".concat(e).concat(c++)}function a(e,t,n=!0){const r=e.split(i).filter((e=>0!==e.length));for(let e=0;e<t.length;e++){const n=t[e],o="{".concat(e,"}");let u=r.indexOf(o);for(;u>=0;)r.splice(u,1,n),u=r.indexOf(o)}return n?r.join(""):r}}}));
//# sourceMappingURL=utils.es.js.map