Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.108/DatePicker/createAutoCorrectedDatePipe",["module","exports","require"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.createAutoCorrectedDatePipe=function(t="mm dd yyyy",{maxYear:r=9999,minYear:y=1}={}){const i=t.split(/[^dhmyHMS]+/).sort(((e,t)=>n.indexOf(e)-n.indexOf(t)));return function(n){const s=[],d={HH:23,MM:59,SS:59,dd:31,hh:12,mm:12,yy:99,yyyy:r},o={HH:0,MM:0,SS:0,dd:1,hh:1,mm:1,yy:0,yyyy:y},a=n.split("");i.forEach((e=>{const n=t.indexOf(e),r=parseInt(d[e].toString().substr(0,1),10);parseInt(a[n],10)>r&&(a[n+1]=a[n],a[n]=0,s.push(n))}));let c=0;return!i.some((i=>{const s=t.indexOf(i),a=i.length,u=n.substr(s,a).replace(/\D/g,""),m=parseInt(u,10);"mm"===i&&(c=m||0);const p="dd"===i?e[c]:d[i];if("yyyy"===i&&(1!==y||9999!==r)){const e=parseInt(d[i].toString().substring(0,u.length),10);return m<parseInt(o[i].toString().substring(0,u.length),10)||m>e}return m>p||u.length===a&&m<o[i]}))&&{indexesOfPipedChars:s,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