@progress/kendo-dateinputs-common 0.2.0-dev.202301231327 → 0.2.0-dev.202301241303
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-dateinputs-common.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/common/dateobject.js +26 -52
- package/dist/es/dateinput/dateinput.js +147 -128
- package/dist/es/dateinput/utils.js +2 -2
- package/dist/es2015/common/dateobject.js +26 -51
- package/dist/es2015/dateinput/dateinput.js +147 -128
- package/dist/es2015/dateinput/utils.js +2 -2
- package/dist/npm/common/dateobject.js +26 -52
- package/dist/npm/dateinput/dateinput.d.ts +9 -1
- package/dist/npm/dateinput/dateinput.js +147 -128
- package/dist/npm/dateinput/utils.js +2 -2
- package/dist/systemjs/kendo-dateinputs-common.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register("@progress/kendo-dateinputs-common",["tslib","@progress/kendo-date-math"],function(s){var r,o;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){r=e(t)},function(t){o=e(t)}],execute:function(){function i(t){var e;return(a[t]||(e=a[t]={i:t,l:!1,exports:{}},n[t].call(e.exports,e,e.exports,i),e.l=!0,e)).exports}var n,a;n=[function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var n=e(2);r.isPresent=function(t){return null!=t},r.isDocumentAvailable=function(){return!!document},r.isNumber=function(t){return r.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},r.parseToInt=function(t){return parseInt(t,10)},r.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},r.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},r.deepExtend=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!e.length)return t;var i,a=e.shift();if(o(t)&&o(a))for(var s in a)i=a[s],i instanceof HTMLElement?t[s]=a[s]:o(a[s])?(t[s]||r.extend(t,((i={})[s]={},i)),r.deepExtend(t[s],a[s])):r.extend(t,((i={})[s]=a[s],i));return r.deepExtend.apply(void 0,[t].concat(e))},r.noop=function(){},r.isFunction=function(t){return"function"==typeof t},r.cropTwoDigitYear=function(t){return!r.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},r.setYears=function(t,e){t=n.cloneDate(t);return t.setFullYear(e),t},r.millisecondDigitsInFormat=function(t){t=t&&t.match(/S+(\1)/);return t?t[0].length:0},r.millisecondStepFor=function(t){return Math.pow(10,3-t)},r.areDatePartsEqualTo=function(t,e,n,i,a,s,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==a||t.getMinutes()!==s||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isValidDate=function(t){return r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e){t.exports=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var d=n(1),p=n(3);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,n=t.newText,i=t.formatPattern,a=t.selectionStart,s=t.isInCaretMode,t=t.keyEvent,r=e[a+e.length-n.length],o=e.substring(0,a+e.length-n.length),e=n.substring(0,a),l=[];if(o===e&&0<a)return l.push([i[a-1],e[a-1]]),l;if(0===o.indexOf(e)&&s&&(t.key===p.Key.DELETE||t.key===p.Key.BACKSPACE)||0===o.indexOf(e)&&!s&&(0===e.length||i[e.length-1]!==i[e.length])){var h="";s||1!==e.length||l.push([i[0],e[0]]);for(var u=e.length;u<o.length;u++)i[u]!==h&&i[u]!==d.Constants.formatSeparator&&(h=i[u],l.push([h,""]));return l}if((!s||0!==e.indexOf(o)&&i[a-1]!==d.Constants.formatSeparator)&&(s||0!==e.indexOf(o)&&i[a-1]!==d.Constants.formatSeparator))return!s&&" "===e[e.length-1]||!s&&e[e.length-1]===r?[[i[a-1],d.Constants.formatSeparator]]:[[i[a-1],e[a-1]]];for(var c=i[0],u=Math.max(0,o.length-1);u<i.length;u++)if(i[u]!==d.Constants.formatSeparator){c=i[u];break}return[[c,e[a-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,n){return null===t||!(e&&t<e||n&&n<t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(e=e.DateInputInteractionMode||(e.DateInputInteractionMode={})).None="none",e.Caret="caret",e.Selection="selection"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),a={events:{}};function s(t){this.options=i.extend({},a,t)}s.prototype.destroy=function(){},s.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!i.isFunction(this.options.events[t])&&(this.options.events[t](i.extend(n,e,{sender:this})),n.defaultPrevented)},e.Observable=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=function(){this.symbols="",this.partMap=[]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var $=n(2),o=n(8),tt=n(4),et=n(0),h=n(1),i=/d|M|H|h|m|s/;function a(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,a=t.cycleTime,a=void 0!==a&&a,s=t.twoDigitYearMax,s=void 0===s?h.Constants.twoDigitYearMax:s,r=t.value,r=void 0===r?null:r,t=t.autoCorrectParts,t=void 0===t||t;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=$.getDate(new Date),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.intl=e,this.formatPlaceholder=n||"wide",this.format=i,this.cycleTime=a,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=s,this.autoCorrectParts=t,r)this._value=$.cloneDate(r);else{this._value=$.getDate(new Date);for(var o=this.dateFormatString(this.value,this.format).symbols,l=0;l<o.length;l++)this.setExisting(o[l],!1)}}Object.defineProperty(a.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"localeId",{get:function(){for(var t=h.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var i=e[n],i=this.intl.cldr[i];if(i.name&&i.calendar&&i.numbers&&i.name!==h.Constants.defaultLocaleId){t=i.name;break}}return t},enumerable:!0,configurable:!0}),a.prototype.setValue=function(t){t?$.isEqual(t,this._value)||(this._value=$.cloneDate(t),this.modifyExisting(!0)):(this._value=$.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},a.prototype.hasValue=function(){var n=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce(function(t,e){return t||"literal"!==e.type&&"dayperiod"!==e.type&&n.getExisting(e.pattern[0])},!1)},a.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return $.cloneDate(this.value)},a.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},a.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),n=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",a=this.intl.formatDate(this.value,t,this.localeId),s=this.getFormattedInvalidDates(t),r=0;r<a.length;r++){var o,l,h=n.symbols[r];"literal"!==n.partMap[r].type&&this.getInvalidDatePartValue(h)?(o=this.getPartsForSegment(n,r),"M"===h?(l=(et.parseToInt(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(i+=tt.padZero(o.length-l.length)+l,r+=o.length-1):i+=s[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),i+=tt.padZero(o.length-l.length)+l,r+=o.length-1):i+=s[h][r]):i+=e[r]}e=i}return this.merge(e,n)},a.prototype.getFormattedInvalidDates=function(t){var n=this,i=(t=void 0===t?"":t)||this.format,a={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=n.getInvalidDatePart(t).date;e&&(e=n.intl.formatDate(e,i,n.localeId),a[t]=e)}),a},a.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,n=0;n<e.length;n++)this.setExisting(e[n],t)},a.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},a.prototype.setExisting=function(t,e){switch(t){case"y":!1===(this.year=e)&&this._value.setFullYear(2e3);break;case"M":!1===(this.month=e)&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},a.prototype.modifyPart=function(t,e){if(et.isPresent(t)&&et.isPresent(e)&&0!==e){var n,i=$.cloneDate(this.value),a=!1,s="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!s)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=$.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),a=!0;break;case"m":i.setMinutes(i.getMinutes()+e),a=!0;break;case"s":i.setSeconds(i.getSeconds()+e),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),a=!0}else{var l=this._partiallyInvalidDate.invalidDateParts||{},h=this.getInvalidDatePartValue(t),u=l.y.value||i.getFullYear(),c=l.M.value||i.getMonth(),d=l.d.value||l.E.value||i.getDate(),p=l.h.value||l.H.value||i.getHours(),m=l.m.value||i.getMinutes(),g=l.s.value||i.getSeconds(),l=l.S.value||i.getMilliseconds();switch(t){case"y":u+=e;break;case"M":c+=e;break;case"d":case"E":d+=e}if("M"===t){if((c<0||11<c)&&o)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);o||(c=c<0?et.clamp(c%11+1+11,0,11):(v=et.isPresent(h)?c:(e-1)%12,et.clamp(v,0,11)),c=et.clamp(c,0,11)),c=et.clamp(c,0,11)}else if("d"===t)if(o){if(d<=0||31<d)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!o){if(et.isPresent(h)&&(d<=0||31<d))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);d=(v=e<0?et.isPresent(h)?d:31-Math.abs(e%31)+1:et.isPresent(h)?d:e%31,et.clamp(v,1,31)),d=et.clamp(d,1,31)}var o=$.createDate(u,c,d,p,m,g,l),h=s||r?this.modifyDateSymbolWithValue(i,t,s?c:d):null,v=et.areDatePartsEqualTo(o,u,c,d,p,m,g,l);this.getValue()&&et.areDatePartsEqualTo(o,u,c,d,p,m,g,l)?(i=$.cloneDate(o),this.markDatePartsAsExisting()):s&&h?h.getMonth()===c?this.getExisting("d")?v?(i=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:c,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(this.resetInvalidDateSymbol(t),i=$.cloneDate(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=$.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:c,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):r&&h&&(h.getDate()===d?this.getExisting("M")?v?(i=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(i=$.cloneDate(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=$.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(this.value),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),a&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},a.prototype.parsePart=function(t){for(var e=t.symbol,n=t.currentChar,A=t.resetSegmentValue,i=t.cycleSegmentValue,a=t.rawTextValue,j=t.isDeleting,s=t.originalFormat,r=!i,t=this.dateFormatString(this.value,this.format),o=t.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}}),l=t.partMap.map(function(t){return{type:t.type,pattern:t.pattern,text:""}}),h=0;h<o.length;h++){for(var u=o[h],c=0;c<u.pattern.length;c++)o[h+c]&&(o[h+c].literal=u.pattern[c]);h+=u.pattern.length-1}for(h=0;h<l.length;h++){for(u=l[h],c=0;c<u.pattern.length;c++)l[h+c]&&(l[h+c].text=u.pattern[c]);h+=u.pattern.length-1}var d={value:null,switchPart:!1,resetPart:r&&"M"===e&&t.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length}),hasInvalidDatePart:!1};if(!n){if(!r)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),{value:null,switchToNext:!1};for(h=0;h<o.length;h++){var L=o[h].literal,K=a.startsWith(L),B=a.endsWith(L),L=0<=a.indexOf(L+L);if(K||B||L)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),et.extend(d,{value:null,switchToNext:!1})}}var p=this.intl.formatDate(this.value,this.format,this.localeId),H=t.symbols,m=!1,g="",v="",f="",W="",R="",y="",Z="";for(h=0;h<l.length;h++)Z+=l[h].text;var D=this.format===H||this.format===Z||this.format===s||this.format.length===s.length,i=(D?Z:s).indexOf(e),E=(D?Z:s).lastIndexOf(e)-i+1,b=0,Y=s.length-a.length;if(r||!r&&!this.autoCorrectParts){for(h=0;h<p.length;h++)H[h]===e?(v+=this.getExisting(e)?p[h]:"0",j?(b<E-1&&(f+=a[h]||""),b++):0<Y&&!(f.length+Y<E)||(f+=a[h]||""),m=!0):m?(y+=p[h],R+=p[h]):(g+=p[h],W+=p[h]);if(D)if(Z.length<a.length?f+=n:!j&&s.length>a.length&&(i=s.length-a.length,i=f.substr(0,f.length-i))&&0<i.length&&(f=i),f.length>E)return et.extend(d,{value:null,switchToNext:!1});if(!D||!this.autoCorrectParts){for(y=g=f=v="",m=!1,h=b=0;h<s.length;h++)s[h]===e?(v+=this.getExisting(e)?p[h]||"":"0",j?(b<E-1&&(f+=a[h]||""),b++):0<Y&&!(f.length+Y<E)||(f+=a[h]||""),m=!0):m?y+=a[h-Y]||"":g+=a[h]||"";s.length<a.length&&(f+=n)}}if(!r)if(this.autoCorrectParts)for(y=g=f=v="",m=!1,h=b=0;h<p.length;h++)H[h]===e?(v+=this.getExisting(e)?p[h]:"0",m=!0):m?y+=p[h]:g+=p[h];else v=A?f:v;var S=null,U=this.matchMonth(n),i=this.matchDayPeriod(n,e),P="0"===n,z=this.leadingZero||{},M=(P?("0"===f&&(f=v),0!==et.parseToInt(A?n:(r?f:v)+n)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e)):this.resetLeadingZero(),this.partPattern(t.partMap,e)),q=M?M.pattern:null;if(r&&j&&!f)this.setExisting(e,!1);else{for(var M=v.length-3,G=!0,I=r?f:v,h=Math.max(0,M);h<=v.length&&G;h++){I=A?n:r?f:v.substring(h)+n,!r&&this.autoCorrectParts||(G=!1,I=tt.unpadZero(I),I=tt.padZero(E-I.length)+I);var x,J=parseInt(I,10),S=this.intl.parseDate(g+I+y,this.format,this.localeId),Q=(r&&!et.isValidDate(S)&&this.autoCorrectParts&&(S=this.intl.parseDate(W+I+R,this.format,this.localeId)),!isNaN(parseInt(n,10))||r&&j&&""===n);if(!S&&!isNaN(J)&&Q&&this.autoCorrectParts&&("M"!==e||U||-1<(Q=J-1)&&Q<12&&((S=$.cloneDate(this.value)).setMonth(Q),S.getMonth()!==Q)&&(S=$.lastDayOfMonth($.addMonths(S,-1))),"y"===e)&&(S=$.createDate(parseInt(I,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),r&&et.isValidDate(S)||!r&&S)&&this.date&&S.getDate()!==this.value.getDate()&&(S=$.lastDayOfMonth($.addMonths(S,-1))),r&&et.isValidDate(S)||!r&&S)return J=""+g+this.peek(I,q)+y,x=null===this.intl.parseDate(J,this.format,this.localeId)||z[e]&&q.length<=I.length||!1,this.shouldNormalizeCentury()&&(S=this.normalizeCentury(S)),this._value=S,this.setExisting(e,!0),this.resetInvalidDateSymbol(e),this.autoCorrectParts||("M"===e?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===e&&this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")),this.hasInvalidDatePart())||this.markDatePartsAsExisting(),r&&(x=x&&("M"===e?2<=(X=et.parseToInt(f))||2<=f.length:x&&(D?f.length===E:f.length>E))),et.extend(d,{value:this.value,switchToNext:x})}if(U&&(S=this.intl.parseDate(g+U+y,this.format,this.localeId)))return this._value=S,this.setExisting(e,!0),et.extend(d,{value:this.value,switchToNext:!1});if(i&&(S=this.intl.parseDate(g+i+y,this.format)))return this._value=S,et.extend(d,{value:this.value,switchToNext:!0});if(P&&(this.leadingZero=this.isAbbrMonth(t.partMap,e)?null:((M={})[e]=!0,M),this.setExisting(e,!1)),!this.autoCorrectParts){var C,O,w,F,V,k,_,T,N,X=void 0,i=r?f:I,P=et.parseToInt(i);if(et.isNumber(P))return"d"===e&&(P<=0||31<P)||"M"===e&&(P<0||11<P)?et.extend(d,{value:null,switchToNext:!1}):(X="M"===e?P-1:P,t="M"===e,M="d"===e,C=$.cloneDate(this._value),k=(F=this._partiallyInvalidDate.invalidDateParts||{}).y.value||C.getFullYear(),O=t?X:F.M.value||C.getMonth(),w=M?X:F.d.value||F.E.value||C.getDate(),_=F.h.value||F.H.value||C.getHours(),T=F.m.value||C.getMinutes(),N=F.s.value||C.getSeconds(),F=F.S.value||C.getMilliseconds(),V=$.createDate(k,O,w,_,T,N,F),k=et.areDatePartsEqualTo(V,k,O,w,_,T,N,F),_=t||M?this.modifyDateSymbolWithValue(C,e,t?O:w):null,T=!1,t&&_?_.getMonth()===O?this.getExisting("d")?k?(C=$.cloneDate(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:O,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):k?(this.resetInvalidDateSymbol(e),C=$.cloneDate(V),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),C=$.cloneDate(_)):(T=!0,this.setInvalidDatePart(e,{value:O,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):M&&_&&(_.getDate()===w?this.getExisting("M")?k?(C=$.cloneDate(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:w,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):k?(C=$.cloneDate(V),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),C=$.cloneDate(_)):(T=!0,this.setInvalidDatePart(e,{value:w,date:$.cloneDate(this.value),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1))),T||(this.setExisting(e,!0),r&&!et.isValidDate(S)?(N=this.intl.parseDate(W+I+R,this.format,this.localeId),et.isValidDate(N)&&(this._value=N)):this._value=C,this.getValue()&&this.resetInvalidDate()),x=!1,x="M"===e?2<=P||2<=i.length:D?i.length===E:i.length>E,et.extend(d,{value:null,switchToNext:x,hasInvalidDatePart:T}))}}return et.extend(d,{value:null,switchToNext:!1})},a.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(tt.dateSymbolMap,{})[t]},a.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},a.prototype.setLeadingZero=function(t){this.leadingZero=t},a.prototype.getLeadingZero=function(){return this.leadingZero||{}},a.prototype.normalizeCentury=function(t){var e,n;return et.isPresent(t)?(e=et.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e),et.setYears(t,n+e)):t},a.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},a.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},a.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},a.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return tt.padZero(e.length-t.length)+t},a.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0!==this.monthNames.length)for(;0<this.typedMonthPart.length;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var n=parseInt(this.typedMonthPart,10);if(1<=n&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},a.prototype.matchDayPeriod=function(t,e){t=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(t))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(t))return this.dayPeriods.pm}return""},a.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},a.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),n=0;n<e.length;n++)if("dayperiod"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return null},a.prototype.patternLength=function(t){return"y"===t[0]?4:i.test(t)?2:0},a.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),i=[],a=[],s=0;s<n.length;s++)for(var r=this.intl.formatDate(t,{pattern:n[s].pattern},this.localeId).length;0<r;)i.push(this.symbols[n[s].pattern[0]]||h.Constants.formatSeparator),a.push(n[s]),r--;e=new o.Mask;return e.symbols=i.join(""),e.partMap=a,e},a.prototype.merge=function(t,e){for(var n="",i="",a=e.symbols,s=!1,r=0,o=this.getFormattedInvalidDates(a),l=a.length-1;0<=l;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(a[l])||this.getExisting(a[l]))this.autoCorrectParts||t.length===a.length||s?n=t[l]+n:0<r?(n=t[l]+n,--r<=0&&(s=!0)):n=(t[l+t.length-a.length]||"")+n,i=a[l]+i;else{var u,c=a[l],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;0<=l&&c===a[l];)l--;l++}for(this.leadingZero&&this.leadingZero[c]?n="0"+n:!this.autoCorrectParts&&this.getInvalidDatePartValue(c)?(u=this.getInvalidDatePartValue(c).toString(),"M"===c?(u=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?n=o[c][l]+n:(u=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),n=tt.padZero(h.length-u.length)+u+n,d=h.length-1,r=u.length-h.length)):(n=tt.padZero(h.length-u.length)+u+n,d=h.length-1,r=u.length-h.length)):n=this.dateFieldName(e.partMap[l])+n;i.length<n.length;)i=a[l]+i;0!==d&&(l=l-d+(t.length-a.length))}}return{text:n,format:i}},a.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]||("formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e})))},a.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},a.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},a.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},a.prototype.resetInvalidDateSymbol=function(t){var e=this,n=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&et.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)}),n&&this.resetInvalidDate()},a.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},a.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},a.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},a.prototype.setInvalidDatePart=function(t,e){var n=e.value,i=e.date,i=void 0===i?null:i,a=e.startDateOffset,a=void 0===a?0:a,e=e.startDate,e=void 0===e?null:e;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=void 0===n?null:n,this._partiallyInvalidDate.invalidDateParts[t].date=i,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=a,this._partiallyInvalidDate.startDate=e)},a.prototype.hasInvalidDatePart=function(){var e=this,n=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&et.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!0)}),n},a.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=$.cloneDate(t),a=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=$.addMonths(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),a=!0;break;case"m":i.setMinutes(i.getMinutes()+n),a=!0;break;case"s":i.setSeconds(i.getSeconds()+n),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),a=!0}return{date:i,timeModified:a}},a.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=$.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=$.addMonths(t,n-t.getMonth());break;case"d":case"E":i.setDate(n);break;case"h":case"H":i.setHours(n);break;case"m":i.setMinutes(n);break;case"s":i.setSeconds(n);break;case"S":i.setMilliseconds(n);break;case"a":i.setHours(n)}return i},a.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},a.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],a=e;a<t.partMap.length;a++){var s=t.partMap[a];if(n.type!==s.type||n.pattern!==s.pattern)break;i.push(s)}for(a=e-1;0<=a&&(s=t.partMap[a],n.type===s.type&&n.pattern===s.pattern);a--)i.unshift(s);return i},e.DateObject=a},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,a=n(10),s=n(9),b=n(4),S=n(7),P=n(3),M=n(0),r=n(6),I=n(5),x=n(2),C=n(1),o={format:"d",allowNulls:!1,hasPlaceholder:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:((n={}).valueChange=null,n.input=null,n.inputEnd=null,n.focus=null,n.focusEnd=null,n.blur=null,n.blurEnd=null,n.keydown=null,n.mousewheel=null,n.change=null,n),selectNearestSegmentOnFocus:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:C.Constants.twoDigitYearMax,autoCorrectParts:!0},n=(i=r.Observable,a.__extends(l,i),Object.defineProperty(l.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),l.prototype.init=function(t,e){var n=M.isValidDate(this.options.value)?x.cloneDate(this.options.value):new Date(e.formattedValue);M.isValidDate(n)||(n=null),this.element=t,this.options=M.extend({},o,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder||"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=I.DateInputInteractionMode.None,this.forceUpdate()},l.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,i.prototype.destroy.call(this)},l.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=M.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},l.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},l.prototype.isInCaretMode=function(){return this.interactionMode===I.DateInputInteractionMode.Caret},l.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},l.prototype.onElementDragStart=function(t){t.preventDefault()},l.prototype.onElementDrop=function(t){t.preventDefault()},l.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},l.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},l.prototype.onElementClick=function(t){this.mouseDownStarted=!1;var e,n=this.selection;this.isInCaretMode()&&this.forceUpdate(),3!==t.detail&&(this.isActive&&this.options.selectNearestSegmentOnFocus?(t=this.element.selectionStart!==this.element.selectionEnd,e=M.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,t=!t&&e?0:this.caret()[0],this.selectNearestSegment(t)):this.setSelection(this.selectionByIndex(n.start)))},l.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===S.KeyCode.BACKSPACE||e.key===P.Key.BACKSPACE,i=e.keyCode===S.KeyCode.DELETE||e.key===P.Key.DELETE;if(this.element&&this.dateObject)if(this.isPasteInProgress)this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),this.isPasteInProgress=!1;else{var e=this.interactionMode,a=(!this.options.allowCaretMode||e===I.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=I.DateInputInteractionMode.Caret:this.interactionMode=I.DateInputInteractionMode.Selection,this.isInCaretMode());if(a&&this.keyDownEvent.key===P.Key.SPACE)this.restorePreviousInputEventState();else{var s=this.dateObject&&this.dateObject.getValue(),r=this.dateObject.getTextAndFormat(),o=r.text,r=r.format,r=(this.currentFormat=r,a&&(n||i||e===I.DateInputInteractionMode.Caret)?this.previousElementValue:o),o=this.elementValue,l=b.approximateStringMatching({oldText:r,newText:o,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:a,keyEvent:this.keyDownEvent}),r=this.formatStateOnKeyDown.format[this.formatStateOnKeyDown.selectionStart]||"";if(this.options.allowCaretMode&&a&&this.currentFormat.length!==this.elementValue.length&&r&&0<r.length&&r!==C.Constants.formatSeparator&&(l&&0!==l.length?l[0]&&l[0][0]!==C.Constants.formatSeparator&&l[0][0]!==r&&(l[0][0]=r,l[0][1]=t.data||""):((l=[])[0][0]=r,l[0][1]=t.data||"")),!a||l&&0!==l.length){if(a&&1===l.length){if(!l[0]||!l[0][0])return void this.restorePreviousInputEventState();if(a&&l[0]&&(l[0][0]===C.Constants.formatSeparator||l[0][1]===C.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var o=1===l.length&&l[0][1]===C.Constants.formatSeparator,h=[],u=!1;if(!o)for(var c=0;c<l.length;c++){var d=this.dateObject.parsePart({symbol:l[c][0],currentChar:l[c][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||i,originalFormat:this.currentFormat});h.push(d),u=d.switchToNext}this.options.autoSwitchParts||(u=!1),this.resetSegmentValue=!1;var p,m,g=h[h.length-1],v=g&&!g.value,f=a&&(n||i)&&v,y=!!g&&g.resetPart,g=!!g&&g.hasInvalidDatePart,D=!x.isEqual(s,this.dateObject.value),E=this.selection;a&&!f&&!y||(y&&(p=this.currentFormat[E.start]),this.forceUpdate()),l.length&&l[0][0]!==C.Constants.formatSeparator&&(!a||f||y?p?this.setSelection(this.selectionBySymbol(p)):!this.options.autoSwitchParts&&l[0][1]===C.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(l[0][0])):a&&(D&&M.isPresent(this.dateObject.getValue())||!D&&u&&M.isPresent(this.dateObject.getValue())?u?this.switchDateSegment(1):this.options.format.length!==this.currentFormat.length&&r&&"y"!==r&&(f=this.elementValue.length,this.forceUpdate(),f=this.elementValue.length-f,this.setSelection({start:E.start+f,end:E.start+f})):v&&(m=this.dateObject.getLeadingZero()[r],u?this.switchDateSegment(1):"0"===t.data&&m||this.restorePreviousInputEventState()))),u||!a||n||i||y||!v?this.options.autoSwitchParts&&(u||o)&&!a&&this.switchDateSegment(1):D?this.currentFormat.length===this.elementValue.length||e!==I.DateInputInteractionMode.Caret&&D||(e!==I.DateInputInteractionMode.Caret?(p=this.currentFormat[E.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(p))):g||this.restorePreviousInputEventState()):(m=this.dateObject.getLeadingZero()[r],"0"===t.data&&m||g||this.restorePreviousInputEventState()),this.tryTriggerValueChange({oldValue:s,event:t}),this.triggerInputEnd({event:t}),a&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},l.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=I.DateInputInteractionMode.None,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},l.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.interactionMode=I.DateInputInteractionMode.None,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},l.prototype.onElementChange=function(t){this.triggerChange({event:t})},l.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){var e=this.selection,n=e.start,e=e.end,n=(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.formatStateOnKeyDown={format:this.currentFormat,selectionStart:n,selectionEnd:e},this.previousElementSelection={start:n,end:e},(this.options.autoSwitchKeys||[]).map(function(t){return t.toString().toLowerCase().trim()}));if(0<=n.indexOf(t.keyCode.toString())||0<=n.indexOf(t.keyCode)||0<=n.indexOf(t.key.toLowerCase().trim())){e=0<=n.indexOf(P.Key.TAB.toLowerCase().trim())||0<=n.indexOf(S.KeyCode.TAB)||0<=n.indexOf(S.KeyCode.TAB.toString());if(!e)return t.preventDefault(),void this.switchDateSegment(1);var n=this.selection,i=n.start,n=n.end;if(t.shiftKey&&e?this.switchDateSegment(-1):this.switchDateSegment(1),i!==this.selection.start||n!==this.selection.end)return void t.preventDefault()}var a,s=this.currentFormat[this.selection.start],r=this.getStepFromSymbol(s),o=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===S.KeyCode.TAB)){switch(t.keyCode){case S.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),o=!0;break;case S.KeyCode.ARROW_UP:this.modifyDateSegmentValue(r,s,event),o=!0;break;case S.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),o=!0;break;case S.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-r,s,event),o=!0;break;case S.KeyCode.ENTER:break;case S.KeyCode.DELETE:case S.KeyCode.BACKSPACE:return this.options.allowNulls&&(a=this.dateObject.value,this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:a,event:t})),o=!0,void(t.keyCode===S.KeyCode.BACKSPACE&&(0<=(this.options.autoSwitchKeys||[]).indexOf(S.KeyCode.BACKSPACE)||0<=(this.options.autoSwitchKeys||[]).indexOf(P.Key.BACKSPACE))&&this.switchDateSegment(-1));case P.Key.HOME:this.selectNearestSegment(0);break;case P.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}o&&t.preventDefault()}}},l.prototype.onElementPaste=function(){this.isPasteInProgress=!0},l.prototype.onElementMouseWheel=function(t){this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive&&((t=t).shiftKey?this.switchDateSegment(0<(t.wheelDelta||-t.detail)?-1:1):this.modifyDateSegmentValue(0<(t.wheelDelta||-t.detail)?1:-1),t.returnValue=!1,t.preventDefault&&t.preventDefault(),t.stopPropagation)&&t.stopPropagation()},l.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value,n=(M.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e)),this.dateObject&&this.dateObject.getValue());this.writeValue(e),this.tryTriggerValueChange({oldValue:n,event:t})},Object.defineProperty(l.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:C.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:C.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"selection",{get:function(){var t={start:0,end:0};return t=null!==this.element&&void 0!==this.element.selectionStart?{start:this.element.selectionStart,end:this.element.selectionEnd}:t},enumerable:!0,configurable:!0}),l.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&this.element.setSelectionRange(t.start,t.end)},l.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?n+=this.currentText.length-this.currentFormat.length:n=Math.max(0,n-(this.currentFormat.length-this.currentText.length))),{start:e,end:n}},l.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,i=t-1;n<this.currentFormat.length||0<=i;n++,i--){if(n<this.currentFormat.length&&this.currentFormat[n]!==C.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(0<=i&&this.currentFormat[i]!==C.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e},l.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,i=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)]||this.currentFormat[n],a="",s="";if(t<0){for(var r=n+t;0<=r;r--)if((s=this.currentFormat[r])!==C.Constants.formatSeparator&&s!==i){n=r,a=s;break}}else for(r=n+t;r<this.currentFormat.length;r++)if((s=this.currentFormat[r])!==C.Constants.formatSeparator&&s!==i){n=r,a=s;break}if(a)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(a)),void(this.interactionMode=I.DateInputInteractionMode.Selection)}this.interactionMode=I.DateInputInteractionMode.None;var e=this.selection,o=e.start,e=e.end;if(o<e&&this.currentFormat[o]!==this.currentFormat[e-1])this.setSelection(this.selectionByIndex(0<t?o:e-1)),this.resetSegmentValue=!0,this.interactionMode=I.DateInputInteractionMode.None;else{for(var l=this.currentFormat[o],h=o+t;0<h&&h<this.currentFormat.length&&(this.currentFormat[h]===l||this.currentFormat[h]===C.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==C.Constants.formatSeparator){for(var u=h;0<=u&&u<this.currentFormat.length&&this.currentFormat[u]===this.currentFormat[h];)u+=t;u<h&&(u+1!==o||h+1!==e)?(this.setSelection({start:u+1,end:h+1}),this.resetSegmentValue=!0):h<u&&(h!==o||u!==e)&&(this.setSelection({start:h,end:u}),this.resetSegmentValue=!0),this.interactionMode=I.DateInputInteractionMode.None}}},l.prototype.modifyDateSegmentValue=function(t,e,n){var i,a;void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject&&(i=this.value,t=+t,a=this.caret(),"S"!==(e=e||this.currentFormat[a[0]])||this.options.steps.millisecond||(a=M.millisecondDigitsInFormat(this.inputFormat),t=M.millisecondStepFor(a)),this.dateObject.modifyPart(e,t),this.tryTriggerValueChange({oldValue:i,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},l.prototype.tryTriggerValueChange=function(t){if(!x.isEqual(this.value,(t=void 0===t?{oldValue:null,event:{}}:t).oldValue))return this.triggerValueChange(t)},l.prototype.triggerValueChange=function(t){return this.trigger("valueChange",M.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},l.prototype.triggerInput=function(t){return this.trigger("input",M.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",M.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerFocus=function(t){return this.trigger("focus",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlur=function(t){return this.trigger("blur",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerChange=function(t){return this.trigger("change",M.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerKeyDown=function(t){return this.trigger("keydown",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},l.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,t=t.format;this.currentFormat=t,this.currentText=e},l.prototype.setElementValue=function(t){this.element.value=t},l.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},l.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},l.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},l.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,t=t.end;this.setSelection({start:e||0,end:t||0})},l.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},l.prototype.verifyValue=function(t){if(t&&!M.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},l.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,n=this.dateObject.getTextAndFormat(n),i=n.text,n=n.format,n=(this.currentFormat=n,this.currentText=i,this.options.hasPlaceholder||M.isPresent(this.options.placeholder)),a=!this.isActive&&n&&!this.dateObject.hasValue(),n=(n&&M.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder),a?"":i);this.previousElementValue=this.elementValue,this.setElementValue(n),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},l.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,i=[t,t],a=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==a.selectionStart&&(n&&(M.isDocumentAvailable()&&document.activeElement!==a&&a.focus(),a.setSelectionRange(t,e)),i=[a.selectionStart,a.selectionEnd])}catch(t){i=[]}return i}},l.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||0<=n;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(0<=n&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},l.prototype.selectDateSegment=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);e<0&&(e=0),this.caret(0,0),this.caret(e,n)},l.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=this.createDateObject({value:t});return t.setLeadingZero(this.isActive?e:null),t},l.prototype.createDateObject=function(t){return new s.DateObject(M.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t=void 0===t?{}:t))},l);function l(t,e){var n=i.call(this,e)||this;return n.dateObject=null,n.currentText="",n.currentFormat="",n.interactionMode=I.DateInputInteractionMode.None,n.previousElementSelection={start:0,end:0},n.init(t,e),n}e.DateInput=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=n(11),a=(e.DateInput=n.DateInput,e);for(i in a)s(i,a[i])}],a={},i.m=n,i.c=a,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=12)}}});
|
|
1
|
+
System.register("@progress/kendo-dateinputs-common",["tslib","@progress/kendo-date-math"],function(a){var r,o;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){r=e(t)},function(t){o=e(t)}],execute:function(){function n(t){var e;return(s[t]||(e=s[t]={i:t,l:!1,exports:{}},i[t].call(e.exports,e,e.exports,n),e.l=!0,e)).exports}var i,s;i=[function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var i=e(2);r.isPresent=function(t){return null!=t},r.isDocumentAvailable=function(){return!!document},r.isNumber=function(t){return r.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},r.parseToInt=function(t){return parseInt(t,10)},r.clamp=function(t,e,i){return Math.min(i,Math.max(e,t))},r.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},r.deepExtend=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(!e.length)return t;var n,s=e.shift();if(o(t)&&o(s))for(var a in s)n=s[a],n instanceof HTMLElement?t[a]=s[a]:o(s[a])?(t[a]||r.extend(t,((n={})[a]={},n)),r.deepExtend(t[a],s[a])):r.extend(t,((n={})[a]=s[a],n));return r.deepExtend.apply(void 0,[t].concat(e))},r.noop=function(){},r.isFunction=function(t){return"function"==typeof t},r.cropTwoDigitYear=function(t){return!r.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},r.setYears=function(t,e){t=i.cloneDate(t);return t.setFullYear(e),t},r.millisecondDigitsInFormat=function(t){t=t&&t.match(/S+(\1)/);return t?t[0].length:0},r.millisecondStepFor=function(t){return Math.pow(10,3-t)},r.areDatePartsEqualTo=function(t,e,i,n,s,a,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==i||t.getDate()!==n||t.getHours()!==s||t.getMinutes()!==a||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isValidDate=function(t){return r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e){t.exports=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var d=i(1),p=i(3);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,i=t.newText,n=t.formatPattern,s=t.selectionStart,a=t.isInCaretMode,t=t.keyEvent,r=e[s+e.length-i.length],o=e.substring(0,s+e.length-i.length),e=i.substring(0,s),l=[];if(o===e&&0<s)return l.push([n[s-1],e[s-1]]),l;if(0===o.indexOf(e)&&a&&(t.key===p.Key.DELETE||t.key===p.Key.BACKSPACE)||0===o.indexOf(e)&&!a&&(0===e.length||n[e.length-1]!==n[e.length])){var h="";a||1!==e.length||l.push([n[0],e[0]]);for(var u=e.length;u<o.length;u++)n[u]!==h&&n[u]!==d.Constants.formatSeparator&&(h=n[u],l.push([h,""]));return l}if((!a||0!==e.indexOf(o)&&n[s-1]!==d.Constants.formatSeparator)&&(a||0!==e.indexOf(o)&&n[s-1]!==d.Constants.formatSeparator))return" "===e[e.length-1]||e[e.length-1]===r?[[n[s-1],d.Constants.formatSeparator]]:[[n[s-1],e[s-1]]];for(var c=n[0],u=Math.max(0,o.length-1);u<n.length;u++)if(n[u]!==d.Constants.formatSeparator){c=n[u];break}return[[c,e[s-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,i){return null===t||!(e&&t<e||i&&i<t)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(e=e.DateInputInteractionMode||(e.DateInputInteractionMode={})).None="none",e.Caret="caret",e.Selection="selection"},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),s={events:{}};function a(t){this.options=n.extend({},s,t)}a.prototype.destroy=function(){},a.prototype.trigger=function(t,e){void 0===e&&(e={});var i={defaultPrevented:!1,preventDefault:function(){i.defaultPrevented=!0}};return!!n.isFunction(this.options.events[t])&&(this.options.events[t](n.extend(i,e,{sender:this})),i.defaultPrevented)},e.Observable=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=function(){this.symbols="",this.partMap=[]}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var $=i(2),o=i(8),tt=i(4),et=i(0),h=i(1),n=/d|M|H|h|m|s/;function s(t){var e=t.intlService,i=t.formatPlaceholder,n=t.format,s=t.cycleTime,s=void 0!==s&&s,a=t.twoDigitYearMax,a=void 0===a?h.Constants.twoDigitYearMax:a,r=t.value,r=void 0===r?null:r,t=t.autoCorrectParts,t=void 0===t||t;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=$.getDate(new Date),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.intl=e,this.formatPlaceholder=i||"wide",this.format=n,this.cycleTime=s,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=a,this.autoCorrectParts=t,r)this._value=$.cloneDate(r);else{this._value=$.getDate(new Date);for(var o=this.dateFormatString(this.value,this.format).symbols,l=0;l<o.length;l++)this.setExisting(o[l],!1)}}Object.defineProperty(s.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"localeId",{get:function(){for(var t=h.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),i=0;i<e.length;i++){var n=e[i],n=this.intl.cldr[n];if(n.name&&n.calendar&&n.numbers&&n.name!==h.Constants.defaultLocaleId){t=n.name;break}}return t},enumerable:!0,configurable:!0}),s.prototype.setValue=function(t){t?$.isEqual(t,this._value)||(this._value=$.cloneDate(t),this.modifyExisting(!0)):(this._value=$.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},s.prototype.hasValue=function(){var i=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce(function(t,e){return t||"literal"!==e.type&&"dayperiod"!==e.type&&i.getExisting(e.pattern[0])},!1)},s.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return $.cloneDate(this.value)},s.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},s.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),i=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var n="",s=this.intl.formatDate(this.value,t,this.localeId),a=this.getFormattedInvalidDates(t),r=0;r<s.length;r++){var o,l,h=i.symbols[r];"literal"!==i.partMap[r].type&&this.getInvalidDatePartValue(h)?(o=this.getPartsForSegment(i,r),"M"===h?(l=(et.parseToInt(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(n+=tt.padZero(o.length-l.length)+l,r+=o.length-1):n+=a[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),n+=tt.padZero(o.length-l.length)+l,r+=o.length-1):n+=a[h][r]):n+=e[r]}e=n}return this.merge(e,i)},s.prototype.getFormattedInvalidDates=function(t){var i=this,n=(t=void 0===t?"":t)||this.format,s={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=i.getInvalidDatePart(t).date;e&&(e=i.intl.formatDate(e,n,i.localeId),s[t]=e)}),s},s.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,i=0;i<e.length;i++)this.setExisting(e[i],t)},s.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},s.prototype.setExisting=function(t,e){switch(t){case"y":!1===(this.year=e)&&this._value.setFullYear(2e3);break;case"M":!1===(this.month=e)&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},s.prototype.modifyPart=function(t,e){if(et.isPresent(t)&&et.isPresent(e)&&0!==e){var i,n=$.cloneDate(this.value),s=!1,a="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!a)switch(t){case"y":n.setFullYear(n.getFullYear()+e);break;case"M":n=$.addMonths(this.value,e);break;case"d":case"E":n.setDate(n.getDate()+e);break;case"h":case"H":n.setHours(n.getHours()+e),s=!0;break;case"m":n.setMinutes(n.getMinutes()+e),s=!0;break;case"s":n.setSeconds(n.getSeconds()+e),s=!0;break;case"S":n.setMilliseconds(n.getMilliseconds()+e);break;case"a":n.setHours(n.getHours()+12*e),s=!0}else{var l=this._partiallyInvalidDate.invalidDateParts||{},h=this.getInvalidDatePartValue(t),u=l.y.value||n.getFullYear(),c=l.M.value||n.getMonth(),d=l.d.value||l.E.value||n.getDate(),p=l.h.value||l.H.value||n.getHours(),m=l.m.value||n.getMinutes(),g=l.s.value||n.getSeconds(),l=l.S.value||n.getMilliseconds();switch(t){case"y":u+=e;break;case"M":c+=e;break;case"d":case"E":d+=e}if("M"===t){if((c<0||11<c)&&o)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);o||(c=c<0?et.clamp(c%11+1+11,0,11):(v=et.isPresent(h)?c:(e-1)%12,et.clamp(v,0,11)),c=et.clamp(c,0,11)),c=et.clamp(c,0,11)}else if("d"===t)if(o){if(d<=0||31<d)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!o){if(et.isPresent(h)&&(d<=0||31<d))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);d=(v=e<0?et.isPresent(h)?d:31-Math.abs(e%31)+1:et.isPresent(h)?d:e%31,et.clamp(v,1,31)),d=et.clamp(d,1,31)}var o=$.createDate(u,c,d,p,m,g,l),h=a||r?this.modifyDateSymbolWithValue(n,t,a?c:d):null,v=et.areDatePartsEqualTo(o,u,c,d,p,m,g,l);this.getValue()&&et.areDatePartsEqualTo(o,u,c,d,p,m,g,l)?(n=$.cloneDate(o),this.markDatePartsAsExisting()):a&&h?h.getMonth()===c?this.getExisting("d")?v?(n=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:c,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(this.resetInvalidDateSymbol(t),n=$.cloneDate(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),n=$.cloneDate(h)):(i=!0,this.setInvalidDatePart(t,{value:c,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):r&&h&&(h.getDate()===d?this.getExisting("M")?v?(n=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(n=$.cloneDate(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),n=$.cloneDate(h)):(i=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(this.value),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(n=this.normalizeCentury(n)),s&&!this.cycleTime&&(n.getDate(),this._value.getDate()),i||(this.setExisting(t,!0),this._value=n,this.getValue()&&this.resetInvalidDate())}},s.prototype.parsePart=function(t){for(var e=t.symbol,i=t.currentChar,N=t.resetSegmentValue,n=t.cycleSegmentValue,s=t.rawTextValue,j=t.isDeleting,a=t.originalFormat,r=!n,t=this.dateFormatString(this.value,this.format),o=t.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}}),l=t.partMap.map(function(t){return{type:t.type,pattern:t.pattern,text:""}}),h=0;h<o.length;h++){for(var u=o[h],c=0;c<u.pattern.length;c++)o[h+c]&&(o[h+c].literal=u.pattern[c]);h+=u.pattern.length-1}for(h=0;h<l.length;h++){for(u=l[h],c=0;c<u.pattern.length;c++)l[h+c]&&(l[h+c].text=u.pattern[c]);h+=u.pattern.length-1}var d={value:null,switchToNext:!1,resetPart:r&&"M"===e&&t.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length}),hasInvalidDatePart:!1};if(!i){if(!r)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),et.extend(d,{value:null,switchToNext:!1});for(h=0;h<o.length;h++){var p=o[h].literal,L=s.startsWith(p),K=s.endsWith(p),p=0<=s.indexOf(p+p);if(L||K||p)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),et.extend(d,{value:null,switchToNext:!1})}}var m=this.intl.formatDate(this.value,this.format,this.localeId),W=t.symbols,g=!1,v="",f="",y="",H="",B="",D="",E="";for(h=0;h<l.length;h++)E+=l[h].text;var n=this.format===W||this.format===E||this.format===a||this.format.length===a.length,P=(n?E:a).indexOf(e),S=(n?E:a).lastIndexOf(e)-P+1,b=a.length-s.length;if(r||!r&&!this.autoCorrectParts){for(h=0;h<m.length;h++)W[h]===e?(f+=this.getExisting(e)?m[h]:"0",0<b&&!(y.length+b<S)||(y+=s[h]||""),g=!0):g?(D+=m[h],B+=m[h]):(v+=m[h],H+=m[h]);if(n&&(E.length<s.length?y+=i:j||(a.length,s.length),y.length>S))return et.extend(d,{value:null,switchToNext:!1});if(!n||!this.autoCorrectParts){for(D=v=y=f="",g=!1,h=0;h<a.length;h++)a[h]===e?(f+=this.getExisting(e)?m[h]||"":"0",0<b&&!(y.length+b<S)||(y+=s[h]||""),g=!0):g?D+=s[h-b]||"":v+=s[h]||"";a.length<s.length&&(y+=i)}}if(!r)if(this.autoCorrectParts)for(D=v=y=f="",g=!1,h=0;h<m.length;h++)W[h]===e?(f+=this.getExisting(e)?m[h]:"0",g=!0):g?D+=m[h]:v+=m[h];else f=N?y:f;var M=null,R=this.matchMonth(i),P=this.matchDayPeriod(i,e),I="0"===i,Z=this.leadingZero||{},t=(I?("0"===y&&(y=f),0!==et.parseToInt(N?i:(r?y:f)+i)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e)):this.resetLeadingZero(),this.partPattern(t.partMap,e)),U=t?t.pattern:null,Y=this.patternLength(U)||U.length;if(r&&j&&!y)this.setExisting(e,!1);else{for(var t=f.length-3,z=!0,x=r?y:f,h=Math.max(0,t);h<=f.length&&z;h++){x=N?i:r?y:f.substring(h)+i,!r&&this.autoCorrectParts||(z=!1,x=tt.unpadZero(x),x=tt.padZero(Y-x.length)+x);var q,G=parseInt(x,10),M=this.intl.parseDate(v+x+D,this.format,this.localeId),J=!1,O=(r&&!et.isValidDate(M)&&this.autoCorrectParts&&(M=this.intl.parseDate(H+x+B,this.format,this.localeId),J=!0),!isNaN(parseInt(i,10))||r&&j&&""===i);if(!M&&!isNaN(G)&&O&&this.autoCorrectParts&&("M"!==e||R||-1<(O=G-1)&&O<12&&((M=$.cloneDate(this.value)).setMonth(O),M.getMonth()!==O)&&(M=$.lastDayOfMonth($.addMonths(M,-1))),"y"===e)&&(M=$.createDate(parseInt(x,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),r&&et.isValidDate(M)||!r&&M)&&this.date&&M.getDate()!==this.value.getDate()&&(M=$.lastDayOfMonth($.addMonths(M,-1))),r&&et.isValidDate(M)||!r&&M)return G=this.peek(x,U),O=this.intl.parseDate(J?""+H+G+B:""+v+G+D,this.format,this.localeId),J=((this.leadingZero||{})[e]||0)+tt.unpadZero(x).length>=Y,q=null===O||(Z[e]?U.length<=x.length:J),this.shouldNormalizeCentury()&&(M=this.normalizeCentury(M)),this._value=M,this.setExisting(e,!0),this.resetInvalidDateSymbol(e),this.autoCorrectParts||("M"===e?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===e&&this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")),this.hasInvalidDatePart())||this.markDatePartsAsExisting(),et.extend(d,{value:this.value,switchToNext:q})}if(R&&(M=this.intl.parseDate(v+R+D,this.format,this.localeId)))return this._value=M,this.setExisting(e,!0),et.extend(d,{value:this.value,switchToNext:!1});if(P&&(M=this.intl.parseDate(v+P+D,this.format)))return this._value=M,et.extend(d,{value:this.value,switchToNext:!0});if(I&&this.setExisting(e,!1),!this.autoCorrectParts){var Q,X,w,C,F,V,k,_,T,A,t=void 0,P=r?y:x,I=et.parseToInt(P);if(et.isNumber(I))return"d"===e&&(I<=0||31<I)||"M"===e&&(I<0||11<I)?et.extend(d,{value:null,switchToNext:!1}):(t="M"===e?I-1:I,Q="M"===e,X="d"===e,w=$.cloneDate(this._value),k=(F=this._partiallyInvalidDate.invalidDateParts||{}).y.value||w.getFullYear(),C=Q?t:F.M.value||w.getMonth(),t=X?t:F.d.value||F.E.value||w.getDate(),_=F.h.value||F.H.value||w.getHours(),T=F.m.value||w.getMinutes(),A=F.s.value||w.getSeconds(),F=F.S.value||w.getMilliseconds(),V=$.createDate(k,C,t,_,T,A,F),k=et.areDatePartsEqualTo(V,k,C,t,_,T,A,F),_=Q||X?this.modifyDateSymbolWithValue(w,e,Q?C:t):null,T=!1,Q&&_?_.getMonth()===C?this.getExisting("d")?k?(w=$.cloneDate(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:C,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):k?(this.resetInvalidDateSymbol(e),w=$.cloneDate(V),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),w=$.cloneDate(_)):(T=!0,this.setInvalidDatePart(e,{value:C,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):X&&_&&(_.getDate()===t?this.getExisting("M")?k?(w=$.cloneDate(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:t,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):k?(w=$.cloneDate(V),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),w=$.cloneDate(_)):(T=!0,this.setInvalidDatePart(e,{value:t,date:$.cloneDate(this.value),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1))),T||(this.setExisting(e,!0),r&&!et.isValidDate(M)?(A=this.intl.parseDate(H+x+B,this.format,this.localeId),et.isValidDate(A)&&(this._value=A)):this._value=w,this.getValue()&&this.resetInvalidDate()),q=!1,q="M"===e?2<=I||2<=P.length:n?P.length===S:P.length>S,et.extend(d,{value:null,switchToNext:q,hasInvalidDatePart:T}))}}return et.extend(d,{value:null,switchToNext:!1})},s.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(tt.dateSymbolMap,{})[t]},s.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},s.prototype.setLeadingZero=function(t){this.leadingZero=t},s.prototype.getLeadingZero=function(){return this.leadingZero||{}},s.prototype.normalizeCentury=function(t){var e,i;return et.isPresent(t)?(e=et.cropTwoDigitYear(t),i=this.getNormalizedCenturyBase(e),et.setYears(t,i+e)):t},s.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},s.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},s.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},s.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return tt.padZero(e.length-t.length)+t},s.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0!==this.monthNames.length)for(;0<this.typedMonthPart.length;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var i=parseInt(this.typedMonthPart,10);if(1<=i&&i<=12&&i.toString()===this.typedMonthPart)return this.monthNames[i-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},s.prototype.matchDayPeriod=function(t,e){t=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(t))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(t))return this.dayPeriods.pm}return""},s.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),i=0;i<e.length;i++)if("month"===e[i].type&&e[i].names)return this.intl.dateFormatNames(t,e[i].names);return[]},s.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),i=0;i<e.length;i++)if("dayperiod"===e[i].type&&e[i].names)return this.intl.dateFormatNames(t,e[i].names);return null},s.prototype.patternLength=function(t){return"y"===t[0]?4:n.test(t)?2:0},s.prototype.dateFormatString=function(t,e){for(var i=this.intl.splitDateFormat(e,this.localeId),n=[],s=[],a=0;a<i.length;a++)for(var r=this.intl.formatDate(t,{pattern:i[a].pattern},this.localeId).length;0<r;)n.push(this.symbols[i[a].pattern[0]]||h.Constants.formatSeparator),s.push(i[a]),r--;e=new o.Mask;return e.symbols=n.join(""),e.partMap=s,e},s.prototype.merge=function(t,e){for(var i="",n="",s=e.symbols,a=!1,r=0,o=this.getFormattedInvalidDates(s),l=s.length-1;0<=l;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(s[l])||this.getExisting(s[l]))this.autoCorrectParts||t.length===s.length||a?i=t[l]+i:0<r?(i=t[l]+i,--r<=0&&(a=!0)):i=(t[l+t.length-s.length]||"")+i,n=s[l]+n;else{var u,c=s[l],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;0<=l&&c===s[l];)l--;l++}for(this.leadingZero&&this.leadingZero[c]?i="0"+i:!this.autoCorrectParts&&this.getInvalidDatePartValue(c)?(u=this.getInvalidDatePartValue(c).toString(),"M"===c?(u=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?i=o[c][l]+i:(u=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),i=tt.padZero(h.length-u.length)+u+i,d=h.length-1,r=u.length-h.length)):(i=tt.padZero(h.length-u.length)+u+i,d=h.length-1,r=u.length-h.length)):i=this.dateFieldName(e.partMap[l])+i;n.length<i.length;)n=s[l]+n;0!==d&&(l=l-d+(t.length-s.length))}}return{text:i,format:n}},s.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]||("formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e})))},s.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},s.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},s.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},s.prototype.resetInvalidDateSymbol=function(t){var e=this,i=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&et.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(i=!1)}),i&&this.resetInvalidDate()},s.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},s.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},s.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},s.prototype.setInvalidDatePart=function(t,e){var i=e.value,n=e.date,n=void 0===n?null:n,s=e.startDateOffset,s=void 0===s?0:s,e=e.startDate,e=void 0===e?null:e;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=void 0===i?null:i,this._partiallyInvalidDate.invalidDateParts[t].date=n,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=e)},s.prototype.hasInvalidDatePart=function(){var e=this,i=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&et.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(i=!0)}),i},s.prototype.modifyDateSymbolWithOffset=function(t,e,i){var n=$.cloneDate(t),s=!1;switch(e){case"y":n.setFullYear(n.getFullYear()+i);break;case"M":n=$.addMonths(this.value,i);break;case"d":case"E":n.setDate(n.getDate()+i);break;case"h":case"H":n.setHours(n.getHours()+i),s=!0;break;case"m":n.setMinutes(n.getMinutes()+i),s=!0;break;case"s":n.setSeconds(n.getSeconds()+i),s=!0;break;case"S":n.setMilliseconds(n.getMilliseconds()+i);break;case"a":n.setHours(n.getHours()+12*i),s=!0}return{date:n,timeModified:s}},s.prototype.modifyDateSymbolWithValue=function(t,e,i){var n=$.cloneDate(t);switch(e){case"y":n.setFullYear(i);break;case"M":n=$.addMonths(t,i-t.getMonth());break;case"d":case"E":n.setDate(i);break;case"h":case"H":n.setHours(i);break;case"m":n.setMinutes(i);break;case"s":n.setSeconds(i);break;case"S":n.setMilliseconds(i);break;case"a":n.setHours(i)}return n},s.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},s.prototype.getPartsForSegment=function(t,e){for(var i=t.partMap[e],n=[],s=e;s<t.partMap.length;s++){var a=t.partMap[s];if(i.type!==a.type||i.pattern!==a.pattern)break;n.push(a)}for(s=e-1;0<=s&&(a=t.partMap[s],i.type===a.type&&i.pattern===a.pattern);s--)n.unshift(a);return n},e.DateObject=s},function(t,e){t.exports=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,s=i(10),a=i(9),b=i(4),M=i(7),I=i(3),x=i(0),r=i(6),O=i(5),w=i(2),C=i(1),o={format:"d",hasPlaceholder:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:((i={}).valueChange=null,i.input=null,i.inputEnd=null,i.focus=null,i.focusEnd=null,i.blur=null,i.blurEnd=null,i.keydown=null,i.mousewheel=null,i.change=null,i),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:C.Constants.twoDigitYearMax,autoCorrectParts:!0},i=(n=r.Observable,s.__extends(l,n),Object.defineProperty(l.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),l.prototype.init=function(t,e){var i=x.isValidDate(this.options.value)?w.cloneDate(this.options.value):new Date(e.formattedValue);x.isValidDate(i)||(i=null),this.element=t,this.options=x.extend({},o,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder||"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(i),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=O.DateInputInteractionMode.None,this.forceUpdate()},l.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,n.prototype.destroy.call(this)},l.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=x.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},l.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},l.prototype.isInCaretMode=function(){return this.interactionMode===O.DateInputInteractionMode.Caret},l.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},l.prototype.onElementDragStart=function(t){t.preventDefault()},l.prototype.onElementDrop=function(t){t.preventDefault()},l.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},l.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},l.prototype.onElementClick=function(t){this.mouseDownStarted=!1,this.switchedPartOnPreviousKeyAction=!1;var e,i=this.selection;this.isInCaretMode()&&this.forceUpdate(),3!==t.detail&&(this.isActive&&this.options.selectNearestSegmentOnFocus?(t=this.element.selectionStart!==this.element.selectionEnd,e=x.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,t=!t&&e?0:this.caret()[0],this.selectNearestSegment(t)):this.setSelection(this.selectionByIndex(i.start)))},l.prototype.onElementInput=function(t){if(this.triggerInput({event:t}),this.element&&this.dateObject){var e=this.switchedPartOnPreviousKeyAction;if(this.isPasteInProgress)this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),this.isPasteInProgress=!1;else{var i=this.keyDownEvent||{},n=i.keyCode===M.KeyCode.BACKSPACE||i.key===I.Key.BACKSPACE,s=i.keyCode===M.KeyCode.DELETE||i.key===I.Key.DELETE,i=this.interactionMode,a=(!this.options.allowCaretMode||i===O.DateInputInteractionMode.Caret||s||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=O.DateInputInteractionMode.Caret:this.interactionMode=O.DateInputInteractionMode.Selection,this.isInCaretMode());if(a&&this.keyDownEvent.key===I.Key.SPACE)this.restorePreviousInputEventState();else{var r=this.dateObject&&this.dateObject.getValue(),o=this.dateObject?this.dateObject.value:null,l=this.dateObject.getTextAndFormat(),h=l.text,l=l.format,l=(this.currentFormat=l,a&&(n||s||i===O.DateInputInteractionMode.Caret)?this.previousElementValue:h),i=this.elementValue,u=b.approximateStringMatching({oldText:l,newText:i,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:a,keyEvent:this.keyDownEvent});if(u&&u.length&&u[0]&&u[0][1]!==C.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!a||u&&0!==u.length){if(a&&1===u.length){if(!u[0]||!u[0][0])return void this.restorePreviousInputEventState();if(a&&u[0]&&(u[0][0]===C.Constants.formatSeparator||u[0][1]===C.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var h=1===u.length&&u[0][1]===C.Constants.formatSeparator,c=[],d=!1;if(!h)for(var p=0;p<u.length;p++){var m=this.dateObject.parsePart({symbol:u[p][0],currentChar:u[p][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||s,originalFormat:this.currentFormat});c.push(m),d=m.switchToNext}this.options.autoSwitchParts||(d=!1),this.resetSegmentValue=!1;var g,l=this.options.format===this.currentFormat||x.isPresent(this.options.format)&&1<this.options.format.length,i=c[c.length-1],v=i&&!x.isPresent(i.value),f=a&&(n||s)&&v,y=!!i&&i.resetPart,D=this.dateObject.getValue(),E=!w.isEqual(r,D),P=this.dateObject.value,S=this.selection;a?(g=u&&0<u.length?u[0][0]:null,g=this.dateObject.getLeadingZero()[g],u.length&&u[0][0]!==C.Constants.formatSeparator?d?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):y?(y=this.currentFormat[S.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(y))):this.restorePreviousInputEventState():f?(this.forceUpdate(),u.length&&u[0][0]!==C.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(u[0][0]))):v?"0"===t.data&&g||(x.isPresent(r)&&!x.isPresent(D)?this.restorePreviousInputEventState():!x.isPresent(r)&&x.isPresent(D)?this.forceUpdateWithSelection():x.isPresent(r)&&x.isPresent(D)?E?this.forceUpdateWithSelection():this.restorePreviousInputEventState():x.isPresent(r)||x.isPresent(D)?o===P&&this.restorePreviousInputEventState():this.forceUpdateWithSelection()):l||this.forceUpdateWithSelection():!this.options.autoSwitchParts&&u[0][1]===C.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(u[0][0]))):(this.forceUpdate(),u.length&&u[0][0]!==C.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(u[0][0])),this.options.autoSwitchParts?h?(this.resetSegmentValue=!0,e||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):d&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):i&&i.switchToNext?this.resetSegmentValue=!0:h&&(this.resetSegmentValue=!0,e||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0),n&&this.options.selectPreviousSegmentOnBackspace&&this.switchDateSegment(-1)),this.tryTriggerValueChange({oldValue:r,event:t}),this.triggerInputEnd({event:t}),a&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}}},l.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=O.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},l.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.interactionMode=O.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},l.prototype.onElementChange=function(t){this.triggerChange({event:t})},l.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){var e=this.selection,i=e.start,e=e.end;if(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.previousElementSelection={start:i,end:e},this.keyEventMatchesAutoSwitchKeys(t)){i=t.KeyCode===M.KeyCode.TAB;if(!i)return t.preventDefault(),void this.switchDateSegment(1);var e=this.selection,n=e.start,e=e.end;if(t.shiftKey&&i?this.switchDateSegment(-1):this.switchDateSegment(1),n!==this.selection.start||e!==this.selection.end)return void t.preventDefault()}var s=this.currentFormat[this.selection.start],a=this.getStepFromSymbol(s),r=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===M.KeyCode.TAB)){switch(t.keyCode){case M.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),this.switchedPartOnPreviousKeyAction=!(r=!0);break;case M.KeyCode.ARROW_UP:this.modifyDateSegmentValue(a,s,event),this.switchedPartOnPreviousKeyAction=!(r=!0);break;case M.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!(r=!0);break;case M.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-a,s,event),this.switchedPartOnPreviousKeyAction=!(r=!0);break;case M.KeyCode.ENTER:break;case I.Key.HOME:this.selectNearestSegment(0),this.switchedPartOnPreviousKeyAction=!1;break;case I.Key.END:this.selectNearestSegment(this.elementValue.length),this.switchedPartOnPreviousKeyAction=!1;break;default:return}r&&t.preventDefault()}}},l.prototype.onElementPaste=function(){this.isPasteInProgress=!0},l.prototype.onElementMouseWheel=function(t){this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive&&((t=t).shiftKey?this.switchDateSegment(0<(t.wheelDelta||-t.detail)?-1:1):this.modifyDateSegmentValue(0<(t.wheelDelta||-t.detail)?1:-1),t.returnValue=!1,t.preventDefault&&t.preventDefault(),t.stopPropagation)&&t.stopPropagation()},l.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value,i=(x.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e)),this.dateObject&&this.dateObject.getValue());this.writeValue(e),this.tryTriggerValueChange({oldValue:i,event:t})},Object.defineProperty(l.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:C.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:C.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"selection",{get:function(){var t={start:0,end:0};return t=null!==this.element&&void 0!==this.element.selectionStart?{start:this.element.selectionStart,end:this.element.selectionEnd}:t},enumerable:!0,configurable:!0}),l.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),t.start!==t.end)&&(this.interactionMode=O.DateInputInteractionMode.Selection)},l.prototype.selectionBySymbol=function(t){for(var e=-1,i=0,n=0;n<this.currentFormat.length;n++)this.currentFormat[n]===t&&(i=n+1,-1===e)&&(e=n);return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?i+=this.currentText.length-this.currentFormat.length:i=Math.max(0,i-(this.currentFormat.length-this.currentText.length))),{start:e,end:i}},l.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},i=t,n=t-1;i<this.currentFormat.length||0<=n;i++,n--){if(i<this.currentFormat.length&&this.currentFormat[i]!==C.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}if(0<=n&&this.currentFormat[n]!==C.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}}return e},l.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var i=e.start,n=this.currentFormat[i-1],s="",a="";if(t<0){for(var r=i+t;0<=r;r--)if((a=this.currentFormat[r])!==C.Constants.formatSeparator&&a!==n){i=r,s=a;break}}else for(r=i+t;r<this.currentFormat.length;r++)if((a=this.currentFormat[r])!==C.Constants.formatSeparator&&a!==n){i=r,s=a;break}if(s)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(s)),void(this.interactionMode=O.DateInputInteractionMode.Selection)}this.interactionMode=O.DateInputInteractionMode.None;var e=this.selection,o=e.start,e=e.end;if(o<e&&this.currentFormat[o]!==this.currentFormat[e-1])this.setSelection(this.selectionByIndex(0<t?o:e-1)),this.resetSegmentValue=!0,this.interactionMode=O.DateInputInteractionMode.None;else{for(var l=this.currentFormat[o],h=o+t;0<h&&h<this.currentFormat.length&&(this.currentFormat[h]===l||this.currentFormat[h]===C.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==C.Constants.formatSeparator){for(var u=h;0<=u&&u<this.currentFormat.length&&this.currentFormat[u]===this.currentFormat[h];)u+=t;u<h&&(u+1!==o||h+1!==e)?(this.setSelection({start:u+1,end:h+1}),this.resetSegmentValue=!0):h<u&&(h!==o||u!==e)&&(this.setSelection({start:h,end:u}),this.resetSegmentValue=!0),this.interactionMode=O.DateInputInteractionMode.None}}},l.prototype.modifyDateSegmentValue=function(t,e,i){var n,s;void 0===e&&(e=""),void 0===i&&(i={}),this.dateObject&&(n=this.value,t=+t,s=this.caret(),"S"!==(e=e||this.currentFormat[s[0]])||this.options.steps.millisecond||(s=x.millisecondDigitsInFormat(this.inputFormat),t=x.millisecondStepFor(s)),this.dateObject.modifyPart(e,t),this.tryTriggerValueChange({oldValue:n,event:i}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},l.prototype.tryTriggerValueChange=function(t){if(!w.isEqual(this.value,(t=void 0===t?{oldValue:null,event:{}}:t).oldValue))return this.triggerValueChange(t)},l.prototype.triggerValueChange=function(t){return this.trigger("valueChange",x.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},l.prototype.triggerInput=function(t){return this.trigger("input",x.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",x.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerFocus=function(t){return this.trigger("focus",x.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",x.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlur=function(t){return this.trigger("blur",x.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",x.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerChange=function(t){return this.trigger("change",x.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerKeyDown=function(t){return this.trigger("keydown",x.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",x.extend({},t=void 0===t?{event:{}}:t))},l.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},l.prototype.forceUpdateWithSelection=function(){var t=this.selection,e=t.start,t=t.end,i=this.elementValue.length,i=(this.forceUpdate(),this.elementValue.length-i);this.setSelection({start:e+i,end:t+i})},l.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,t=t.format;this.currentFormat=t,this.currentText=e},l.prototype.setElementValue=function(t){this.element.value=t},l.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},l.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},l.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},l.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,t=t.end;this.setSelection({start:e||0,end:t||0})},l.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},l.prototype.verifyValue=function(t){if(t&&!x.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},l.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,i=this.isActive?this.inputFormat:this.displayFormat,i=this.dateObject.getTextAndFormat(i),n=i.text,i=i.format,i=(this.currentFormat=i,this.currentText=n,this.options.hasPlaceholder||x.isPresent(this.options.placeholder)),s=!this.isActive&&i&&!this.dateObject.hasValue(),i=(i&&x.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder),s?"":n);this.previousElementValue=this.elementValue,this.setElementValue(i),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},l.prototype.caret=function(t,e){void 0===e&&(e=t);var i=void 0!==t,n=[t,t],s=this.element;if(!i||!this.options.disabled&&!this.options.readonly){try{void 0!==s.selectionStart&&(i&&(x.isDocumentAvailable()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),n=[s.selectionStart,s.selectionEnd])}catch(t){n=[]}return n}},l.prototype.selectNearestSegment=function(t){for(var e=t,i=t-1;e<this.currentFormat.length||0<=i;e++,i--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(0<=i&&"_"!==this.currentFormat[i])return void this.selectDateSegment(this.currentFormat[i])}},l.prototype.selectDateSegment=function(t){for(var e=-1,i=0,n=0;n<this.currentFormat.length;n++)this.currentFormat[n]===t&&(i=n+1,-1===e)&&(e=n);e<0&&(e=0),this.caret(0,0),this.caret(e,i)},l.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=this.createDateObject({value:t});return t.setLeadingZero(this.isActive?e:null),t},l.prototype.createDateObject=function(t){return new a.DateObject(x.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t=void 0===t?{}:t))},l.prototype.keyEventMatchesAutoSwitchKeys=function(t){var e=(this.options.autoSwitchKeys||[]).map(function(t){return t.toString().toLowerCase().trim()});return 0<=e.indexOf(t.keyCode.toString())||0<=e.indexOf(t.keyCode)||0<=e.indexOf(t.key.toLowerCase().trim())},l);function l(t,e){var i=n.call(this,e)||this;return i.dateObject=null,i.currentText="",i.currentFormat="",i.interactionMode=O.DateInputInteractionMode.None,i.previousElementSelection={start:0,end:0},i.init(t,e),i}e.DateInput=i},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=i(11),s=(e.DateInput=i.DateInput,e);for(n in s)a(n,s[n])}],s={},n.m=i,n.c=s,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}}});
|