Liferay.Loader.define("@liferay/object-js-components-web@1.0.58/utils/createAutoCorrectedDatePipe",["module","exports","require"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.createAutoCorrectedDatePipe=function createAutoCorrectedDatePipe(t="mm dd yyyy",{maxYear:r=9999,minYear:o=1}={}){const s=t.split(/[^dhmyHMS]+/).sort(((e,t)=>n.indexOf(e)-n.indexOf(t)));return function(n){const i=[],y={HH:23,MM:59,SS:59,dd:31,hh:12,mm:12,yy:99,yyyy:r},d={HH:0,MM:0,SS:0,dd:1,hh:1,mm:1,yy:0,yyyy:o},a=n.split("");s.forEach((e=>{const n=t.indexOf(e),r=parseInt(y[e].toString().substring(0,1),10);("string"==typeof a[n]?parseInt(a[n],10):a[n])>r&&(a[n+1]=a[n],a[n]=0,i.push(n))}));let c=0;return!s.some((s=>{const i=t.indexOf(s),a=s.length,u=n.substring(i,i+a).replace(/\D/g,""),p=parseInt(u,10);"mm"===s&&(c=p||0);const m="dd"===s?e[c]:y[s];if("yyyy"===s&&(1!==o||9999!==r)){const e=parseInt(y[s].toString().substring(0,u.length),10);return p<parseInt(d[s].toString().substring(0,u.length),10)||p>e}return p>m||u.length===a&&p<d[s]}))&&{indexesOfPipedChars:i,value:a.join("")}}};const e=[31,31,29,31,30,31,30,31,31,30,31,30,31],n=["yyyy","yy","mm","dd","HH","MM","SS","hh"]}}));
//# sourceMappingURL=createAutoCorrectedDatePipe.js.map