diff --git a/.gitignore b/.gitignore index 74dd2d334..61d281ec3 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,6 @@ site src/docs/partials/examples/test.html /docs/ /dist/plugins/examples/ +coverage/tmp -.DS_Store \ No newline at end of file +.DS_Store diff --git a/README.md b/README.md index 1fe86a4c4..155cd3afa 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Rate on Openbase](https://badges.openbase.com/js/rating/@eonasdan/tempus-dominus.svg)](https://openbase.com/js/@eonasdan/tempus-dominus?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge) -# Tempus Dominus Date/Time Picker v6.2.6 +# Tempus Dominus Date/Time Picker v6.2.7 Tempus Dominus is a powerful and robust date time picker for javascript. Version 6 is another major rewrite over the previous version. V6 is written with modern browsers in mind and is written in typescript. Bootstrap, momentjs and jQuery are no longer required dependencies. Popper2 is all that is required for the picker to position correctly. If you still require jQuery (seriously, you should move off that asap) there's a jQuery provider that wraps the native js functions. diff --git a/build/rollup-plugin.config.js b/build/rollup-plugin.config.js index 36c910e4b..bc5b19218 100644 --- a/build/rollup-plugin.config.js +++ b/build/rollup-plugin.config.js @@ -1,4 +1,5 @@ const typescript = require('rollup-plugin-ts'); +const ignore = require('rollup-plugin-ignore'); const banner = require('./banner.js'); const globals = { @@ -15,6 +16,7 @@ module.exports = (config) => { 'tempusDominus' ], plugins: [ + ignore(['DateTime', 'ErrorMessages']), typescript({ tsconfig: resolvedConfig => ({ ...resolvedConfig, declaration: false, rootDir: "./src" }) }) diff --git a/coverage/base.css b/coverage/base.css new file mode 100644 index 000000000..f418035b4 --- /dev/null +++ b/coverage/base.css @@ -0,0 +1,224 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* yellow */ +.cbranch-no { background: yellow !important; color: #111; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +.highlighted, +.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ + background: #C21F39 !important; +} +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +.medium .chart { border:1px solid #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + +span.cline-neutral { background: #eaeaea; } + +.coverage-summary td.empty { + opacity: .5; + padding-top: 4px; + padding-bottom: 4px; + line-height: 1; + color: #888; +} + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/coverage/block-navigation.js b/coverage/block-navigation.js new file mode 100644 index 000000000..cc1213023 --- /dev/null +++ b/coverage/block-navigation.js @@ -0,0 +1,87 @@ +/* eslint-disable */ +var jumpToCode = (function init() { + // Classes of code we would like to highlight in the file view + var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; + + // Elements to highlight in the file listing view + var fileListingElements = ['td.pct.low']; + + // We don't want to select elements that are direct descendants of another match + var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` + + // Selecter that finds elements on the page to which we can jump + var selector = + fileListingElements.join(', ') + + ', ' + + notSelector + + missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` + + // The NodeList of matching elements + var missingCoverageElements = document.querySelectorAll(selector); + + var currentIndex; + + function toggleClass(index) { + missingCoverageElements + .item(currentIndex) + .classList.remove('highlighted'); + missingCoverageElements.item(index).classList.add('highlighted'); + } + + function makeCurrent(index) { + toggleClass(index); + currentIndex = index; + missingCoverageElements.item(index).scrollIntoView({ + behavior: 'smooth', + block: 'center', + inline: 'center' + }); + } + + function goToPrevious() { + var nextIndex = 0; + if (typeof currentIndex !== 'number' || currentIndex === 0) { + nextIndex = missingCoverageElements.length - 1; + } else if (missingCoverageElements.length > 1) { + nextIndex = currentIndex - 1; + } + + makeCurrent(nextIndex); + } + + function goToNext() { + var nextIndex = 0; + + if ( + typeof currentIndex === 'number' && + currentIndex < missingCoverageElements.length - 1 + ) { + nextIndex = currentIndex + 1; + } + + makeCurrent(nextIndex); + } + + return function jump(event) { + if ( + document.getElementById('fileSearch') === document.activeElement && + document.activeElement != null + ) { + // if we're currently focused on the search input, we don't want to navigate + return; + } + + switch (event.which) { + case 78: // n + case 74: // j + goToNext(); + break; + case 66: // b + case 75: // k + case 80: // p + goToPrevious(); + break; + } + }; +})(); +window.addEventListener('keydown', jumpToCode); diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json new file mode 100644 index 000000000..f9f7723c7 --- /dev/null +++ b/coverage/coverage-final.json @@ -0,0 +1,2 @@ +{"D:\\projects\\GitHub\\tempus-dominus\\src\\js\\datetime.ts": {"path":"D:\\projects\\GitHub\\tempus-dominus\\src\\js\\datetime.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":22}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":18}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":16}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":18}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":16}},"7":{"start":{"line":8,"column":0},"end":{"line":8,"column":1}},"8":{"start":{"line":9,"column":0},"end":{"line":9,"column":0}},"9":{"start":{"line":10,"column":0},"end":{"line":10,"column":26}},"10":{"start":{"line":11,"column":0},"end":{"line":11,"column":19}},"11":{"start":{"line":12,"column":0},"end":{"line":12,"column":17}},"12":{"start":{"line":13,"column":0},"end":{"line":13,"column":18}},"13":{"start":{"line":14,"column":0},"end":{"line":14,"column":18}},"14":{"start":{"line":15,"column":0},"end":{"line":15,"column":20}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":20}},"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":15}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":1}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":0}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":36}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":18}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":15}},"22":{"start":{"line":23,"column":0},"end":{"line":23,"column":1}},"23":{"start":{"line":24,"column":0},"end":{"line":24,"column":0}},"24":{"start":{"line":25,"column":0},"end":{"line":25,"column":75}},"25":{"start":{"line":26,"column":0},"end":{"line":26,"column":42}},"26":{"start":{"line":27,"column":0},"end":{"line":27,"column":51}},"27":{"start":{"line":28,"column":0},"end":{"line":28,"column":27}},"28":{"start":{"line":29,"column":0},"end":{"line":29,"column":1}},"29":{"start":{"line":30,"column":0},"end":{"line":30,"column":0}},"30":{"start":{"line":31,"column":0},"end":{"line":31,"column":56}},"31":{"start":{"line":32,"column":0},"end":{"line":32,"column":17}},"32":{"start":{"line":33,"column":0},"end":{"line":33,"column":16}},"33":{"start":{"line":34,"column":0},"end":{"line":34,"column":36}},"34":{"start":{"line":35,"column":0},"end":{"line":35,"column":17}},"35":{"start":{"line":36,"column":0},"end":{"line":36,"column":14}},"36":{"start":{"line":37,"column":0},"end":{"line":37,"column":25}},"37":{"start":{"line":38,"column":0},"end":{"line":38,"column":23}},"38":{"start":{"line":39,"column":0},"end":{"line":39,"column":8}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":16}},"40":{"start":{"line":41,"column":0},"end":{"line":41,"column":33}},"41":{"start":{"line":42,"column":0},"end":{"line":42,"column":3}},"42":{"start":{"line":43,"column":0},"end":{"line":43,"column":2}},"43":{"start":{"line":44,"column":0},"end":{"line":44,"column":0}},"44":{"start":{"line":45,"column":0},"end":{"line":45,"column":3}},"45":{"start":{"line":46,"column":0},"end":{"line":46,"column":61}},"46":{"start":{"line":47,"column":0},"end":{"line":47,"column":55}},"47":{"start":{"line":48,"column":0},"end":{"line":48,"column":3}},"48":{"start":{"line":49,"column":0},"end":{"line":49,"column":36}},"49":{"start":{"line":50,"column":0},"end":{"line":50,"column":5}},"50":{"start":{"line":51,"column":0},"end":{"line":51,"column":34}},"51":{"start":{"line":52,"column":0},"end":{"line":52,"column":5}},"52":{"start":{"line":53,"column":0},"end":{"line":53,"column":21}},"53":{"start":{"line":54,"column":0},"end":{"line":54,"column":0}},"54":{"start":{"line":55,"column":0},"end":{"line":55,"column":5}},"55":{"start":{"line":56,"column":0},"end":{"line":56,"column":44}},"56":{"start":{"line":57,"column":0},"end":{"line":57,"column":17}},"57":{"start":{"line":58,"column":0},"end":{"line":58,"column":5}},"58":{"start":{"line":59,"column":0},"end":{"line":59,"column":34}},"59":{"start":{"line":60,"column":0},"end":{"line":60,"column":24}},"60":{"start":{"line":61,"column":0},"end":{"line":61,"column":16}},"61":{"start":{"line":62,"column":0},"end":{"line":62,"column":3}},"62":{"start":{"line":63,"column":0},"end":{"line":63,"column":0}},"63":{"start":{"line":64,"column":0},"end":{"line":64,"column":5}},"64":{"start":{"line":65,"column":0},"end":{"line":65,"column":58}},"65":{"start":{"line":66,"column":0},"end":{"line":66,"column":45}},"66":{"start":{"line":67,"column":0},"end":{"line":67,"column":17}},"67":{"start":{"line":68,"column":0},"end":{"line":68,"column":18}},"68":{"start":{"line":69,"column":0},"end":{"line":69,"column":5}},"69":{"start":{"line":70,"column":0},"end":{"line":70,"column":68}},"70":{"start":{"line":71,"column":0},"end":{"line":71,"column":53}},"71":{"start":{"line":72,"column":0},"end":{"line":72,"column":24}},"72":{"start":{"line":73,"column":0},"end":{"line":73,"column":25}},"73":{"start":{"line":74,"column":0},"end":{"line":74,"column":22}},"74":{"start":{"line":75,"column":0},"end":{"line":75,"column":21}},"75":{"start":{"line":76,"column":0},"end":{"line":76,"column":22}},"76":{"start":{"line":77,"column":0},"end":{"line":77,"column":24}},"77":{"start":{"line":78,"column":0},"end":{"line":78,"column":24}},"78":{"start":{"line":79,"column":0},"end":{"line":79,"column":28}},"79":{"start":{"line":80,"column":0},"end":{"line":80,"column":24}},"80":{"start":{"line":81,"column":0},"end":{"line":81,"column":3}},"81":{"start":{"line":82,"column":0},"end":{"line":82,"column":0}},"82":{"start":{"line":83,"column":0},"end":{"line":83,"column":5}},"83":{"start":{"line":84,"column":0},"end":{"line":84,"column":98}},"84":{"start":{"line":85,"column":0},"end":{"line":85,"column":17}},"85":{"start":{"line":86,"column":0},"end":{"line":86,"column":24}},"86":{"start":{"line":87,"column":0},"end":{"line":87,"column":5}},"87":{"start":{"line":88,"column":0},"end":{"line":88,"column":65}},"88":{"start":{"line":89,"column":0},"end":{"line":89,"column":31}},"89":{"start":{"line":90,"column":0},"end":{"line":90,"column":3}},"90":{"start":{"line":91,"column":0},"end":{"line":91,"column":0}},"91":{"start":{"line":92,"column":0},"end":{"line":92,"column":5}},"92":{"start":{"line":93,"column":0},"end":{"line":93,"column":112}},"93":{"start":{"line":94,"column":0},"end":{"line":94,"column":5}},"94":{"start":{"line":95,"column":0},"end":{"line":95,"column":15}},"95":{"start":{"line":96,"column":0},"end":{"line":96,"column":24}},"96":{"start":{"line":97,"column":0},"end":{"line":97,"column":16}},"97":{"start":{"line":98,"column":0},"end":{"line":98,"column":17}},"98":{"start":{"line":99,"column":0},"end":{"line":99,"column":16}},"99":{"start":{"line":100,"column":0},"end":{"line":100,"column":17}},"100":{"start":{"line":101,"column":0},"end":{"line":101,"column":19}},"101":{"start":{"line":102,"column":0},"end":{"line":102,"column":19}},"102":{"start":{"line":103,"column":0},"end":{"line":103,"column":28}},"103":{"start":{"line":104,"column":0},"end":{"line":104,"column":29}},"104":{"start":{"line":105,"column":0},"end":{"line":105,"column":3}},"105":{"start":{"line":106,"column":0},"end":{"line":106,"column":0}},"106":{"start":{"line":107,"column":0},"end":{"line":107,"column":5}},"107":{"start":{"line":108,"column":0},"end":{"line":108,"column":68}},"108":{"start":{"line":109,"column":0},"end":{"line":109,"column":129}},"109":{"start":{"line":110,"column":0},"end":{"line":110,"column":59}},"110":{"start":{"line":111,"column":0},"end":{"line":111,"column":16}},"111":{"start":{"line":112,"column":0},"end":{"line":112,"column":73}},"112":{"start":{"line":113,"column":0},"end":{"line":113,"column":5}},"113":{"start":{"line":114,"column":0},"end":{"line":114,"column":61}},"114":{"start":{"line":115,"column":0},"end":{"line":115,"column":81}},"115":{"start":{"line":116,"column":0},"end":{"line":116,"column":19}},"116":{"start":{"line":117,"column":0},"end":{"line":117,"column":21}},"117":{"start":{"line":118,"column":0},"end":{"line":118,"column":32}},"118":{"start":{"line":119,"column":0},"end":{"line":119,"column":14}},"119":{"start":{"line":120,"column":0},"end":{"line":120,"column":21}},"120":{"start":{"line":121,"column":0},"end":{"line":121,"column":30}},"121":{"start":{"line":122,"column":0},"end":{"line":122,"column":14}},"122":{"start":{"line":123,"column":0},"end":{"line":123,"column":19}},"123":{"start":{"line":124,"column":0},"end":{"line":124,"column":33}},"124":{"start":{"line":125,"column":0},"end":{"line":125,"column":14}},"125":{"start":{"line":126,"column":0},"end":{"line":126,"column":18}},"126":{"start":{"line":127,"column":0},"end":{"line":127,"column":34}},"127":{"start":{"line":128,"column":0},"end":{"line":128,"column":14}},"128":{"start":{"line":129,"column":0},"end":{"line":129,"column":21}},"129":{"start":{"line":130,"column":0},"end":{"line":130,"column":32}},"130":{"start":{"line":131,"column":0},"end":{"line":131,"column":51}},"131":{"start":{"line":132,"column":0},"end":{"line":132,"column":34}},"132":{"start":{"line":133,"column":0},"end":{"line":133,"column":84}},"133":{"start":{"line":134,"column":0},"end":{"line":134,"column":60}},"134":{"start":{"line":135,"column":0},"end":{"line":135,"column":14}},"135":{"start":{"line":136,"column":0},"end":{"line":136,"column":19}},"136":{"start":{"line":137,"column":0},"end":{"line":137,"column":32}},"137":{"start":{"line":138,"column":0},"end":{"line":138,"column":24}},"138":{"start":{"line":139,"column":0},"end":{"line":139,"column":14}},"139":{"start":{"line":140,"column":0},"end":{"line":140,"column":18}},"140":{"start":{"line":141,"column":0},"end":{"line":141,"column":32}},"141":{"start":{"line":142,"column":0},"end":{"line":142,"column":28}},"142":{"start":{"line":143,"column":0},"end":{"line":143,"column":14}},"143":{"start":{"line":144,"column":0},"end":{"line":144,"column":5}},"144":{"start":{"line":145,"column":0},"end":{"line":145,"column":16}},"145":{"start":{"line":146,"column":0},"end":{"line":146,"column":3}},"146":{"start":{"line":147,"column":0},"end":{"line":147,"column":0}},"147":{"start":{"line":148,"column":0},"end":{"line":148,"column":5}},"148":{"start":{"line":149,"column":0},"end":{"line":149,"column":66}},"149":{"start":{"line":150,"column":0},"end":{"line":150,"column":127}},"150":{"start":{"line":151,"column":0},"end":{"line":151,"column":49}},"151":{"start":{"line":152,"column":0},"end":{"line":152,"column":16}},"152":{"start":{"line":153,"column":0},"end":{"line":153,"column":26}},"153":{"start":{"line":154,"column":0},"end":{"line":154,"column":5}},"154":{"start":{"line":155,"column":0},"end":{"line":155,"column":59}},"155":{"start":{"line":156,"column":0},"end":{"line":156,"column":81}},"156":{"start":{"line":157,"column":0},"end":{"line":157,"column":19}},"157":{"start":{"line":158,"column":0},"end":{"line":158,"column":21}},"158":{"start":{"line":159,"column":0},"end":{"line":159,"column":34}},"159":{"start":{"line":160,"column":0},"end":{"line":160,"column":14}},"160":{"start":{"line":161,"column":0},"end":{"line":161,"column":21}},"161":{"start":{"line":162,"column":0},"end":{"line":162,"column":33}},"162":{"start":{"line":163,"column":0},"end":{"line":163,"column":14}},"163":{"start":{"line":164,"column":0},"end":{"line":164,"column":19}},"164":{"start":{"line":165,"column":0},"end":{"line":165,"column":37}},"165":{"start":{"line":166,"column":0},"end":{"line":166,"column":14}},"166":{"start":{"line":167,"column":0},"end":{"line":167,"column":18}},"167":{"start":{"line":168,"column":0},"end":{"line":168,"column":39}},"168":{"start":{"line":169,"column":0},"end":{"line":169,"column":14}},"169":{"start":{"line":170,"column":0},"end":{"line":170,"column":21}},"170":{"start":{"line":171,"column":0},"end":{"line":171,"column":30}},"171":{"start":{"line":172,"column":0},"end":{"line":172,"column":47}},"172":{"start":{"line":173,"column":0},"end":{"line":173,"column":46}},"173":{"start":{"line":174,"column":0},"end":{"line":174,"column":61}},"174":{"start":{"line":175,"column":0},"end":{"line":175,"column":14}},"175":{"start":{"line":176,"column":0},"end":{"line":176,"column":19}},"176":{"start":{"line":177,"column":0},"end":{"line":177,"column":30}},"177":{"start":{"line":178,"column":0},"end":{"line":178,"column":39}},"178":{"start":{"line":179,"column":0},"end":{"line":179,"column":24}},"179":{"start":{"line":180,"column":0},"end":{"line":180,"column":14}},"180":{"start":{"line":181,"column":0},"end":{"line":181,"column":18}},"181":{"start":{"line":182,"column":0},"end":{"line":182,"column":30}},"182":{"start":{"line":183,"column":0},"end":{"line":183,"column":30}},"183":{"start":{"line":184,"column":0},"end":{"line":184,"column":14}},"184":{"start":{"line":185,"column":0},"end":{"line":185,"column":5}},"185":{"start":{"line":186,"column":0},"end":{"line":186,"column":16}},"186":{"start":{"line":187,"column":0},"end":{"line":187,"column":3}},"187":{"start":{"line":188,"column":0},"end":{"line":188,"column":0}},"188":{"start":{"line":189,"column":0},"end":{"line":189,"column":5}},"189":{"start":{"line":190,"column":0},"end":{"line":190,"column":67}},"190":{"start":{"line":191,"column":0},"end":{"line":191,"column":135}},"191":{"start":{"line":192,"column":0},"end":{"line":192,"column":47}},"192":{"start":{"line":193,"column":0},"end":{"line":193,"column":47}},"193":{"start":{"line":194,"column":0},"end":{"line":194,"column":16}},"194":{"start":{"line":195,"column":0},"end":{"line":195,"column":5}},"195":{"start":{"line":196,"column":0},"end":{"line":196,"column":47}},"196":{"start":{"line":197,"column":0},"end":{"line":197,"column":81}},"197":{"start":{"line":198,"column":0},"end":{"line":198,"column":24}},"198":{"start":{"line":199,"column":0},"end":{"line":199,"column":16}},"199":{"start":{"line":200,"column":0},"end":{"line":200,"column":3}},"200":{"start":{"line":201,"column":0},"end":{"line":201,"column":0}},"201":{"start":{"line":202,"column":0},"end":{"line":202,"column":5}},"202":{"start":{"line":203,"column":0},"end":{"line":203,"column":29}},"203":{"start":{"line":204,"column":0},"end":{"line":204,"column":109}},"204":{"start":{"line":205,"column":0},"end":{"line":205,"column":43}},"205":{"start":{"line":206,"column":0},"end":{"line":206,"column":64}},"206":{"start":{"line":207,"column":0},"end":{"line":207,"column":91}},"207":{"start":{"line":208,"column":0},"end":{"line":208,"column":5}},"208":{"start":{"line":209,"column":0},"end":{"line":209,"column":73}},"209":{"start":{"line":210,"column":0},"end":{"line":210,"column":66}},"210":{"start":{"line":211,"column":0},"end":{"line":211,"column":3}},"211":{"start":{"line":212,"column":0},"end":{"line":212,"column":0}},"212":{"start":{"line":213,"column":0},"end":{"line":213,"column":5}},"213":{"start":{"line":214,"column":0},"end":{"line":214,"column":55}},"214":{"start":{"line":215,"column":0},"end":{"line":215,"column":48}},"215":{"start":{"line":216,"column":0},"end":{"line":216,"column":54}},"216":{"start":{"line":217,"column":0},"end":{"line":217,"column":17}},"217":{"start":{"line":218,"column":0},"end":{"line":218,"column":5}},"218":{"start":{"line":219,"column":0},"end":{"line":219,"column":53}},"219":{"start":{"line":220,"column":0},"end":{"line":220,"column":57}},"220":{"start":{"line":221,"column":0},"end":{"line":221,"column":81}},"221":{"start":{"line":222,"column":0},"end":{"line":222,"column":12}},"222":{"start":{"line":223,"column":0},"end":{"line":223,"column":80}},"223":{"start":{"line":224,"column":0},"end":{"line":224,"column":6}},"224":{"start":{"line":225,"column":0},"end":{"line":225,"column":3}},"225":{"start":{"line":226,"column":0},"end":{"line":226,"column":0}},"226":{"start":{"line":227,"column":0},"end":{"line":227,"column":5}},"227":{"start":{"line":228,"column":0},"end":{"line":228,"column":54}},"228":{"start":{"line":229,"column":0},"end":{"line":229,"column":48}},"229":{"start":{"line":230,"column":0},"end":{"line":230,"column":54}},"230":{"start":{"line":231,"column":0},"end":{"line":231,"column":17}},"231":{"start":{"line":232,"column":0},"end":{"line":232,"column":5}},"232":{"start":{"line":233,"column":0},"end":{"line":233,"column":52}},"233":{"start":{"line":234,"column":0},"end":{"line":234,"column":57}},"234":{"start":{"line":235,"column":0},"end":{"line":235,"column":81}},"235":{"start":{"line":236,"column":0},"end":{"line":236,"column":12}},"236":{"start":{"line":237,"column":0},"end":{"line":237,"column":80}},"237":{"start":{"line":238,"column":0},"end":{"line":238,"column":6}},"238":{"start":{"line":239,"column":0},"end":{"line":239,"column":3}},"239":{"start":{"line":240,"column":0},"end":{"line":240,"column":0}},"240":{"start":{"line":241,"column":0},"end":{"line":241,"column":5}},"241":{"start":{"line":242,"column":0},"end":{"line":242,"column":53}},"242":{"start":{"line":243,"column":0},"end":{"line":243,"column":48}},"243":{"start":{"line":244,"column":0},"end":{"line":244,"column":54}},"244":{"start":{"line":245,"column":0},"end":{"line":245,"column":17}},"245":{"start":{"line":246,"column":0},"end":{"line":246,"column":5}},"246":{"start":{"line":247,"column":0},"end":{"line":247,"column":51}},"247":{"start":{"line":248,"column":0},"end":{"line":248,"column":59}},"248":{"start":{"line":249,"column":0},"end":{"line":249,"column":81}},"249":{"start":{"line":250,"column":0},"end":{"line":250,"column":40}},"250":{"start":{"line":251,"column":0},"end":{"line":251,"column":12}},"251":{"start":{"line":252,"column":0},"end":{"line":252,"column":76}},"252":{"start":{"line":253,"column":0},"end":{"line":253,"column":6}},"253":{"start":{"line":254,"column":0},"end":{"line":254,"column":3}},"254":{"start":{"line":255,"column":0},"end":{"line":255,"column":0}},"255":{"start":{"line":256,"column":0},"end":{"line":256,"column":5}},"256":{"start":{"line":257,"column":0},"end":{"line":257,"column":108}},"257":{"start":{"line":258,"column":0},"end":{"line":258,"column":16}},"258":{"start":{"line":259,"column":0},"end":{"line":259,"column":17}},"259":{"start":{"line":260,"column":0},"end":{"line":260,"column":17}},"260":{"start":{"line":261,"column":0},"end":{"line":261,"column":85}},"261":{"start":{"line":262,"column":0},"end":{"line":262,"column":74}},"262":{"start":{"line":263,"column":0},"end":{"line":263,"column":5}},"263":{"start":{"line":264,"column":0},"end":{"line":264,"column":12}},"264":{"start":{"line":265,"column":0},"end":{"line":265,"column":19}},"265":{"start":{"line":266,"column":0},"end":{"line":266,"column":20}},"266":{"start":{"line":267,"column":0},"end":{"line":267,"column":16}},"267":{"start":{"line":268,"column":0},"end":{"line":268,"column":49}},"268":{"start":{"line":269,"column":0},"end":{"line":269,"column":14}},"269":{"start":{"line":270,"column":0},"end":{"line":270,"column":89}},"270":{"start":{"line":271,"column":0},"end":{"line":271,"column":51}},"271":{"start":{"line":272,"column":0},"end":{"line":272,"column":52}},"272":{"start":{"line":273,"column":0},"end":{"line":273,"column":0}},"273":{"start":{"line":274,"column":0},"end":{"line":274,"column":27}},"274":{"start":{"line":275,"column":0},"end":{"line":275,"column":34}},"275":{"start":{"line":276,"column":0},"end":{"line":276,"column":40}},"276":{"start":{"line":277,"column":0},"end":{"line":277,"column":23}},"277":{"start":{"line":278,"column":0},"end":{"line":278,"column":36}},"278":{"start":{"line":279,"column":0},"end":{"line":279,"column":40}},"279":{"start":{"line":280,"column":0},"end":{"line":280,"column":20}},"280":{"start":{"line":281,"column":0},"end":{"line":281,"column":35}},"281":{"start":{"line":282,"column":0},"end":{"line":282,"column":39}},"282":{"start":{"line":283,"column":0},"end":{"line":283,"column":23}},"283":{"start":{"line":284,"column":0},"end":{"line":284,"column":35}},"284":{"start":{"line":285,"column":0},"end":{"line":285,"column":39}},"285":{"start":{"line":286,"column":0},"end":{"line":286,"column":3}},"286":{"start":{"line":287,"column":0},"end":{"line":287,"column":0}},"287":{"start":{"line":288,"column":0},"end":{"line":288,"column":5}},"288":{"start":{"line":289,"column":0},"end":{"line":289,"column":68}},"289":{"start":{"line":290,"column":0},"end":{"line":290,"column":18}},"290":{"start":{"line":291,"column":0},"end":{"line":291,"column":20}},"291":{"start":{"line":292,"column":0},"end":{"line":292,"column":5}},"292":{"start":{"line":293,"column":0},"end":{"line":293,"column":8}},"293":{"start":{"line":294,"column":0},"end":{"line":294,"column":25}},"294":{"start":{"line":295,"column":0},"end":{"line":295,"column":60}},"295":{"start":{"line":296,"column":0},"end":{"line":296,"column":10}},"296":{"start":{"line":297,"column":0},"end":{"line":297,"column":21}},"297":{"start":{"line":298,"column":0},"end":{"line":298,"column":45}},"298":{"start":{"line":299,"column":0},"end":{"line":299,"column":26}},"299":{"start":{"line":300,"column":0},"end":{"line":300,"column":42}},"300":{"start":{"line":301,"column":0},"end":{"line":301,"column":49}},"301":{"start":{"line":302,"column":0},"end":{"line":302,"column":17}},"302":{"start":{"line":303,"column":0},"end":{"line":303,"column":3}},"303":{"start":{"line":304,"column":0},"end":{"line":304,"column":0}},"304":{"start":{"line":305,"column":0},"end":{"line":305,"column":5}},"305":{"start":{"line":306,"column":0},"end":{"line":306,"column":34}},"306":{"start":{"line":307,"column":0},"end":{"line":307,"column":5}},"307":{"start":{"line":308,"column":0},"end":{"line":308,"column":25}},"308":{"start":{"line":309,"column":0},"end":{"line":309,"column":29}},"309":{"start":{"line":310,"column":0},"end":{"line":310,"column":3}},"310":{"start":{"line":311,"column":0},"end":{"line":311,"column":0}},"311":{"start":{"line":312,"column":0},"end":{"line":312,"column":5}},"312":{"start":{"line":313,"column":0},"end":{"line":313,"column":34}},"313":{"start":{"line":314,"column":0},"end":{"line":314,"column":5}},"314":{"start":{"line":315,"column":0},"end":{"line":315,"column":30}},"315":{"start":{"line":316,"column":0},"end":{"line":316,"column":27}},"316":{"start":{"line":317,"column":0},"end":{"line":317,"column":3}},"317":{"start":{"line":318,"column":0},"end":{"line":318,"column":0}},"318":{"start":{"line":319,"column":0},"end":{"line":319,"column":5}},"319":{"start":{"line":320,"column":0},"end":{"line":320,"column":28}},"320":{"start":{"line":321,"column":0},"end":{"line":321,"column":5}},"321":{"start":{"line":322,"column":0},"end":{"line":322,"column":34}},"322":{"start":{"line":323,"column":0},"end":{"line":323,"column":58}},"323":{"start":{"line":324,"column":0},"end":{"line":324,"column":3}},"324":{"start":{"line":325,"column":0},"end":{"line":325,"column":0}},"325":{"start":{"line":326,"column":0},"end":{"line":326,"column":5}},"326":{"start":{"line":327,"column":0},"end":{"line":327,"column":34}},"327":{"start":{"line":328,"column":0},"end":{"line":328,"column":5}},"328":{"start":{"line":329,"column":0},"end":{"line":329,"column":25}},"329":{"start":{"line":330,"column":0},"end":{"line":330,"column":29}},"330":{"start":{"line":331,"column":0},"end":{"line":331,"column":3}},"331":{"start":{"line":332,"column":0},"end":{"line":332,"column":0}},"332":{"start":{"line":333,"column":0},"end":{"line":333,"column":5}},"333":{"start":{"line":334,"column":0},"end":{"line":334,"column":34}},"334":{"start":{"line":335,"column":0},"end":{"line":335,"column":5}},"335":{"start":{"line":336,"column":0},"end":{"line":336,"column":30}},"336":{"start":{"line":337,"column":0},"end":{"line":337,"column":27}},"337":{"start":{"line":338,"column":0},"end":{"line":338,"column":3}},"338":{"start":{"line":339,"column":0},"end":{"line":339,"column":0}},"339":{"start":{"line":340,"column":0},"end":{"line":340,"column":5}},"340":{"start":{"line":341,"column":0},"end":{"line":341,"column":30}},"341":{"start":{"line":342,"column":0},"end":{"line":342,"column":5}},"342":{"start":{"line":343,"column":0},"end":{"line":343,"column":34}},"343":{"start":{"line":344,"column":0},"end":{"line":344,"column":58}},"344":{"start":{"line":345,"column":0},"end":{"line":345,"column":3}},"345":{"start":{"line":346,"column":0},"end":{"line":346,"column":0}},"346":{"start":{"line":347,"column":0},"end":{"line":347,"column":5}},"347":{"start":{"line":348,"column":0},"end":{"line":348,"column":32}},"348":{"start":{"line":349,"column":0},"end":{"line":349,"column":5}},"349":{"start":{"line":350,"column":0},"end":{"line":350,"column":23}},"350":{"start":{"line":351,"column":0},"end":{"line":351,"column":27}},"351":{"start":{"line":352,"column":0},"end":{"line":352,"column":3}},"352":{"start":{"line":353,"column":0},"end":{"line":353,"column":0}},"353":{"start":{"line":354,"column":0},"end":{"line":354,"column":5}},"354":{"start":{"line":355,"column":0},"end":{"line":355,"column":32}},"355":{"start":{"line":356,"column":0},"end":{"line":356,"column":5}},"356":{"start":{"line":357,"column":0},"end":{"line":357,"column":28}},"357":{"start":{"line":358,"column":0},"end":{"line":358,"column":25}},"358":{"start":{"line":359,"column":0},"end":{"line":359,"column":3}},"359":{"start":{"line":360,"column":0},"end":{"line":360,"column":0}},"360":{"start":{"line":361,"column":0},"end":{"line":361,"column":5}},"361":{"start":{"line":362,"column":0},"end":{"line":362,"column":28}},"362":{"start":{"line":363,"column":0},"end":{"line":363,"column":5}},"363":{"start":{"line":364,"column":0},"end":{"line":364,"column":32}},"364":{"start":{"line":365,"column":0},"end":{"line":365,"column":66}},"365":{"start":{"line":366,"column":0},"end":{"line":366,"column":3}},"366":{"start":{"line":367,"column":0},"end":{"line":367,"column":0}},"367":{"start":{"line":368,"column":0},"end":{"line":368,"column":5}},"368":{"start":{"line":369,"column":0},"end":{"line":369,"column":65}},"369":{"start":{"line":370,"column":0},"end":{"line":370,"column":5}},"370":{"start":{"line":371,"column":0},"end":{"line":371,"column":38}},"371":{"start":{"line":372,"column":0},"end":{"line":372,"column":56}},"372":{"start":{"line":373,"column":0},"end":{"line":373,"column":3}},"373":{"start":{"line":374,"column":0},"end":{"line":374,"column":0}},"374":{"start":{"line":375,"column":0},"end":{"line":375,"column":5}},"375":{"start":{"line":376,"column":0},"end":{"line":376,"column":49}},"376":{"start":{"line":377,"column":0},"end":{"line":377,"column":77}},"377":{"start":{"line":378,"column":0},"end":{"line":378,"column":39}},"378":{"start":{"line":379,"column":0},"end":{"line":379,"column":18}},"379":{"start":{"line":380,"column":0},"end":{"line":380,"column":5}},"380":{"start":{"line":381,"column":0},"end":{"line":381,"column":50}},"381":{"start":{"line":382,"column":0},"end":{"line":382,"column":44}},"382":{"start":{"line":383,"column":0},"end":{"line":383,"column":22}},"383":{"start":{"line":384,"column":0},"end":{"line":384,"column":18}},"384":{"start":{"line":385,"column":0},"end":{"line":385,"column":13}},"385":{"start":{"line":386,"column":0},"end":{"line":386,"column":26}},"386":{"start":{"line":387,"column":0},"end":{"line":387,"column":50}},"387":{"start":{"line":388,"column":0},"end":{"line":388,"column":3}},"388":{"start":{"line":389,"column":0},"end":{"line":389,"column":0}},"389":{"start":{"line":390,"column":0},"end":{"line":390,"column":5}},"390":{"start":{"line":391,"column":0},"end":{"line":391,"column":31}},"391":{"start":{"line":392,"column":0},"end":{"line":392,"column":5}},"392":{"start":{"line":393,"column":0},"end":{"line":393,"column":22}},"393":{"start":{"line":394,"column":0},"end":{"line":394,"column":26}},"394":{"start":{"line":395,"column":0},"end":{"line":395,"column":3}},"395":{"start":{"line":396,"column":0},"end":{"line":396,"column":0}},"396":{"start":{"line":397,"column":0},"end":{"line":397,"column":5}},"397":{"start":{"line":398,"column":0},"end":{"line":398,"column":31}},"398":{"start":{"line":399,"column":0},"end":{"line":399,"column":5}},"399":{"start":{"line":400,"column":0},"end":{"line":400,"column":27}},"400":{"start":{"line":401,"column":0},"end":{"line":401,"column":24}},"401":{"start":{"line":402,"column":0},"end":{"line":402,"column":3}},"402":{"start":{"line":403,"column":0},"end":{"line":403,"column":0}},"403":{"start":{"line":404,"column":0},"end":{"line":404,"column":5}},"404":{"start":{"line":405,"column":0},"end":{"line":405,"column":26}},"405":{"start":{"line":406,"column":0},"end":{"line":406,"column":5}},"406":{"start":{"line":407,"column":0},"end":{"line":407,"column":31}},"407":{"start":{"line":408,"column":0},"end":{"line":408,"column":55}},"408":{"start":{"line":409,"column":0},"end":{"line":409,"column":3}},"409":{"start":{"line":410,"column":0},"end":{"line":410,"column":0}},"410":{"start":{"line":411,"column":0},"end":{"line":411,"column":5}},"411":{"start":{"line":412,"column":0},"end":{"line":412,"column":30}},"412":{"start":{"line":413,"column":0},"end":{"line":413,"column":5}},"413":{"start":{"line":414,"column":0},"end":{"line":414,"column":25}},"414":{"start":{"line":415,"column":0},"end":{"line":415,"column":25}},"415":{"start":{"line":416,"column":0},"end":{"line":416,"column":3}},"416":{"start":{"line":417,"column":0},"end":{"line":417,"column":0}},"417":{"start":{"line":418,"column":0},"end":{"line":418,"column":5}},"418":{"start":{"line":419,"column":0},"end":{"line":419,"column":32}},"419":{"start":{"line":420,"column":0},"end":{"line":420,"column":5}},"420":{"start":{"line":421,"column":0},"end":{"line":421,"column":23}},"421":{"start":{"line":422,"column":0},"end":{"line":422,"column":27}},"422":{"start":{"line":423,"column":0},"end":{"line":423,"column":3}},"423":{"start":{"line":424,"column":0},"end":{"line":424,"column":0}},"424":{"start":{"line":425,"column":0},"end":{"line":425,"column":5}},"425":{"start":{"line":426,"column":0},"end":{"line":426,"column":32}},"426":{"start":{"line":427,"column":0},"end":{"line":427,"column":5}},"427":{"start":{"line":428,"column":0},"end":{"line":428,"column":28}},"428":{"start":{"line":429,"column":0},"end":{"line":429,"column":55}},"429":{"start":{"line":430,"column":0},"end":{"line":430,"column":27}},"430":{"start":{"line":431,"column":0},"end":{"line":431,"column":45}},"431":{"start":{"line":432,"column":0},"end":{"line":432,"column":33}},"432":{"start":{"line":433,"column":0},"end":{"line":433,"column":29}},"433":{"start":{"line":434,"column":0},"end":{"line":434,"column":5}},"434":{"start":{"line":435,"column":0},"end":{"line":435,"column":25}},"435":{"start":{"line":436,"column":0},"end":{"line":436,"column":3}},"436":{"start":{"line":437,"column":0},"end":{"line":437,"column":0}},"437":{"start":{"line":438,"column":0},"end":{"line":438,"column":5}},"438":{"start":{"line":439,"column":0},"end":{"line":439,"column":76}},"439":{"start":{"line":440,"column":0},"end":{"line":440,"column":5}},"440":{"start":{"line":441,"column":0},"end":{"line":441,"column":32}},"441":{"start":{"line":442,"column":0},"end":{"line":442,"column":57}},"442":{"start":{"line":443,"column":0},"end":{"line":443,"column":3}},"443":{"start":{"line":444,"column":0},"end":{"line":444,"column":0}},"444":{"start":{"line":445,"column":0},"end":{"line":445,"column":5}},"445":{"start":{"line":446,"column":0},"end":{"line":446,"column":35}},"446":{"start":{"line":447,"column":0},"end":{"line":447,"column":5}},"447":{"start":{"line":448,"column":0},"end":{"line":448,"column":22}},"448":{"start":{"line":449,"column":0},"end":{"line":449,"column":30}},"449":{"start":{"line":450,"column":0},"end":{"line":450,"column":3}},"450":{"start":{"line":451,"column":0},"end":{"line":451,"column":0}},"451":{"start":{"line":452,"column":0},"end":{"line":452,"column":5}},"452":{"start":{"line":453,"column":0},"end":{"line":453,"column":35}},"453":{"start":{"line":454,"column":0},"end":{"line":454,"column":5}},"454":{"start":{"line":455,"column":0},"end":{"line":455,"column":27}},"455":{"start":{"line":456,"column":0},"end":{"line":456,"column":28}},"456":{"start":{"line":457,"column":0},"end":{"line":457,"column":3}},"457":{"start":{"line":458,"column":0},"end":{"line":458,"column":0}},"458":{"start":{"line":459,"column":0},"end":{"line":459,"column":41}},"459":{"start":{"line":460,"column":0},"end":{"line":460,"column":5}},"460":{"start":{"line":461,"column":0},"end":{"line":461,"column":30}},"461":{"start":{"line":462,"column":0},"end":{"line":462,"column":5}},"462":{"start":{"line":463,"column":0},"end":{"line":463,"column":22}},"463":{"start":{"line":464,"column":0},"end":{"line":464,"column":42}},"464":{"start":{"line":465,"column":0},"end":{"line":465,"column":33}},"465":{"start":{"line":466,"column":0},"end":{"line":466,"column":0}},"466":{"start":{"line":467,"column":0},"end":{"line":467,"column":62}},"467":{"start":{"line":468,"column":0},"end":{"line":468,"column":0}},"468":{"start":{"line":469,"column":0},"end":{"line":469,"column":25}},"469":{"start":{"line":470,"column":0},"end":{"line":470,"column":55}},"470":{"start":{"line":471,"column":0},"end":{"line":471,"column":62}},"471":{"start":{"line":472,"column":0},"end":{"line":472,"column":21}},"472":{"start":{"line":473,"column":0},"end":{"line":473,"column":5}},"473":{"start":{"line":474,"column":0},"end":{"line":474,"column":0}},"474":{"start":{"line":475,"column":0},"end":{"line":475,"column":22}},"475":{"start":{"line":476,"column":0},"end":{"line":476,"column":3}},"476":{"start":{"line":477,"column":0},"end":{"line":477,"column":0}},"477":{"start":{"line":478,"column":0},"end":{"line":478,"column":29}},"478":{"start":{"line":479,"column":0},"end":{"line":479,"column":14}},"479":{"start":{"line":480,"column":0},"end":{"line":480,"column":19}},"480":{"start":{"line":481,"column":0},"end":{"line":481,"column":36}},"481":{"start":{"line":482,"column":0},"end":{"line":482,"column":38}},"482":{"start":{"line":483,"column":0},"end":{"line":483,"column":39}},"483":{"start":{"line":484,"column":0},"end":{"line":484,"column":10}},"484":{"start":{"line":485,"column":0},"end":{"line":485,"column":26}},"485":{"start":{"line":486,"column":0},"end":{"line":486,"column":10}},"486":{"start":{"line":487,"column":0},"end":{"line":487,"column":15}},"487":{"start":{"line":488,"column":0},"end":{"line":488,"column":32}},"488":{"start":{"line":489,"column":0},"end":{"line":489,"column":34}},"489":{"start":{"line":490,"column":0},"end":{"line":490,"column":35}},"490":{"start":{"line":491,"column":0},"end":{"line":491,"column":10}},"491":{"start":{"line":492,"column":0},"end":{"line":492,"column":42}},"492":{"start":{"line":493,"column":0},"end":{"line":493,"column":3}},"493":{"start":{"line":494,"column":0},"end":{"line":494,"column":0}},"494":{"start":{"line":495,"column":0},"end":{"line":495,"column":20}},"495":{"start":{"line":496,"column":0},"end":{"line":496,"column":83}},"496":{"start":{"line":497,"column":0},"end":{"line":497,"column":3}},"497":{"start":{"line":498,"column":0},"end":{"line":498,"column":0}},"498":{"start":{"line":499,"column":0},"end":{"line":499,"column":28}},"499":{"start":{"line":500,"column":0},"end":{"line":500,"column":92}},"500":{"start":{"line":501,"column":0},"end":{"line":501,"column":3}},"501":{"start":{"line":502,"column":0},"end":{"line":502,"column":0}},"502":{"start":{"line":503,"column":0},"end":{"line":503,"column":82}},"503":{"start":{"line":504,"column":0},"end":{"line":504,"column":79}},"504":{"start":{"line":505,"column":0},"end":{"line":505,"column":1}}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":3,"32":3,"33":1,"34":3,"35":1,"36":1,"37":1,"38":1,"39":3,"40":1,"41":3,"42":3,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"52":1,"53":37,"54":37,"55":37,"56":37,"57":37,"58":37,"59":13,"60":13,"61":13,"62":37,"63":37,"64":37,"65":37,"66":37,"67":37,"68":37,"69":37,"70":3,"71":3,"72":2,"73":2,"74":2,"75":2,"76":2,"77":2,"78":2,"79":2,"80":2,"81":37,"82":37,"83":37,"84":37,"85":37,"86":37,"87":37,"88":1,"89":1,"90":37,"91":37,"92":37,"93":37,"94":37,"95":10,"96":10,"97":10,"98":10,"99":10,"100":10,"101":10,"102":10,"103":10,"104":10,"105":37,"106":37,"107":37,"108":37,"109":37,"110":37,"111":37,"112":37,"113":37,"114":25,"115":25,"116":25,"117":1,"118":1,"119":25,"120":1,"121":1,"122":25,"123":1,"124":1,"125":25,"126":16,"127":16,"128":25,"129":3,"130":3,"131":3,"132":3,"133":3,"134":2,"135":25,"136":1,"137":1,"138":1,"139":25,"140":1,"141":1,"142":1,"143":25,"144":25,"145":24,"146":37,"147":37,"148":37,"149":37,"150":37,"151":37,"152":37,"153":37,"154":37,"155":15,"156":15,"157":15,"158":1,"159":1,"160":15,"161":1,"162":1,"163":15,"164":1,"165":1,"166":15,"167":6,"168":6,"169":15,"170":3,"171":3,"172":3,"173":3,"174":2,"175":15,"176":1,"177":1,"178":1,"179":1,"180":15,"181":1,"182":1,"183":1,"184":15,"185":15,"186":14,"187":37,"188":37,"189":37,"190":37,"191":37,"192":37,"193":37,"194":37,"195":37,"196":6,"197":6,"198":5,"199":5,"200":37,"201":37,"202":37,"203":37,"204":37,"205":37,"206":37,"207":37,"208":37,"209":1,"210":1,"211":37,"212":37,"213":37,"214":37,"215":37,"216":37,"217":37,"218":37,"219":9,"220":9,"221":1,"222":2,"223":2,"224":2,"225":37,"226":37,"227":37,"228":37,"229":37,"230":37,"231":37,"232":37,"233":9,"234":9,"235":1,"236":2,"237":2,"238":2,"239":37,"240":37,"241":37,"242":37,"243":37,"244":37,"245":37,"246":37,"247":3,"248":3,"249":1,"250":1,"251":1,"252":1,"253":1,"254":37,"255":37,"256":37,"257":37,"258":37,"259":37,"260":37,"261":37,"262":37,"263":37,"264":7,"265":7,"266":7,"267":7,"268":7,"269":7,"270":7,"271":6,"272":6,"273":6,"274":4,"275":2,"276":5,"277":3,"278":2,"279":1,"280":1,"281":0,"282":0,"283":0,"284":0,"285":7,"286":37,"287":37,"288":37,"289":37,"290":37,"291":37,"292":37,"293":0,"294":0,"295":0,"296":0,"297":0,"298":0,"299":0,"300":0,"301":0,"302":0,"303":37,"304":37,"305":37,"306":37,"307":37,"308":12,"309":12,"310":37,"311":37,"312":37,"313":37,"314":37,"315":0,"316":0,"317":37,"318":37,"319":37,"320":37,"321":37,"322":0,"323":0,"324":37,"325":37,"326":37,"327":37,"328":37,"329":12,"330":12,"331":37,"332":37,"333":37,"334":37,"335":37,"336":0,"337":0,"338":37,"339":37,"340":37,"341":37,"342":37,"343":0,"344":0,"345":37,"346":37,"347":37,"348":37,"349":37,"350":12,"351":12,"352":37,"353":37,"354":37,"355":37,"356":37,"357":0,"358":0,"359":37,"360":37,"361":37,"362":37,"363":37,"364":0,"365":0,"366":37,"367":37,"368":37,"369":37,"370":37,"371":0,"372":0,"373":37,"374":37,"375":37,"376":37,"377":37,"378":37,"379":37,"380":37,"381":0,"382":0,"383":0,"384":0,"385":0,"386":0,"387":0,"388":37,"389":37,"390":37,"391":37,"392":37,"393":49,"394":49,"395":37,"396":37,"397":37,"398":37,"399":37,"400":4,"401":4,"402":37,"403":37,"404":37,"405":37,"406":37,"407":0,"408":0,"409":37,"410":37,"411":37,"412":37,"413":37,"414":17,"415":17,"416":37,"417":37,"418":37,"419":37,"420":37,"421":16,"422":16,"423":37,"424":37,"425":37,"426":37,"427":37,"428":1,"429":1,"430":1,"431":1,"432":0,"433":0,"434":1,"435":1,"436":37,"437":37,"438":37,"439":37,"440":37,"441":0,"442":0,"443":37,"444":37,"445":37,"446":37,"447":37,"448":15,"449":15,"450":37,"451":37,"452":37,"453":37,"454":37,"455":0,"456":0,"457":37,"458":37,"459":37,"460":37,"461":37,"462":37,"463":0,"464":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"471":0,"472":0,"473":0,"474":0,"475":0,"476":37,"477":37,"478":0,"479":0,"480":0,"481":0,"482":0,"483":0,"484":0,"485":0,"486":0,"487":0,"488":0,"489":0,"490":0,"491":0,"492":0,"493":37,"494":37,"495":0,"496":0,"497":37,"498":37,"499":0,"500":0,"501":37,"502":37,"503":37,"504":27},"branchMap":{"0":{"type":"branch","line":1,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}},"locations":[{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}]},"1":{"type":"branch","line":1,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}},"locations":[{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}]},"2":{"type":"branch","line":31,"loc":{"start":{"line":31,"column":32},"end":{"line":43,"column":2}},"locations":[{"start":{"line":31,"column":32},"end":{"line":43,"column":2}}]},"3":{"type":"branch","line":33,"loc":{"start":{"line":33,"column":4},"end":{"line":34,"column":36}},"locations":[{"start":{"line":33,"column":4},"end":{"line":34,"column":36}}]},"4":{"type":"branch","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":39,"column":8}},"locations":[{"start":{"line":35,"column":4},"end":{"line":39,"column":8}}]},"5":{"type":"branch","line":40,"loc":{"start":{"line":40,"column":4},"end":{"line":41,"column":33}},"locations":[{"start":{"line":40,"column":4},"end":{"line":41,"column":33}}]},"6":{"type":"branch","line":43,"loc":{"start":{"line":43,"column":0},"end":{"line":43,"column":2}},"locations":[{"start":{"line":43,"column":0},"end":{"line":43,"column":2}}]},"7":{"type":"branch","line":53,"loc":{"start":{"line":53,"column":2},"end":{"line":504,"column":79}},"locations":[{"start":{"line":53,"column":2},"end":{"line":504,"column":79}}]},"8":{"type":"branch","line":59,"loc":{"start":{"line":59,"column":2},"end":{"line":62,"column":3}},"locations":[{"start":{"line":59,"column":2},"end":{"line":62,"column":3}}]},"9":{"type":"branch","line":70,"loc":{"start":{"line":70,"column":9},"end":{"line":81,"column":3}},"locations":[{"start":{"line":70,"column":9},"end":{"line":81,"column":3}}]},"10":{"type":"branch","line":71,"loc":{"start":{"line":71,"column":15},"end":{"line":72,"column":11}},"locations":[{"start":{"line":71,"column":15},"end":{"line":72,"column":11}}]},"11":{"type":"branch","line":72,"loc":{"start":{"line":72,"column":4},"end":{"line":81,"column":3}},"locations":[{"start":{"line":72,"column":4},"end":{"line":81,"column":3}}]},"12":{"type":"branch","line":88,"loc":{"start":{"line":88,"column":9},"end":{"line":90,"column":3}},"locations":[{"start":{"line":88,"column":9},"end":{"line":90,"column":3}}]},"13":{"type":"branch","line":95,"loc":{"start":{"line":95,"column":2},"end":{"line":105,"column":3}},"locations":[{"start":{"line":95,"column":2},"end":{"line":105,"column":3}}]},"14":{"type":"branch","line":114,"loc":{"start":{"line":114,"column":2},"end":{"line":146,"column":3}},"locations":[{"start":{"line":114,"column":2},"end":{"line":146,"column":3}}]},"15":{"type":"branch","line":115,"loc":{"start":{"line":115,"column":34},"end":{"line":116,"column":12}},"locations":[{"start":{"line":115,"column":34},"end":{"line":116,"column":12}}]},"16":{"type":"branch","line":116,"loc":{"start":{"line":116,"column":4},"end":{"line":117,"column":11}},"locations":[{"start":{"line":116,"column":4},"end":{"line":117,"column":11}}]},"17":{"type":"branch","line":117,"loc":{"start":{"line":117,"column":6},"end":{"line":119,"column":14}},"locations":[{"start":{"line":117,"column":6},"end":{"line":119,"column":14}}]},"18":{"type":"branch","line":120,"loc":{"start":{"line":120,"column":6},"end":{"line":122,"column":14}},"locations":[{"start":{"line":120,"column":6},"end":{"line":122,"column":14}}]},"19":{"type":"branch","line":123,"loc":{"start":{"line":123,"column":6},"end":{"line":125,"column":14}},"locations":[{"start":{"line":123,"column":6},"end":{"line":125,"column":14}}]},"20":{"type":"branch","line":126,"loc":{"start":{"line":126,"column":6},"end":{"line":128,"column":14}},"locations":[{"start":{"line":126,"column":6},"end":{"line":128,"column":14}}]},"21":{"type":"branch","line":129,"loc":{"start":{"line":129,"column":6},"end":{"line":135,"column":14}},"locations":[{"start":{"line":129,"column":6},"end":{"line":135,"column":14}}]},"22":{"type":"branch","line":131,"loc":{"start":{"line":131,"column":45},"end":{"line":132,"column":12}},"locations":[{"start":{"line":131,"column":45},"end":{"line":132,"column":12}}]},"23":{"type":"branch","line":132,"loc":{"start":{"line":132,"column":8},"end":{"line":133,"column":36}},"locations":[{"start":{"line":132,"column":8},"end":{"line":133,"column":36}}]},"24":{"type":"branch","line":133,"loc":{"start":{"line":133,"column":31},"end":{"line":133,"column":56}},"locations":[{"start":{"line":133,"column":31},"end":{"line":133,"column":56}}]},"25":{"type":"branch","line":133,"loc":{"start":{"line":133,"column":56},"end":{"line":134,"column":13}},"locations":[{"start":{"line":133,"column":56},"end":{"line":134,"column":13}}]},"26":{"type":"branch","line":134,"loc":{"start":{"line":134,"column":8},"end":{"line":135,"column":14}},"locations":[{"start":{"line":134,"column":8},"end":{"line":135,"column":14}}]},"27":{"type":"branch","line":136,"loc":{"start":{"line":136,"column":6},"end":{"line":139,"column":14}},"locations":[{"start":{"line":136,"column":6},"end":{"line":139,"column":14}}]},"28":{"type":"branch","line":140,"loc":{"start":{"line":140,"column":6},"end":{"line":143,"column":14}},"locations":[{"start":{"line":140,"column":6},"end":{"line":143,"column":14}}]},"29":{"type":"branch","line":145,"loc":{"start":{"line":145,"column":4},"end":{"line":146,"column":3}},"locations":[{"start":{"line":145,"column":4},"end":{"line":146,"column":3}}]},"30":{"type":"branch","line":155,"loc":{"start":{"line":155,"column":2},"end":{"line":187,"column":3}},"locations":[{"start":{"line":155,"column":2},"end":{"line":187,"column":3}}]},"31":{"type":"branch","line":156,"loc":{"start":{"line":156,"column":34},"end":{"line":157,"column":12}},"locations":[{"start":{"line":156,"column":34},"end":{"line":157,"column":12}}]},"32":{"type":"branch","line":157,"loc":{"start":{"line":157,"column":4},"end":{"line":158,"column":11}},"locations":[{"start":{"line":157,"column":4},"end":{"line":158,"column":11}}]},"33":{"type":"branch","line":158,"loc":{"start":{"line":158,"column":6},"end":{"line":160,"column":14}},"locations":[{"start":{"line":158,"column":6},"end":{"line":160,"column":14}}]},"34":{"type":"branch","line":161,"loc":{"start":{"line":161,"column":6},"end":{"line":163,"column":14}},"locations":[{"start":{"line":161,"column":6},"end":{"line":163,"column":14}}]},"35":{"type":"branch","line":164,"loc":{"start":{"line":164,"column":6},"end":{"line":166,"column":14}},"locations":[{"start":{"line":164,"column":6},"end":{"line":166,"column":14}}]},"36":{"type":"branch","line":167,"loc":{"start":{"line":167,"column":6},"end":{"line":169,"column":14}},"locations":[{"start":{"line":167,"column":6},"end":{"line":169,"column":14}}]},"37":{"type":"branch","line":170,"loc":{"start":{"line":170,"column":6},"end":{"line":175,"column":14}},"locations":[{"start":{"line":170,"column":6},"end":{"line":175,"column":14}}]},"38":{"type":"branch","line":173,"loc":{"start":{"line":173,"column":40},"end":{"line":174,"column":13}},"locations":[{"start":{"line":173,"column":40},"end":{"line":174,"column":13}}]},"39":{"type":"branch","line":174,"loc":{"start":{"line":174,"column":8},"end":{"line":175,"column":14}},"locations":[{"start":{"line":174,"column":8},"end":{"line":175,"column":14}}]},"40":{"type":"branch","line":176,"loc":{"start":{"line":176,"column":6},"end":{"line":180,"column":14}},"locations":[{"start":{"line":176,"column":6},"end":{"line":180,"column":14}}]},"41":{"type":"branch","line":181,"loc":{"start":{"line":181,"column":6},"end":{"line":184,"column":14}},"locations":[{"start":{"line":181,"column":6},"end":{"line":184,"column":14}}]},"42":{"type":"branch","line":186,"loc":{"start":{"line":186,"column":4},"end":{"line":187,"column":3}},"locations":[{"start":{"line":186,"column":4},"end":{"line":187,"column":3}}]},"43":{"type":"branch","line":196,"loc":{"start":{"line":196,"column":2},"end":{"line":200,"column":3}},"locations":[{"start":{"line":196,"column":2},"end":{"line":200,"column":3}}]},"44":{"type":"branch","line":197,"loc":{"start":{"line":197,"column":34},"end":{"line":198,"column":9}},"locations":[{"start":{"line":197,"column":34},"end":{"line":198,"column":9}}]},"45":{"type":"branch","line":198,"loc":{"start":{"line":198,"column":4},"end":{"line":200,"column":3}},"locations":[{"start":{"line":198,"column":4},"end":{"line":200,"column":3}}]},"46":{"type":"branch","line":209,"loc":{"start":{"line":209,"column":2},"end":{"line":211,"column":3}},"locations":[{"start":{"line":209,"column":2},"end":{"line":211,"column":3}}]},"47":{"type":"branch","line":219,"loc":{"start":{"line":219,"column":2},"end":{"line":225,"column":3}},"locations":[{"start":{"line":219,"column":2},"end":{"line":225,"column":3}}]},"48":{"type":"branch","line":220,"loc":{"start":{"line":220,"column":15},"end":{"line":221,"column":8}},"locations":[{"start":{"line":220,"column":15},"end":{"line":221,"column":8}}]},"49":{"type":"branch","line":221,"loc":{"start":{"line":221,"column":4},"end":{"line":221,"column":40}},"locations":[{"start":{"line":221,"column":4},"end":{"line":221,"column":40}}]},"50":{"type":"branch","line":221,"loc":{"start":{"line":221,"column":34},"end":{"line":222,"column":12}},"locations":[{"start":{"line":221,"column":34},"end":{"line":222,"column":12}}]},"51":{"type":"branch","line":222,"loc":{"start":{"line":222,"column":4},"end":{"line":225,"column":3}},"locations":[{"start":{"line":222,"column":4},"end":{"line":225,"column":3}}]},"52":{"type":"branch","line":233,"loc":{"start":{"line":233,"column":2},"end":{"line":239,"column":3}},"locations":[{"start":{"line":233,"column":2},"end":{"line":239,"column":3}}]},"53":{"type":"branch","line":234,"loc":{"start":{"line":234,"column":15},"end":{"line":235,"column":8}},"locations":[{"start":{"line":234,"column":15},"end":{"line":235,"column":8}}]},"54":{"type":"branch","line":235,"loc":{"start":{"line":235,"column":4},"end":{"line":235,"column":40}},"locations":[{"start":{"line":235,"column":4},"end":{"line":235,"column":40}}]},"55":{"type":"branch","line":235,"loc":{"start":{"line":235,"column":34},"end":{"line":236,"column":12}},"locations":[{"start":{"line":235,"column":34},"end":{"line":236,"column":12}}]},"56":{"type":"branch","line":236,"loc":{"start":{"line":236,"column":4},"end":{"line":239,"column":3}},"locations":[{"start":{"line":236,"column":4},"end":{"line":239,"column":3}}]},"57":{"type":"branch","line":247,"loc":{"start":{"line":247,"column":2},"end":{"line":254,"column":3}},"locations":[{"start":{"line":247,"column":2},"end":{"line":254,"column":3}}]},"58":{"type":"branch","line":248,"loc":{"start":{"line":248,"column":15},"end":{"line":249,"column":8}},"locations":[{"start":{"line":248,"column":15},"end":{"line":249,"column":8}}]},"59":{"type":"branch","line":249,"loc":{"start":{"line":249,"column":4},"end":{"line":249,"column":40}},"locations":[{"start":{"line":249,"column":4},"end":{"line":249,"column":40}}]},"60":{"type":"branch","line":249,"loc":{"start":{"line":249,"column":34},"end":{"line":254,"column":3}},"locations":[{"start":{"line":249,"column":34},"end":{"line":254,"column":3}}]},"61":{"type":"branch","line":264,"loc":{"start":{"line":264,"column":2},"end":{"line":286,"column":3}},"locations":[{"start":{"line":264,"column":2},"end":{"line":286,"column":3}}]},"62":{"type":"branch","line":270,"loc":{"start":{"line":270,"column":8},"end":{"line":270,"column":42}},"locations":[{"start":{"line":270,"column":8},"end":{"line":270,"column":42}}]},"63":{"type":"branch","line":270,"loc":{"start":{"line":270,"column":42},"end":{"line":271,"column":10}},"locations":[{"start":{"line":270,"column":42},"end":{"line":271,"column":10}}]},"64":{"type":"branch","line":271,"loc":{"start":{"line":271,"column":4},"end":{"line":274,"column":27}},"locations":[{"start":{"line":271,"column":4},"end":{"line":274,"column":27}}]},"65":{"type":"branch","line":274,"loc":{"start":{"line":274,"column":12},"end":{"line":275,"column":34}},"locations":[{"start":{"line":274,"column":12},"end":{"line":275,"column":34}}]},"66":{"type":"branch","line":275,"loc":{"start":{"line":275,"column":33},"end":{"line":276,"column":40}},"locations":[{"start":{"line":275,"column":33},"end":{"line":276,"column":40}}]},"67":{"type":"branch","line":276,"loc":{"start":{"line":276,"column":35},"end":{"line":279,"column":40}},"locations":[{"start":{"line":276,"column":35},"end":{"line":279,"column":40}}]},"68":{"type":"branch","line":277,"loc":{"start":{"line":277,"column":7},"end":{"line":278,"column":36}},"locations":[{"start":{"line":277,"column":7},"end":{"line":278,"column":36}}]},"69":{"type":"branch","line":278,"loc":{"start":{"line":278,"column":35},"end":{"line":279,"column":40}},"locations":[{"start":{"line":278,"column":35},"end":{"line":279,"column":40}}]},"70":{"type":"branch","line":279,"loc":{"start":{"line":279,"column":35},"end":{"line":285,"column":39}},"locations":[{"start":{"line":279,"column":35},"end":{"line":285,"column":39}}]},"71":{"type":"branch","line":281,"loc":{"start":{"line":281,"column":34},"end":{"line":282,"column":39}},"locations":[{"start":{"line":281,"column":34},"end":{"line":282,"column":39}}]},"72":{"type":"branch","line":282,"loc":{"start":{"line":282,"column":34},"end":{"line":285,"column":39}},"locations":[{"start":{"line":282,"column":34},"end":{"line":285,"column":39}}]},"73":{"type":"branch","line":308,"loc":{"start":{"line":308,"column":2},"end":{"line":310,"column":3}},"locations":[{"start":{"line":308,"column":2},"end":{"line":310,"column":3}}]},"74":{"type":"branch","line":329,"loc":{"start":{"line":329,"column":2},"end":{"line":331,"column":3}},"locations":[{"start":{"line":329,"column":2},"end":{"line":331,"column":3}}]},"75":{"type":"branch","line":350,"loc":{"start":{"line":350,"column":2},"end":{"line":352,"column":3}},"locations":[{"start":{"line":350,"column":2},"end":{"line":352,"column":3}}]},"76":{"type":"branch","line":393,"loc":{"start":{"line":393,"column":2},"end":{"line":395,"column":3}},"locations":[{"start":{"line":393,"column":2},"end":{"line":395,"column":3}}]},"77":{"type":"branch","line":400,"loc":{"start":{"line":400,"column":2},"end":{"line":402,"column":3}},"locations":[{"start":{"line":400,"column":2},"end":{"line":402,"column":3}}]},"78":{"type":"branch","line":414,"loc":{"start":{"line":414,"column":2},"end":{"line":416,"column":3}},"locations":[{"start":{"line":414,"column":2},"end":{"line":416,"column":3}}]},"79":{"type":"branch","line":421,"loc":{"start":{"line":421,"column":2},"end":{"line":423,"column":3}},"locations":[{"start":{"line":421,"column":2},"end":{"line":423,"column":3}}]},"80":{"type":"branch","line":428,"loc":{"start":{"line":428,"column":2},"end":{"line":436,"column":3}},"locations":[{"start":{"line":428,"column":2},"end":{"line":436,"column":3}}]},"81":{"type":"branch","line":432,"loc":{"start":{"line":432,"column":32},"end":{"line":435,"column":9}},"locations":[{"start":{"line":432,"column":32},"end":{"line":435,"column":9}}]},"82":{"type":"branch","line":448,"loc":{"start":{"line":448,"column":2},"end":{"line":450,"column":3}},"locations":[{"start":{"line":448,"column":2},"end":{"line":450,"column":3}}]},"83":{"type":"branch","line":505,"loc":{"start":{"line":505,"column":0},"end":{"line":505,"column":1}},"locations":[{"start":{"line":505,"column":0},"end":{"line":505,"column":1}}]}},"b":{"0":[1],"1":[19],"2":[3],"3":[1],"4":[1],"5":[1],"6":[3],"7":[37],"8":[13],"9":[3],"10":[1],"11":[2],"12":[1],"13":[10],"14":[25],"15":[1],"16":[24],"17":[1],"18":[1],"19":[1],"20":[16],"21":[3],"22":[1],"23":[2],"24":[1],"25":[1],"26":[2],"27":[1],"28":[1],"29":[24],"30":[15],"31":[1],"32":[14],"33":[1],"34":[1],"35":[1],"36":[6],"37":[3],"38":[1],"39":[2],"40":[1],"41":[1],"42":[14],"43":[6],"44":[1],"45":[5],"46":[1],"47":[9],"48":[6],"49":[3],"50":[1],"51":[2],"52":[9],"53":[6],"54":[3],"55":[1],"56":[2],"57":[3],"58":[1],"59":[2],"60":[1],"61":[7],"62":[2],"63":[1],"64":[6],"65":[4],"66":[2],"67":[5],"68":[3],"69":[2],"70":[1],"71":[0],"72":[0],"73":[12],"74":[12],"75":[12],"76":[49],"77":[4],"78":[17],"79":[16],"80":[1],"81":[0],"82":[15],"83":[27]},"fnMap":{"0":{"name":"get","decl":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}},"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}},"line":1},"1":{"name":"getFormatByUnit","decl":{"start":{"line":31,"column":32},"end":{"line":43,"column":2}},"loc":{"start":{"line":31,"column":32},"end":{"line":43,"column":2}},"line":31},"2":{"name":"get","decl":{"start":{"line":43,"column":0},"end":{"line":43,"column":2}},"loc":{"start":{"line":43,"column":0},"end":{"line":43,"column":2}},"line":43},"3":{"name":"","decl":{"start":{"line":53,"column":2},"end":{"line":504,"column":79}},"loc":{"start":{"line":53,"column":2},"end":{"line":504,"column":79}},"line":53},"4":{"name":"setLocale","decl":{"start":{"line":59,"column":2},"end":{"line":62,"column":3}},"loc":{"start":{"line":59,"column":2},"end":{"line":62,"column":3}},"line":59},"5":{"name":"convert","decl":{"start":{"line":70,"column":9},"end":{"line":81,"column":3}},"loc":{"start":{"line":70,"column":9},"end":{"line":81,"column":3}},"line":70},"6":{"name":"fromString","decl":{"start":{"line":88,"column":9},"end":{"line":90,"column":3}},"loc":{"start":{"line":88,"column":9},"end":{"line":90,"column":3}},"line":88},"7":{"name":"get clone","decl":{"start":{"line":95,"column":2},"end":{"line":105,"column":3}},"loc":{"start":{"line":95,"column":2},"end":{"line":105,"column":3}},"line":95},"8":{"name":"startOf","decl":{"start":{"line":114,"column":2},"end":{"line":146,"column":3}},"loc":{"start":{"line":114,"column":2},"end":{"line":146,"column":3}},"line":114},"9":{"name":"endOf","decl":{"start":{"line":155,"column":2},"end":{"line":187,"column":3}},"loc":{"start":{"line":155,"column":2},"end":{"line":187,"column":3}},"line":155},"10":{"name":"manipulate","decl":{"start":{"line":196,"column":2},"end":{"line":200,"column":3}},"loc":{"start":{"line":196,"column":2},"end":{"line":200,"column":3}},"line":196},"11":{"name":"format","decl":{"start":{"line":209,"column":2},"end":{"line":211,"column":3}},"loc":{"start":{"line":209,"column":2},"end":{"line":211,"column":3}},"line":209},"12":{"name":"isBefore","decl":{"start":{"line":219,"column":2},"end":{"line":225,"column":3}},"loc":{"start":{"line":219,"column":2},"end":{"line":225,"column":3}},"line":219},"13":{"name":"isAfter","decl":{"start":{"line":233,"column":2},"end":{"line":239,"column":3}},"loc":{"start":{"line":233,"column":2},"end":{"line":239,"column":3}},"line":233},"14":{"name":"isSame","decl":{"start":{"line":247,"column":2},"end":{"line":254,"column":3}},"loc":{"start":{"line":247,"column":2},"end":{"line":254,"column":3}},"line":247},"15":{"name":"isBetween","decl":{"start":{"line":264,"column":2},"end":{"line":286,"column":3}},"loc":{"start":{"line":264,"column":2},"end":{"line":286,"column":3}},"line":264},"16":{"name":"parts","decl":{"start":{"line":293,"column":2},"end":{"line":303,"column":3}},"loc":{"start":{"line":293,"column":2},"end":{"line":303,"column":3}},"line":293},"17":{"name":"get seconds","decl":{"start":{"line":308,"column":2},"end":{"line":310,"column":3}},"loc":{"start":{"line":308,"column":2},"end":{"line":310,"column":3}},"line":308},"18":{"name":"set seconds","decl":{"start":{"line":315,"column":2},"end":{"line":317,"column":3}},"loc":{"start":{"line":315,"column":2},"end":{"line":317,"column":3}},"line":315},"19":{"name":"get secondsFormatted","decl":{"start":{"line":322,"column":2},"end":{"line":324,"column":3}},"loc":{"start":{"line":322,"column":2},"end":{"line":324,"column":3}},"line":322},"20":{"name":"get minutes","decl":{"start":{"line":329,"column":2},"end":{"line":331,"column":3}},"loc":{"start":{"line":329,"column":2},"end":{"line":331,"column":3}},"line":329},"21":{"name":"set minutes","decl":{"start":{"line":336,"column":2},"end":{"line":338,"column":3}},"loc":{"start":{"line":336,"column":2},"end":{"line":338,"column":3}},"line":336},"22":{"name":"get minutesFormatted","decl":{"start":{"line":343,"column":2},"end":{"line":345,"column":3}},"loc":{"start":{"line":343,"column":2},"end":{"line":345,"column":3}},"line":343},"23":{"name":"get hours","decl":{"start":{"line":350,"column":2},"end":{"line":352,"column":3}},"loc":{"start":{"line":350,"column":2},"end":{"line":352,"column":3}},"line":350},"24":{"name":"set hours","decl":{"start":{"line":357,"column":2},"end":{"line":359,"column":3}},"loc":{"start":{"line":357,"column":2},"end":{"line":359,"column":3}},"line":357},"25":{"name":"get hoursFormatted","decl":{"start":{"line":364,"column":2},"end":{"line":366,"column":3}},"loc":{"start":{"line":364,"column":2},"end":{"line":366,"column":3}},"line":364},"26":{"name":"get twelveHoursFormatted","decl":{"start":{"line":371,"column":2},"end":{"line":373,"column":3}},"loc":{"start":{"line":371,"column":2},"end":{"line":373,"column":3}},"line":371},"27":{"name":"meridiem","decl":{"start":{"line":381,"column":2},"end":{"line":388,"column":3}},"loc":{"start":{"line":381,"column":2},"end":{"line":388,"column":3}},"line":381},"28":{"name":"get date","decl":{"start":{"line":393,"column":2},"end":{"line":395,"column":3}},"loc":{"start":{"line":393,"column":2},"end":{"line":395,"column":3}},"line":393},"29":{"name":"set date","decl":{"start":{"line":400,"column":2},"end":{"line":402,"column":3}},"loc":{"start":{"line":400,"column":2},"end":{"line":402,"column":3}},"line":400},"30":{"name":"get dateFormatted","decl":{"start":{"line":407,"column":2},"end":{"line":409,"column":3}},"loc":{"start":{"line":407,"column":2},"end":{"line":409,"column":3}},"line":407},"31":{"name":"get weekDay","decl":{"start":{"line":414,"column":2},"end":{"line":416,"column":3}},"loc":{"start":{"line":414,"column":2},"end":{"line":416,"column":3}},"line":414},"32":{"name":"get month","decl":{"start":{"line":421,"column":2},"end":{"line":423,"column":3}},"loc":{"start":{"line":421,"column":2},"end":{"line":423,"column":3}},"line":421},"33":{"name":"set month","decl":{"start":{"line":428,"column":2},"end":{"line":436,"column":3}},"loc":{"start":{"line":428,"column":2},"end":{"line":436,"column":3}},"line":428},"34":{"name":"get monthFormatted","decl":{"start":{"line":441,"column":2},"end":{"line":443,"column":3}},"loc":{"start":{"line":441,"column":2},"end":{"line":443,"column":3}},"line":441},"35":{"name":"get year","decl":{"start":{"line":448,"column":2},"end":{"line":450,"column":3}},"loc":{"start":{"line":448,"column":2},"end":{"line":450,"column":3}},"line":448},"36":{"name":"set year","decl":{"start":{"line":455,"column":2},"end":{"line":457,"column":3}},"loc":{"start":{"line":455,"column":2},"end":{"line":457,"column":3}},"line":455},"37":{"name":"get week","decl":{"start":{"line":463,"column":2},"end":{"line":476,"column":3}},"loc":{"start":{"line":463,"column":2},"end":{"line":476,"column":3}},"line":463},"38":{"name":"weeksInWeekYear","decl":{"start":{"line":478,"column":2},"end":{"line":493,"column":3}},"loc":{"start":{"line":478,"column":2},"end":{"line":493,"column":3}},"line":478},"39":{"name":"get isLeapYear","decl":{"start":{"line":495,"column":2},"end":{"line":497,"column":3}},"loc":{"start":{"line":495,"column":2},"end":{"line":497,"column":3}},"line":495},"40":{"name":"computeOrdinal","decl":{"start":{"line":499,"column":10},"end":{"line":501,"column":3}},"loc":{"start":{"line":499,"column":10},"end":{"line":501,"column":3}},"line":499},"41":{"name":"get","decl":{"start":{"line":505,"column":0},"end":{"line":505,"column":1}},"loc":{"start":{"line":505,"column":0},"end":{"line":505,"column":1}},"line":505}},"f":{"0":19,"1":3,"2":3,"3":37,"4":13,"5":3,"6":1,"7":10,"8":25,"9":15,"10":6,"11":1,"12":9,"13":9,"14":3,"15":7,"16":0,"17":12,"18":0,"19":0,"20":12,"21":0,"22":0,"23":12,"24":0,"25":0,"26":0,"27":0,"28":49,"29":4,"30":0,"31":17,"32":16,"33":1,"34":0,"35":15,"36":0,"37":0,"38":0,"39":0,"40":0,"41":27}} +} diff --git a/coverage/datetime.ts.html b/coverage/datetime.ts.html new file mode 100644 index 000000000..39873bdc6 --- /dev/null +++ b/coverage/datetime.ts.html @@ -0,0 +1,1600 @@ + + + + + + Code coverage report for datetime.ts + + + + + + + + + +
+
+

All files datetime.ts

+
+ +
+ 85.14% + Statements + 430/505 +
+ + +
+ 96.42% + Branches + 81/84 +
+ + +
+ 61.9% + Functions + 26/42 +
+ + +
+ 85.14% + Lines + 430/505 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +5061x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +3x +3x +1x +3x +1x +1x +1x +1x +3x +1x +3x +3x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +37x +37x +37x +37x +37x +37x +13x +13x +13x +37x +37x +37x +37x +37x +37x +37x +37x +3x +3x +2x +2x +2x +2x +2x +2x +2x +2x +2x +37x +37x +37x +37x +37x +37x +37x +1x +1x +37x +37x +37x +37x +37x +10x +10x +10x +10x +10x +10x +10x +10x +10x +10x +37x +37x +37x +37x +37x +37x +37x +37x +37x +25x +25x +25x +1x +1x +25x +1x +1x +25x +1x +1x +25x +16x +16x +25x +3x +3x +3x +3x +3x +2x +25x +1x +1x +1x +25x +1x +1x +1x +25x +25x +24x +37x +37x +37x +37x +37x +37x +37x +37x +37x +15x +15x +15x +1x +1x +15x +1x +1x +15x +1x +1x +15x +6x +6x +15x +3x +3x +3x +3x +2x +15x +1x +1x +1x +1x +15x +1x +1x +1x +15x +15x +14x +37x +37x +37x +37x +37x +37x +37x +37x +37x +6x +6x +5x +5x +37x +37x +37x +37x +37x +37x +37x +37x +37x +1x +1x +37x +37x +37x +37x +37x +37x +37x +37x +9x +9x +1x +2x +2x +2x +37x +37x +37x +37x +37x +37x +37x +37x +9x +9x +1x +2x +2x +2x +37x +37x +37x +37x +37x +37x +37x +37x +3x +3x +1x +1x +1x +1x +1x +37x +37x +37x +37x +37x +37x +37x +37x +37x +37x +7x +7x +7x +7x +7x +7x +7x +6x +6x +6x +4x +2x +5x +3x +2x +1x +1x +  +  +  +  +7x +37x +37x +37x +37x +37x +37x +37x +  +  +  +  +  +  +  +  +  +  +37x +37x +37x +37x +37x +12x +12x +37x +37x +37x +37x +37x +  +  +37x +37x +37x +37x +37x +  +  +37x +37x +37x +37x +37x +12x +12x +37x +37x +37x +37x +37x +  +  +37x +37x +37x +37x +37x +  +  +37x +37x +37x +37x +37x +12x +12x +37x +37x +37x +37x +37x +  +  +37x +37x +37x +37x +37x +  +  +37x +37x +37x +37x +37x +  +  +37x +37x +37x +37x +37x +37x +37x +37x +  +  +  +  +  +  +  +37x +37x +37x +37x +37x +49x +49x +37x +37x +37x +37x +37x +4x +4x +37x +37x +37x +37x +37x +  +  +37x +37x +37x +37x +37x +17x +17x +37x +37x +37x +37x +37x +16x +16x +37x +37x +37x +37x +37x +1x +1x +1x +1x +  +  +1x +1x +37x +37x +37x +37x +37x +  +  +37x +37x +37x +37x +37x +15x +15x +37x +37x +37x +37x +37x +  +  +37x +37x +37x +37x +37x +37x +  +  +  +  +  +  +  +  +  +  +  +  +  +37x +37x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +37x +37x +  +  +37x +37x +  +  +37x +37x +37x +27x + 
export enum Unit {
+  seconds = 'seconds',
+  minutes = 'minutes',
+  hours = 'hours',
+  date = 'date',
+  month = 'month',
+  year = 'year',
+}
+ 
+const twoDigitTemplate = {
+  month: '2-digit',
+  day: '2-digit',
+  year: 'numeric',
+  hour: '2-digit',
+  minute: '2-digit',
+  second: '2-digit',
+  hour12: true,
+}
+ 
+const twoDigitTwentyFourTemplate = {
+  hour: '2-digit',
+  hour12: false
+}
+ 
+export interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {
+  timeStyle?: 'short' | 'medium' | 'long';
+  dateStyle?: 'short' | 'medium' | 'long' | 'full';
+  numberingSystem?: string;
+}
+ 
+export const getFormatByUnit = (unit: Unit): object => {
+  switch (unit) {
+    case 'date':
+      return { dateStyle: 'short' };
+    case 'month':
+      return {
+        month: 'numeric',
+        year: 'numeric'
+      };
+    case 'year':
+      return { year: 'numeric' };
+  }
+};
+ 
+/**
+ * For the most part this object behaves exactly the same way
+ * as the native Date object with a little extra spice.
+ */
+export class DateTime extends Date {
+  /**
+   * Used with Intl.DateTimeFormat
+   */
+  locale = 'default';
+ 
+  /**
+   * Chainable way to set the {@link locale}
+   * @param value
+   */
+  setLocale(value: string): this {
+    this.locale = value;
+    return this;
+  }
+ 
+  /**
+   * Converts a plain JS date object to a DateTime object.
+   * Doing this allows access to format, etc.
+   * @param  date
+   * @param locale
+   */
+  static convert(date: Date, locale: string = 'default'): DateTime {
+    if (!date) throw new Error(`A date is required`);
+    return new DateTime(
+      date.getFullYear(),
+      date.getMonth(),
+      date.getDate(),
+      date.getHours(),
+      date.getMinutes(),
+      date.getSeconds(),
+      date.getMilliseconds()
+    ).setLocale(locale);
+  }
+ 
+  /**
+   * Attempts to create a DateTime from a string. A customDateFormat is required for non US dates.
+   * @param input
+   * @param localization
+   */
+  static fromString(input: string, localization: any): DateTime {
+    return new DateTime(input);
+  }
+ 
+  /**
+   * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.
+   */
+  get clone() {
+    return new DateTime(
+      this.year,
+      this.month,
+      this.date,
+      this.hours,
+      this.minutes,
+      this.seconds,
+      this.getMilliseconds()
+    ).setLocale(this.locale);
+  }
+ 
+  /**
+   * Sets the current date to the start of the {@link unit} provided
+   * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')
+   * would return April 1, 2021, 12:00:00.000 AM (midnight)
+   * @param unit
+   * @param startOfTheWeek Allows for the changing the start of the week.
+   */
+  startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {
+    if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);
+    switch (unit) {
+      case 'seconds':
+        this.setMilliseconds(0);
+        break;
+      case 'minutes':
+        this.setSeconds(0, 0);
+        break;
+      case 'hours':
+        this.setMinutes(0, 0, 0);
+        break;
+      case 'date':
+        this.setHours(0, 0, 0, 0);
+        break;
+      case 'weekDay':
+        this.startOf(Unit.date);
+        if (this.weekDay === startOfTheWeek) break;
+        let goBack = this.weekDay;
+        if (startOfTheWeek !== 0 && this.weekDay === 0) goBack = 8 - startOfTheWeek;
+        this.manipulate(startOfTheWeek - goBack, Unit.date);
+        break;
+      case 'month':
+        this.startOf(Unit.date);
+        this.setDate(1);
+        break;
+      case 'year':
+        this.startOf(Unit.date);
+        this.setMonth(0, 1);
+        break;
+    }
+    return this;
+  }
+ 
+  /**
+   * Sets the current date to the end of the {@link unit} provided
+   * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')
+   * would return April 30, 2021, 11:59:59.999 PM
+   * @param unit
+   * @param startOfTheWeek
+   */
+  endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {
+    if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);
+    switch (unit) {
+      case 'seconds':
+        this.setMilliseconds(999);
+        break;
+      case 'minutes':
+        this.setSeconds(59, 999);
+        break;
+      case 'hours':
+        this.setMinutes(59, 59, 999);
+        break;
+      case 'date':
+        this.setHours(23, 59, 59, 999);
+        break;
+      case 'weekDay':
+        this.endOf(Unit.date);
+        const endOfWeek = (6 + startOfTheWeek);
+        if (this.weekDay === endOfWeek) break;
+        this.manipulate(endOfWeek - this.weekDay, Unit.date);
+        break;
+      case 'month':
+        this.endOf(Unit.date);
+        this.manipulate(1, Unit.month);
+        this.setDate(0);
+        break;
+      case 'year':
+        this.endOf(Unit.date);
+        this.setMonth(11, 31);
+        break;
+    }
+    return this;
+  }
+ 
+  /**
+   * Change a {@link unit} value. Value can be positive or negative
+   * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')
+   * would return May 30, 2021, 11:45:32.984 AM
+   * @param value A positive or negative number
+   * @param unit
+   */
+  manipulate(value: number, unit: Unit): this {
+    if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);
+    this[unit] += value;
+    return this;
+  }
+ 
+  /**
+   * Returns a string format.
+   * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat
+   * for valid templates and locale objects
+   * @param template An object. Uses browser defaults otherwise.
+   * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.
+   */
+  format(template: DateTimeFormatOptions, locale = this.locale): string {
+    return new Intl.DateTimeFormat(locale, template).format(this);
+  }
+ 
+  /**
+   * Return true if {@link compare} is before this date
+   * @param compare The Date/DateTime to compare
+   * @param unit If provided, uses {@link startOf} for
+   * comparision.
+   */
+  isBefore(compare: DateTime, unit?: Unit): boolean {
+    if (!unit) return this.valueOf() < compare.valueOf();
+    if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);
+    return (
+      this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()
+    );
+  }
+ 
+  /**
+   * Return true if {@link compare} is after this date
+   * @param compare The Date/DateTime to compare
+   * @param unit If provided, uses {@link startOf} for
+   * comparision.
+   */
+  isAfter(compare: DateTime, unit?: Unit): boolean {
+    if (!unit) return this.valueOf() > compare.valueOf();
+    if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);
+    return (
+      this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()
+    );
+  }
+ 
+  /**
+   * Return true if {@link compare} is same this date
+   * @param compare The Date/DateTime to compare
+   * @param unit If provided, uses {@link startOf} for
+   * comparision.
+   */
+  isSame(compare: DateTime, unit?: Unit): boolean {
+    if (!unit) return this.valueOf() === compare.valueOf();
+    if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);
+    compare = DateTime.convert(compare);
+    return (
+      this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()
+    );
+  }
+ 
+  /**
+   * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.
+   * @param left
+   * @param right
+   * @param unit.
+   * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.
+   * If the inclusivity parameter is used, both indicators must be passed.
+   */
+  isBetween(
+    left: DateTime,
+    right: DateTime,
+    unit?: Unit,
+    inclusivity: '()' | '[]' | '(]' | '[)' = '()'
+  ): boolean {
+    if (unit && this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);
+    const leftInclusivity = inclusivity[0] === '(';
+    const rightInclusivity = inclusivity[1] === ')';
+ 
+    return (leftInclusivity
+        ? this.isAfter(left, unit)
+        : !this.isBefore(left, unit)) &&
+      (rightInclusivity
+        ? this.isBefore(right, unit)
+        : !this.isAfter(right, unit)) ||
+    (leftInclusivity
+        ? this.isBefore(left, unit)
+        : !this.isAfter(left, unit)) &&
+      (rightInclusivity
+        ? this.isAfter(right, unit)
+        : !this.isBefore(right, unit));
+  }
+ 
+  /**
+   * Returns flattened object of the date. Does not include literals
+   * @param locale
+   * @param template
+   */
+  parts(
+    locale = this.locale,
+    template: any = { dateStyle: 'full', timeStyle: 'long' }
+  ): any {
+    const parts = {};
+    new Intl.DateTimeFormat(locale, template)
+      .formatToParts(this)
+      .filter((x) => x.type !== 'literal')
+      .forEach((x) => (parts[x.type] = x.value));
+    return parts;
+  }
+ 
+  /**
+   * Shortcut to Date.getSeconds()
+   */
+  get seconds(): number {
+    return this.getSeconds();
+  }
+ 
+  /**
+   * Shortcut to Date.setSeconds()
+   */
+  set seconds(value: number) {
+    this.setSeconds(value);
+  }
+ 
+  /**
+   * Returns two digit hours
+   */
+  get secondsFormatted(): string {
+    return this.parts(undefined, twoDigitTemplate).second;
+  }
+ 
+  /**
+   * Shortcut to Date.getMinutes()
+   */
+  get minutes(): number {
+    return this.getMinutes();
+  }
+ 
+  /**
+   * Shortcut to Date.setMinutes()
+   */
+  set minutes(value: number) {
+    this.setMinutes(value);
+  }
+ 
+  /**
+   * Returns two digit minutes
+   */
+  get minutesFormatted(): string {
+    return this.parts(undefined, twoDigitTemplate).minute;
+  }
+ 
+  /**
+   * Shortcut to Date.getHours()
+   */
+  get hours(): number {
+    return this.getHours();
+  }
+ 
+  /**
+   * Shortcut to Date.setHours()
+   */
+  set hours(value: number) {
+    this.setHours(value);
+  }
+ 
+  /**
+   * Returns two digit hours
+   */
+  get hoursFormatted(): string {
+    return this.parts(undefined, twoDigitTwentyFourTemplate).hour;
+  }
+ 
+  /**
+   * Returns two digit hours but in twelve hour mode e.g. 13 -> 1
+   */
+  get twelveHoursFormatted(): string {
+    return this.parts(undefined, twoDigitTemplate).hour;
+  }
+ 
+  /**
+   * Get the meridiem of the date. E.g. AM or PM.
+   * If the {@link locale} provides a "dayPeriod" then this will be returned,
+   * otherwise it will return AM or PM.
+   * @param locale
+   */
+  meridiem(locale: string = this.locale): string {
+    return new Intl.DateTimeFormat(locale, {
+      hour: 'numeric',
+      hour12: true
+    } as any)
+      .formatToParts(this)
+      .find((p) => p.type === 'dayPeriod')?.value;
+  }
+ 
+  /**
+   * Shortcut to Date.getDate()
+   */
+  get date(): number {
+    return this.getDate();
+  }
+ 
+  /**
+   * Shortcut to Date.setDate()
+   */
+  set date(value: number) {
+    this.setDate(value);
+  }
+ 
+  /**
+   * Return two digit date
+   */
+  get dateFormatted(): string {
+    return this.parts(undefined, twoDigitTemplate).day;
+  }
+ 
+  /**
+   * Shortcut to Date.getDay()
+   */
+  get weekDay(): number {
+    return this.getDay();
+  }
+ 
+  /**
+   * Shortcut to Date.getMonth()
+   */
+  get month(): number {
+    return this.getMonth();
+  }
+ 
+  /**
+   * Shortcut to Date.setMonth()
+   */
+  set month(value: number) {
+    const targetMonth = new Date(this.year, value + 1);
+    targetMonth.setDate(0);
+    const endOfMonth = targetMonth.getDate();
+    if (this.date > endOfMonth) {
+      this.date = endOfMonth;
+    }
+    this.setMonth(value);
+  }
+ 
+  /**
+   * Return two digit, human expected month. E.g. January = 1, December = 12
+   */
+  get monthFormatted(): string {
+    return this.parts(undefined, twoDigitTemplate).month;
+  }
+ 
+  /**
+   * Shortcut to Date.getFullYear()
+   */
+  get year(): number {
+    return this.getFullYear();
+  }
+ 
+  /**
+   * Shortcut to Date.setFullYear()
+   */
+  set year(value: number) {
+    this.setFullYear(value);
+  }
+ 
+  // borrowed a bunch of stuff from Luxon
+  /**
+   * Gets the week of the year
+   */
+  get week(): number {
+    const ordinal = this.computeOrdinal(),
+      weekday = this.getUTCDay();
+
+    let weekNumber = Math.floor((ordinal - weekday + 10) / 7);
+
+    if (weekNumber < 1) {
+      weekNumber = this.weeksInWeekYear(this.year - 1);
+    } else if (weekNumber > this.weeksInWeekYear(this.year)) {
+      weekNumber = 1;
+    }
+
+    return weekNumber;
+  }
+ 
+  weeksInWeekYear(weekYear) {
+    const p1 =
+        (weekYear +
+          Math.floor(weekYear / 4) -
+          Math.floor(weekYear / 100) +
+          Math.floor(weekYear / 400)) %
+        7,
+      last = weekYear - 1,
+      p2 =
+        (last +
+          Math.floor(last / 4) -
+          Math.floor(last / 100) +
+          Math.floor(last / 400)) %
+        7;
+    return p1 === 4 || p2 === 3 ? 53 : 52;
+  }
+ 
+  get isLeapYear() {
+    return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);
+  }
+ 
+  private computeOrdinal() {
+    return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];
+  }
+ 
+  private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
+  private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/coverage/favicon.png b/coverage/favicon.png new file mode 100644 index 000000000..c1525b811 Binary files /dev/null and b/coverage/favicon.png differ diff --git a/coverage/index.html b/coverage/index.html new file mode 100644 index 000000000..01548b1e3 --- /dev/null +++ b/coverage/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for All files + + + + + + + + + +
+
+

All files

+
+ +
+ 85.14% + Statements + 430/505 +
+ + +
+ 96.42% + Branches + 81/84 +
+ + +
+ 61.9% + Functions + 26/42 +
+ + +
+ 85.14% + Lines + 430/505 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
datetime.ts +
+
85.14%430/50596.42%81/8461.9%26/4285.14%430/505
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/coverage/prettify.css b/coverage/prettify.css new file mode 100644 index 000000000..b317a7cda --- /dev/null +++ b/coverage/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/prettify.js b/coverage/prettify.js new file mode 100644 index 000000000..b3225238f --- /dev/null +++ b/coverage/prettify.js @@ -0,0 +1,2 @@ +/* eslint-disable */ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/sort-arrow-sprite.png b/coverage/sort-arrow-sprite.png new file mode 100644 index 000000000..6ed68316e Binary files /dev/null and b/coverage/sort-arrow-sprite.png differ diff --git a/coverage/sorter.js b/coverage/sorter.js new file mode 100644 index 000000000..2bb296a8c --- /dev/null +++ b/coverage/sorter.js @@ -0,0 +1,196 @@ +/* eslint-disable */ +var addSorting = (function() { + 'use strict'; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { + return document.querySelector('.coverage-summary'); + } + // returns the thead element of the summary table + function getTableHeader() { + return getTable().querySelector('thead tr'); + } + // returns the tbody element of the summary table + function getTableBody() { + return getTable().querySelector('tbody'); + } + // returns the th element for nth column + function getNthColumn(n) { + return getTableHeader().querySelectorAll('th')[n]; + } + + function onFilterInput() { + const searchValue = document.getElementById('fileSearch').value; + const rows = document.getElementsByTagName('tbody')[0].children; + for (let i = 0; i < rows.length; i++) { + const row = rows[i]; + if ( + row.textContent + .toLowerCase() + .includes(searchValue.toLowerCase()) + ) { + row.style.display = ''; + } else { + row.style.display = 'none'; + } + } + } + + // loads the search box + function addSearchBox() { + var template = document.getElementById('filterTemplate'); + var templateClone = template.content.cloneNode(true); + templateClone.getElementById('fileSearch').oninput = onFilterInput; + template.parentElement.appendChild(templateClone); + } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = + colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function(a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function(a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc + ? ' sorted-desc' + : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function() { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i = 0; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function() { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(); + addSearchBox(); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/dist/js/jQuery-provider.js b/dist/js/jQuery-provider.js index ddddc9c26..cf260026e 100644 --- a/dist/js/jQuery-provider.js +++ b/dist/js/jQuery-provider.js @@ -2,7 +2,7 @@ /*global $, tempusDominus */ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2021 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/js/jQuery-provider.min.js b/dist/js/jQuery-provider.min.js index c6993d2aa..712a4aeab 100644 --- a/dist/js/jQuery-provider.min.js +++ b/dist/js/jQuery-provider.min.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2021 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/js/tempus-dominus.esm.js b/dist/js/tempus-dominus.esm.js index 4ac1d1593..b7cfeecc6 100644 --- a/dist/js/tempus-dominus.esm.js +++ b/dist/js/tempus-dominus.esm.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -153,7 +153,10 @@ class DateTime extends Date { break; case 'weekDay': this.endOf(Unit.date); - this.manipulate((6 + startOfTheWeek) - this.weekDay, Unit.date); + const endOfWeek = (6 + startOfTheWeek); + if (this.weekDay === endOfWeek) + break; + this.manipulate(endOfWeek - this.weekDay, Unit.date); break; case 'month': this.endOf(Unit.date); @@ -162,8 +165,7 @@ class DateTime extends Date { break; case 'year': this.endOf(Unit.date); - this.manipulate(1, Unit.year); - this.setDate(0); + this.setMonth(11, 31); break; } return this; @@ -244,18 +246,18 @@ class DateTime extends Date { throw new Error(`Unit '${unit}' is not valid`); const leftInclusivity = inclusivity[0] === '('; const rightInclusivity = inclusivity[1] === ')'; - return (((leftInclusivity + return (leftInclusivity ? this.isAfter(left, unit) : !this.isBefore(left, unit)) && (rightInclusivity ? this.isBefore(right, unit) - : !this.isAfter(right, unit))) || - ((leftInclusivity + : !this.isAfter(right, unit)) || + (leftInclusivity ? this.isBefore(left, unit) : !this.isAfter(left, unit)) && (rightInclusivity ? this.isAfter(right, unit) - : !this.isBefore(right, unit)))); + : !this.isBefore(right, unit)); } /** * Returns flattened object of the date. Does not include literals @@ -1352,6 +1354,7 @@ class OptionConverter { } else if (inputElement instanceof Date) { o[key] = new Date(inputElement.valueOf()); + return; } o[key] = inputElement; if (typeof inputElement !== 'object' || @@ -1712,6 +1715,18 @@ class Dates { const step = factor / 10, startYear = Math.floor(year / factor) * factor, endYear = startYear + step * 9, focusValue = Math.floor(year / step) * step; return [startYear, endYear, focusValue]; } + updateInput(target) { + if (!this.optionsStore.input) + return; + let newValue = this.formatInput(target); + if (this.optionsStore.options.multipleDates) { + newValue = this._dates + .map((d) => this.formatInput(d)) + .join(this.optionsStore.options.multipleDatesSeparator); + } + if (this.optionsStore.input.value != newValue) + this.optionsStore.input.value = newValue; + } /** * Attempts to either clear or set the `target` date at `index`. * If the `target` is null then the date will be cleared. @@ -1727,20 +1742,8 @@ class Dates { if (!oldDate && !this.optionsStore.unset && noIndex && isClear) { oldDate = this.lastPicked; } - const updateInput = () => { - if (!this.optionsStore.input) - return; - let newValue = this.formatInput(target); - if (this.optionsStore.options.multipleDates) { - newValue = this._dates - .map((d) => this.formatInput(d)) - .join(this.optionsStore.options.multipleDatesSeparator); - } - if (this.optionsStore.input.value != newValue) - this.optionsStore.input.value = newValue; - }; if (target && oldDate?.isSame(target)) { - updateInput(); + this.updateInput(target); return; } // case of calling setValue(null) @@ -1754,7 +1757,7 @@ class Dates { else { this._dates.splice(index, 1); } - updateInput(); + this.updateInput(); this._eventEmitters.triggerEvent.emit({ type: Namespace.events.change, date: undefined, @@ -1777,7 +1780,7 @@ class Dates { if (this.validation.isValid(target)) { this._dates[index] = target; this._eventEmitters.updateViewDate.emit(target.clone); - updateInput(); + this.updateInput(target); this.optionsStore.unset = false; this._eventEmitters.updateDisplay.emit('all'); this._eventEmitters.triggerEvent.emit({ @@ -1792,7 +1795,7 @@ class Dates { if (this.optionsStore.options.keepInvalid) { this._dates[index] = target; this._eventEmitters.updateViewDate.emit(target.clone); - updateInput(); + this.updateInput(target); this._eventEmitters.triggerEvent.emit({ type: Namespace.events.change, date: target, @@ -2902,6 +2905,8 @@ class Display { break; } picker.style.display = 'grid'; + if (this.optionsStore.options.display.sideBySide) + (this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]).style.display = 'grid'; this._updateCalendarHeader(); this._eventEmitters.viewUpdate.emit(); } @@ -2972,7 +2977,7 @@ class Display { previous.setAttribute('title', this.optionsStore.options.localization.previousMonth); switcher.setAttribute('title', this.optionsStore.options.localization.selectMonth); next.setAttribute('title', this.optionsStore.options.localization.nextMonth); - switcher.innerText = this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat); + switcher.setAttribute(showing, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)); break; } switcher.innerText = switcher.getAttribute(showing); @@ -3477,7 +3482,7 @@ class TempusDominus { return; const setViewDate = () => { if (this.dates.lastPicked) - this.viewDate = this.dates.lastPicked.clone; + this.optionsStore.viewDate = this.dates.lastPicked.clone; }; const value = this.optionsStore.input.value; if (this.optionsStore.options.multipleDates) { @@ -3643,7 +3648,7 @@ class TempusDominus { } this._subscribers[eventType].push(callBackArray[i]); returnArray.push({ - unsubscribe: this._unsubscribe.bind(this, eventType, this._subscribers[eventType].length - 1) + unsubscribe: this._unsubscribe.bind(this, eventType, this._subscribers[eventType].length - 1), }); if (eventTypes.length === 1) { return returnArray[0]; @@ -3677,7 +3682,7 @@ class TempusDominus { if (!asked) return; this.updateOptions({ - localization: asked + localization: asked, }); } /** @@ -3728,7 +3733,7 @@ class TempusDominus { _viewUpdate() { this._triggerEvent({ type: Namespace.events.update, - viewDate: this.optionsStore.viewDate.clone + viewDate: this.optionsStore.viewDate.clone, }); } _unsubscribe(eventName, index) { @@ -3800,6 +3805,8 @@ class TempusDominus { } if (!this.optionsStore.input) return; + if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate) + this.optionsStore.input.value = this.dates.formatInput(this.optionsStore.options.defaultDate); this.optionsStore.input.addEventListener('change', this._inputChangeEvent); if (this.optionsStore.options.allowInputToggle) { this.optionsStore.input.addEventListener('click', this._toggleClickEvent); @@ -3855,9 +3862,9 @@ class TempusDominus { if (this.display.widget) { this._eventEmitters.action.emit({ e: { - currentTarget: this.display.widget.querySelector(`.${Namespace.css.switch} div`) + currentTarget: this.display.widget.querySelector(`.${Namespace.css.switch} div`), }, - action: ActionTypes$1.togglePicker + action: ActionTypes$1.togglePicker, }); } }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay); @@ -3900,12 +3907,12 @@ const extend = function (plugin, option) { return tempusDominus; if (!plugin.installed) { // install plugin only once - plugin(option, { TempusDominus, Dates, Display, DateTime, ErrorMessages }, tempusDominus); + plugin(option, { TempusDominus, Dates, Display, DateTime, Namespace }, tempusDominus); plugin.installed = true; } return tempusDominus; }; -const version = '6.2.6'; +const version = '6.2.7'; const tempusDominus = { TempusDominus, extend, diff --git a/dist/js/tempus-dominus.esm.js.map b/dist/js/tempus-dominus.esm.js.map index 57c1f7ccc..9848f1490 100644 --- a/dist/js/tempus-dominus.esm.js.map +++ b/dist/js/tempus-dominus.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"tempus-dominus.esm.js","sources":["../../src/js/datetime.ts","../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/typeChecker.ts","../../src/js/utilities/optionProcessor.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export enum Unit {\r\n seconds = 'seconds',\r\n minutes = 'minutes',\r\n hours = 'hours',\r\n date = 'date',\r\n month = 'month',\r\n year = 'year',\r\n}\r\n\r\nconst twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: true,\r\n}\r\n\r\nconst twoDigitTwentyFourTemplate = {\r\n hour: '2-digit',\r\n hour12: false\r\n}\r\n\r\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\r\n timeStyle?: 'short' | 'medium' | 'long';\r\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\r\n numberingSystem?: string;\r\n}\r\n\r\nexport const getFormatByUnit = (unit: Unit): object => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric'\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n};\r\n\r\n/**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\nexport class DateTime extends Date {\r\n /**\r\n * Used with Intl.DateTimeFormat\r\n */\r\n locale = 'default';\r\n\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n */\r\n setLocale(value: string): this {\r\n this.locale = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale\r\n */\r\n static convert(date: Date, locale: string = 'default'): DateTime {\r\n if (!date) throw new Error(`A date is required`);\r\n return new DateTime(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ).setLocale(locale);\r\n }\r\n\r\n /**\r\n * Attempts to create a DateTime from a string. A customDateFormat is required for non US dates.\r\n * @param input\r\n * @param localization\r\n */\r\n static fromString(input: string, localization: any): DateTime {\r\n return new DateTime(input);\r\n }\r\n\r\n /**\r\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\r\n */\r\n get clone() {\r\n return new DateTime(\r\n this.year,\r\n this.month,\r\n this.date,\r\n this.hours,\r\n this.minutes,\r\n this.seconds,\r\n this.getMilliseconds()\r\n ).setLocale(this.locale);\r\n }\r\n\r\n /**\r\n * Sets the current date to the start of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\r\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\r\n * @param unit\r\n * @param startOfTheWeek Allows for the changing the start of the week.\r\n */\r\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(0);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(0, 0);\r\n break;\r\n case 'hours':\r\n this.setMinutes(0, 0, 0);\r\n break;\r\n case 'date':\r\n this.setHours(0, 0, 0, 0);\r\n break;\r\n case 'weekDay':\r\n this.startOf(Unit.date);\r\n if (this.weekDay === startOfTheWeek) break;\r\n let goBack = this.weekDay;\r\n if (startOfTheWeek !== 0 && this.weekDay === 0) goBack = 8 - startOfTheWeek;\r\n this.manipulate(startOfTheWeek - goBack, Unit.date);\r\n break;\r\n case 'month':\r\n this.startOf(Unit.date);\r\n this.setDate(1);\r\n break;\r\n case 'year':\r\n this.startOf(Unit.date);\r\n this.setMonth(0, 1);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the current date to the end of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\r\n * would return April 30, 2021, 11:59:59.999 PM\r\n * @param unit\r\n * @param startOfTheWeek\r\n */\r\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(999);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(59, 999);\r\n break;\r\n case 'hours':\r\n this.setMinutes(59, 59, 999);\r\n break;\r\n case 'date':\r\n this.setHours(23, 59, 59, 999);\r\n break;\r\n case 'weekDay':\r\n this.endOf(Unit.date);\r\n this.manipulate((6 + startOfTheWeek) - this.weekDay, Unit.date);\r\n break;\r\n case 'month':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.month);\r\n this.setDate(0);\r\n break;\r\n case 'year':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.year);\r\n this.setDate(0);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Change a {@link unit} value. Value can be positive or negative\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\r\n * would return May 30, 2021, 11:45:32.984 AM\r\n * @param value A positive or negative number\r\n * @param unit\r\n */\r\n manipulate(value: number, unit: Unit): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n this[unit] += value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a string format.\r\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\r\n * for valid templates and locale objects\r\n * @param template An object. Uses browser defaults otherwise.\r\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\r\n */\r\n format(template: DateTimeFormatOptions, locale = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, template).format(this);\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is before this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isBefore(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() < compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is after this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isAfter(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() > compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is same this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isSame(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() === compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n compare = DateTime.convert(compare);\r\n return (\r\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\r\n * @param left\r\n * @param right\r\n * @param unit.\r\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\r\n * If the inclusivity parameter is used, both indicators must be passed.\r\n */\r\n isBetween(\r\n left: DateTime,\r\n right: DateTime,\r\n unit?: Unit,\r\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\r\n ): boolean {\r\n if (unit && this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n const leftInclusivity = inclusivity[0] === '(';\r\n const rightInclusivity = inclusivity[1] === ')';\r\n\r\n return (\r\n ((leftInclusivity\r\n ? this.isAfter(left, unit)\r\n : !this.isBefore(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isBefore(right, unit)\r\n : !this.isAfter(right, unit))) ||\r\n ((leftInclusivity\r\n ? this.isBefore(left, unit)\r\n : !this.isAfter(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isAfter(right, unit)\r\n : !this.isBefore(right, unit)))\r\n );\r\n }\r\n\r\n /**\r\n * Returns flattened object of the date. Does not include literals\r\n * @param locale\r\n * @param template\r\n */\r\n parts(\r\n locale = this.locale,\r\n template: any = { dateStyle: 'full', timeStyle: 'long' }\r\n ): any {\r\n const parts = {};\r\n new Intl.DateTimeFormat(locale, template)\r\n .formatToParts(this)\r\n .filter((x) => x.type !== 'literal')\r\n .forEach((x) => (parts[x.type] = x.value));\r\n return parts;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getSeconds()\r\n */\r\n get seconds(): number {\r\n return this.getSeconds();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setSeconds()\r\n */\r\n set seconds(value: number) {\r\n this.setSeconds(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get secondsFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).second;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMinutes()\r\n */\r\n get minutes(): number {\r\n return this.getMinutes();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMinutes()\r\n */\r\n set minutes(value: number) {\r\n this.setMinutes(value);\r\n }\r\n\r\n /**\r\n * Returns two digit minutes\r\n */\r\n get minutesFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).minute;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getHours()\r\n */\r\n get hours(): number {\r\n return this.getHours();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setHours()\r\n */\r\n set hours(value: number) {\r\n this.setHours(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get hoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n }\r\n\r\n /**\r\n * Returns two digit hours but in twelve hour mode e.g. 13 -> 1\r\n */\r\n get twelveHoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).hour;\r\n }\r\n\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale: string = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true\r\n } as any)\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date(): number {\r\n return this.getDate();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value: number) {\r\n this.setDate(value);\r\n }\r\n\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay(): number {\r\n return this.getDay();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month(): number {\r\n return this.getMonth();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value: number) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year(): number {\r\n return this.getFullYear();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value: number) {\r\n this.setFullYear(value);\r\n }\r\n\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week(): number {\r\n const ordinal = this.computeOrdinal(),\r\n weekday = this.getUTCDay();\r\n\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear(this.year - 1);\r\n } else if (weekNumber > this.weeksInWeekYear(this.year)) {\r\n weekNumber = 1;\r\n }\r\n\r\n return weekNumber;\r\n }\r\n\r\n weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 =\r\n (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n\r\n get isLeapYear() {\r\n return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);\r\n }\r\n\r\n private computeOrdinal() {\r\n return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];\r\n }\r\n\r\n private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\r\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n}\r\n","export class TdError extends Error {\r\n code: number;\r\n}\r\n\r\nexport class ErrorMessages {\r\n private base = 'TD:';\r\n\r\n //#region out to console\r\n\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName: string) {\r\n const error = new TdError(\r\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\r\n );\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName: string[]) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(\r\n optionName: string,\r\n badValue: string,\r\n validOptions: string[]\r\n ) {\r\n const error = new TdError(\r\n `${\r\n this.base\r\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\r\n ', '\r\n )}`\r\n );\r\n error.code = 2;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName: string, badType: string, expectedType: string) {\r\n const error = new TdError(\r\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\r\n );\r\n error.code = 3;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\r\n const error = new TdError(\r\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\r\n );\r\n error.code = 4;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n failedToParseDate(optionName: string, date: any, soft = false) {\r\n const error = new TdError(\r\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\r\n );\r\n error.code = 5;\r\n if (!soft) throw error;\r\n console.warn(error);\r\n }\r\n\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(\r\n `${this.base} The subscribed events does not match the number of callbacks`\r\n );\r\n error.code = 7;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message?: string) {\r\n const error = new TdError(\r\n `${this.base} A configuration value conflicts with another rule. ${message}`\r\n );\r\n error.code = 8;\r\n throw error;\r\n }\r\n\r\n /**\r\n * customDateFormat errors\r\n */\r\n customDateFormatError(message?: string) {\r\n const error = new TdError(\r\n `${this.base} customDateFormat: ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Logs a warning if a date option value is provided as a string, instead of\r\n * a date/datetime object.\r\n */\r\n dateString() {\r\n console.warn(\r\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\r\n );\r\n }\r\n\r\n throwError(message) {\r\n const error = new TdError(\r\n `${this.base} ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region used with notify.error\r\n\r\n /**\r\n * Used with an Error Event type if the user selects a date that\r\n * fails restriction validation.\r\n */\r\n failedToSetInvalidDate = 'Failed to set invalid date';\r\n\r\n /**\r\n * Used with an Error Event type when a user changes the value of the\r\n * input field directly, and does not provide a valid date.\r\n */\r\n failedToParseInput = 'Failed parse input field';\r\n\r\n //#endregion\r\n}\r\n","import { ErrorMessages } from './errors';\r\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\r\nconst NAME = 'tempus-dominus',\r\n dataKey = 'td';\r\n\r\n/**\r\n * Events\r\n */\r\nclass Events {\r\n key = `.${dataKey}`;\r\n\r\n /**\r\n * Change event. Fired when the user selects a date.\r\n * See also EventTypes.ChangeEvent\r\n */\r\n change = `change${this.key}`;\r\n\r\n /**\r\n * Emit when the view changes for example from month view to the year view.\r\n * See also EventTypes.ViewUpdateEvent\r\n */\r\n update = `update${this.key}`;\r\n\r\n /**\r\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\r\n * See also EventTypes.FailEvent\r\n */\r\n error = `error${this.key}`;\r\n\r\n /**\r\n * Show event\r\n * @event Events#show\r\n */\r\n show = `show${this.key}`;\r\n\r\n /**\r\n * Hide event\r\n * @event Events#hide\r\n */\r\n hide = `hide${this.key}`;\r\n\r\n // blur and focus are used in the jQuery provider but are otherwise unused.\r\n // keyup/down will be used later for keybinding options\r\n\r\n blur = `blur${this.key}`;\r\n focus = `focus${this.key}`;\r\n keyup = `keyup${this.key}`;\r\n keydown = `keydown${this.key}`;\r\n}\r\n\r\nclass Css {\r\n /**\r\n * The outer element for the widget.\r\n */\r\n widget = `${NAME}-widget`;\r\n\r\n /**\r\n * Hold the previous, next and switcher divs\r\n */\r\n calendarHeader = 'calendar-header';\r\n\r\n /**\r\n * The element for the action to change the calendar view. E.g. month -> year.\r\n */\r\n switch = 'picker-switch';\r\n\r\n /**\r\n * The elements for all the toolbar options\r\n */\r\n toolbar = 'toolbar';\r\n\r\n /**\r\n * Disables the hover and rounding affect.\r\n */\r\n noHighlight = 'no-highlight';\r\n\r\n /**\r\n * Applied to the widget element when the side by side option is in use.\r\n */\r\n sideBySide = 'timepicker-sbs';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> July\r\n */\r\n previous = 'previous';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> September\r\n */\r\n next = 'next';\r\n\r\n /**\r\n * Applied to any action that would violate any restriction options. ALso applied\r\n * to an input field if the disabled function is called.\r\n */\r\n disabled = 'disabled';\r\n\r\n /**\r\n * Applied to any date that is less than requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n old = 'old';\r\n\r\n /**\r\n * Applied to any date that is greater than of requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n new = 'new';\r\n\r\n /**\r\n * Applied to any date that is currently selected.\r\n */\r\n active = 'active';\r\n\r\n //#region date element\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer element for the decades view.\r\n */\r\n decadesContainer = `${this.dateContainer}-decades`;\r\n\r\n /**\r\n * Applied to elements within the decades container, e.g. 2020, 2030\r\n */\r\n decade = 'decade';\r\n\r\n /**\r\n * The outer element for the years view.\r\n */\r\n yearsContainer = `${this.dateContainer}-years`;\r\n\r\n /**\r\n * Applied to elements within the years container, e.g. 2021, 2021\r\n */\r\n year = 'year';\r\n\r\n /**\r\n * The outer element for the month view.\r\n */\r\n monthsContainer = `${this.dateContainer}-months`;\r\n\r\n /**\r\n * Applied to elements within the month container, e.g. January, February\r\n */\r\n month = 'month';\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n daysContainer = `${this.dateContainer}-days`;\r\n\r\n /**\r\n * Applied to elements within the day container, e.g. 1, 2..31\r\n */\r\n day = 'day';\r\n\r\n /**\r\n * If display.calendarWeeks is enabled, a column displaying the week of year\r\n * is shown. This class is applied to each cell in that column.\r\n */\r\n calendarWeeks = 'cw';\r\n\r\n /**\r\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\r\n */\r\n dayOfTheWeek = 'dow';\r\n\r\n /**\r\n * Applied to the current date on the calendar view.\r\n */\r\n today = 'today';\r\n\r\n /**\r\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\r\n */\r\n weekend = 'weekend';\r\n\r\n //#endregion\r\n\r\n //#region time element\r\n\r\n /**\r\n * The outer element for all time related elements.\r\n */\r\n timeContainer = 'time-container';\r\n\r\n /**\r\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\r\n */\r\n separator = 'separator';\r\n\r\n /**\r\n * The outer element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer element for the seconds selection view.\r\n */\r\n secondContainer = `${this.timeContainer}-second`;\r\n\r\n /**\r\n * Applied to each element in the hours selection view.\r\n */\r\n hour = 'hour';\r\n\r\n /**\r\n * Applied to each element in the minutes selection view.\r\n */\r\n minute = 'minute';\r\n\r\n /**\r\n * Applied to each element in the seconds selection view.\r\n */\r\n second = 'second';\r\n\r\n /**\r\n * Applied AM/PM toggle button.\r\n */\r\n toggleMeridiem = 'toggleMeridiem';\r\n\r\n //#endregion\r\n\r\n //#region collapse\r\n\r\n /**\r\n * Applied the element of the current view mode, e.g. calendar or clock.\r\n */\r\n show = 'show';\r\n\r\n /**\r\n * Applied to the currently showing view mode during a transition\r\n * between calendar and clock views\r\n */\r\n collapsing = 'td-collapsing';\r\n\r\n /**\r\n * Applied to the currently hidden view mode.\r\n */\r\n collapse = 'td-collapse';\r\n\r\n //#endregion\r\n\r\n /**\r\n * Applied to the widget when the option display.inline is enabled.\r\n */\r\n inline = 'inline';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is light.\r\n */\r\n lightTheme = 'light';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n darkTheme = 'dark';\r\n\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\r\n}\r\n\r\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static dataKey = dataKey;\r\n\r\n static events = new Events();\r\n\r\n static css = new Css();\r\n\r\n static errorMessages = new ErrorMessages();\r\n}\r\n","export declare type Constructable = new (...args: any[]) => T;\r\n\r\nclass ServiceLocator {\r\n private cache: Map, unknown | Symbol> = new Map();\r\n\r\n locate(identifier: Constructable): T {\r\n const service = this.cache.get(identifier);\r\n if (service) return service as T;\r\n const value = new identifier();\r\n this.cache.set(identifier, value);\r\n return value;\r\n }\r\n}\r\nexport const setupServiceLocator = () => {\r\n serviceLocator = new ServiceLocator();\r\n}\r\n\r\nexport let serviceLocator: ServiceLocator;\r\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import { DateTime } from '../datetime';\r\nimport CalendarModes from './calendar-modes';\r\nimport ViewMode from './view-mode';\r\nimport Options from './options';\r\n\r\nexport class OptionsStore {\r\n options: Options;\r\n element: HTMLElement;\r\n input: HTMLInputElement;\r\n unset: boolean;\r\n private _currentCalendarViewMode = 0;\r\n\r\n get currentCalendarViewMode() {\r\n return this._currentCalendarViewMode;\r\n }\r\n\r\n set currentCalendarViewMode(value) {\r\n this._currentCalendarViewMode = value;\r\n this.currentView = CalendarModes[value].name;\r\n }\r\n\r\n _viewDate = new DateTime();\r\n\r\n get viewDate() {\r\n return this._viewDate;\r\n }\r\n\r\n set viewDate(v) {\r\n this._viewDate = v;\r\n if (this.options) this.options.viewDate = v;\r\n }\r\n\r\n /**\r\n * When switching back to the calendar from the clock,\r\n * this sets currentView to the correct calendar view.\r\n */\r\n refreshCurrentView() {\r\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\r\n }\r\n\r\n minimumCalendarViewMode = 0;\r\n currentView: keyof ViewMode = 'calendar';\r\n}\r\n","import { DateTime, Unit } from './datetime';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { OptionsStore } from './utilities/optionsStore';\r\n\r\n/**\r\n * Main class for date validation rules based on the options provided.\r\n */\r\nexport default class Validation {\r\n private optionsStore: OptionsStore;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n }\r\n\r\n /**\r\n * Checks to see if the target date is valid based on the rules provided in the options.\r\n * Granularity can be provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\r\n if (\r\n granularity !== Unit.month &&\r\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\r\n targetDate.weekDay\r\n ) !== -1\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(\r\n this.optionsStore.options.restrictions.minDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(\r\n this.optionsStore.options.restrictions.maxDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds\r\n ) {\r\n if (\r\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0\r\n ) {\r\n for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) {\r\n if (\r\n targetDate.isBetween(\r\n disabledTimeIntervals.from,\r\n disabledTimeIntervals.to\r\n )\r\n )\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0\r\n )\r\n return false;\r\n return this.optionsStore.options.restrictions.disabledDates\r\n .find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0\r\n )\r\n return true;\r\n return this.optionsStore.options.restrictions.enabledDates\r\n .find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n}\r\n","import { DateTime, Unit } from '../datetime';\r\nimport ActionTypes from './action-types';\r\nimport { BaseEvent } from './event-types';\r\n\r\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\r\n\r\nexport class EventEmitter {\r\n private subscribers: ((value?: T) => void)[] = [];\r\n\r\n subscribe(callback: (value: T) => void) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n\r\n unsubscribe(index: number) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n\r\n emit(value?: T) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n}\r\n\r\nexport class EventEmitters {\r\n triggerEvent = new EventEmitter();\r\n viewUpdate = new EventEmitter();\r\n updateDisplay = new EventEmitter();\r\n action = new EventEmitter<{ e: any; action?: ActionTypes }>();\r\n updateViewDate = new EventEmitter();\r\n\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n this.updateViewDate.destroy();\r\n }\r\n}\r\n","import Options from './options';\r\nimport { DateTime } from '../datetime';\r\n\r\nconst DefaultOptions: Options = {\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: []\r\n },\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark'\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined\r\n },\r\n inline: false,\r\n theme: 'auto'\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n defaultDate: undefined,\r\n localization: {\r\n today: 'Go to today',\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n selectMonth: 'Select Month',\r\n previousMonth: 'Previous Month',\r\n nextMonth: 'Next Month',\r\n selectYear: 'Select Year',\r\n previousYear: 'Previous Year',\r\n nextYear: 'Next Year',\r\n selectDecade: 'Select Decade',\r\n previousDecade: 'Previous Decade',\r\n nextDecade: 'Next Decade',\r\n previousCentury: 'Previous Century',\r\n nextCentury: 'Next Century',\r\n pickHour: 'Pick Hour',\r\n incrementHour: 'Increment Hour',\r\n decrementHour: 'Decrement Hour',\r\n pickMinute: 'Pick Minute',\r\n incrementMinute: 'Increment Minute',\r\n decrementMinute: 'Decrement Minute',\r\n pickSecond: 'Pick Second',\r\n incrementSecond: 'Increment Second',\r\n decrementSecond: 'Decrement Second',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n selectTime: 'Select Time',\r\n selectDate: 'Select Date',\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n locale: 'default',\r\n startOfTheWeek: 0,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n dateFormats: {\r\n LTS: 'h:mm:ss T',\r\n LT: 'h:mm T',\r\n L: 'MM/dd/yyyy',\r\n LL: 'MMMM d, yyyy',\r\n LLL: 'MMMM d, yyyy h:mm T',\r\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\r\n },\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n ordinal: (n) => n,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n format: 'L LT'\r\n },\r\n keepInvalid: false,\r\n debug: false,\r\n allowInputToggle: false,\r\n viewDate: new DateTime(),\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n meta: {},\r\n container: undefined\r\n};\r\n\r\nexport default DefaultOptions;\r\n","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport { FormatLocalization } from './options';\r\n\r\n/**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\nexport function tryConvertToDateTime(\r\n this: void,\r\n d: any,\r\n localization: FormatLocalization\r\n): DateTime | null {\r\n if (d.constructor.name === DateTime.name) return d;\r\n if (d.constructor.name === Date.name) {\r\n return DateTime.convert(d);\r\n }\r\n if (typeof d === typeof '') {\r\n const dateTime = DateTime.fromString(d, localization);\r\n if (JSON.stringify(dateTime) === 'null') {\r\n return null;\r\n }\r\n return dateTime;\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\nexport function convertToDateTime(\r\n this: void,\r\n d: any,\r\n optionName: string,\r\n localization: FormatLocalization\r\n): DateTime {\r\n if (typeof d === typeof '' && optionName !== 'input') {\r\n Namespace.errorMessages.dateString();\r\n }\r\n\r\n const converted = tryConvertToDateTime(d, localization);\r\n\r\n if (!converted) {\r\n Namespace.errorMessages.failedToParseDate(\r\n optionName,\r\n d,\r\n optionName === 'input'\r\n );\r\n }\r\n return converted;\r\n}\r\n\r\n/**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\nexport function typeCheckDateArray(\r\n this: void,\r\n optionName: string,\r\n value: any,\r\n providedType: string,\r\n localization: FormatLocalization\r\n) {\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of DateTime or Date'\r\n );\r\n }\r\n for (let i = 0; i < value.length; i++) {\r\n let d = value[i];\r\n const dateTime = convertToDateTime(d, optionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization?.locale ?? 'default');\r\n value[i] = dateTime;\r\n }\r\n}\r\n\r\n/**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\nexport function typeCheckNumberArray(\r\n this: void,\r\n optionName: string,\r\n value: any,\r\n providedType: string\r\n) {\r\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of numbers'\r\n );\r\n }\r\n}\r\n","import Namespace from './namespace';\r\nimport type { FormatLocalization } from './options';\r\nimport { convertToDateTime, typeCheckNumberArray, typeCheckDateArray } from './typeChecker';\r\n\r\ninterface OptionProcessorFunctionArguments {\r\n key: string,\r\n value: any,\r\n providedType: string,\r\n defaultType: string,\r\n path: string,\r\n localization: FormatLocalization;\r\n}\r\n\r\ntype OptionProcessorFunction = (\r\n this: void,\r\n args: OptionProcessorFunctionArguments\r\n) => any;\r\n\r\nfunction mandatoryDate(key: string): OptionProcessorFunction {\r\n return ({ value, providedType, localization }) => {\r\n const dateTime = convertToDateTime(value, key, localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n };\r\n}\r\n\r\nfunction optionalDate(key: string): OptionProcessorFunction {\r\n const mandatory = mandatoryDate(key);\r\n return (args) => {\r\n if (args.value === undefined) {\r\n return args.value;\r\n }\r\n return mandatory(args);\r\n };\r\n}\r\n\r\nfunction numbersInRange(key: string, lower: number, upper: number): OptionProcessorFunction {\r\n return ({ value, providedType }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckNumberArray(\r\n key,\r\n value,\r\n providedType\r\n );\r\n if ((value as number[]).some(x => x < lower || x > upper))\r\n Namespace.errorMessages.numbersOutOfRange(\r\n key,\r\n lower,\r\n upper\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nfunction validHourRange(key: string): OptionProcessorFunction {\r\n return numbersInRange(key, 0, 23);\r\n}\r\n\r\nfunction validDateArray(key: string): OptionProcessorFunction {\r\n return ({ value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckDateArray(\r\n key,\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\r\n return ({ value, path }) => {\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(\r\n path.substring(1),\r\n value,\r\n keyOptions\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nconst optionProcessors: { [key: string]: OptionProcessorFunction; } = Object.freeze({\r\n 'defaultDate': mandatoryDate('defaultDate'),\r\n 'viewDate': mandatoryDate('viewDate'),\r\n 'minDate': optionalDate('restrictions.minDate'),\r\n 'maxDate': optionalDate('restrictions.maxDate'),\r\n 'disabledHours': validHourRange('restrictions.disabledHours'),\r\n 'enabledHours': validHourRange('restrictions.enabledHours'),\r\n 'disabledDates': validDateArray('restrictions.disabledDates'),\r\n 'enabledDates': validDateArray('restrictions.enabledDates'),\r\n 'daysOfWeekDisabled': numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\r\n 'disabledTimeIntervals': ({ key, value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'array of { from: DateTime|Date, to: DateTime|Date }'\r\n );\r\n }\r\n const valueObject = value as { from: any; to: any; }[];\r\n for (let i = 0; i < valueObject.length; i++) {\r\n Object.keys(valueObject[i]).forEach((vk) => {\r\n const subOptionName = `${key}[${i}].${vk}`;\r\n const d = valueObject[i][vk];\r\n const dateTime = convertToDateTime(d, subOptionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n subOptionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization.locale);\r\n valueObject[i][vk] = dateTime;\r\n });\r\n }\r\n return valueObject;\r\n },\r\n 'toolbarPlacement': validKeyOption(['top', 'bottom', 'default']),\r\n 'type': validKeyOption(['icons', 'sprites']),\r\n 'viewMode': validKeyOption(['clock', 'calendar', 'months', 'years', 'decades']),\r\n 'theme': validKeyOption(['light', 'dark', 'auto']),\r\n 'meta': ({ value }) => value,\r\n 'dayViewHeaderFormat': ({ value }) => value,\r\n 'container': ({ value, path }) => {\r\n if (\r\n value &&\r\n !(\r\n value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild\r\n )\r\n ) {\r\n Namespace.errorMessages.typeMismatch(\r\n path.substring(1),\r\n typeof value,\r\n 'HTMLElement'\r\n );\r\n }\r\n return value;\r\n },\r\n 'useTwentyfourHour': ({ value, path, providedType, defaultType }) => {\r\n if (value === undefined || providedType === 'boolean') return value;\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n});\r\n\r\nconst defaultProcessor: OptionProcessorFunction = ({ value, defaultType, providedType, path }) => {\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n};\r\n\r\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\r\n return (optionProcessors[args.key] || defaultProcessor)(args);\r\n}\r\n","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport DefaultOptions from './default-options';\r\nimport Options, { FormatLocalization } from './options';\r\nimport { processKey } from './optionProcessor';\r\nimport { convertToDateTime, tryConvertToDateTime, typeCheckDateArray, typeCheckNumberArray } from './typeChecker';\r\n\r\nexport class OptionConverter {\r\n\r\n private static ignoreProperties = ['meta', 'dayViewHeaderFormat',\r\n 'container', 'dateForms', 'ordinal'];\r\n\r\n static deepCopy(input): Options {\r\n const o = {};\r\n\r\n Object.keys(input).forEach((key) => {\r\n const inputElement = input[key];\r\n\r\n if (inputElement instanceof DateTime) {\r\n o[key] = inputElement.clone\r\n return;\r\n }\r\n else if (inputElement instanceof Date) {\r\n o[key] = new Date(inputElement.valueOf())\r\n }\r\n\r\n o[key] = inputElement;\r\n if (typeof inputElement !== 'object' ||\r\n inputElement instanceof HTMLElement ||\r\n inputElement instanceof Element) return;\r\n if (!Array.isArray(inputElement)) {\r\n o[key] = OptionConverter.deepCopy(inputElement);\r\n }\r\n });\r\n\r\n return o;\r\n }\r\n\r\n private static isValue = a => a != null; // everything except undefined + null\r\n\r\n /**\r\n * Finds value out of an object based on a string, period delimited, path\r\n * @param paths\r\n * @param obj\r\n */\r\n static objectPath(paths: string, obj) {\r\n if (paths.charAt(0) === '.')\r\n paths = paths.slice(1);\r\n if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param localization\r\n */\r\n static spread(provided, copyTo, path = '', localization: FormatLocalization) {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).filter(key => key !== '__proto__' && key !== 'constructor').forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key))) {\r\n OptionConverter.spread(provided[key], copyTo[key], path, localization);\r\n } else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key: string, value: any, providedType: string, defaultType: string, path: string, localization: FormatLocalization) {\r\n return processKey({ key, value, providedType, defaultType, path, localization });\r\n }\r\n\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const localization =\r\n mergeTo.localization?.locale !== 'default'\r\n ? mergeTo.localization\r\n : providedOptions?.localization || DefaultOptions.localization;\r\n\r\n OptionConverter.spread(providedOptions, newConfig, '', localization);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n static _dateTypeCheck(d: any, localization: FormatLocalization): DateTime | null {\r\n return tryConvertToDateTime(d, localization);\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n localization: FormatLocalization\r\n ) {\r\n return typeCheckDateArray(optionName, value, providedType, localization);\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n static _typeCheckNumberArray(\r\n optionName: string,\r\n value,\r\n providedType: string\r\n ) {\r\n return typeCheckNumberArray(optionName, value, providedType);\r\n }\r\n\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n static dateConversion(d: any, optionName: string, localization: FormatLocalization): DateTime {\r\n return convertToDateTime(d, optionName, localization);\r\n }\r\n\r\n private static _flattenDefaults: string[];\r\n\r\n private static getFlattenDefaultOptions(): string[] {\r\n if (this._flattenDefaults) return this._flattenDefaults;\r\n const deepKeys = (t, pre = []) => {\r\n if (Array.isArray(t)) return [];\r\n if (Object(t) === t) {\r\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\r\n } else {\r\n return pre.join('.');\r\n }\r\n };\r\n\r\n this._flattenDefaults = deepKeys(DefaultOptions);\r\n\r\n return this._flattenDefaults;\r\n }\r\n\r\n /**\r\n * Some options conflict like min/max date. Verify that these kinds of options\r\n * are set correctly.\r\n * @param config\r\n */\r\n static _validateConflicts(config: Options) {\r\n if (\r\n config.display.sideBySide &&\r\n (!config.display.components.clock ||\r\n !(\r\n config.display.components.hours ||\r\n config.display.components.minutes ||\r\n config.display.components.seconds\r\n ))\r\n ) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'Cannot use side by side mode without the clock components'\r\n );\r\n }\r\n\r\n if (config.restrictions.minDate && config.restrictions.maxDate) {\r\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'minDate is after maxDate'\r\n );\r\n }\r\n\r\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'maxDate is before minDate'\r\n );\r\n }\r\n }\r\n }\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\r\nimport Validation from './validation';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\n\r\nexport default class Dates {\r\n private _dates: DateTime[] = [];\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n }\r\n\r\n /**\r\n * Returns the array of selected dates\r\n */\r\n get picked(): DateTime[] {\r\n return this._dates;\r\n }\r\n\r\n /**\r\n * Returns the last picked value.\r\n */\r\n get lastPicked(): DateTime {\r\n return this._dates[this.lastPickedIndex];\r\n }\r\n\r\n /**\r\n * Returns the length of picked dates -1 or 0 if none are selected.\r\n */\r\n get lastPickedIndex(): number {\r\n if (this._dates.length === 0) return 0;\r\n return this._dates.length - 1;\r\n }\r\n\r\n /**\r\n * Formats a DateTime object to a string. Used when setting the input value.\r\n * @param date\r\n */\r\n formatInput(date: DateTime): string {\r\n const components = this.optionsStore.options.display.components;\r\n if (!date) return '';\r\n return date.format({\r\n year: components.calendar && components.year ? 'numeric' : undefined,\r\n month: components.calendar && components.month ? '2-digit' : undefined,\r\n day: components.calendar && components.date ? '2-digit' : undefined,\r\n hour:\r\n components.clock && components.hours\r\n ? components.useTwentyfourHour\r\n ? '2-digit'\r\n : 'numeric'\r\n : undefined,\r\n minute: components.clock && components.minutes ? '2-digit' : undefined,\r\n second: components.clock && components.seconds ? '2-digit' : undefined,\r\n hour12: !components.useTwentyfourHour,\r\n });\r\n }\r\n \r\n /**\r\n * parse the value into a DateTime object.\r\n * this can be overwritten to supply your own parsing.\r\n */\r\n parseInput(value:any): DateTime {\r\n return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization);\r\n }\r\n\r\n /**\r\n * Tries to convert the provided value to a DateTime object.\r\n * If value is null|undefined then clear the value of the provided index (or 0).\r\n * @param value Value to convert or null|undefined\r\n * @param index When using multidates this is the index in the array\r\n */\r\n setFromInput(value: any, index?: number) {\r\n if (!value) {\r\n this.setValue(undefined, index);\r\n return;\r\n }\r\n const converted = this.parseInput(value);\r\n if (converted) {\r\n converted.setLocale(this.optionsStore.options.localization.locale);\r\n this.setValue(converted, index);\r\n }\r\n }\r\n\r\n /**\r\n * Adds a new DateTime to selected dates array\r\n * @param date\r\n */\r\n add(date: DateTime): void {\r\n this._dates.push(date);\r\n }\r\n\r\n /**\r\n * Returns true if the `targetDate` is part of the selected dates array.\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this._dates.find((x) => x === targetDate) !== undefined;\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return (\r\n this._dates\r\n .map((x) => x.format(format))\r\n .find((x) => x === innerDateFormatted) !== undefined\r\n );\r\n }\r\n\r\n /**\r\n * Returns the index at which `targetDate` is in the array.\r\n * This is used for updating or removing a date when multi-date is used\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\r\n if (!unit) return this._dates.indexOf(targetDate);\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\r\n }\r\n\r\n /**\r\n * Clears all selected dates.\r\n */\r\n clear() {\r\n this.optionsStore.unset = true;\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate: this.lastPicked,\r\n isClear: true,\r\n isValid: true,\r\n } as ChangeEvent);\r\n this._dates = [];\r\n }\r\n\r\n /**\r\n * Find the \"book end\" years given a `year` and a `factor`\r\n * @param factor e.g. 100 for decades\r\n * @param year e.g. 2021\r\n */\r\n static getStartEndYear(\r\n factor: number,\r\n year: number\r\n ): [number, number, number] {\r\n const step = factor / 10,\r\n startYear = Math.floor(year / factor) * factor,\r\n endYear = startYear + step * 9,\r\n focusValue = Math.floor(year / step) * step;\r\n return [startYear, endYear, focusValue];\r\n }\r\n\r\n /**\r\n * Attempts to either clear or set the `target` date at `index`.\r\n * If the `target` is null then the date will be cleared.\r\n * If multi-date is being used then it will be removed from the array.\r\n * If `target` is valid and multi-date is used then if `index` is\r\n * provided the date at that index will be replaced, otherwise it is appended.\r\n * @param target\r\n * @param index\r\n */\r\n setValue(target?: DateTime, index?: number): void {\r\n const noIndex = typeof index === 'undefined',\r\n isClear = !target && noIndex;\r\n let oldDate = this.optionsStore.unset ? null : this._dates[index];\r\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\r\n oldDate = this.lastPicked;\r\n }\r\n\r\n const updateInput = () => {\r\n if (!this.optionsStore.input) return;\r\n\r\n let newValue = this.formatInput(target);\r\n if (this.optionsStore.options.multipleDates) {\r\n newValue = this._dates\r\n .map((d) => this.formatInput(d))\r\n .join(this.optionsStore.options.multipleDatesSeparator);\r\n }\r\n if (this.optionsStore.input.value != newValue)\r\n this.optionsStore.input.value = newValue;\r\n };\r\n\r\n if (target && oldDate?.isSame(target)) {\r\n updateInput();\r\n return;\r\n }\r\n\r\n // case of calling setValue(null)\r\n if (!target) {\r\n if (\r\n !this.optionsStore.options.multipleDates ||\r\n this._dates.length === 1 ||\r\n isClear\r\n ) {\r\n this.optionsStore.unset = true;\r\n this._dates = [];\r\n } else {\r\n this._dates.splice(index, 1);\r\n }\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n\r\n this._eventEmitters.updateDisplay.emit('all');\r\n return;\r\n }\r\n\r\n index = index || 0;\r\n target = target.clone;\r\n\r\n // minute stepping is being used, force the minute to the closest value\r\n if (this.optionsStore.options.stepping !== 1) {\r\n target.minutes =\r\n Math.round(target.minutes / this.optionsStore.options.stepping) *\r\n this.optionsStore.options.stepping;\r\n target.seconds = 0;\r\n }\r\n\r\n if (this.validation.isValid(target)) {\r\n this._dates[index] = target;\r\n this._eventEmitters.updateViewDate.emit(target.clone);\r\n\r\n updateInput();\r\n\r\n this.optionsStore.unset = false;\r\n this._eventEmitters.updateDisplay.emit('all');\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.keepInvalid) {\r\n this._dates[index] = target;\r\n this._eventEmitters.updateViewDate.emit(target.clone);\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: false,\r\n } as ChangeEvent);\r\n }\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToSetInvalidDate,\r\n date: target,\r\n oldDate,\r\n } as FailEvent);\r\n }\r\n}\r\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport Dates from \"../../dates\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `date`\r\n */\r\nexport default class DateDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.daysContainer);\r\n\r\n container.append(...this._daysOfTheWeek());\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n\r\n for (let i = 0; i < 42; i++) {\r\n if (i !== 0 && i % 7 === 0) {\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n container.appendChild(div);\r\n }\r\n }\r\n\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDay);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.daysContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"calendar\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.daysContainer,\r\n this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n )\r\n );\r\n\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\r\n Unit.month\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\r\n Unit.month\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n\r\n container\r\n .querySelectorAll(\r\n `[data-action=\"${ActionTypes.selectDay}\"], .${Namespace.css.calendarWeeks}`\r\n )\r\n .forEach((containerClone: HTMLElement) => {\r\n if (\r\n this.optionsStore.options.display.calendarWeeks &&\r\n containerClone.classList.contains(Namespace.css.calendarWeeks)\r\n ) {\r\n if (containerClone.innerText === \"#\") return;\r\n containerClone.innerText = `${innerDate.week}`;\r\n return;\r\n }\r\n\r\n let classes: string[] = [];\r\n classes.push(Namespace.css.day);\r\n\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.date)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n\r\n paint(Unit.date, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`\r\n );\r\n containerClone.setAttribute(\"data-day\", `${innerDate.date}`);\r\n containerClone.innerText = innerDate.format({ day: \"numeric\" });\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n\r\n /***\r\n * Generates an html row that contains the days of the week.\r\n * @private\r\n */\r\n private _daysOfTheWeek(): HTMLElement[] {\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement(\"div\");\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = \"#\";\r\n row.push(htmlDivElement);\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.dayOfTheWeek,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = innerDate.format({ weekday: \"short\" });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n\r\n return row;\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { Paint } from '../index';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `month`\r\n */\r\nexport default class MonthDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMonth);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.monthsContainer\r\n )[0];\r\n\r\n if(this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switcher.setAttribute(\r\n Namespace.css.monthsContainer,\r\n this.optionsStore.viewDate.format({ year: 'numeric' })\r\n );\r\n\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\r\n Unit.year\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\r\n Unit.year\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n let classes = [];\r\n classes.push(Namespace.css.month);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n}\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Dates from \"../../dates\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `year`\r\n */\r\nexport default class YearDisplay {\r\n private _startYear: DateTime;\r\n private _endYear: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.yearsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectYear);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.yearsContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"years\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.yearsContainer,\r\n `${this._startYear.format({ year: \"numeric\" })}-${this._endYear.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.year);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\"data-value\", `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: \"numeric\" });\r\n\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n}\r\n","import Dates from \"../../dates\";\r\nimport { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class DecadeDisplay {\r\n private _startDecade: DateTime;\r\n private _endDecade: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.decadesContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n const [start, end] = Dates.getStartEndYear(\r\n 100,\r\n this.optionsStore.viewDate.year\r\n );\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.decadesContainer\r\n )[0];\r\n\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(\r\n Namespace.css.decadesContainer,\r\n `${this._startDecade.format({ year: \"numeric\" })}-${this._endDecade.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = \" \";\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute(\"data-value\", ``);\r\n return;\r\n } else {\r\n containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: \"numeric\" });\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n return;\r\n }\r\n }\r\n\r\n let classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n\r\n paint(\"decade\", this._startDecade, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n containerClone.innerText = `${this._startDecade.format({ year: \"numeric\" })}`;\r\n\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates the clock display\r\n */\r\nexport default class TimeDisplay {\r\n private _gridColumns = '';\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n\r\n container.append(...this._grid(iconTag));\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget: HTMLElement): void {\r\n const timesDiv = (\r\n widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0]\r\n );\r\n const lastPicked = (\r\n this.dates.lastPicked || this.optionsStore.viewDate\r\n ).clone;\r\n\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.hours}]`\r\n ).innerText = this.optionsStore.options.display.components.useTwentyfourHour\r\n ? lastPicked.hoursFormatted\r\n : lastPicked.twelveHoursFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.minutes}]`\r\n ).innerText = lastPicked.minutesFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.seconds}]`\r\n ).innerText = lastPicked.secondsFormatted;\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n const toggle = timesDiv.querySelector(\r\n `[data-action=${ActionTypes.toggleMeridiem}]`\r\n );\r\n\r\n toggle.innerText = lastPicked.meridiem();\r\n\r\n if (\r\n !this.validation.isValid(\r\n lastPicked.clone.manipulate(\r\n lastPicked.hours >= 12 ? -12 : 12,\r\n Unit.hours\r\n )\r\n )\r\n ) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n } else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\r\n this._gridColumns = '';\r\n const top = [],\r\n middle = [],\r\n bottom = [],\r\n separator = document.createElement('div'),\r\n upIcon = iconTag(\r\n this.optionsStore.options.display.icons.up\r\n ),\r\n downIcon = iconTag(\r\n this.optionsStore.options.display.icons.down\r\n );\r\n\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n\r\n const getSeparator = (colon = false): HTMLElement => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n\r\n let button = document.createElement('button');\r\n button.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.toggleMeridiem\r\n );\r\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) { //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else button.classList.add(Namespace.css.toggleMeridiem);\r\n\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n\r\n this._gridColumns = this._gridColumns.trim();\r\n\r\n return [...top, ...middle, ...bottom];\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `hours`\r\n */\r\nexport default class HourDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n\r\n for (\r\n let i = 0;\r\n i <\r\n (this.optionsStore.options.display.components.useTwentyfourHour ? 24 : 12);\r\n i++\r\n ) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectHour);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.hourContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.hour);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = this.optionsStore.options.display.components\r\n .useTwentyfourHour\r\n ? innerDate.hoursFormatted\r\n : innerDate.twelveHoursFormatted;\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `minutes`\r\n */\r\nexport default class MinuteDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMinute);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.minuteContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.minute);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n 'data-value',\r\n `${innerDate.minutes}`\r\n );\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class secondDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectSecond);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.secondContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.second);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n}\r\n","import Namespace from '../utilities/namespace';\r\n\r\n/**\r\n * Provides a collapse functionality to the view changes\r\n */\r\nexport default class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target: HTMLElement) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n } else {\r\n this.show(target);\r\n }\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n if (!target) return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport Namespace from '../utilities/namespace';\r\nimport { HideEvent } from '../utilities/event-types';\r\nimport Collapse from './collapse';\r\nimport Validation from '../validation';\r\nimport Dates from '../dates';\r\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\r\nimport { serviceLocator } from '../utilities/service-locator';\r\nimport ActionTypes from '../utilities/action-types';\r\nimport CalendarModes from '../utilities/calendar-modes';\r\nimport { OptionsStore } from '../utilities/optionsStore';\r\n\r\n/**\r\n * Main class for all things display related.\r\n */\r\nexport default class Display {\r\n private _widget: HTMLElement;\r\n private _popperInstance: any;\r\n private _isVisible = false;\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n dateDisplay: DateDisplay;\r\n monthDisplay: MonthDisplay;\r\n yearDisplay: YearDisplay;\r\n decadeDisplay: DecadeDisplay;\r\n timeDisplay: TimeDisplay;\r\n hourDisplay: HourDisplay;\r\n minuteDisplay: MinuteDisplay;\r\n secondDisplay: SecondDisplay;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n\r\n this.dateDisplay = serviceLocator.locate(DateDisplay);\r\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\r\n this.yearDisplay = serviceLocator.locate(YearDisplay);\r\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\r\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\r\n this.hourDisplay = serviceLocator.locate(HourDisplay);\r\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\r\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._widget = undefined;\r\n\r\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\r\n this._update(result);\r\n });\r\n }\r\n\r\n /**\r\n * Returns the widget body or undefined\r\n * @private\r\n */\r\n get widget(): HTMLElement | undefined {\r\n return this._widget;\r\n }\r\n\r\n /**\r\n * Returns this visible state of the picker (shown)\r\n */\r\n get isVisible() {\r\n return this._isVisible;\r\n }\r\n\r\n /**\r\n * Updates the table for a particular unit. Used when an option as changed or\r\n * whenever the class list might need to be refreshed.\r\n * @param unit\r\n * @private\r\n */\r\n _update(unit: ViewUpdateValues): void {\r\n if (!this.widget) return;\r\n //todo do I want some kind of error catching or other guards here?\r\n switch (unit) {\r\n case Unit.seconds:\r\n this.secondDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.minutes:\r\n this.minuteDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.hours:\r\n this.hourDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.date:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.month:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.year:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'clock':\r\n if (!this._hasTime) break;\r\n this.timeDisplay._update(this.widget);\r\n this._update(Unit.hours);\r\n this._update(Unit.minutes);\r\n this._update(Unit.seconds);\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n this._update(Unit.year);\r\n this._update(Unit.month);\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n this._updateCalendarHeader();\r\n break;\r\n case 'all':\r\n if (this._hasTime) {\r\n this._update('clock');\r\n }\r\n if (this._hasDate) {\r\n this._update('calendar');\r\n }\r\n }\r\n }\r\n\r\n // noinspection JSUnusedLocalSymbols\r\n /**\r\n * Allows developers to add/remove classes from an element.\r\n * @param _unit\r\n * @param _date\r\n * @param _classes\r\n * @param _element\r\n */\r\n paint(\r\n _unit: Unit | 'decade',\r\n _date: DateTime,\r\n _classes: string[],\r\n _element: HTMLElement\r\n ) {\r\n // implemented in plugin\r\n }\r\n\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * fires Events#show\r\n */\r\n show(): void {\r\n if (this.widget == undefined) {\r\n if (this.dates.picked.length == 0) {\r\n if (\r\n this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate\r\n ) {\r\n const date = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (\r\n this.optionsStore.options.restrictions.maxDate?.isBefore(date)\r\n ) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date)) {\r\n date.manipulate(direction, Unit.date);\r\n if (tries > 31) break;\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n\r\n this._buildWidget();\r\n this._updateTheme();\r\n\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n // otherwise return to the calendar view\r\n if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n\r\n if (\r\n !onlyClock &&\r\n this.optionsStore.options.display.viewMode !== 'clock'\r\n ) {\r\n if (this._hasTime) {\r\n if(!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n } else {\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n }\r\n }\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.dateContainer}`)\r\n );\r\n }\r\n\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n container.appendChild(this.widget);\r\n this.createPopup(this.optionsStore.element, this.widget, {\r\n modifiers: [{ name: 'eventListeners', enabled: true }],\r\n //#2400\r\n placement:\r\n document.documentElement.dir === 'rtl'\r\n ? 'bottom-end'\r\n : 'bottom-start',\r\n }).then();\r\n } else {\r\n this.optionsStore.element.appendChild(this.widget);\r\n }\r\n\r\n if (this.optionsStore.options.display.viewMode == 'clock') {\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.addEventListener('click', this._actionsClickEvent)\r\n );\r\n\r\n // show the clock when using sideBySide\r\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\r\n this.timeDisplay._update(this.widget);\r\n (\r\n this.widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0] as HTMLElement\r\n ).style.display = 'grid';\r\n }\r\n }\r\n\r\n this.widget.classList.add(Namespace.css.show);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.updatePopup();\r\n document.addEventListener('click', this._documentClickEvent);\r\n }\r\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\r\n this._isVisible = true;\r\n }\r\n\r\n async createPopup(element: HTMLElement, widget: HTMLElement, options: any): Promise {\r\n let createPopperFunction;\r\n if((window as any)?.Popper) {\r\n createPopperFunction = (window as any)?.Popper?.createPopper;\r\n }\r\n else {\r\n const { createPopper } = await import('@popperjs/core');\r\n createPopperFunction = createPopper;\r\n }\r\n if(createPopperFunction){\r\n this._popperInstance = createPopperFunction(element, widget, options);\r\n }\r\n }\r\n\r\n updatePopup(): void {\r\n this._popperInstance?.update();\r\n }\r\n\r\n /**\r\n * Changes the calendar view mode. E.g. month <-> year\r\n * @param direction -/+ number to move currentViewMode\r\n * @private\r\n */\r\n _showMode(direction?: number): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (direction) {\r\n const max = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\r\n );\r\n if (this.optionsStore.currentCalendarViewMode == max) return;\r\n this.optionsStore.currentCalendarViewMode = max;\r\n }\r\n\r\n this.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\r\n )\r\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\r\n\r\n const datePickerMode =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n let picker: HTMLElement = this.widget.querySelector(\r\n `.${datePickerMode.className}`\r\n );\r\n\r\n switch (datePickerMode.className) {\r\n case Namespace.css.decadesContainer:\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.daysContainer:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n }\r\n\r\n picker.style.display = 'grid';\r\n this._updateCalendarHeader();\r\n this._eventEmitters.viewUpdate.emit();\r\n }\r\n\r\n /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme) return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n } else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n\r\n _getThemeClass(): string {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\r\n\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n\r\n _updateCalendarHeader() {\r\n const showing = [\r\n ...this.widget.querySelector(\r\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\r\n ).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousCentury\r\n );\r\n switcher.setAttribute('title', '');\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextCentury\r\n );\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousDecade\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDecade\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextDecade\r\n );\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousYear\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectYear\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextYear\r\n );\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousMonth\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectMonth\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextMonth\r\n );\r\n switcher.innerText = this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n );\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * fires Events#hide\r\n */\r\n hide(): void {\r\n if (!this.widget || !this._isVisible) return;\r\n\r\n this.widget.classList.remove(Namespace.css.show);\r\n\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset\r\n ? null\r\n : this.dates.lastPicked\r\n ? this.dates.lastPicked.clone\r\n : void 0,\r\n } as HideEvent);\r\n this._isVisible = false;\r\n }\r\n\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget) return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.removeEventListener('click', this._actionsClickEvent)\r\n );\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n private _buildWidget(): HTMLElement {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(\r\n this.getHeadTemplate(),\r\n this.decadeDisplay.getPicker(),\r\n this.yearDisplay.getPicker(),\r\n this.monthDisplay.getPicker(),\r\n this.dateDisplay.getPicker()\r\n );\r\n\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n\r\n if (\r\n this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n if (this._hasDate) {\r\n if (this._hasTime) {\r\n dateView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode !== 'clock')\r\n dateView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(dateView);\r\n }\r\n\r\n if (this._hasTime) {\r\n if (this._hasDate) {\r\n timeView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode === 'clock')\r\n timeView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(timeView);\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n\r\n this._widget = template;\r\n }\r\n\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds)\r\n );\r\n }\r\n\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date)\r\n );\r\n }\r\n\r\n /**\r\n * Get the toolbar html based on options like buttons.today\r\n * @private\r\n */\r\n getToolbarElements(): HTMLElement[] {\r\n const toolbar = [];\r\n\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.today)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (\r\n !this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n } else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.togglePicker);\r\n div.setAttribute('title', title);\r\n\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.clear)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.close)\r\n );\r\n toolbar.push(div);\r\n }\r\n\r\n return toolbar;\r\n }\r\n\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate(): HTMLElement {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes.previous);\r\n previous.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.previous)\r\n );\r\n\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\r\n\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes.next);\r\n next.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.next)\r\n );\r\n\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons.type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass: string): HTMLElement | SVGElement {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n const icon = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'use'\r\n );\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n private _documentClickEvent = (e: MouseEvent) => {\r\n if (this.optionsStore.options.debug || (window as any).debug) return;\r\n\r\n if (\r\n this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n private _actionsClickEvent = (e: MouseEvent) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n if (wasVisible) this.hide();\r\n this._dispose();\r\n if (wasVisible) {\r\n this.show();\r\n }\r\n }\r\n}\r\n\r\nexport type Paint = (\r\n unit: Unit | 'decade',\r\n innerDate: DateTime,\r\n classes: string[],\r\n element: HTMLElement\r\n) => void;\r\n","import { DateTime, Unit } from \"./datetime\";\r\nimport Collapse from \"./display/collapse\";\r\nimport Namespace from \"./utilities/namespace\";\r\nimport Dates from \"./dates\";\r\nimport Validation from \"./validation\";\r\nimport Display from \"./display\";\r\nimport { EventEmitters } from \"./utilities/event-emitter\";\r\nimport { serviceLocator } from \"./utilities/service-locator.js\";\r\nimport ActionTypes from \"./utilities/action-types\";\r\nimport CalendarModes from \"./utilities/calendar-modes\";\r\nimport { OptionsStore } from \"./utilities/optionsStore\";\r\n\r\n/**\r\n *\r\n */\r\nexport default class Actions {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n private display: Display;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n do(e: any, action?: ActionTypes) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return false;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n\r\n switch (action) {\r\n case ActionTypes.next:\r\n case ActionTypes.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.selectMonth:\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n\r\n if (\r\n this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode\r\n ) {\r\n this.dates.setValue(\r\n this.optionsStore.viewDate,\r\n this.dates.lastPickedIndex\r\n );\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n } else {\r\n this.display._showMode(-1);\r\n }\r\n break;\r\n case ActionTypes.selectDay:\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n\r\n day.date = +currentTarget.dataset.day;\r\n let index = 0;\r\n if (this.optionsStore.options.multipleDates) {\r\n index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex + 1);\r\n }\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n\r\n if (\r\n !this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates\r\n ) {\r\n this.display.hide();\r\n }\r\n break;\r\n case ActionTypes.selectHour:\r\n let hour = +currentTarget.dataset.value;\r\n if (\r\n lastPicked.hours >= 12 &&\r\n !this.optionsStore.options.display.components.useTwentyfourHour\r\n )\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectMinute:\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectSecond:\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes.incrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping\r\n );\r\n break;\r\n case ActionTypes.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes.decrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping * -1\r\n );\r\n break;\r\n case ActionTypes.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes.toggleMeridiem:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.hours,\r\n this.dates.lastPicked.hours >= 12 ? -12 : 12\r\n );\r\n break;\r\n case ActionTypes.togglePicker:\r\n if (\r\n currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate\r\n ) {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectTime\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.time\r\n ).outerHTML;\r\n\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n } else {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDate\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.date\r\n ).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n\r\n this.display.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\r\n )\r\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n break;\r\n case ActionTypes.showClock:\r\n case ActionTypes.showHours:\r\n case ActionTypes.showMinutes:\r\n case ActionTypes.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this._eventEmitters.updateViewDate.emit(today);\r\n\r\n //todo this this really a good idea?\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport { OptionsStore } from './utilities/optionsStore';\r\nimport { OptionConverter } from './utilities/optionConverter';\r\nimport { ErrorMessages } from './utilities/errors';\r\n\r\n/**\r\n * A robust and powerful date/time picker component.\r\n */\r\nclass TempusDominus {\r\n _subscribers: { [key: string]: ((event: any) => {})[] } = {};\r\n private _isDisabled = false;\r\n private _toggle: HTMLElement;\r\n private _currentPromptTimeTimeout: any;\r\n private actions: Actions;\r\n private optionsStore: OptionsStore;\r\n private _eventEmitters: EventEmitters;\r\n display: Display;\r\n dates: Dates;\r\n\r\n constructor(element: HTMLElement, options: Options = {} as Options) {\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.unset = true;\r\n\r\n this._initializeInput();\r\n this._initializeToggle();\r\n\r\n if (this.optionsStore.options.display.inline) this.display.show();\r\n\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n\r\n this._eventEmitters.updateViewDate.subscribe(dateTime => {\r\n this.viewDate = dateTime;\r\n });\r\n }\r\n\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n\r\n set viewDate(value) {\r\n this.optionsStore.viewDate = value;\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.display._update(this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false): void {\r\n if (reset) this._initializeOptions(options, DefaultOptions);\r\n else this._initializeOptions(options, this.optionsStore.options);\r\n this.display._rebuild();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle(): void {\r\n if (this._isDisabled) return;\r\n this.display.toggle();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show(): void {\r\n if (this._isDisabled) return;\r\n this.display.show();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide(): void {\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable(): void {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable(): void {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear(): void {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(\r\n eventTypes: string | string[],\r\n callbacks: (event: any) => void | ((event: any) => void)[]\r\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray: any[];\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n } else {\r\n callBackArray = callbacks;\r\n }\r\n\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n\r\n const returnArray = [];\r\n\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(\r\n this,\r\n eventType,\r\n this._subscribers[eventType].length - 1\r\n )\r\n });\r\n\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n\r\n return returnArray;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this._eventEmitters.destroy();\r\n this.optionsStore.input?.removeEventListener(\r\n 'change',\r\n this._inputChangeEvent\r\n );\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener(\r\n 'click',\r\n this._toggleClickEvent\r\n );\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language: string) {\r\n let asked = loadedLocales[language];\r\n if (!asked) return;\r\n this.updateOptions({\r\n localization: asked\r\n });\r\n }\r\n\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n private _triggerEvent(event: BaseEvent) {\r\n event.viewMode = this.optionsStore.currentView;\r\n\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event as ChangeEvent;\r\n if (\r\n (date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)\r\n ) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event as ChangeEvent);\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent('change', { detail: event as any })\r\n );\r\n }\r\n\r\n this.optionsStore.element.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n if ((window as any).jQuery) {\r\n const $ = (window as any).jQuery;\r\n\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n } else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n\r\n this._publish(event);\r\n }\r\n\r\n private _publish(event: BaseEvent) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n private _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone\r\n } as ViewUpdateEvent);\r\n }\r\n\r\n private _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n private _initializeOptions(\r\n config: Options,\r\n mergeTo: Options,\r\n includeDataset = false\r\n ): void {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n newConfig\r\n );\r\n\r\n OptionConverter._validateConflicts(newConfig);\r\n\r\n newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n this.optionsStore.currentCalendarViewMode\r\n );\r\n\r\n // Update view mode if needed\r\n if (\r\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\r\n this.optionsStore.minimumCalendarViewMode\r\n );\r\n }\r\n\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n\r\n if (newConfig.display.components.useTwentyfourHour === undefined) {\r\n newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod;\r\n }\r\n\r\n this.optionsStore.options = newConfig;\r\n }\r\n\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n private _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\r\n } else {\r\n let query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n } else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n\r\n if (!this.optionsStore.input) return;\r\n\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n private _initializeToggle() {\r\n if (this.optionsStore.options.display.inline) return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n private _handleAfterChangeEvent(e: ChangeEvent) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer)\r\n )\r\n return;\r\n\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if (\r\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))\r\n ) {\r\n return;\r\n }\r\n\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector(\r\n `.${Namespace.css.switch} div`\r\n )\r\n },\r\n action: ActionTypes.togglePicker\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _inputChangeEvent = (event?: any) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered) return;\r\n\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.viewDate = this.dates.lastPicked.clone;\r\n };\r\n\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates) {\r\n try {\r\n const valueSplit = value.split(\r\n this.optionsStore.options.multipleDatesSeparator\r\n );\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n } catch {\r\n console.warn(\r\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\r\n );\r\n }\r\n } else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _toggleClickEvent = () => {\r\n if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return;\r\n this.toggle();\r\n };\r\n}\r\n\r\n/**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\nconst loadedLocales = {};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\nconst loadLocale = (l) => {\r\n if (loadedLocales[l.name]) return;\r\n loadedLocales[l.name] = l.localization;\r\n};\r\n\r\n/**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\nconst locale = (l: string) => {\r\n let asked = loadedLocales[l];\r\n if (!asked) return;\r\n DefaultOptions.localization = asked;\r\n};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\nconst extend = function(plugin, option) {\r\n if (!plugin) return tempusDominus;\r\n if (!plugin.installed) {\r\n // install plugin only once\r\n plugin(option, { TempusDominus, Dates, Display, DateTime, ErrorMessages }, tempusDominus);\r\n plugin.installed = true;\r\n }\r\n return tempusDominus;\r\n};\r\n\r\nconst version = '6.2.5';\r\n\r\nconst tempusDominus = {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version\r\n};\r\n\r\nexport {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version,\r\n DateTimeFormatOptions,\r\n Options\r\n};\r\n"],"names":["ActionTypes","SecondDisplay"],"mappings":";;;;;IAAY,KAOX;AAPD,CAAA,UAAY,IAAI,EAAA;AACd,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAPW,IAAI,KAAJ,IAAI,GAOf,EAAA,CAAA,CAAA,CAAA;AAED,MAAM,gBAAgB,GAAG;AACvB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,GAAG,EAAE,SAAS;AACd,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,IAAI;CACb,CAAA;AAED,MAAM,0BAA0B,GAAG;AACjC,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,MAAM,EAAE,KAAK;CACd,CAAA;AAQM,MAAM,eAAe,GAAG,CAAC,IAAU,KAAY;AACpD,I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AAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC;AACzC,EAAE;AAEF;;;;AAIG;AACH,MAAM,MAAM,GAAG,CAAC,CAAS,KAAI;AAC3B,IAAA,IAAI,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAC7B,IAAA,IAAI,CAAC,KAAK;QAAE,OAAO;AACnB,IAAA,cAAc,CAAC,YAAY,GAAG,KAAK,CAAC;AACtC,EAAE;AAEF;AACA;;;;AAIG;AACH,MAAM,MAAM,GAAG,UAAS,MAAM,EAAE,MAAM,EAAA;AACpC,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,aAAa,CAAC;AAClC,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;;AAErB,QAAA,MAAM,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,aAAa,CAAC,CAAC;AAC1F,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;AACzB,KAAA;AACD,IAAA,OAAO,aAAa,CAAC;AACvB,EAAE;AAEI,MAAA,OAAO,GAAG,QAAQ;AAExB,MAAM,aAAa,GAAG;IACpB,aAAa;IACb,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,cAAc;IACd,QAAQ;IACR,IAAI;IACJ,OAAO;CACR;;;;"} \ No newline at end of file +{"version":3,"file":"tempus-dominus.esm.js","sources":["../../src/js/datetime.ts","../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/typeChecker.ts","../../src/js/utilities/optionProcessor.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export enum Unit {\r\n seconds = 'seconds',\r\n minutes = 'minutes',\r\n hours = 'hours',\r\n date = 'date',\r\n month = 'month',\r\n year = 'year',\r\n}\r\n\r\nconst twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: true,\r\n}\r\n\r\nconst twoDigitTwentyFourTemplate = {\r\n hour: '2-digit',\r\n hour12: false\r\n}\r\n\r\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\r\n timeStyle?: 'short' | 'medium' | 'long';\r\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\r\n numberingSystem?: string;\r\n}\r\n\r\nexport const getFormatByUnit = (unit: Unit): object => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric'\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n};\r\n\r\n/**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\nexport class DateTime extends Date {\r\n /**\r\n * Used with Intl.DateTimeFormat\r\n */\r\n locale = 'default';\r\n\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n */\r\n setLocale(value: string): this {\r\n this.locale = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale\r\n */\r\n static convert(date: Date, locale: string = 'default'): DateTime {\r\n if (!date) throw new Error(`A date is required`);\r\n return new DateTime(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ).setLocale(locale);\r\n }\r\n\r\n /**\r\n * Attempts to create a DateTime from a string. A customDateFormat is required for non US dates.\r\n * @param input\r\n * @param localization\r\n */\r\n static fromString(input: string, localization: any): DateTime {\r\n return new DateTime(input);\r\n }\r\n\r\n /**\r\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\r\n */\r\n get clone() {\r\n return new DateTime(\r\n this.year,\r\n this.month,\r\n this.date,\r\n this.hours,\r\n this.minutes,\r\n this.seconds,\r\n this.getMilliseconds()\r\n ).setLocale(this.locale);\r\n }\r\n\r\n /**\r\n * Sets the current date to the start of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\r\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\r\n * @param unit\r\n * @param startOfTheWeek Allows for the changing the start of the week.\r\n */\r\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(0);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(0, 0);\r\n break;\r\n case 'hours':\r\n this.setMinutes(0, 0, 0);\r\n break;\r\n case 'date':\r\n this.setHours(0, 0, 0, 0);\r\n break;\r\n case 'weekDay':\r\n this.startOf(Unit.date);\r\n if (this.weekDay === startOfTheWeek) break;\r\n let goBack = this.weekDay;\r\n if (startOfTheWeek !== 0 && this.weekDay === 0) goBack = 8 - startOfTheWeek;\r\n this.manipulate(startOfTheWeek - goBack, Unit.date);\r\n break;\r\n case 'month':\r\n this.startOf(Unit.date);\r\n this.setDate(1);\r\n break;\r\n case 'year':\r\n this.startOf(Unit.date);\r\n this.setMonth(0, 1);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the current date to the end of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\r\n * would return April 30, 2021, 11:59:59.999 PM\r\n * @param unit\r\n * @param startOfTheWeek\r\n */\r\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(999);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(59, 999);\r\n break;\r\n case 'hours':\r\n this.setMinutes(59, 59, 999);\r\n break;\r\n case 'date':\r\n this.setHours(23, 59, 59, 999);\r\n break;\r\n case 'weekDay':\r\n this.endOf(Unit.date);\r\n const endOfWeek = (6 + startOfTheWeek);\r\n if (this.weekDay === endOfWeek) break;\r\n this.manipulate(endOfWeek - this.weekDay, Unit.date);\r\n break;\r\n case 'month':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.month);\r\n this.setDate(0);\r\n break;\r\n case 'year':\r\n this.endOf(Unit.date);\r\n this.setMonth(11, 31);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Change a {@link unit} value. Value can be positive or negative\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\r\n * would return May 30, 2021, 11:45:32.984 AM\r\n * @param value A positive or negative number\r\n * @param unit\r\n */\r\n manipulate(value: number, unit: Unit): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n this[unit] += value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a string format.\r\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\r\n * for valid templates and locale objects\r\n * @param template An object. Uses browser defaults otherwise.\r\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\r\n */\r\n format(template: DateTimeFormatOptions, locale = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, template).format(this);\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is before this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isBefore(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() < compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is after this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isAfter(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() > compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is same this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isSame(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() === compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n compare = DateTime.convert(compare);\r\n return (\r\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\r\n * @param left\r\n * @param right\r\n * @param unit.\r\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\r\n * If the inclusivity parameter is used, both indicators must be passed.\r\n */\r\n isBetween(\r\n left: DateTime,\r\n right: DateTime,\r\n unit?: Unit,\r\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\r\n ): boolean {\r\n if (unit && this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n const leftInclusivity = inclusivity[0] === '(';\r\n const rightInclusivity = inclusivity[1] === ')';\r\n\r\n return (leftInclusivity\r\n ? this.isAfter(left, unit)\r\n : !this.isBefore(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isBefore(right, unit)\r\n : !this.isAfter(right, unit)) ||\r\n (leftInclusivity\r\n ? this.isBefore(left, unit)\r\n : !this.isAfter(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isAfter(right, unit)\r\n : !this.isBefore(right, unit));\r\n }\r\n\r\n /**\r\n * Returns flattened object of the date. Does not include literals\r\n * @param locale\r\n * @param template\r\n */\r\n parts(\r\n locale = this.locale,\r\n template: any = { dateStyle: 'full', timeStyle: 'long' }\r\n ): any {\r\n const parts = {};\r\n new Intl.DateTimeFormat(locale, template)\r\n .formatToParts(this)\r\n .filter((x) => x.type !== 'literal')\r\n .forEach((x) => (parts[x.type] = x.value));\r\n return parts;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getSeconds()\r\n */\r\n get seconds(): number {\r\n return this.getSeconds();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setSeconds()\r\n */\r\n set seconds(value: number) {\r\n this.setSeconds(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get secondsFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).second;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMinutes()\r\n */\r\n get minutes(): number {\r\n return this.getMinutes();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMinutes()\r\n */\r\n set minutes(value: number) {\r\n this.setMinutes(value);\r\n }\r\n\r\n /**\r\n * Returns two digit minutes\r\n */\r\n get minutesFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).minute;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getHours()\r\n */\r\n get hours(): number {\r\n return this.getHours();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setHours()\r\n */\r\n set hours(value: number) {\r\n this.setHours(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get hoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n }\r\n\r\n /**\r\n * Returns two digit hours but in twelve hour mode e.g. 13 -> 1\r\n */\r\n get twelveHoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).hour;\r\n }\r\n\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale: string = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true\r\n } as any)\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date(): number {\r\n return this.getDate();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value: number) {\r\n this.setDate(value);\r\n }\r\n\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay(): number {\r\n return this.getDay();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month(): number {\r\n return this.getMonth();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value: number) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year(): number {\r\n return this.getFullYear();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value: number) {\r\n this.setFullYear(value);\r\n }\r\n\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week(): number {\r\n const ordinal = this.computeOrdinal(),\r\n weekday = this.getUTCDay();\r\n\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear(this.year - 1);\r\n } else if (weekNumber > this.weeksInWeekYear(this.year)) {\r\n weekNumber = 1;\r\n }\r\n\r\n return weekNumber;\r\n }\r\n\r\n weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 =\r\n (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n\r\n get isLeapYear() {\r\n return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);\r\n }\r\n\r\n private computeOrdinal() {\r\n return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];\r\n }\r\n\r\n private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\r\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n}\r\n","export class TdError extends Error {\r\n code: number;\r\n}\r\n\r\nexport class ErrorMessages {\r\n private base = 'TD:';\r\n\r\n //#region out to console\r\n\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName: string) {\r\n const error = new TdError(\r\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\r\n );\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName: string[]) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(\r\n optionName: string,\r\n badValue: string,\r\n validOptions: string[]\r\n ) {\r\n const error = new TdError(\r\n `${\r\n this.base\r\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\r\n ', '\r\n )}`\r\n );\r\n error.code = 2;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName: string, badType: string, expectedType: string) {\r\n const error = new TdError(\r\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\r\n );\r\n error.code = 3;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\r\n const error = new TdError(\r\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\r\n );\r\n error.code = 4;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n failedToParseDate(optionName: string, date: any, soft = false) {\r\n const error = new TdError(\r\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\r\n );\r\n error.code = 5;\r\n if (!soft) throw error;\r\n console.warn(error);\r\n }\r\n\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(\r\n `${this.base} The subscribed events does not match the number of callbacks`\r\n );\r\n error.code = 7;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message?: string) {\r\n const error = new TdError(\r\n `${this.base} A configuration value conflicts with another rule. ${message}`\r\n );\r\n error.code = 8;\r\n throw error;\r\n }\r\n\r\n /**\r\n * customDateFormat errors\r\n */\r\n customDateFormatError(message?: string) {\r\n const error = new TdError(\r\n `${this.base} customDateFormat: ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Logs a warning if a date option value is provided as a string, instead of\r\n * a date/datetime object.\r\n */\r\n dateString() {\r\n console.warn(\r\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\r\n );\r\n }\r\n\r\n throwError(message) {\r\n const error = new TdError(\r\n `${this.base} ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region used with notify.error\r\n\r\n /**\r\n * Used with an Error Event type if the user selects a date that\r\n * fails restriction validation.\r\n */\r\n failedToSetInvalidDate = 'Failed to set invalid date';\r\n\r\n /**\r\n * Used with an Error Event type when a user changes the value of the\r\n * input field directly, and does not provide a valid date.\r\n */\r\n failedToParseInput = 'Failed parse input field';\r\n\r\n //#endregion\r\n}\r\n","import { ErrorMessages } from './errors';\r\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\r\nconst NAME = 'tempus-dominus',\r\n dataKey = 'td';\r\n\r\n/**\r\n * Events\r\n */\r\nclass Events {\r\n key = `.${dataKey}`;\r\n\r\n /**\r\n * Change event. Fired when the user selects a date.\r\n * See also EventTypes.ChangeEvent\r\n */\r\n change = `change${this.key}`;\r\n\r\n /**\r\n * Emit when the view changes for example from month view to the year view.\r\n * See also EventTypes.ViewUpdateEvent\r\n */\r\n update = `update${this.key}`;\r\n\r\n /**\r\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\r\n * See also EventTypes.FailEvent\r\n */\r\n error = `error${this.key}`;\r\n\r\n /**\r\n * Show event\r\n * @event Events#show\r\n */\r\n show = `show${this.key}`;\r\n\r\n /**\r\n * Hide event\r\n * @event Events#hide\r\n */\r\n hide = `hide${this.key}`;\r\n\r\n // blur and focus are used in the jQuery provider but are otherwise unused.\r\n // keyup/down will be used later for keybinding options\r\n\r\n blur = `blur${this.key}`;\r\n focus = `focus${this.key}`;\r\n keyup = `keyup${this.key}`;\r\n keydown = `keydown${this.key}`;\r\n}\r\n\r\nclass Css {\r\n /**\r\n * The outer element for the widget.\r\n */\r\n widget = `${NAME}-widget`;\r\n\r\n /**\r\n * Hold the previous, next and switcher divs\r\n */\r\n calendarHeader = 'calendar-header';\r\n\r\n /**\r\n * The element for the action to change the calendar view. E.g. month -> year.\r\n */\r\n switch = 'picker-switch';\r\n\r\n /**\r\n * The elements for all the toolbar options\r\n */\r\n toolbar = 'toolbar';\r\n\r\n /**\r\n * Disables the hover and rounding affect.\r\n */\r\n noHighlight = 'no-highlight';\r\n\r\n /**\r\n * Applied to the widget element when the side by side option is in use.\r\n */\r\n sideBySide = 'timepicker-sbs';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> July\r\n */\r\n previous = 'previous';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> September\r\n */\r\n next = 'next';\r\n\r\n /**\r\n * Applied to any action that would violate any restriction options. ALso applied\r\n * to an input field if the disabled function is called.\r\n */\r\n disabled = 'disabled';\r\n\r\n /**\r\n * Applied to any date that is less than requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n old = 'old';\r\n\r\n /**\r\n * Applied to any date that is greater than of requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n new = 'new';\r\n\r\n /**\r\n * Applied to any date that is currently selected.\r\n */\r\n active = 'active';\r\n\r\n //#region date element\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer element for the decades view.\r\n */\r\n decadesContainer = `${this.dateContainer}-decades`;\r\n\r\n /**\r\n * Applied to elements within the decades container, e.g. 2020, 2030\r\n */\r\n decade = 'decade';\r\n\r\n /**\r\n * The outer element for the years view.\r\n */\r\n yearsContainer = `${this.dateContainer}-years`;\r\n\r\n /**\r\n * Applied to elements within the years container, e.g. 2021, 2021\r\n */\r\n year = 'year';\r\n\r\n /**\r\n * The outer element for the month view.\r\n */\r\n monthsContainer = `${this.dateContainer}-months`;\r\n\r\n /**\r\n * Applied to elements within the month container, e.g. January, February\r\n */\r\n month = 'month';\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n daysContainer = `${this.dateContainer}-days`;\r\n\r\n /**\r\n * Applied to elements within the day container, e.g. 1, 2..31\r\n */\r\n day = 'day';\r\n\r\n /**\r\n * If display.calendarWeeks is enabled, a column displaying the week of year\r\n * is shown. This class is applied to each cell in that column.\r\n */\r\n calendarWeeks = 'cw';\r\n\r\n /**\r\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\r\n */\r\n dayOfTheWeek = 'dow';\r\n\r\n /**\r\n * Applied to the current date on the calendar view.\r\n */\r\n today = 'today';\r\n\r\n /**\r\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\r\n */\r\n weekend = 'weekend';\r\n\r\n //#endregion\r\n\r\n //#region time element\r\n\r\n /**\r\n * The outer element for all time related elements.\r\n */\r\n timeContainer = 'time-container';\r\n\r\n /**\r\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\r\n */\r\n separator = 'separator';\r\n\r\n /**\r\n * The outer element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer element for the seconds selection view.\r\n */\r\n secondContainer = `${this.timeContainer}-second`;\r\n\r\n /**\r\n * Applied to each element in the hours selection view.\r\n */\r\n hour = 'hour';\r\n\r\n /**\r\n * Applied to each element in the minutes selection view.\r\n */\r\n minute = 'minute';\r\n\r\n /**\r\n * Applied to each element in the seconds selection view.\r\n */\r\n second = 'second';\r\n\r\n /**\r\n * Applied AM/PM toggle button.\r\n */\r\n toggleMeridiem = 'toggleMeridiem';\r\n\r\n //#endregion\r\n\r\n //#region collapse\r\n\r\n /**\r\n * Applied the element of the current view mode, e.g. calendar or clock.\r\n */\r\n show = 'show';\r\n\r\n /**\r\n * Applied to the currently showing view mode during a transition\r\n * between calendar and clock views\r\n */\r\n collapsing = 'td-collapsing';\r\n\r\n /**\r\n * Applied to the currently hidden view mode.\r\n */\r\n collapse = 'td-collapse';\r\n\r\n //#endregion\r\n\r\n /**\r\n * Applied to the widget when the option display.inline is enabled.\r\n */\r\n inline = 'inline';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is light.\r\n */\r\n lightTheme = 'light';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n darkTheme = 'dark';\r\n\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\r\n}\r\n\r\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static dataKey = dataKey;\r\n\r\n static events = new Events();\r\n\r\n static css = new Css();\r\n\r\n static errorMessages = new ErrorMessages();\r\n}\r\n","export declare type Constructable = new (...args: any[]) => T;\r\n\r\nclass ServiceLocator {\r\n private cache: Map, unknown | Symbol> = new Map();\r\n\r\n locate(identifier: Constructable): T {\r\n const service = this.cache.get(identifier);\r\n if (service) return service as T;\r\n const value = new identifier();\r\n this.cache.set(identifier, value);\r\n return value;\r\n }\r\n}\r\nexport const setupServiceLocator = () => {\r\n serviceLocator = new ServiceLocator();\r\n}\r\n\r\nexport let serviceLocator: ServiceLocator;\r\n","import { Unit } from '../datetime';\r\nimport Namespace from './namespace';\r\nimport ViewMode from './view-mode';\r\n\r\nconst CalendarModes: {\r\n name: keyof ViewMode;\r\n className: string;\r\n unit: Unit;\r\n step: number;\r\n}[] = [\r\n {\r\n name: 'calendar',\r\n className: Namespace.css.daysContainer,\r\n unit: Unit.month,\r\n step: 1,\r\n },\r\n {\r\n name: 'months',\r\n className: Namespace.css.monthsContainer,\r\n unit: Unit.year,\r\n step: 1,\r\n },\r\n {\r\n name: 'years',\r\n className: Namespace.css.yearsContainer,\r\n unit: Unit.year,\r\n step: 10,\r\n },\r\n {\r\n name: 'decades',\r\n className: Namespace.css.decadesContainer,\r\n unit: Unit.year,\r\n step: 100,\r\n },\r\n];\r\n\r\nexport default CalendarModes;\r\n","import { DateTime } from '../datetime';\r\nimport CalendarModes from './calendar-modes';\r\nimport ViewMode from './view-mode';\r\nimport Options from './options';\r\n\r\nexport class OptionsStore {\r\n options: Options;\r\n element: HTMLElement;\r\n input: HTMLInputElement;\r\n unset: boolean;\r\n private _currentCalendarViewMode = 0;\r\n\r\n get currentCalendarViewMode() {\r\n return this._currentCalendarViewMode;\r\n }\r\n\r\n set currentCalendarViewMode(value) {\r\n this._currentCalendarViewMode = value;\r\n this.currentView = CalendarModes[value].name;\r\n }\r\n\r\n _viewDate = new DateTime();\r\n\r\n get viewDate() {\r\n return this._viewDate;\r\n }\r\n\r\n set viewDate(v) {\r\n this._viewDate = v;\r\n if (this.options) this.options.viewDate = v;\r\n }\r\n\r\n /**\r\n * When switching back to the calendar from the clock,\r\n * this sets currentView to the correct calendar view.\r\n */\r\n refreshCurrentView() {\r\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\r\n }\r\n\r\n minimumCalendarViewMode = 0;\r\n currentView: keyof ViewMode = 'calendar';\r\n}\r\n","import { DateTime, Unit } from './datetime';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { OptionsStore } from './utilities/optionsStore';\r\n\r\n/**\r\n * Main class for date validation rules based on the options provided.\r\n */\r\nexport default class Validation {\r\n private optionsStore: OptionsStore;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n }\r\n\r\n /**\r\n * Checks to see if the target date is valid based on the rules provided in the options.\r\n * Granularity can be provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\r\n if (\r\n granularity !== Unit.month &&\r\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\r\n targetDate.weekDay\r\n ) !== -1\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(\r\n this.optionsStore.options.restrictions.minDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(\r\n this.optionsStore.options.restrictions.maxDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds\r\n ) {\r\n if (\r\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0\r\n ) {\r\n for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) {\r\n if (\r\n targetDate.isBetween(\r\n disabledTimeIntervals.from,\r\n disabledTimeIntervals.to\r\n )\r\n )\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0\r\n )\r\n return false;\r\n return this.optionsStore.options.restrictions.disabledDates\r\n .find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0\r\n )\r\n return true;\r\n return this.optionsStore.options.restrictions.enabledDates\r\n .find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n}\r\n","import { DateTime, Unit } from '../datetime';\r\nimport ActionTypes from './action-types';\r\nimport { BaseEvent } from './event-types';\r\n\r\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\r\n\r\nexport class EventEmitter {\r\n private subscribers: ((value?: T) => void)[] = [];\r\n\r\n subscribe(callback: (value: T) => void) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n\r\n unsubscribe(index: number) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n\r\n emit(value?: T) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n}\r\n\r\nexport class EventEmitters {\r\n triggerEvent = new EventEmitter();\r\n viewUpdate = new EventEmitter();\r\n updateDisplay = new EventEmitter();\r\n action = new EventEmitter<{ e: any; action?: ActionTypes }>();\r\n updateViewDate = new EventEmitter();\r\n\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n this.updateViewDate.destroy();\r\n }\r\n}\r\n","import Options from './options';\r\nimport { DateTime } from '../datetime';\r\n\r\nconst DefaultOptions: Options = {\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: []\r\n },\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark'\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined\r\n },\r\n inline: false,\r\n theme: 'auto'\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n defaultDate: undefined,\r\n localization: {\r\n today: 'Go to today',\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n selectMonth: 'Select Month',\r\n previousMonth: 'Previous Month',\r\n nextMonth: 'Next Month',\r\n selectYear: 'Select Year',\r\n previousYear: 'Previous Year',\r\n nextYear: 'Next Year',\r\n selectDecade: 'Select Decade',\r\n previousDecade: 'Previous Decade',\r\n nextDecade: 'Next Decade',\r\n previousCentury: 'Previous Century',\r\n nextCentury: 'Next Century',\r\n pickHour: 'Pick Hour',\r\n incrementHour: 'Increment Hour',\r\n decrementHour: 'Decrement Hour',\r\n pickMinute: 'Pick Minute',\r\n incrementMinute: 'Increment Minute',\r\n decrementMinute: 'Decrement Minute',\r\n pickSecond: 'Pick Second',\r\n incrementSecond: 'Increment Second',\r\n decrementSecond: 'Decrement Second',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n selectTime: 'Select Time',\r\n selectDate: 'Select Date',\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n locale: 'default',\r\n startOfTheWeek: 0,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n dateFormats: {\r\n LTS: 'h:mm:ss T',\r\n LT: 'h:mm T',\r\n L: 'MM/dd/yyyy',\r\n LL: 'MMMM d, yyyy',\r\n LLL: 'MMMM d, yyyy h:mm T',\r\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\r\n },\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n ordinal: (n) => n,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n format: 'L LT'\r\n },\r\n keepInvalid: false,\r\n debug: false,\r\n allowInputToggle: false,\r\n viewDate: new DateTime(),\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n meta: {},\r\n container: undefined\r\n};\r\n\r\nexport default DefaultOptions;\r\n","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport { FormatLocalization } from './options';\r\n\r\n/**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\nexport function tryConvertToDateTime(\r\n this: void,\r\n d: any,\r\n localization: FormatLocalization\r\n): DateTime | null {\r\n if (d.constructor.name === DateTime.name) return d;\r\n if (d.constructor.name === Date.name) {\r\n return DateTime.convert(d);\r\n }\r\n if (typeof d === typeof '') {\r\n const dateTime = DateTime.fromString(d, localization);\r\n if (JSON.stringify(dateTime) === 'null') {\r\n return null;\r\n }\r\n return dateTime;\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\nexport function convertToDateTime(\r\n this: void,\r\n d: any,\r\n optionName: string,\r\n localization: FormatLocalization\r\n): DateTime {\r\n if (typeof d === typeof '' && optionName !== 'input') {\r\n Namespace.errorMessages.dateString();\r\n }\r\n\r\n const converted = tryConvertToDateTime(d, localization);\r\n\r\n if (!converted) {\r\n Namespace.errorMessages.failedToParseDate(\r\n optionName,\r\n d,\r\n optionName === 'input'\r\n );\r\n }\r\n return converted;\r\n}\r\n\r\n/**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\nexport function typeCheckDateArray(\r\n this: void,\r\n optionName: string,\r\n value: any,\r\n providedType: string,\r\n localization: FormatLocalization\r\n) {\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of DateTime or Date'\r\n );\r\n }\r\n for (let i = 0; i < value.length; i++) {\r\n let d = value[i];\r\n const dateTime = convertToDateTime(d, optionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization?.locale ?? 'default');\r\n value[i] = dateTime;\r\n }\r\n}\r\n\r\n/**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\nexport function typeCheckNumberArray(\r\n this: void,\r\n optionName: string,\r\n value: any,\r\n providedType: string\r\n) {\r\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of numbers'\r\n );\r\n }\r\n}\r\n","import Namespace from \"./namespace\";\r\nimport type { FormatLocalization } from \"./options\";\r\nimport { convertToDateTime, typeCheckNumberArray, typeCheckDateArray } from \"./typeChecker\";\r\n\r\ninterface OptionProcessorFunctionArguments {\r\n key: string,\r\n value: any,\r\n providedType: string,\r\n defaultType: string,\r\n path: string,\r\n localization: FormatLocalization;\r\n}\r\n\r\ntype OptionProcessorFunction = (\r\n this: void,\r\n args: OptionProcessorFunctionArguments\r\n) => any;\r\n\r\nfunction mandatoryDate(key: string): OptionProcessorFunction {\r\n return ({ value, providedType, localization }) => {\r\n const dateTime = convertToDateTime(value, key, localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n };\r\n}\r\n\r\nfunction optionalDate(key: string): OptionProcessorFunction {\r\n const mandatory = mandatoryDate(key);\r\n return (args) => {\r\n if (args.value === undefined) {\r\n return args.value;\r\n }\r\n return mandatory(args);\r\n };\r\n}\r\n\r\nfunction numbersInRange(key: string, lower: number, upper: number): OptionProcessorFunction {\r\n return ({ value, providedType }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckNumberArray(\r\n key,\r\n value,\r\n providedType\r\n );\r\n if ((value as number[]).some(x => x < lower || x > upper))\r\n Namespace.errorMessages.numbersOutOfRange(\r\n key,\r\n lower,\r\n upper\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nfunction validHourRange(key: string): OptionProcessorFunction {\r\n return numbersInRange(key, 0, 23);\r\n}\r\n\r\nfunction validDateArray(key: string): OptionProcessorFunction {\r\n return ({ value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckDateArray(\r\n key,\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\r\n return ({ value, path }) => {\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(\r\n path.substring(1),\r\n value,\r\n keyOptions\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nconst optionProcessors: { [key: string]: OptionProcessorFunction; } = Object.freeze({\r\n 'defaultDate': mandatoryDate('defaultDate'),\r\n 'viewDate': mandatoryDate('viewDate'),\r\n 'minDate': optionalDate('restrictions.minDate'),\r\n 'maxDate': optionalDate('restrictions.maxDate'),\r\n 'disabledHours': validHourRange('restrictions.disabledHours'),\r\n 'enabledHours': validHourRange('restrictions.enabledHours'),\r\n 'disabledDates': validDateArray('restrictions.disabledDates'),\r\n 'enabledDates': validDateArray('restrictions.enabledDates'),\r\n 'daysOfWeekDisabled': numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\r\n 'disabledTimeIntervals': ({ key, value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'array of { from: DateTime|Date, to: DateTime|Date }'\r\n );\r\n }\r\n const valueObject = value as { from: any; to: any; }[];\r\n for (let i = 0; i < valueObject.length; i++) {\r\n Object.keys(valueObject[i]).forEach((vk) => {\r\n const subOptionName = `${key}[${i}].${vk}`;\r\n const d = valueObject[i][vk];\r\n const dateTime = convertToDateTime(d, subOptionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n subOptionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization.locale);\r\n valueObject[i][vk] = dateTime;\r\n });\r\n }\r\n return valueObject;\r\n },\r\n 'toolbarPlacement': validKeyOption(['top', 'bottom', 'default']),\r\n 'type': validKeyOption(['icons', 'sprites']),\r\n 'viewMode': validKeyOption(['clock', 'calendar', 'months', 'years', 'decades']),\r\n 'theme': validKeyOption(['light', 'dark', 'auto']),\r\n 'meta': ({ value }) => value,\r\n 'dayViewHeaderFormat': ({ value }) => value,\r\n 'container': ({ value, path }) => {\r\n if (\r\n value &&\r\n !(\r\n value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild\r\n )\r\n ) {\r\n Namespace.errorMessages.typeMismatch(\r\n path.substring(1),\r\n typeof value,\r\n 'HTMLElement'\r\n );\r\n }\r\n return value;\r\n },\r\n 'useTwentyfourHour': ({ value, path, providedType, defaultType }) => {\r\n if (value === undefined || providedType === 'boolean') return value;\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n});\r\n\r\nconst defaultProcessor: OptionProcessorFunction = ({ value, defaultType, providedType, path }) => {\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n};\r\n\r\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\r\n return (optionProcessors[args.key] || defaultProcessor)(args);\r\n};","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport DefaultOptions from './default-options';\r\nimport Options, { FormatLocalization } from './options';\r\nimport { processKey } from './optionProcessor';\r\nimport { convertToDateTime, tryConvertToDateTime, typeCheckDateArray, typeCheckNumberArray } from './typeChecker';\r\n\r\nexport class OptionConverter {\r\n\r\n private static ignoreProperties = ['meta', 'dayViewHeaderFormat',\r\n 'container', 'dateForms', 'ordinal'];\r\n\r\n static deepCopy(input): Options {\r\n const o = {};\r\n\r\n Object.keys(input).forEach((key) => {\r\n const inputElement = input[key];\r\n\r\n if (inputElement instanceof DateTime) {\r\n o[key] = inputElement.clone\r\n return;\r\n }\r\n else if (inputElement instanceof Date) {\r\n o[key] = new Date(inputElement.valueOf());\r\n return;\r\n }\r\n\r\n o[key] = inputElement;\r\n if (typeof inputElement !== 'object' ||\r\n inputElement instanceof HTMLElement ||\r\n inputElement instanceof Element) return;\r\n if (!Array.isArray(inputElement)) {\r\n o[key] = OptionConverter.deepCopy(inputElement);\r\n }\r\n });\r\n\r\n return o;\r\n }\r\n\r\n private static isValue = a => a != null; // everything except undefined + null\r\n\r\n /**\r\n * Finds value out of an object based on a string, period delimited, path\r\n * @param paths\r\n * @param obj\r\n */\r\n static objectPath(paths: string, obj) {\r\n if (paths.charAt(0) === '.')\r\n paths = paths.slice(1);\r\n if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param localization\r\n */\r\n static spread(provided, copyTo, path = '', localization: FormatLocalization) {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).filter(key => key !== '__proto__' && key !== 'constructor').forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key))) {\r\n OptionConverter.spread(provided[key], copyTo[key], path, localization);\r\n } else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key: string, value: any, providedType: string, defaultType: string, path: string, localization: FormatLocalization) {\r\n return processKey({ key, value, providedType, defaultType, path, localization });\r\n }\r\n\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const localization =\r\n mergeTo.localization?.locale !== 'default'\r\n ? mergeTo.localization\r\n : providedOptions?.localization || DefaultOptions.localization;\r\n\r\n OptionConverter.spread(providedOptions, newConfig, '', localization);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n static _dateTypeCheck(d: any, localization: FormatLocalization): DateTime | null {\r\n return tryConvertToDateTime(d, localization);\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n localization: FormatLocalization\r\n ) {\r\n return typeCheckDateArray(optionName, value, providedType, localization);\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n static _typeCheckNumberArray(\r\n optionName: string,\r\n value,\r\n providedType: string\r\n ) {\r\n return typeCheckNumberArray(optionName, value, providedType);\r\n }\r\n\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n static dateConversion(d: any, optionName: string, localization: FormatLocalization): DateTime {\r\n return convertToDateTime(d, optionName, localization);\r\n }\r\n\r\n private static _flattenDefaults: string[];\r\n\r\n private static getFlattenDefaultOptions(): string[] {\r\n if (this._flattenDefaults) return this._flattenDefaults;\r\n const deepKeys = (t, pre = []) => {\r\n if (Array.isArray(t)) return [];\r\n if (Object(t) === t) {\r\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\r\n } else {\r\n return pre.join('.');\r\n }\r\n };\r\n\r\n this._flattenDefaults = deepKeys(DefaultOptions);\r\n\r\n return this._flattenDefaults;\r\n }\r\n\r\n /**\r\n * Some options conflict like min/max date. Verify that these kinds of options\r\n * are set correctly.\r\n * @param config\r\n */\r\n static _validateConflicts(config: Options) {\r\n if (\r\n config.display.sideBySide &&\r\n (!config.display.components.clock ||\r\n !(\r\n config.display.components.hours ||\r\n config.display.components.minutes ||\r\n config.display.components.seconds\r\n ))\r\n ) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'Cannot use side by side mode without the clock components'\r\n );\r\n }\r\n\r\n if (config.restrictions.minDate && config.restrictions.maxDate) {\r\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'minDate is after maxDate'\r\n );\r\n }\r\n\r\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'maxDate is before minDate'\r\n );\r\n }\r\n }\r\n }\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\r\nimport Validation from './validation';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\n\r\nexport default class Dates {\r\n private _dates: DateTime[] = [];\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n }\r\n\r\n /**\r\n * Returns the array of selected dates\r\n */\r\n get picked(): DateTime[] {\r\n return this._dates;\r\n }\r\n\r\n /**\r\n * Returns the last picked value.\r\n */\r\n get lastPicked(): DateTime {\r\n return this._dates[this.lastPickedIndex];\r\n }\r\n\r\n /**\r\n * Returns the length of picked dates -1 or 0 if none are selected.\r\n */\r\n get lastPickedIndex(): number {\r\n if (this._dates.length === 0) return 0;\r\n return this._dates.length - 1;\r\n }\r\n\r\n /**\r\n * Formats a DateTime object to a string. Used when setting the input value.\r\n * @param date\r\n */\r\n formatInput(date: DateTime): string {\r\n const components = this.optionsStore.options.display.components;\r\n if (!date) return '';\r\n return date.format({\r\n year: components.calendar && components.year ? 'numeric' : undefined,\r\n month: components.calendar && components.month ? '2-digit' : undefined,\r\n day: components.calendar && components.date ? '2-digit' : undefined,\r\n hour:\r\n components.clock && components.hours\r\n ? components.useTwentyfourHour\r\n ? '2-digit'\r\n : 'numeric'\r\n : undefined,\r\n minute: components.clock && components.minutes ? '2-digit' : undefined,\r\n second: components.clock && components.seconds ? '2-digit' : undefined,\r\n hour12: !components.useTwentyfourHour,\r\n });\r\n }\r\n \r\n /**\r\n * parse the value into a DateTime object.\r\n * this can be overwritten to supply your own parsing.\r\n */\r\n parseInput(value:any): DateTime {\r\n return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization);\r\n }\r\n\r\n /**\r\n * Tries to convert the provided value to a DateTime object.\r\n * If value is null|undefined then clear the value of the provided index (or 0).\r\n * @param value Value to convert or null|undefined\r\n * @param index When using multidates this is the index in the array\r\n */\r\n setFromInput(value: any, index?: number) {\r\n if (!value) {\r\n this.setValue(undefined, index);\r\n return;\r\n }\r\n const converted = this.parseInput(value);\r\n if (converted) {\r\n converted.setLocale(this.optionsStore.options.localization.locale);\r\n this.setValue(converted, index);\r\n }\r\n }\r\n\r\n /**\r\n * Adds a new DateTime to selected dates array\r\n * @param date\r\n */\r\n add(date: DateTime): void {\r\n this._dates.push(date);\r\n }\r\n\r\n /**\r\n * Returns true if the `targetDate` is part of the selected dates array.\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this._dates.find((x) => x === targetDate) !== undefined;\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return (\r\n this._dates\r\n .map((x) => x.format(format))\r\n .find((x) => x === innerDateFormatted) !== undefined\r\n );\r\n }\r\n\r\n /**\r\n * Returns the index at which `targetDate` is in the array.\r\n * This is used for updating or removing a date when multi-date is used\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\r\n if (!unit) return this._dates.indexOf(targetDate);\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\r\n }\r\n\r\n /**\r\n * Clears all selected dates.\r\n */\r\n clear() {\r\n this.optionsStore.unset = true;\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate: this.lastPicked,\r\n isClear: true,\r\n isValid: true,\r\n } as ChangeEvent);\r\n this._dates = [];\r\n }\r\n\r\n /**\r\n * Find the \"book end\" years given a `year` and a `factor`\r\n * @param factor e.g. 100 for decades\r\n * @param year e.g. 2021\r\n */\r\n static getStartEndYear(\r\n factor: number,\r\n year: number\r\n ): [number, number, number] {\r\n const step = factor / 10,\r\n startYear = Math.floor(year / factor) * factor,\r\n endYear = startYear + step * 9,\r\n focusValue = Math.floor(year / step) * step;\r\n return [startYear, endYear, focusValue];\r\n }\r\n\r\n updateInput(target?: DateTime) {\r\n if (!this.optionsStore.input) return;\r\n\r\n let newValue = this.formatInput(target);\r\n if (this.optionsStore.options.multipleDates) {\r\n newValue = this._dates\r\n .map((d) => this.formatInput(d))\r\n .join(this.optionsStore.options.multipleDatesSeparator);\r\n }\r\n if (this.optionsStore.input.value != newValue)\r\n this.optionsStore.input.value = newValue;\r\n }\r\n\r\n /**\r\n * Attempts to either clear or set the `target` date at `index`.\r\n * If the `target` is null then the date will be cleared.\r\n * If multi-date is being used then it will be removed from the array.\r\n * If `target` is valid and multi-date is used then if `index` is\r\n * provided the date at that index will be replaced, otherwise it is appended.\r\n * @param target\r\n * @param index\r\n */\r\n setValue(target?: DateTime, index?: number): void {\r\n const noIndex = typeof index === 'undefined',\r\n isClear = !target && noIndex;\r\n let oldDate = this.optionsStore.unset ? null : this._dates[index];\r\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\r\n oldDate = this.lastPicked;\r\n }\r\n\r\n if (target && oldDate?.isSame(target)) {\r\n this.updateInput(target);\r\n return;\r\n }\r\n\r\n // case of calling setValue(null)\r\n if (!target) {\r\n if (\r\n !this.optionsStore.options.multipleDates ||\r\n this._dates.length === 1 ||\r\n isClear\r\n ) {\r\n this.optionsStore.unset = true;\r\n this._dates = [];\r\n } else {\r\n this._dates.splice(index, 1);\r\n }\r\n\r\n this.updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n\r\n this._eventEmitters.updateDisplay.emit('all');\r\n return;\r\n }\r\n\r\n index = index || 0;\r\n target = target.clone;\r\n\r\n // minute stepping is being used, force the minute to the closest value\r\n if (this.optionsStore.options.stepping !== 1) {\r\n target.minutes =\r\n Math.round(target.minutes / this.optionsStore.options.stepping) *\r\n this.optionsStore.options.stepping;\r\n target.seconds = 0;\r\n }\r\n\r\n if (this.validation.isValid(target)) {\r\n this._dates[index] = target;\r\n this._eventEmitters.updateViewDate.emit(target.clone);\r\n\r\n this.updateInput(target);\r\n\r\n this.optionsStore.unset = false;\r\n this._eventEmitters.updateDisplay.emit('all');\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.keepInvalid) {\r\n this._dates[index] = target;\r\n this._eventEmitters.updateViewDate.emit(target.clone);\r\n\r\n this.updateInput(target);\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: false,\r\n } as ChangeEvent);\r\n }\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToSetInvalidDate,\r\n date: target,\r\n oldDate,\r\n } as FailEvent);\r\n }\r\n}\r\n","enum ActionTypes {\r\n next = 'next',\r\n previous = 'previous',\r\n changeCalendarView = 'changeCalendarView',\r\n selectMonth = 'selectMonth',\r\n selectYear = 'selectYear',\r\n selectDecade = 'selectDecade',\r\n selectDay = 'selectDay',\r\n selectHour = 'selectHour',\r\n selectMinute = 'selectMinute',\r\n selectSecond = 'selectSecond',\r\n incrementHours = 'incrementHours',\r\n incrementMinutes = 'incrementMinutes',\r\n incrementSeconds = 'incrementSeconds',\r\n decrementHours = 'decrementHours',\r\n decrementMinutes = 'decrementMinutes',\r\n decrementSeconds = 'decrementSeconds',\r\n toggleMeridiem = 'toggleMeridiem',\r\n togglePicker = 'togglePicker',\r\n showClock = 'showClock',\r\n showHours = 'showHours',\r\n showMinutes = 'showMinutes',\r\n showSeconds = 'showSeconds',\r\n clear = 'clear',\r\n close = 'close',\r\n today = 'today',\r\n}\r\n\r\nexport default ActionTypes;\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport Dates from \"../../dates\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `date`\r\n */\r\nexport default class DateDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.daysContainer);\r\n\r\n container.append(...this._daysOfTheWeek());\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n\r\n for (let i = 0; i < 42; i++) {\r\n if (i !== 0 && i % 7 === 0) {\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n container.appendChild(div);\r\n }\r\n }\r\n\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDay);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.daysContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"calendar\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.daysContainer,\r\n this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n )\r\n );\r\n\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\r\n Unit.month\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\r\n Unit.month\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n\r\n container\r\n .querySelectorAll(\r\n `[data-action=\"${ActionTypes.selectDay}\"], .${Namespace.css.calendarWeeks}`\r\n )\r\n .forEach((containerClone: HTMLElement) => {\r\n if (\r\n this.optionsStore.options.display.calendarWeeks &&\r\n containerClone.classList.contains(Namespace.css.calendarWeeks)\r\n ) {\r\n if (containerClone.innerText === \"#\") return;\r\n containerClone.innerText = `${innerDate.week}`;\r\n return;\r\n }\r\n\r\n let classes: string[] = [];\r\n classes.push(Namespace.css.day);\r\n\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.date)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n\r\n paint(Unit.date, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`\r\n );\r\n containerClone.setAttribute(\"data-day\", `${innerDate.date}`);\r\n containerClone.innerText = innerDate.format({ day: \"numeric\" });\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n\r\n /***\r\n * Generates an html row that contains the days of the week.\r\n * @private\r\n */\r\n private _daysOfTheWeek(): HTMLElement[] {\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement(\"div\");\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = \"#\";\r\n row.push(htmlDivElement);\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.dayOfTheWeek,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = innerDate.format({ weekday: \"short\" });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n\r\n return row;\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { Paint } from '../index';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `month`\r\n */\r\nexport default class MonthDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMonth);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.monthsContainer\r\n )[0];\r\n\r\n if(this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switcher.setAttribute(\r\n Namespace.css.monthsContainer,\r\n this.optionsStore.viewDate.format({ year: 'numeric' })\r\n );\r\n\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\r\n Unit.year\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\r\n Unit.year\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n let classes = [];\r\n classes.push(Namespace.css.month);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n}\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Dates from \"../../dates\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `year`\r\n */\r\nexport default class YearDisplay {\r\n private _startYear: DateTime;\r\n private _endYear: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.yearsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectYear);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.yearsContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"years\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.yearsContainer,\r\n `${this._startYear.format({ year: \"numeric\" })}-${this._endYear.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.year);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\"data-value\", `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: \"numeric\" });\r\n\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n}\r\n","import Dates from \"../../dates\";\r\nimport { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class DecadeDisplay {\r\n private _startDecade: DateTime;\r\n private _endDecade: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.decadesContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n const [start, end] = Dates.getStartEndYear(\r\n 100,\r\n this.optionsStore.viewDate.year\r\n );\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.decadesContainer\r\n )[0];\r\n\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(\r\n Namespace.css.decadesContainer,\r\n `${this._startDecade.format({ year: \"numeric\" })}-${this._endDecade.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = \" \";\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute(\"data-value\", ``);\r\n return;\r\n } else {\r\n containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: \"numeric\" });\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n return;\r\n }\r\n }\r\n\r\n let classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n\r\n paint(\"decade\", this._startDecade, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n containerClone.innerText = `${this._startDecade.format({ year: \"numeric\" })}`;\r\n\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates the clock display\r\n */\r\nexport default class TimeDisplay {\r\n private _gridColumns = '';\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n\r\n container.append(...this._grid(iconTag));\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget: HTMLElement): void {\r\n const timesDiv = (\r\n widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0]\r\n );\r\n const lastPicked = (\r\n this.dates.lastPicked || this.optionsStore.viewDate\r\n ).clone;\r\n\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.hours}]`\r\n ).innerText = this.optionsStore.options.display.components.useTwentyfourHour\r\n ? lastPicked.hoursFormatted\r\n : lastPicked.twelveHoursFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.minutes}]`\r\n ).innerText = lastPicked.minutesFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.seconds}]`\r\n ).innerText = lastPicked.secondsFormatted;\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n const toggle = timesDiv.querySelector(\r\n `[data-action=${ActionTypes.toggleMeridiem}]`\r\n );\r\n\r\n toggle.innerText = lastPicked.meridiem();\r\n\r\n if (\r\n !this.validation.isValid(\r\n lastPicked.clone.manipulate(\r\n lastPicked.hours >= 12 ? -12 : 12,\r\n Unit.hours\r\n )\r\n )\r\n ) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n } else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\r\n this._gridColumns = '';\r\n const top = [],\r\n middle = [],\r\n bottom = [],\r\n separator = document.createElement('div'),\r\n upIcon = iconTag(\r\n this.optionsStore.options.display.icons.up\r\n ),\r\n downIcon = iconTag(\r\n this.optionsStore.options.display.icons.down\r\n );\r\n\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n\r\n const getSeparator = (colon = false): HTMLElement => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n\r\n let button = document.createElement('button');\r\n button.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.toggleMeridiem\r\n );\r\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) { //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else button.classList.add(Namespace.css.toggleMeridiem);\r\n\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n\r\n this._gridColumns = this._gridColumns.trim();\r\n\r\n return [...top, ...middle, ...bottom];\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `hours`\r\n */\r\nexport default class HourDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n\r\n for (\r\n let i = 0;\r\n i <\r\n (this.optionsStore.options.display.components.useTwentyfourHour ? 24 : 12);\r\n i++\r\n ) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectHour);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.hourContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.hour);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = this.optionsStore.options.display.components\r\n .useTwentyfourHour\r\n ? innerDate.hoursFormatted\r\n : innerDate.twelveHoursFormatted;\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `minutes`\r\n */\r\nexport default class MinuteDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMinute);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.minuteContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.minute);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n 'data-value',\r\n `${innerDate.minutes}`\r\n );\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class secondDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectSecond);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.secondContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.second);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n}\r\n","import Namespace from '../utilities/namespace';\r\n\r\n/**\r\n * Provides a collapse functionality to the view changes\r\n */\r\nexport default class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target: HTMLElement) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n } else {\r\n this.show(target);\r\n }\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n if (!target) return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport Namespace from '../utilities/namespace';\r\nimport { HideEvent } from '../utilities/event-types';\r\nimport Collapse from './collapse';\r\nimport Validation from '../validation';\r\nimport Dates from '../dates';\r\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\r\nimport { serviceLocator } from '../utilities/service-locator';\r\nimport ActionTypes from '../utilities/action-types';\r\nimport CalendarModes from '../utilities/calendar-modes';\r\nimport { OptionsStore } from '../utilities/optionsStore';\r\n\r\n/**\r\n * Main class for all things display related.\r\n */\r\nexport default class Display {\r\n private _widget: HTMLElement;\r\n private _popperInstance: any;\r\n private _isVisible = false;\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n dateDisplay: DateDisplay;\r\n monthDisplay: MonthDisplay;\r\n yearDisplay: YearDisplay;\r\n decadeDisplay: DecadeDisplay;\r\n timeDisplay: TimeDisplay;\r\n hourDisplay: HourDisplay;\r\n minuteDisplay: MinuteDisplay;\r\n secondDisplay: SecondDisplay;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n\r\n this.dateDisplay = serviceLocator.locate(DateDisplay);\r\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\r\n this.yearDisplay = serviceLocator.locate(YearDisplay);\r\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\r\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\r\n this.hourDisplay = serviceLocator.locate(HourDisplay);\r\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\r\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._widget = undefined;\r\n\r\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\r\n this._update(result);\r\n });\r\n }\r\n\r\n /**\r\n * Returns the widget body or undefined\r\n * @private\r\n */\r\n get widget(): HTMLElement | undefined {\r\n return this._widget;\r\n }\r\n\r\n /**\r\n * Returns this visible state of the picker (shown)\r\n */\r\n get isVisible() {\r\n return this._isVisible;\r\n }\r\n\r\n /**\r\n * Updates the table for a particular unit. Used when an option as changed or\r\n * whenever the class list might need to be refreshed.\r\n * @param unit\r\n * @private\r\n */\r\n _update(unit: ViewUpdateValues): void {\r\n if (!this.widget) return;\r\n //todo do I want some kind of error catching or other guards here?\r\n switch (unit) {\r\n case Unit.seconds:\r\n this.secondDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.minutes:\r\n this.minuteDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.hours:\r\n this.hourDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.date:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.month:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.year:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'clock':\r\n if (!this._hasTime) break;\r\n this.timeDisplay._update(this.widget);\r\n this._update(Unit.hours);\r\n this._update(Unit.minutes);\r\n this._update(Unit.seconds);\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n this._update(Unit.year);\r\n this._update(Unit.month);\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n this._updateCalendarHeader();\r\n break;\r\n case 'all':\r\n if (this._hasTime) {\r\n this._update('clock');\r\n }\r\n if (this._hasDate) {\r\n this._update('calendar');\r\n }\r\n }\r\n }\r\n\r\n // noinspection JSUnusedLocalSymbols\r\n /**\r\n * Allows developers to add/remove classes from an element.\r\n * @param _unit\r\n * @param _date\r\n * @param _classes\r\n * @param _element\r\n */\r\n paint(\r\n _unit: Unit | 'decade',\r\n _date: DateTime,\r\n _classes: string[],\r\n _element: HTMLElement\r\n ) {\r\n // implemented in plugin\r\n }\r\n\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * fires Events#show\r\n */\r\n show(): void {\r\n if (this.widget == undefined) {\r\n if (this.dates.picked.length == 0) {\r\n if (\r\n this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate\r\n ) {\r\n const date = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (\r\n this.optionsStore.options.restrictions.maxDate?.isBefore(date)\r\n ) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date)) {\r\n date.manipulate(direction, Unit.date);\r\n if (tries > 31) break;\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n\r\n this._buildWidget();\r\n this._updateTheme();\r\n\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n // otherwise return to the calendar view\r\n if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n\r\n if (\r\n !onlyClock &&\r\n this.optionsStore.options.display.viewMode !== 'clock'\r\n ) {\r\n if (this._hasTime) {\r\n if(!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n } else {\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n }\r\n }\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.dateContainer}`)\r\n );\r\n }\r\n\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n container.appendChild(this.widget);\r\n this.createPopup(this.optionsStore.element, this.widget, {\r\n modifiers: [{ name: 'eventListeners', enabled: true }],\r\n //#2400\r\n placement:\r\n document.documentElement.dir === 'rtl'\r\n ? 'bottom-end'\r\n : 'bottom-start',\r\n }).then();\r\n } else {\r\n this.optionsStore.element.appendChild(this.widget);\r\n }\r\n\r\n if (this.optionsStore.options.display.viewMode == 'clock') {\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.addEventListener('click', this._actionsClickEvent)\r\n );\r\n\r\n // show the clock when using sideBySide\r\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\r\n this.timeDisplay._update(this.widget);\r\n (\r\n this.widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0] as HTMLElement\r\n ).style.display = 'grid';\r\n }\r\n }\r\n\r\n this.widget.classList.add(Namespace.css.show);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.updatePopup();\r\n document.addEventListener('click', this._documentClickEvent);\r\n }\r\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\r\n this._isVisible = true;\r\n }\r\n\r\n async createPopup(element: HTMLElement, widget: HTMLElement, options: any): Promise {\r\n let createPopperFunction;\r\n if((window as any)?.Popper) {\r\n createPopperFunction = (window as any)?.Popper?.createPopper;\r\n }\r\n else {\r\n const { createPopper } = await import('@popperjs/core');\r\n createPopperFunction = createPopper;\r\n }\r\n if(createPopperFunction){\r\n this._popperInstance = createPopperFunction(element, widget, options);\r\n }\r\n }\r\n\r\n updatePopup(): void {\r\n this._popperInstance?.update();\r\n }\r\n\r\n /**\r\n * Changes the calendar view mode. E.g. month <-> year\r\n * @param direction -/+ number to move currentViewMode\r\n * @private\r\n */\r\n _showMode(direction?: number): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (direction) {\r\n const max = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\r\n );\r\n if (this.optionsStore.currentCalendarViewMode == max) return;\r\n this.optionsStore.currentCalendarViewMode = max;\r\n }\r\n\r\n this.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\r\n )\r\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\r\n\r\n const datePickerMode =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n let picker: HTMLElement = this.widget.querySelector(\r\n `.${datePickerMode.className}`\r\n );\r\n\r\n switch (datePickerMode.className) {\r\n case Namespace.css.decadesContainer:\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.daysContainer:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n }\r\n\r\n picker.style.display = 'grid';\r\n\r\n if (this.optionsStore.options.display.sideBySide)\r\n ((this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0])).style.display = 'grid';\r\n\r\n this._updateCalendarHeader();\r\n this._eventEmitters.viewUpdate.emit();\r\n }\r\n\r\n /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme) return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n } else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n\r\n _getThemeClass(): string {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\r\n\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n\r\n _updateCalendarHeader() {\r\n const showing = [\r\n ...this.widget.querySelector(\r\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\r\n ).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousCentury\r\n );\r\n switcher.setAttribute('title', '');\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextCentury\r\n );\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousDecade\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDecade\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextDecade\r\n );\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousYear\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectYear\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextYear\r\n );\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousMonth\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectMonth\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextMonth\r\n );\r\n switcher.setAttribute(showing, this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n ));\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * fires Events#hide\r\n */\r\n hide(): void {\r\n if (!this.widget || !this._isVisible) return;\r\n\r\n this.widget.classList.remove(Namespace.css.show);\r\n\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset\r\n ? null\r\n : this.dates.lastPicked\r\n ? this.dates.lastPicked.clone\r\n : void 0,\r\n } as HideEvent);\r\n this._isVisible = false;\r\n }\r\n\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget) return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.removeEventListener('click', this._actionsClickEvent)\r\n );\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n private _buildWidget(): HTMLElement {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(\r\n this.getHeadTemplate(),\r\n this.decadeDisplay.getPicker(),\r\n this.yearDisplay.getPicker(),\r\n this.monthDisplay.getPicker(),\r\n this.dateDisplay.getPicker()\r\n );\r\n\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n\r\n if (\r\n this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n if (this._hasDate) {\r\n if (this._hasTime) {\r\n dateView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode !== 'clock')\r\n dateView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(dateView);\r\n }\r\n\r\n if (this._hasTime) {\r\n if (this._hasDate) {\r\n timeView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode === 'clock')\r\n timeView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(timeView);\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n\r\n this._widget = template;\r\n }\r\n\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds)\r\n );\r\n }\r\n\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date)\r\n );\r\n }\r\n\r\n /**\r\n * Get the toolbar html based on options like buttons.today\r\n * @private\r\n */\r\n getToolbarElements(): HTMLElement[] {\r\n const toolbar = [];\r\n\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.today)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (\r\n !this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n } else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.togglePicker);\r\n div.setAttribute('title', title);\r\n\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.clear)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.close)\r\n );\r\n toolbar.push(div);\r\n }\r\n\r\n return toolbar;\r\n }\r\n\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate(): HTMLElement {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes.previous);\r\n previous.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.previous)\r\n );\r\n\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\r\n\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes.next);\r\n next.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.next)\r\n );\r\n\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons.type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass: string): HTMLElement | SVGElement {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n const icon = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'use'\r\n );\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n private _documentClickEvent = (e: MouseEvent) => {\r\n if (this.optionsStore.options.debug || (window as any).debug) return;\r\n\r\n if (\r\n this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n private _actionsClickEvent = (e: MouseEvent) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n if (wasVisible) this.hide();\r\n this._dispose();\r\n if (wasVisible) {\r\n this.show();\r\n }\r\n }\r\n}\r\n\r\nexport type Paint = (\r\n unit: Unit | 'decade',\r\n innerDate: DateTime,\r\n classes: string[],\r\n element: HTMLElement\r\n) => void;\r\n","import { DateTime, Unit } from \"./datetime\";\r\nimport Collapse from \"./display/collapse\";\r\nimport Namespace from \"./utilities/namespace\";\r\nimport Dates from \"./dates\";\r\nimport Validation from \"./validation\";\r\nimport Display from \"./display\";\r\nimport { EventEmitters } from \"./utilities/event-emitter\";\r\nimport { serviceLocator } from \"./utilities/service-locator.js\";\r\nimport ActionTypes from \"./utilities/action-types\";\r\nimport CalendarModes from \"./utilities/calendar-modes\";\r\nimport { OptionsStore } from \"./utilities/optionsStore\";\r\n\r\n/**\r\n *\r\n */\r\nexport default class Actions {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n private display: Display;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n do(e: any, action?: ActionTypes) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return false;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n\r\n switch (action) {\r\n case ActionTypes.next:\r\n case ActionTypes.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.selectMonth:\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n\r\n if (\r\n this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode\r\n ) {\r\n this.dates.setValue(\r\n this.optionsStore.viewDate,\r\n this.dates.lastPickedIndex\r\n );\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n } else {\r\n this.display._showMode(-1);\r\n }\r\n break;\r\n case ActionTypes.selectDay:\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n\r\n day.date = +currentTarget.dataset.day;\r\n let index = 0;\r\n if (this.optionsStore.options.multipleDates) {\r\n index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex + 1);\r\n }\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n\r\n if (\r\n !this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates\r\n ) {\r\n this.display.hide();\r\n }\r\n break;\r\n case ActionTypes.selectHour:\r\n let hour = +currentTarget.dataset.value;\r\n if (\r\n lastPicked.hours >= 12 &&\r\n !this.optionsStore.options.display.components.useTwentyfourHour\r\n )\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectMinute:\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectSecond:\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes.incrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping\r\n );\r\n break;\r\n case ActionTypes.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes.decrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping * -1\r\n );\r\n break;\r\n case ActionTypes.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes.toggleMeridiem:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.hours,\r\n this.dates.lastPicked.hours >= 12 ? -12 : 12\r\n );\r\n break;\r\n case ActionTypes.togglePicker:\r\n if (\r\n currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate\r\n ) {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectTime\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.time\r\n ).outerHTML;\r\n\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n } else {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDate\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.date\r\n ).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n\r\n this.display.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\r\n )\r\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n break;\r\n case ActionTypes.showClock:\r\n case ActionTypes.showHours:\r\n case ActionTypes.showMinutes:\r\n case ActionTypes.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this._eventEmitters.updateViewDate.emit(today);\r\n\r\n //todo this this really a good idea?\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent,\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator,\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\nimport { ErrorMessages } from './utilities/errors';\r\n\r\n/**\r\n * A robust and powerful date/time picker component.\r\n */\r\nclass TempusDominus {\r\n _subscribers: { [key: string]: ((event: any) => {})[] } = {};\r\n private _isDisabled = false;\r\n private _toggle: HTMLElement;\r\n private _currentPromptTimeTimeout: any;\r\n private actions: Actions;\r\n private optionsStore: OptionsStore;\r\n private _eventEmitters: EventEmitters;\r\n display: Display;\r\n dates: Dates;\r\n\r\n constructor(element: HTMLElement, options: Options = {} as Options) {\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.unset = true;\r\n\r\n this._initializeInput();\r\n this._initializeToggle();\r\n\r\n if (this.optionsStore.options.display.inline) this.display.show();\r\n\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n\r\n this._eventEmitters.updateViewDate.subscribe(dateTime => {\r\n this.viewDate = dateTime;\r\n });\r\n }\r\n\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n\r\n set viewDate(value) {\r\n this.optionsStore.viewDate = value;\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.display._update(this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false): void {\r\n if (reset) this._initializeOptions(options, DefaultOptions);\r\n else this._initializeOptions(options, this.optionsStore.options);\r\n this.display._rebuild();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle(): void {\r\n if (this._isDisabled) return;\r\n this.display.toggle();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show(): void {\r\n if (this._isDisabled) return;\r\n this.display.show();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide(): void {\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable(): void {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable(): void {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear(): void {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(\r\n eventTypes: string | string[],\r\n callbacks: (event: any) => void | ((event: any) => void)[]\r\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray: any[];\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n } else {\r\n callBackArray = callbacks;\r\n }\r\n\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n\r\n const returnArray = [];\r\n\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(\r\n this,\r\n eventType,\r\n this._subscribers[eventType].length - 1\r\n ),\r\n });\r\n\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n\r\n return returnArray;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this._eventEmitters.destroy();\r\n this.optionsStore.input?.removeEventListener(\r\n 'change',\r\n this._inputChangeEvent\r\n );\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener(\r\n 'click',\r\n this._toggleClickEvent\r\n );\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language: string) {\r\n let asked = loadedLocales[language];\r\n if (!asked) return;\r\n this.updateOptions({\r\n localization: asked,\r\n });\r\n }\r\n\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n private _triggerEvent(event: BaseEvent) {\r\n event.viewMode = this.optionsStore.currentView;\r\n\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event as ChangeEvent;\r\n if (\r\n (date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)\r\n ) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event as ChangeEvent);\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent('change', { detail: event as any })\r\n );\r\n }\r\n\r\n this.optionsStore.element.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n if ((window as any).jQuery) {\r\n const $ = (window as any).jQuery;\r\n\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n } else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n\r\n this._publish(event);\r\n }\r\n\r\n private _publish(event: BaseEvent) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n private _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone,\r\n } as ViewUpdateEvent);\r\n }\r\n\r\n private _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n private _initializeOptions(\r\n config: Options,\r\n mergeTo: Options,\r\n includeDataset = false\r\n ): void {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n newConfig\r\n );\r\n\r\n OptionConverter._validateConflicts(newConfig);\r\n\r\n newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n this.optionsStore.currentCalendarViewMode\r\n );\r\n\r\n // Update view mode if needed\r\n if (\r\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\r\n this.optionsStore.minimumCalendarViewMode\r\n );\r\n }\r\n\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n\r\n if (newConfig.display.components.useTwentyfourHour === undefined) {\r\n newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod;\r\n }\r\n\r\n\r\n this.optionsStore.options = newConfig;\r\n }\r\n\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n private _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\r\n } else {\r\n let query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n } else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n\r\n if (!this.optionsStore.input) return;\r\n\r\n if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\r\n this.optionsStore.input.value = this.dates.formatInput(this.optionsStore.options.defaultDate);\r\n\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n private _initializeToggle() {\r\n if (this.optionsStore.options.display.inline) return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n private _handleAfterChangeEvent(e: ChangeEvent) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer)\r\n )\r\n return;\r\n\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if (\r\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))\r\n ) {\r\n return;\r\n }\r\n\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector(\r\n `.${Namespace.css.switch} div`\r\n ),\r\n },\r\n action: ActionTypes.togglePicker,\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _inputChangeEvent = (event?: any) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered) return;\r\n\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\r\n };\r\n\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates) {\r\n try {\r\n const valueSplit = value.split(\r\n this.optionsStore.options.multipleDatesSeparator\r\n );\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n } catch {\r\n console.warn(\r\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\r\n );\r\n }\r\n } else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _toggleClickEvent = () => {\r\n if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return\r\n this.toggle();\r\n };\r\n}\r\n\r\n/**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\nconst loadedLocales = {};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\nconst loadLocale = (l) => {\r\n if (loadedLocales[l.name]) return;\r\n loadedLocales[l.name] = l.localization;\r\n};\r\n\r\n/**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\nconst locale = (l: string) => {\r\n let asked = loadedLocales[l];\r\n if (!asked) return;\r\n DefaultOptions.localization = asked;\r\n};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\nconst extend = function (plugin, option) {\r\n if (!plugin) return tempusDominus;\r\n if (!plugin.installed) {\r\n // install plugin only once\r\n plugin(option, { TempusDominus, Dates, Display, DateTime, Namespace }, tempusDominus);\r\n plugin.installed = true;\r\n }\r\n return tempusDominus;\r\n};\r\n\r\nconst version = '6.2.7';\r\n\r\nconst tempusDominus = {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version\r\n};\r\n\r\nexport {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version,\r\n DateTimeFormatOptions,\r\n Options\r\n}\r\n"],"names":["ActionTypes","SecondDisplay"],"mappings":";;;;;IAAY,KAOX;AAPD,CAAA,UAAY,IAAI,EAAA;AACd,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAPW,IAAI,KAAJ,IAAI,GAOf,EAAA,CAAA,CAAA,CAAA;AAED,MAAM,gBAAgB,GAAG;AACvB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,GAAG,EAAE,SAAS;AACd,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,IAAI;CACb,CAAA;AAED,MAAM,0BAA0B,GAAG;AACjC,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,MAAM,EAAE,KAAK;CACd,CAAA;AAQM,MAAM,eAAe,GAAG,CAAC,IAAU,KAAY;AACpD,IAAA,QAAQ,IAAI;AACV,QAAA,KA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F,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;AACzB,KAAA;AACD,IAAA,OAAO,aAAa,CAAC;AACvB,EAAE;AAEI,MAAA,OAAO,GAAG,QAAQ;AAExB,MAAM,aAAa,GAAG;IACpB,aAAa;IACb,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,cAAc;IACd,QAAQ;IACR,IAAI;IACJ,OAAO;CACR;;;;"} \ No newline at end of file diff --git a/dist/js/tempus-dominus.esm.min.js b/dist/js/tempus-dominus.esm.min.js index 52b4ae863..3a90966c4 100644 --- a/dist/js/tempus-dominus.esm.min.js +++ b/dist/js/tempus-dominus.esm.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ -var t;!function(t){t.seconds="seconds",t.minutes="minutes",t.hours="hours",t.date="date",t.month="month",t.year="year"}(t||(t={}));const e={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},s={hour:"2-digit",hour12:!1},i=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}};class o extends Date{constructor(){super(...arguments),this.locale="default",this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335]}setLocale(t){return this.locale=t,this}static convert(t,e="default"){if(!t)throw new Error("A date is required");return new o(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocale(e)}static fromString(t,e){return new o(t)}get clone(){return new o(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":if(this.startOf(t.date),this.weekDay===s)break;let e=this.weekDay;0!==s&&0===this.weekDay&&(e=8-s),this.manipulate(s-e,t.date);break;case"month":this.startOf(t.date),this.setDate(1);break;case"year":this.startOf(t.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":this.endOf(t.date),this.manipulate(6+s-this.weekDay,t.date);break;case"month":this.endOf(t.date),this.manipulate(1,t.month),this.setDate(0);break;case"year":this.endOf(t.date),this.manipulate(1,t.year),this.setDate(0)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}format(t,e=this.locale){return new Intl.DateTimeFormat(e,t).format(this)}isBefore(t,e){if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=o.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1];return(o?this.isAfter(t,s):!this.isBefore(t,s))&&(a?this.isBefore(e,s):!this.isAfter(e,s))||(o?this.isBefore(t,s):!this.isAfter(t,s))&&(a?this.isAfter(e,s):!this.isBefore(e,s))}parts(t=this.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,e).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,e).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){return this.parts(void 0,s).hour}get twelveHoursFormatted(){return this.parts(void 0,e).hour}meridiem(t=this.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,e).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,e).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear(this.year-1):s>this.weeksInWeekYear(this.year)&&(s=1),s}weeksInWeekYear(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,s=t-1,i=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===e||3===i?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}}class a extends Error{}class n{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new a(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new a(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new a(`${this.base} Unexpected option value: ${t} does not accept a value of "${e}". Valid values are: ${s.join(", ")}`);throw i.code=2,i}typeMismatch(t,e,s){const i=new a(`${this.base} Mismatch types: ${t} has a type of ${e} instead of the required ${s}`);throw i.code=3,i}numbersOutOfRange(t,e,s){const i=new a(`${this.base} ${t} expected an array of number between ${e} and ${s}.`);throw i.code=4,i}failedToParseDate(t,e,s=!1){const i=new a(`${this.base} Could not correctly parse "${e}" to a date for ${t}.`);if(i.code=5,!s)throw i;console.warn(i)}mustProvideElement(){const t=new a(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new a(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new a(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}customDateFormatError(t){const e=new a(`${this.base} customDateFormat: ${t}`);throw e.code=9,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}throwError(t){const e=new a(`${this.base} ${t}`);throw e.code=9,e}}const r="tempus-dominus";class d{}d.NAME=r,d.dataKey="td",d.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},d.css=new class{constructor(){this.widget=`${r}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},d.errorMessages=new n;class c{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let l;const h=[{name:"calendar",className:d.css.daysContainer,unit:t.month,step:1},{name:"months",className:d.css.monthsContainer,unit:t.year,step:1},{name:"years",className:d.css.yearsContainer,unit:t.year,step:10},{name:"decades",className:d.css.decadesContainer,unit:t.year,step:100}];class p{constructor(){this._currentCalendarViewMode=0,this._viewDate=new o,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=h[t].name}get viewDate(){return this._viewDate}set viewDate(t){this._viewDate=t,this.options&&(this.options.viewDate=t)}refreshCurrentView(){this.currentView=h[this.currentCalendarViewMode].name}}class u{constructor(){this.optionsStore=l.locate(p)}isValid(e,s){if(s!==t.month&&this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))return!1;if(s!==t.month&&this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))return!1;if(s!==t.month&&s!==t.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&e.isBefore(this.optionsStore.options.restrictions.minDate,s))return!1;if(this.optionsStore.options.restrictions.maxDate&&e.isAfter(this.optionsStore.options.restrictions.maxDate,s))return!1;if(s===t.hours||s===t.minutes||s===t.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(e))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(e))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let t of this.optionsStore.options.restrictions.disabledTimeIntervals)if(e.isBetween(t.from,t.to))return!1}return!0}_isInDisabledDates(e){return!(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)&&this.optionsStore.options.restrictions.disabledDates.find((s=>s.isSame(e,t.date)))}_isInEnabledDates(e){return!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length||this.optionsStore.options.restrictions.enabledDates.find((s=>s.isSame(e,t.date)))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.find((t=>t===e))}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.find((t=>t===e))}}class m{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class y{constructor(){this.triggerEvent=new m,this.viewUpdate=new m,this.updateDisplay=new m,this.action=new m,this.updateViewDate=new m}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy(),this.updateViewDate.destroy()}}const g={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto"},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>t,format:"L LT"},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new o,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};function v(t,e){if(t.constructor.name===o.name)return t;if(t.constructor.name===Date.name)return o.convert(t);if("string"==typeof t){const s=o.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}function w(t,e,s){"string"==typeof t&&"input"!==e&&d.errorMessages.dateString();const i=v(t,s);return i||d.errorMessages.failedToParseDate(e,t,"input"===e),i}function S(t,e,s,i){Array.isArray(e)||d.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||d.errorMessages.typeMismatch(t,s,"array of numbers")}function b(t){return({value:e,providedType:s,localization:i})=>{const o=w(e,t,i);if(void 0!==o)return o.setLocale(i.locale),o;d.errorMessages.typeMismatch(t,s,"DateTime or Date")}}function D(t){const e=b(t);return t=>void 0===t.value?t.value:e(t)}function _(t,e,s){return({value:i,providedType:o})=>void 0===i?[]:(f(t,i,o),i.some((t=>ts))&&d.errorMessages.numbersOutOfRange(t,e,s),i)}function k(t){return _(t,0,23)}function C(t){return({value:e,providedType:s,localization:i})=>void 0===e?[]:(S(t,e,s,i),e)}function E(t){return({value:e,path:s})=>(t.includes(e)||d.errorMessages.unexpectedOptionValue(s.substring(1),e,t),e)}const M=Object.freeze({defaultDate:b("defaultDate"),viewDate:b("viewDate"),minDate:D("restrictions.minDate"),maxDate:D("restrictions.maxDate"),disabledHours:k("restrictions.disabledHours"),enabledHours:k("restrictions.enabledHours"),disabledDates:C("restrictions.disabledDates"),enabledDates:C("restrictions.enabledDates"),daysOfWeekDisabled:_("restrictions.daysOfWeekDisabled",0,6),disabledTimeIntervals:({key:t,value:e,providedType:s,localization:i})=>{if(void 0===e)return[];Array.isArray(e)||d.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const o=e;for(let e=0;e{const a=`${t}[${e}].${s}`,n=o[e][s],r=w(n,a,i);r||d.errorMessages.typeMismatch(a,typeof n,"DateTime or Date"),r.setLocale(i.locale),o[e][s]=r}));return o},toolbarPlacement:E(["top","bottom","default"]),type:E(["icons","sprites"]),viewMode:E(["clock","calendar","months","years","decades"]),theme:E(["light","dark","auto"]),meta:({value:t})=>t,dayViewHeaderFormat:({value:t})=>t,container:({value:t,path:e})=>(t&&!(t instanceof HTMLElement||t instanceof Element||t?.appendChild)&&d.errorMessages.typeMismatch(e.substring(1),typeof t,"HTMLElement"),t),useTwentyfourHour:({value:t,path:e,providedType:s,defaultType:i})=>{if(void 0===t||"boolean"===s)return t;d.errorMessages.typeMismatch(e,s,i)}}),T=({value:t,defaultType:e,providedType:s,path:i})=>{switch(e){case"boolean":return"true"===t||!0===t;case"number":return+t;case"string":return t.toString();case"object":return{};case"function":return t;default:d.errorMessages.typeMismatch(i,s,e)}};function L(t){return(M[t.key]||T)(t)}class A{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];i instanceof o?e[s]=i.clone:(i instanceof Date&&(e[s]=new Date(i.valueOf())),e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||Array.isArray(i)||(e[s]=A.deepCopy(i)))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>A.isValue(t)||A.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i){const o=A.objectPath(s,g),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=A.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));d.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,c=t[a];if(null==c)return e[a]=c,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||A.ignoreProperties.includes(a)?e[a]=A.processKey(a,c,r,d,s,i):A.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){return L({key:t,value:e,providedType:s,defaultType:i,path:o,localization:a})}static _mergeOptions(t,e){const s=A.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||g.localization;return A.spread(t,s,"",i),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;let i={};const o=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},a=(t,e,s,i)=>{const n=o(s)[t[e].toLowerCase()],r={};return void 0===n||(s[n].constructor===Object?(e++,r[n]=a(t,e,s[n],i)):r[n]=i),r},n=o(e);return Object.keys(s).filter((t=>t.startsWith(d.dataKey))).map((t=>t.substring(2))).forEach((t=>{let o=n[t.toLowerCase()];if(t.includes("_")){const r=t.split("_");o=n[r[0].toLowerCase()],void 0!==o&&e[o].constructor===Object&&(i[o]=a(r,1,e[o],s[`td${t}`]))}else void 0!==o&&(i[o]=s[`td${t}`])})),this._mergeOptions(i,e)}static _dateTypeCheck(t,e){return v(t,e)}static _typeCheckDateArray(t,e,s,i){return S(t,e,s,i)}static _typeCheckNumberArray(t,e,s){return f(t,e,s)}static dateConversion(t,e,s){return w(t,e,s)}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(g),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||d.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&d.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&d.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}A.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],A.isValue=t=>null!=t;class V{constructor(){this._dates=[],this.optionsStore=l.locate(p),this.validation=l.locate(u),this._eventEmitters=l.locate(y)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){const e=this.optionsStore.options.display.components;return t?t.format({year:e.calendar&&e.year?"numeric":void 0,month:e.calendar&&e.month?"2-digit":void 0,day:e.calendar&&e.date?"2-digit":void 0,hour:e.clock&&e.hours?e.useTwentyfourHour?"2-digit":"numeric":void 0,minute:e.clock&&e.minutes?"2-digit":void 0,second:e.clock&&e.seconds?"2-digit":void 0,hour12:!e.useTwentyfourHour}):""}parseInput(t){return A.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocale(this.optionsStore.options.localization.locale),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!e)return void 0!==this._dates.find((e=>e===t));const s=i(e);let o=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===o))}pickedIndex(t,e){if(!e)return this._dates.indexOf(t);const s=i(e);let o=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(o)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:d.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[]}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}setValue(t,e){const s=void 0===e,i=!t&&s;let o=this.optionsStore.unset?null:this._dates[e];!o&&!this.optionsStore.unset&&s&&i&&(o=this.lastPicked);const a=()=>{if(!this.optionsStore.input)return;let e=this.formatInput(t);this.optionsStore.options.multipleDates&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)};if(t&&o?.isSame(t))a();else{if(!t)return!this.optionsStore.options.multipleDates||1===this._dates.length||i?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),a(),this._eventEmitters.triggerEvent.emit({type:d.events.change,date:void 0,oldDate:o,isClear:i,isValid:!0}),void this._eventEmitters.updateDisplay.emit("all");if(e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.seconds=0),this.validation.isValid(t))return this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),a(),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),void this._eventEmitters.triggerEvent.emit({type:d.events.change,date:t,oldDate:o,isClear:i,isValid:!0});this.optionsStore.options.keepInvalid&&(this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),a(),this._eventEmitters.triggerEvent.emit({type:d.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:d.events.error,reason:d.errorMessages.failedToSetInvalidDate,date:t,oldDate:o})}}}var $;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}($||($={}));var O=$;class H{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(V),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");if(t.classList.add(d.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.appendChild(e)}for(let e=0;e<42;e++){if(0!==e&&e%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",O.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.daysContainer)[0];if("calendar"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.month),t.month)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.month),t.month)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let a=this.optionsStore.viewDate.clone.startOf(t.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.hours);i.querySelectorAll(`[data-action="${O.selectDay}"], .${d.css.calendarWeeks}`).forEach((e=>{if(this.optionsStore.options.display.calendarWeeks&&e.classList.contains(d.css.calendarWeeks)){if("#"===e.innerText)return;return void(e.innerText=`${a.week}`)}let i=[];i.push(d.css.day),a.isBefore(this.optionsStore.viewDate,t.month)&&i.push(d.css.old),a.isAfter(this.optionsStore.viewDate,t.month)&&i.push(d.css.new),!this.optionsStore.unset&&this.dates.isPicked(a,t.date)&&i.push(d.css.active),this.validation.isValid(a,t.date)||i.push(d.css.disabled),a.isSame(new o,t.date)&&i.push(d.css.today),0!==a.weekDay&&6!==a.weekDay||i.push(d.css.weekend),s(t.date,a,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${a.year}-${a.monthFormatted}-${a.dateFormatted}`),e.setAttribute("data-day",`${a.date}`),e.innerText=a.format({day:"numeric"}),a.manipulate(1,t.date)}))}_daysOfTheWeek(){let e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.date);const s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.innerText="#",s.push(t)}for(let i=0;i<7;i++){const i=document.createElement("div");i.classList.add(d.css.dayOfTheWeek,d.css.noHighlight),i.innerText=e.format({weekday:"short"}),e.manipulate(1,t.date),s.push(i)}return s}}class x{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(V),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.year),t.year)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.year),t.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.year);i.querySelectorAll(`[data-action="${O.selectMonth}"]`).forEach(((e,i)=>{let a=[];a.push(d.css.month),!this.optionsStore.unset&&this.dates.isPicked(o,t.month)&&a.push(d.css.active),this.validation.isValid(o,t.month)||a.push(d.css.disabled),s(t.month,o,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${i}`),e.innerText=`${o.format({month:"short"})}`,o.manipulate(1,t.month)}))}}class P{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(V),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.year);const i=e.getElementsByClassName(d.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this._startYear,t.year)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this._endYear,t.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.year).manipulate(-1,t.year);i.querySelectorAll(`[data-action="${O.selectYear}"]`).forEach((e=>{let i=[];i.push(d.css.year),!this.optionsStore.unset&&this.dates.isPicked(o,t.year)&&i.push(d.css.active),this.validation.isValid(o,t.year)||i.push(d.css.disabled),s(t.year,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}`),e.innerText=o.format({year:"numeric"}),o.manipulate(1,t.year)}))}}class I{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(V),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=V.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.year),this._endDecade.year=o;const a=e.getElementsByClassName(d.css.decadesContainer)[0],[n,r,c]=a.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(r.setAttribute(d.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.year)?n.classList.remove(d.css.disabled):n.classList.add(d.css.disabled),this.validation.isValid(this._endDecade,t.year)?c.classList.remove(d.css.disabled):c.classList.add(d.css.disabled));const l=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${O.selectDecade}"]`).forEach(((e,i)=>{if(0===i)return e.classList.add(d.css.old),this._startDecade.year-10<0?(e.textContent=" ",n.classList.add(d.css.disabled),e.classList.add(d.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));let o=[];o.push(d.css.decade);const a=this._startDecade.year,r=this._startDecade.year+9;!this.optionsStore.unset&&l.filter((t=>t>=a&&t<=r)).length>0&&o.push(d.css.active),s("decade",this._startDecade,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.year)}))}}class z{constructor(){this._gridColumns="",this.optionsStore=l.locate(p),this.dates=l.locate(V),this.validation=l.locate(u)}getPicker(t){const e=document.createElement("div");return e.classList.add(d.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(d.css.clockContainer)[0],i=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(d.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.hours),t.hours)||s.querySelector(`[data-action=${O.incrementHours}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.hours),t.hours)||s.querySelector(`[data-action=${O.decrementHours}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.hours}]`).innerText=this.optionsStore.options.display.components.useTwentyfourHour?i.hoursFormatted:i.twelveHoursFormatted),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.minutes),t.minutes)||s.querySelector(`[data-action=${O.incrementMinutes}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.minutes),t.minutes)||s.querySelector(`[data-action=${O.decrementMinutes}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.minutes}]`).innerText=i.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.seconds),t.seconds)||s.querySelector(`[data-action=${O.incrementSeconds}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.seconds),t.seconds)||s.querySelector(`[data-action=${O.decrementSeconds}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.seconds}]`).innerText=i.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const e=s.querySelector(`[data-action=${O.toggleMeridiem}]`);e.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,t.hours))?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],i=[],o=[],a=document.createElement("div"),n=e(this.optionsStore.options.display.icons.up),r=e(this.optionsStore.options.display.icons.down);a.classList.add(d.css.separator,d.css.noHighlight);const c=a.cloneNode(!0);c.innerHTML=":";const l=(t=!1)=>t?c.cloneNode(!0):a.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",O.incrementHours),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",O.showHours),e.setAttribute("data-time-component",t.hours),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",O.decrementHours),e.appendChild(r.cloneNode(!0)),o.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",O.incrementMinutes),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",O.showMinutes),e.setAttribute("data-time-component",t.minutes),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",O.decrementMinutes),e.appendChild(r.cloneNode(!0)),o.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",O.incrementSeconds),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",O.showSeconds),e.setAttribute("data-time-component",t.seconds),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",O.decrementSeconds),e.appendChild(r.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=l();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",O.toggleMeridiem),e.setAttribute("tabindex","-1"),d.css.toggleMeridiem.includes(",")?e.classList.add(...d.css.toggleMeridiem.split(",")):e.classList.add(d.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(d.css.noHighlight),t.appendChild(e),i.push(t),t=l(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class N{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.hourContainer);for(let e=0;e<(this.optionsStore.options.display.components.useTwentyfourHour?24:12);e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectHour),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.date);i.querySelectorAll(`[data-action="${O.selectHour}"]`).forEach((e=>{let i=[];i.push(d.css.hour),this.validation.isValid(o,t.hours)||i.push(d.css.disabled),s(t.hours,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.hours}`),e.innerText=this.optionsStore.options.display.components.useTwentyfourHour?o.hoursFormatted:o.twelveHoursFormatted,o.manipulate(1,t.hours)}))}}class F{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.minuteContainer);let e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",O.selectMinute),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.hours),a=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${O.selectMinute}"]`).forEach((e=>{let i=[];i.push(d.css.minute),this.validation.isValid(o,t.minutes)||i.push(d.css.disabled),s(t.minutes,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.minutes}`),e.innerText=o.minutesFormatted,o.manipulate(a,t.minutes)}))}}class B{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectSecond),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.minutes);i.querySelectorAll(`[data-action="${O.selectSecond}"]`).forEach((e=>{let i=[];i.push(d.css.second),this.validation.isValid(o,t.seconds)||i.push(d.css.disabled),s(t.seconds,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.seconds}`),e.innerText=o.secondsFormatted,o.manipulate(5,t.seconds)}))}}class q{static toggle(t){t.classList.contains(d.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(d.css.collapsing),t.classList.add(d.css.collapse,d.css.show),t.style.height=""}static show(t){if(t.classList.contains(d.css.collapsing)||t.classList.contains(d.css.show))return;t.style.height="0",t.classList.remove(d.css.collapse),t.classList.add(d.css.collapsing),setTimeout((()=>{q.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(d.css.collapsing,d.css.show),t.classList.add(d.css.collapse))}static hide(t){if(t.classList.contains(d.css.collapsing)||!t.classList.contains(d.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(d.css.collapse,d.css.show),t.classList.add(d.css.collapsing),t.style.height="",setTimeout((()=>{q.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}q.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class W{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=l.locate(p),this.validation=l.locate(u),this.dates=l.locate(V),this.dateDisplay=l.locate(H),this.monthDisplay=l.locate(x),this.yearDisplay=l.locate(P),this.decadeDisplay=l.locate(I),this.timeDisplay=l.locate(z),this.hourDisplay=l.locate(N),this.minuteDisplay=l.locate(F),this.secondDisplay=l.locate(B),this._eventEmitters=l.locate(y),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.date:this.dateDisplay._update(this.widget,this.paint);break;case t.month:this.monthDisplay._update(this.widget,this.paint);break;case t.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.hours),this._update(t.minutes),this._update(t.seconds);break;case"calendar":this._update(t.date),this._update(t.year),this._update(t.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new o).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!(this.validation.isValid(e)||(e.manipulate(i,t.date),s>31));)s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget(),this._updateTheme();const e=this._hasTime&&!this._hasDate;if(e&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:O.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),e||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?q.show(this.widget.querySelector(`div.${d.css.timeContainer}`)):q.hideImmediately(this.widget.querySelector(`div.${d.css.timeContainer}`))),q.show(this.widget.querySelector(`div.${d.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{(this.optionsStore.options?.container||document.body).appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:O.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(d.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(d.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:d.events.show}),this._isVisible=!0}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${d.css.dateContainer} > div:not(.${d.css.calendarHeader}), .${d.css.timeContainer} > div:not(.${d.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=h[this.optionsStore.currentCalendarViewMode];let s=this.widget.querySelector(`.${e.className}`);switch(e.className){case d.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case d.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case d.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case d.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(d.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(d.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(d.css.isDarkPreferredQuery).matches;switch(t){case"light":return d.css.lightTheme;case"dark":return d.css.darkTheme;case"auto":return e?d.css.darkTheme:d.css.lightTheme}}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${d.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(d.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case d.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case d.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),i.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case d.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),i.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case d.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),i.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.innerText=this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(d.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:d.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?this.dates.lastPicked.clone:void 0}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(d.css.widget);const e=document.createElement("div");e.classList.add(d.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(d.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const i=document.createElement("div");if(i.classList.add(d.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(d.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(d.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");return o.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),o.appendChild(e),o.appendChild(s),t.appendChild(o),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),void(this._widget=t)}"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),this._hasDate&&(this._hasTime&&(e.classList.add(d.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(d.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(d.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(d.css.show)),t.appendChild(s)),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");o.classList.add("arrow"),o.setAttribute("data-popper-arrow",""),t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",O.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",O.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",O.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",O.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(d.css.calendarHeader);const e=document.createElement("div");e.classList.add(d.css.previous),e.setAttribute("data-action",O.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(d.css.switch),s.setAttribute("data-action",O.changeCalendarView);const i=document.createElement("div");return i.classList.add(d.css.next),i.setAttribute("data-action",O.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class Y{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(V),this.validation=l.locate(u),this.display=l.locate(W),this._eventEmitters=l.locate(y),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const i=e?.currentTarget;if(i?.classList?.contains(d.css.disabled))return!1;s=s||i?.dataset?.action;const a=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case O.next:case O.previous:this.handleNextPrevious(s);break;case O.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case O.selectMonth:case O.selectYear:case O.selectDecade:const n=+i.dataset.value;switch(s){case O.selectMonth:this.optionsStore.viewDate.month=n;break;case O.selectYear:case O.selectDecade:this.optionsStore.viewDate.year=n}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1);break;case O.selectDay:const r=this.optionsStore.viewDate.clone;i.classList.contains(d.css.old)&&r.manipulate(-1,t.month),i.classList.contains(d.css.new)&&r.manipulate(1,t.month),r.date=+i.dataset.day;let c=0;this.optionsStore.options.multipleDates?(c=this.dates.pickedIndex(r,t.date),-1!==c?this.dates.setValue(null,c):this.dates.setValue(r,this.dates.lastPickedIndex+1)):this.dates.setValue(r,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.display.hide();break;case O.selectHour:let l=+i.dataset.value;a.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(l+=12),a.hours=l,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case O.selectMinute:a.minutes=+i.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case O.selectSecond:a.seconds=+i.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case O.incrementHours:this.manipulateAndSet(a,t.hours);break;case O.incrementMinutes:this.manipulateAndSet(a,t.minutes,this.optionsStore.options.stepping);break;case O.incrementSeconds:this.manipulateAndSet(a,t.seconds);break;case O.decrementHours:this.manipulateAndSet(a,t.hours,-1);break;case O.decrementMinutes:this.manipulateAndSet(a,t.minutes,-1*this.optionsStore.options.stepping);break;case O.decrementSeconds:this.manipulateAndSet(a,t.seconds,-1);break;case O.toggleMeridiem:this.manipulateAndSet(a,t.hours,this.dates.lastPicked.hours>=12?-12:12);break;case O.togglePicker:i.getAttribute("title")===this.optionsStore.options.localization.selectDate?(i.setAttribute("title",this.optionsStore.options.localization.selectTime),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(i.setAttribute("title",this.optionsStore.options.localization.selectDate),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(O.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${d.css.dateContainer}, .${d.css.timeContainer}`).forEach((t=>q.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case O.showClock:case O.showHours:case O.showMinutes:case O.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(q.hideImmediately(this.display.widget.querySelector(`div.${d.css.dateContainer}`)),q.showImmediately(this.display.widget.querySelector(`div.${d.css.timeContainer}`))),this.handleShowClockContainers(s);break;case O.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case O.close:this.display.hide();break;case O.today:const h=(new o).setLocale(this.optionsStore.options.localization.locale);this._eventEmitters.updateViewDate.emit(h),this.validation.isValid(h,t.date)&&this.dates.setValue(h,this.dates.lastPickedIndex)}}handleShowClockContainers(e){if(!this.display._hasTime)return void d.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${d.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case O.showClock:s=d.css.clockContainer,this.display._update("clock");break;case O.showHours:s=d.css.hourContainer,this.display._update(t.hours);break;case O.showMinutes:s=d.css.minuteContainer,this.display._update(t.minutes);break;case O.showSeconds:s=d.css.secondContainer,this.display._update(t.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=h[this.optionsStore.currentCalendarViewMode];t===O.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,O.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class j{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},l=new c,this._eventEmitters=l.locate(y),this.optionsStore=l.locate(p),this.display=l.locate(W),this.dates=l.locate(V),this.actions=l.locate(Y),t||d.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,g,!0),this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()})),this._eventEmitters.updateViewDate.subscribe((t=>{this.viewDate=t}))}get viewDate(){return this.optionsStore.viewDate}set viewDate(t){this.optionsStore.viewDate=t,this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.display._update("clock"===this.optionsStore.currentView?"clock":"calendar")}updateOptions(t,e=!1){e?this._initializeOptions(t,g):this._initializeOptions(t,this.optionsStore.options),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&d.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:d.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=A.deepCopy(t);i=A._mergeOptions(i,e),s&&(i=A._dataToOptions(this.optionsStore.element,i)),A._validateConflicts(i),i.viewDate=i.viewDate.setLocale(i.localization.locale),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),h[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(h.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),void 0===i.display.components.useTwentyfourHour&&(i.display.components.useTwentyfourHour=!i.viewDate.parts()?.dayPeriod),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{let t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(d.css.show)[0].classList.contains(d.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${d.css.switch} div`)},action:O.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const U={},Q=t=>{U[t.name]||(U[t.name]=t.localization)},K=t=>{let e=U[t];e&&(g.localization=e)},J=function(t,e){return t?(t.installed||(t(e,{TempusDominus:j,Dates:V,Display:W,DateTime:o,ErrorMessages:n},G),t.installed=!0),G):G},R="6.2.6",G={TempusDominus:j,extend:J,loadLocale:Q,locale:K,Namespace:d,DefaultOptions:g,DateTime:o,Unit:t,version:"6.2.6"};export{o as DateTime,g as DefaultOptions,d as Namespace,j as TempusDominus,t as Unit,J as extend,Q as loadLocale,K as locale,R as version}; +var t;!function(t){t.seconds="seconds",t.minutes="minutes",t.hours="hours",t.date="date",t.month="month",t.year="year"}(t||(t={}));const e={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},s={hour:"2-digit",hour12:!1},i=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}};class o extends Date{constructor(){super(...arguments),this.locale="default",this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335]}setLocale(t){return this.locale=t,this}static convert(t,e="default"){if(!t)throw new Error("A date is required");return new o(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocale(e)}static fromString(t,e){return new o(t)}get clone(){return new o(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":if(this.startOf(t.date),this.weekDay===s)break;let e=this.weekDay;0!==s&&0===this.weekDay&&(e=8-s),this.manipulate(s-e,t.date);break;case"month":this.startOf(t.date),this.setDate(1);break;case"year":this.startOf(t.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":this.endOf(t.date);const e=6+s;if(this.weekDay===e)break;this.manipulate(e-this.weekDay,t.date);break;case"month":this.endOf(t.date),this.manipulate(1,t.month),this.setDate(0);break;case"year":this.endOf(t.date),this.setMonth(11,31)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}format(t,e=this.locale){return new Intl.DateTimeFormat(e,t).format(this)}isBefore(t,e){if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=o.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1];return(o?this.isAfter(t,s):!this.isBefore(t,s))&&(a?this.isBefore(e,s):!this.isAfter(e,s))||(o?this.isBefore(t,s):!this.isAfter(t,s))&&(a?this.isAfter(e,s):!this.isBefore(e,s))}parts(t=this.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,e).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,e).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){return this.parts(void 0,s).hour}get twelveHoursFormatted(){return this.parts(void 0,e).hour}meridiem(t=this.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,e).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,e).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear(this.year-1):s>this.weeksInWeekYear(this.year)&&(s=1),s}weeksInWeekYear(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,s=t-1,i=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===e||3===i?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}}class a extends Error{}const n="tempus-dominus";class r{}r.NAME=n,r.dataKey="td",r.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},r.css=new class{constructor(){this.widget=`${n}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},r.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new a(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new a(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new a(`${this.base} Unexpected option value: ${t} does not accept a value of "${e}". Valid values are: ${s.join(", ")}`);throw i.code=2,i}typeMismatch(t,e,s){const i=new a(`${this.base} Mismatch types: ${t} has a type of ${e} instead of the required ${s}`);throw i.code=3,i}numbersOutOfRange(t,e,s){const i=new a(`${this.base} ${t} expected an array of number between ${e} and ${s}.`);throw i.code=4,i}failedToParseDate(t,e,s=!1){const i=new a(`${this.base} Could not correctly parse "${e}" to a date for ${t}.`);if(i.code=5,!s)throw i;console.warn(i)}mustProvideElement(){const t=new a(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new a(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new a(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}customDateFormatError(t){const e=new a(`${this.base} customDateFormat: ${t}`);throw e.code=9,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}throwError(t){const e=new a(`${this.base} ${t}`);throw e.code=9,e}};class d{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let c;const l=[{name:"calendar",className:r.css.daysContainer,unit:t.month,step:1},{name:"months",className:r.css.monthsContainer,unit:t.year,step:1},{name:"years",className:r.css.yearsContainer,unit:t.year,step:10},{name:"decades",className:r.css.decadesContainer,unit:t.year,step:100}];class h{constructor(){this._currentCalendarViewMode=0,this._viewDate=new o,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=l[t].name}get viewDate(){return this._viewDate}set viewDate(t){this._viewDate=t,this.options&&(this.options.viewDate=t)}refreshCurrentView(){this.currentView=l[this.currentCalendarViewMode].name}}class p{constructor(){this.optionsStore=c.locate(h)}isValid(e,s){if(s!==t.month&&this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))return!1;if(s!==t.month&&this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))return!1;if(s!==t.month&&s!==t.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&e.isBefore(this.optionsStore.options.restrictions.minDate,s))return!1;if(this.optionsStore.options.restrictions.maxDate&&e.isAfter(this.optionsStore.options.restrictions.maxDate,s))return!1;if(s===t.hours||s===t.minutes||s===t.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(e))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(e))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let t of this.optionsStore.options.restrictions.disabledTimeIntervals)if(e.isBetween(t.from,t.to))return!1}return!0}_isInDisabledDates(e){return!(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)&&this.optionsStore.options.restrictions.disabledDates.find((s=>s.isSame(e,t.date)))}_isInEnabledDates(e){return!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length||this.optionsStore.options.restrictions.enabledDates.find((s=>s.isSame(e,t.date)))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.find((t=>t===e))}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.find((t=>t===e))}}class u{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class m{constructor(){this.triggerEvent=new u,this.viewUpdate=new u,this.updateDisplay=new u,this.action=new u,this.updateViewDate=new u}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy(),this.updateViewDate.destroy()}}const y={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto"},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>t,format:"L LT"},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new o,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};function g(t,e){if(t.constructor.name===o.name)return t;if(t.constructor.name===Date.name)return o.convert(t);if("string"==typeof t){const s=o.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}function v(t,e,s){"string"==typeof t&&"input"!==e&&r.errorMessages.dateString();const i=g(t,s);return i||r.errorMessages.failedToParseDate(e,t,"input"===e),i}function S(t,e,s,i){Array.isArray(e)||r.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||r.errorMessages.typeMismatch(t,s,"array of numbers")}function f(t){return({value:e,providedType:s,localization:i})=>{const o=v(e,t,i);if(void 0!==o)return o.setLocale(i.locale),o;r.errorMessages.typeMismatch(t,s,"DateTime or Date")}}function b(t){const e=f(t);return t=>void 0===t.value?t.value:e(t)}function D(t,e,s){return({value:i,providedType:o})=>void 0===i?[]:(w(t,i,o),i.some((t=>ts))&&r.errorMessages.numbersOutOfRange(t,e,s),i)}function k(t){return D(t,0,23)}function _(t){return({value:e,providedType:s,localization:i})=>void 0===e?[]:(S(t,e,s,i),e)}function C(t){return({value:e,path:s})=>(t.includes(e)||r.errorMessages.unexpectedOptionValue(s.substring(1),e,t),e)}const E=Object.freeze({defaultDate:f("defaultDate"),viewDate:f("viewDate"),minDate:b("restrictions.minDate"),maxDate:b("restrictions.maxDate"),disabledHours:k("restrictions.disabledHours"),enabledHours:k("restrictions.enabledHours"),disabledDates:_("restrictions.disabledDates"),enabledDates:_("restrictions.enabledDates"),daysOfWeekDisabled:D("restrictions.daysOfWeekDisabled",0,6),disabledTimeIntervals:({key:t,value:e,providedType:s,localization:i})=>{if(void 0===e)return[];Array.isArray(e)||r.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const o=e;for(let e=0;e{const a=`${t}[${e}].${s}`,n=o[e][s],d=v(n,a,i);d||r.errorMessages.typeMismatch(a,typeof n,"DateTime or Date"),d.setLocale(i.locale),o[e][s]=d}));return o},toolbarPlacement:C(["top","bottom","default"]),type:C(["icons","sprites"]),viewMode:C(["clock","calendar","months","years","decades"]),theme:C(["light","dark","auto"]),meta:({value:t})=>t,dayViewHeaderFormat:({value:t})=>t,container:({value:t,path:e})=>(t&&!(t instanceof HTMLElement||t instanceof Element||t?.appendChild)&&r.errorMessages.typeMismatch(e.substring(1),typeof t,"HTMLElement"),t),useTwentyfourHour:({value:t,path:e,providedType:s,defaultType:i})=>{if(void 0===t||"boolean"===s)return t;r.errorMessages.typeMismatch(e,s,i)}}),M=({value:t,defaultType:e,providedType:s,path:i})=>{switch(e){case"boolean":return"true"===t||!0===t;case"number":return+t;case"string":return t.toString();case"object":return{};case"function":return t;default:r.errorMessages.typeMismatch(i,s,e)}};function T(t){return(E[t.key]||M)(t)}class L{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];i instanceof o?e[s]=i.clone:i instanceof Date?e[s]=new Date(i.valueOf()):(e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||Array.isArray(i)||(e[s]=L.deepCopy(i)))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>L.isValue(t)||L.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i){const o=L.objectPath(s,y),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=L.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));r.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,c=t[a];if(null==c)return e[a]=c,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||L.ignoreProperties.includes(a)?e[a]=L.processKey(a,c,r,d,s,i):L.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){return T({key:t,value:e,providedType:s,defaultType:i,path:o,localization:a})}static _mergeOptions(t,e){const s=L.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||y.localization;return L.spread(t,s,"",i),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;let i={};const o=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},a=(t,e,s,i)=>{const n=o(s)[t[e].toLowerCase()],r={};return void 0===n||(s[n].constructor===Object?(e++,r[n]=a(t,e,s[n],i)):r[n]=i),r},n=o(e);return Object.keys(s).filter((t=>t.startsWith(r.dataKey))).map((t=>t.substring(2))).forEach((t=>{let o=n[t.toLowerCase()];if(t.includes("_")){const r=t.split("_");o=n[r[0].toLowerCase()],void 0!==o&&e[o].constructor===Object&&(i[o]=a(r,1,e[o],s[`td${t}`]))}else void 0!==o&&(i[o]=s[`td${t}`])})),this._mergeOptions(i,e)}static _dateTypeCheck(t,e){return g(t,e)}static _typeCheckDateArray(t,e,s,i){return S(t,e,s,i)}static _typeCheckNumberArray(t,e,s){return w(t,e,s)}static dateConversion(t,e,s){return v(t,e,s)}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(y),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||r.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&r.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&r.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}L.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],L.isValue=t=>null!=t;class A{constructor(){this._dates=[],this.optionsStore=c.locate(h),this.validation=c.locate(p),this._eventEmitters=c.locate(m)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){const e=this.optionsStore.options.display.components;return t?t.format({year:e.calendar&&e.year?"numeric":void 0,month:e.calendar&&e.month?"2-digit":void 0,day:e.calendar&&e.date?"2-digit":void 0,hour:e.clock&&e.hours?e.useTwentyfourHour?"2-digit":"numeric":void 0,minute:e.clock&&e.minutes?"2-digit":void 0,second:e.clock&&e.seconds?"2-digit":void 0,hour12:!e.useTwentyfourHour}):""}parseInput(t){return L.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocale(this.optionsStore.options.localization.locale),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!e)return void 0!==this._dates.find((e=>e===t));const s=i(e);let o=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===o))}pickedIndex(t,e){if(!e)return this._dates.indexOf(t);const s=i(e);let o=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(o)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:r.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[]}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}updateInput(t){if(!this.optionsStore.input)return;let e=this.formatInput(t);this.optionsStore.options.multipleDates&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)}setValue(t,e){const s=void 0===e,i=!t&&s;let o=this.optionsStore.unset?null:this._dates[e];if(!o&&!this.optionsStore.unset&&s&&i&&(o=this.lastPicked),t&&o?.isSame(t))this.updateInput(t);else{if(!t)return!this.optionsStore.options.multipleDates||1===this._dates.length||i?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),this.updateInput(),this._eventEmitters.triggerEvent.emit({type:r.events.change,date:void 0,oldDate:o,isClear:i,isValid:!0}),void this._eventEmitters.updateDisplay.emit("all");if(e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.seconds=0),this.validation.isValid(t))return this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),this.updateInput(t),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),void this._eventEmitters.triggerEvent.emit({type:r.events.change,date:t,oldDate:o,isClear:i,isValid:!0});this.optionsStore.options.keepInvalid&&(this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),this.updateInput(t),this._eventEmitters.triggerEvent.emit({type:r.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:r.events.error,reason:r.errorMessages.failedToSetInvalidDate,date:t,oldDate:o})}}}var $;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}($||($={}));var V=$;class O{constructor(){this.optionsStore=c.locate(h),this.dates=c.locate(A),this.validation=c.locate(p)}getPicker(){const t=document.createElement("div");if(t.classList.add(r.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(r.css.calendarWeeks,r.css.noHighlight),t.appendChild(e)}for(let e=0;e<42;e++){if(0!==e&&e%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(r.css.calendarWeeks,r.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",V.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(r.css.daysContainer)[0];if("calendar"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(r.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(r.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?s.classList.remove(r.css.disabled):s.classList.add(r.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.month),t.month)?e.classList.remove(r.css.disabled):e.classList.add(r.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.month),t.month)?o.classList.remove(r.css.disabled):o.classList.add(r.css.disabled)}let a=this.optionsStore.viewDate.clone.startOf(t.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.hours);i.querySelectorAll(`[data-action="${V.selectDay}"], .${r.css.calendarWeeks}`).forEach((e=>{if(this.optionsStore.options.display.calendarWeeks&&e.classList.contains(r.css.calendarWeeks)){if("#"===e.innerText)return;return void(e.innerText=`${a.week}`)}let i=[];i.push(r.css.day),a.isBefore(this.optionsStore.viewDate,t.month)&&i.push(r.css.old),a.isAfter(this.optionsStore.viewDate,t.month)&&i.push(r.css.new),!this.optionsStore.unset&&this.dates.isPicked(a,t.date)&&i.push(r.css.active),this.validation.isValid(a,t.date)||i.push(r.css.disabled),a.isSame(new o,t.date)&&i.push(r.css.today),0!==a.weekDay&&6!==a.weekDay||i.push(r.css.weekend),s(t.date,a,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${a.year}-${a.monthFormatted}-${a.dateFormatted}`),e.setAttribute("data-day",`${a.date}`),e.innerText=a.format({day:"numeric"}),a.manipulate(1,t.date)}))}_daysOfTheWeek(){let e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.date);const s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(r.css.calendarWeeks,r.css.noHighlight),t.innerText="#",s.push(t)}for(let i=0;i<7;i++){const i=document.createElement("div");i.classList.add(r.css.dayOfTheWeek,r.css.noHighlight),i.innerText=e.format({weekday:"short"}),e.manipulate(1,t.date),s.push(i)}return s}}class H{constructor(){this.optionsStore=c.locate(h),this.dates=c.locate(A),this.validation=c.locate(p)}getPicker(){const t=document.createElement("div");t.classList.add(r.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",V.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(r.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(r.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(r.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(r.css.disabled):s.classList.add(r.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.year),t.year)?e.classList.remove(r.css.disabled):e.classList.add(r.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.year),t.year)?o.classList.remove(r.css.disabled):o.classList.add(r.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.year);i.querySelectorAll(`[data-action="${V.selectMonth}"]`).forEach(((e,i)=>{let a=[];a.push(r.css.month),!this.optionsStore.unset&&this.dates.isPicked(o,t.month)&&a.push(r.css.active),this.validation.isValid(o,t.month)||a.push(r.css.disabled),s(t.month,o,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${i}`),e.innerText=`${o.format({month:"short"})}`,o.manipulate(1,t.month)}))}}class x{constructor(){this.optionsStore=c.locate(h),this.dates=c.locate(A),this.validation=c.locate(p)}getPicker(){const t=document.createElement("div");t.classList.add(r.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",V.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.year);const i=e.getElementsByClassName(r.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(r.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(r.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(r.css.disabled):s.classList.add(r.css.disabled),this.validation.isValid(this._startYear,t.year)?e.classList.remove(r.css.disabled):e.classList.add(r.css.disabled),this.validation.isValid(this._endYear,t.year)?o.classList.remove(r.css.disabled):o.classList.add(r.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.year).manipulate(-1,t.year);i.querySelectorAll(`[data-action="${V.selectYear}"]`).forEach((e=>{let i=[];i.push(r.css.year),!this.optionsStore.unset&&this.dates.isPicked(o,t.year)&&i.push(r.css.active),this.validation.isValid(o,t.year)||i.push(r.css.disabled),s(t.year,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}`),e.innerText=o.format({year:"numeric"}),o.manipulate(1,t.year)}))}}class P{constructor(){this.optionsStore=c.locate(h),this.dates=c.locate(A),this.validation=c.locate(p)}getPicker(){const t=document.createElement("div");t.classList.add(r.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",V.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=A.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.year),this._endDecade.year=o;const a=e.getElementsByClassName(r.css.decadesContainer)[0],[n,d,c]=a.parentElement.getElementsByClassName(r.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(d.setAttribute(r.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.year)?n.classList.remove(r.css.disabled):n.classList.add(r.css.disabled),this.validation.isValid(this._endDecade,t.year)?c.classList.remove(r.css.disabled):c.classList.add(r.css.disabled));const l=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${V.selectDecade}"]`).forEach(((e,i)=>{if(0===i)return e.classList.add(r.css.old),this._startDecade.year-10<0?(e.textContent=" ",n.classList.add(r.css.disabled),e.classList.add(r.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));let o=[];o.push(r.css.decade);const a=this._startDecade.year,d=this._startDecade.year+9;!this.optionsStore.unset&&l.filter((t=>t>=a&&t<=d)).length>0&&o.push(r.css.active),s("decade",this._startDecade,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.year)}))}}class I{constructor(){this._gridColumns="",this.optionsStore=c.locate(h),this.dates=c.locate(A),this.validation=c.locate(p)}getPicker(t){const e=document.createElement("div");return e.classList.add(r.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(r.css.clockContainer)[0],i=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(r.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.hours),t.hours)||s.querySelector(`[data-action=${V.incrementHours}]`).classList.add(r.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.hours),t.hours)||s.querySelector(`[data-action=${V.decrementHours}]`).classList.add(r.css.disabled),s.querySelector(`[data-time-component=${t.hours}]`).innerText=this.optionsStore.options.display.components.useTwentyfourHour?i.hoursFormatted:i.twelveHoursFormatted),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.minutes),t.minutes)||s.querySelector(`[data-action=${V.incrementMinutes}]`).classList.add(r.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.minutes),t.minutes)||s.querySelector(`[data-action=${V.decrementMinutes}]`).classList.add(r.css.disabled),s.querySelector(`[data-time-component=${t.minutes}]`).innerText=i.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.seconds),t.seconds)||s.querySelector(`[data-action=${V.incrementSeconds}]`).classList.add(r.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.seconds),t.seconds)||s.querySelector(`[data-action=${V.decrementSeconds}]`).classList.add(r.css.disabled),s.querySelector(`[data-time-component=${t.seconds}]`).innerText=i.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const e=s.querySelector(`[data-action=${V.toggleMeridiem}]`);e.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,t.hours))?e.classList.remove(r.css.disabled):e.classList.add(r.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],i=[],o=[],a=document.createElement("div"),n=e(this.optionsStore.options.display.icons.up),d=e(this.optionsStore.options.display.icons.down);a.classList.add(r.css.separator,r.css.noHighlight);const c=a.cloneNode(!0);c.innerHTML=":";const l=(t=!1)=>t?c.cloneNode(!0):a.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",V.incrementHours),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",V.showHours),e.setAttribute("data-time-component",t.hours),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",V.decrementHours),e.appendChild(d.cloneNode(!0)),o.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",V.incrementMinutes),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",V.showMinutes),e.setAttribute("data-time-component",t.minutes),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",V.decrementMinutes),e.appendChild(d.cloneNode(!0)),o.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",V.incrementSeconds),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",V.showSeconds),e.setAttribute("data-time-component",t.seconds),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",V.decrementSeconds),e.appendChild(d.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=l();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",V.toggleMeridiem),e.setAttribute("tabindex","-1"),r.css.toggleMeridiem.includes(",")?e.classList.add(...r.css.toggleMeridiem.split(",")):e.classList.add(r.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(r.css.noHighlight),t.appendChild(e),i.push(t),t=l(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class z{constructor(){this.optionsStore=c.locate(h),this.validation=c.locate(p)}getPicker(){const t=document.createElement("div");t.classList.add(r.css.hourContainer);for(let e=0;e<(this.optionsStore.options.display.components.useTwentyfourHour?24:12);e++){const e=document.createElement("div");e.setAttribute("data-action",V.selectHour),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(r.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.date);i.querySelectorAll(`[data-action="${V.selectHour}"]`).forEach((e=>{let i=[];i.push(r.css.hour),this.validation.isValid(o,t.hours)||i.push(r.css.disabled),s(t.hours,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.hours}`),e.innerText=this.optionsStore.options.display.components.useTwentyfourHour?o.hoursFormatted:o.twelveHoursFormatted,o.manipulate(1,t.hours)}))}}class N{constructor(){this.optionsStore=c.locate(h),this.validation=c.locate(p)}getPicker(){const t=document.createElement("div");t.classList.add(r.css.minuteContainer);let e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",V.selectMinute),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(r.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.hours),a=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${V.selectMinute}"]`).forEach((e=>{let i=[];i.push(r.css.minute),this.validation.isValid(o,t.minutes)||i.push(r.css.disabled),s(t.minutes,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.minutes}`),e.innerText=o.minutesFormatted,o.manipulate(a,t.minutes)}))}}class F{constructor(){this.optionsStore=c.locate(h),this.validation=c.locate(p)}getPicker(){const t=document.createElement("div");t.classList.add(r.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",V.selectSecond),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(r.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.minutes);i.querySelectorAll(`[data-action="${V.selectSecond}"]`).forEach((e=>{let i=[];i.push(r.css.second),this.validation.isValid(o,t.seconds)||i.push(r.css.disabled),s(t.seconds,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.seconds}`),e.innerText=o.secondsFormatted,o.manipulate(5,t.seconds)}))}}class B{static toggle(t){t.classList.contains(r.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(r.css.collapsing),t.classList.add(r.css.collapse,r.css.show),t.style.height=""}static show(t){if(t.classList.contains(r.css.collapsing)||t.classList.contains(r.css.show))return;t.style.height="0",t.classList.remove(r.css.collapse),t.classList.add(r.css.collapsing),setTimeout((()=>{B.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(r.css.collapsing,r.css.show),t.classList.add(r.css.collapse))}static hide(t){if(t.classList.contains(r.css.collapsing)||!t.classList.contains(r.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(r.css.collapse,r.css.show),t.classList.add(r.css.collapsing),t.style.height="",setTimeout((()=>{B.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}B.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class q{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=c.locate(h),this.validation=c.locate(p),this.dates=c.locate(A),this.dateDisplay=c.locate(O),this.monthDisplay=c.locate(H),this.yearDisplay=c.locate(x),this.decadeDisplay=c.locate(P),this.timeDisplay=c.locate(I),this.hourDisplay=c.locate(z),this.minuteDisplay=c.locate(N),this.secondDisplay=c.locate(F),this._eventEmitters=c.locate(m),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.date:this.dateDisplay._update(this.widget,this.paint);break;case t.month:this.monthDisplay._update(this.widget,this.paint);break;case t.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.hours),this._update(t.minutes),this._update(t.seconds);break;case"calendar":this._update(t.date),this._update(t.year),this._update(t.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new o).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!(this.validation.isValid(e)||(e.manipulate(i,t.date),s>31));)s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget(),this._updateTheme();const e=this._hasTime&&!this._hasDate;if(e&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:V.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),e||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?B.show(this.widget.querySelector(`div.${r.css.timeContainer}`)):B.hideImmediately(this.widget.querySelector(`div.${r.css.timeContainer}`))),B.show(this.widget.querySelector(`div.${r.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{(this.optionsStore.options?.container||document.body).appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:V.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(r.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(r.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:r.events.show}),this._isVisible=!0}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${r.css.dateContainer} > div:not(.${r.css.calendarHeader}), .${r.css.timeContainer} > div:not(.${r.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=l[this.optionsStore.currentCalendarViewMode];let s=this.widget.querySelector(`.${e.className}`);switch(e.className){case r.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case r.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case r.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case r.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this.optionsStore.options.display.sideBySide&&(this.widget.querySelectorAll(`.${r.css.clockContainer}`)[0].style.display="grid"),this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(r.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(r.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(r.css.isDarkPreferredQuery).matches;switch(t){case"light":return r.css.lightTheme;case"dark":return r.css.darkTheme;case"auto":return e?r.css.darkTheme:r.css.lightTheme}}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${r.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(r.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(r.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case r.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case r.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),i.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case r.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),i.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case r.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),i.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.setAttribute(t,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat))}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(r.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:r.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?this.dates.lastPicked.clone:void 0}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(r.css.widget);const e=document.createElement("div");e.classList.add(r.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(r.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const i=document.createElement("div");if(i.classList.add(r.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(r.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(r.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");return o.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),o.appendChild(e),o.appendChild(s),t.appendChild(o),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),void(this._widget=t)}"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),this._hasDate&&(this._hasTime&&(e.classList.add(r.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(r.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(r.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(r.css.show)),t.appendChild(s)),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");o.classList.add("arrow"),o.setAttribute("data-popper-arrow",""),t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",V.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",V.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",V.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",V.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(r.css.calendarHeader);const e=document.createElement("div");e.classList.add(r.css.previous),e.setAttribute("data-action",V.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(r.css.switch),s.setAttribute("data-action",V.changeCalendarView);const i=document.createElement("div");return i.classList.add(r.css.next),i.setAttribute("data-action",V.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class W{constructor(){this.optionsStore=c.locate(h),this.dates=c.locate(A),this.validation=c.locate(p),this.display=c.locate(q),this._eventEmitters=c.locate(m),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const i=e?.currentTarget;if(i?.classList?.contains(r.css.disabled))return!1;s=s||i?.dataset?.action;const a=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case V.next:case V.previous:this.handleNextPrevious(s);break;case V.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case V.selectMonth:case V.selectYear:case V.selectDecade:const n=+i.dataset.value;switch(s){case V.selectMonth:this.optionsStore.viewDate.month=n;break;case V.selectYear:case V.selectDecade:this.optionsStore.viewDate.year=n}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1);break;case V.selectDay:const d=this.optionsStore.viewDate.clone;i.classList.contains(r.css.old)&&d.manipulate(-1,t.month),i.classList.contains(r.css.new)&&d.manipulate(1,t.month),d.date=+i.dataset.day;let c=0;this.optionsStore.options.multipleDates?(c=this.dates.pickedIndex(d,t.date),-1!==c?this.dates.setValue(null,c):this.dates.setValue(d,this.dates.lastPickedIndex+1)):this.dates.setValue(d,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.display.hide();break;case V.selectHour:let l=+i.dataset.value;a.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(l+=12),a.hours=l,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case V.selectMinute:a.minutes=+i.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case V.selectSecond:a.seconds=+i.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case V.incrementHours:this.manipulateAndSet(a,t.hours);break;case V.incrementMinutes:this.manipulateAndSet(a,t.minutes,this.optionsStore.options.stepping);break;case V.incrementSeconds:this.manipulateAndSet(a,t.seconds);break;case V.decrementHours:this.manipulateAndSet(a,t.hours,-1);break;case V.decrementMinutes:this.manipulateAndSet(a,t.minutes,-1*this.optionsStore.options.stepping);break;case V.decrementSeconds:this.manipulateAndSet(a,t.seconds,-1);break;case V.toggleMeridiem:this.manipulateAndSet(a,t.hours,this.dates.lastPicked.hours>=12?-12:12);break;case V.togglePicker:i.getAttribute("title")===this.optionsStore.options.localization.selectDate?(i.setAttribute("title",this.optionsStore.options.localization.selectTime),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(i.setAttribute("title",this.optionsStore.options.localization.selectDate),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(V.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${r.css.dateContainer}, .${r.css.timeContainer}`).forEach((t=>B.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case V.showClock:case V.showHours:case V.showMinutes:case V.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(B.hideImmediately(this.display.widget.querySelector(`div.${r.css.dateContainer}`)),B.showImmediately(this.display.widget.querySelector(`div.${r.css.timeContainer}`))),this.handleShowClockContainers(s);break;case V.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case V.close:this.display.hide();break;case V.today:const h=(new o).setLocale(this.optionsStore.options.localization.locale);this._eventEmitters.updateViewDate.emit(h),this.validation.isValid(h,t.date)&&this.dates.setValue(h,this.dates.lastPickedIndex)}}handleShowClockContainers(e){if(!this.display._hasTime)return void r.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${r.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case V.showClock:s=r.css.clockContainer,this.display._update("clock");break;case V.showHours:s=r.css.hourContainer,this.display._update(t.hours);break;case V.showMinutes:s=r.css.minuteContainer,this.display._update(t.minutes);break;case V.showSeconds:s=r.css.secondContainer,this.display._update(t.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=l[this.optionsStore.currentCalendarViewMode];t===V.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,V.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class Y{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},c=new d,this._eventEmitters=c.locate(m),this.optionsStore=c.locate(h),this.display=c.locate(q),this.dates=c.locate(A),this.actions=c.locate(W),t||r.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,y,!0),this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()})),this._eventEmitters.updateViewDate.subscribe((t=>{this.viewDate=t}))}get viewDate(){return this.optionsStore.viewDate}set viewDate(t){this.optionsStore.viewDate=t,this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.display._update("clock"===this.optionsStore.currentView?"clock":"calendar")}updateOptions(t,e=!1){e?this._initializeOptions(t,y):this._initializeOptions(t,this.optionsStore.options),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&r.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:r.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=L.deepCopy(t);i=L._mergeOptions(i,e),s&&(i=L._dataToOptions(this.optionsStore.element,i)),L._validateConflicts(i),i.viewDate=i.viewDate.setLocale(i.localization.locale),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),l[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(l.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),void 0===i.display.components.useTwentyfourHour&&(i.display.components.useTwentyfourHour=!i.viewDate.parts()?.dayPeriod),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{let t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(!this.optionsStore.input.value&&this.optionsStore.options.defaultDate&&(this.optionsStore.input.value=this.dates.formatInput(this.optionsStore.options.defaultDate)),this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(r.css.show)[0].classList.contains(r.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${r.css.switch} div`)},action:V.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const j={},U=t=>{j[t.name]||(j[t.name]=t.localization)},Q=t=>{let e=j[t];e&&(y.localization=e)},K=function(t,e){return t?(t.installed||(t(e,{TempusDominus:Y,Dates:A,Display:q,DateTime:o,Namespace:r},R),t.installed=!0),R):R},J="6.2.7",R={TempusDominus:Y,extend:K,loadLocale:U,locale:Q,Namespace:r,DefaultOptions:y,DateTime:o,Unit:t,version:"6.2.7"};export{o as DateTime,y as DefaultOptions,r as Namespace,Y as TempusDominus,t as Unit,K as extend,U as loadLocale,Q as locale,J as version}; diff --git a/dist/js/tempus-dominus.js b/dist/js/tempus-dominus.js index 0d511b05c..f6293e889 100644 --- a/dist/js/tempus-dominus.js +++ b/dist/js/tempus-dominus.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -159,7 +159,10 @@ break; case 'weekDay': this.endOf(exports.Unit.date); - this.manipulate((6 + startOfTheWeek) - this.weekDay, exports.Unit.date); + const endOfWeek = (6 + startOfTheWeek); + if (this.weekDay === endOfWeek) + break; + this.manipulate(endOfWeek - this.weekDay, exports.Unit.date); break; case 'month': this.endOf(exports.Unit.date); @@ -168,8 +171,7 @@ break; case 'year': this.endOf(exports.Unit.date); - this.manipulate(1, exports.Unit.year); - this.setDate(0); + this.setMonth(11, 31); break; } return this; @@ -250,18 +252,18 @@ throw new Error(`Unit '${unit}' is not valid`); const leftInclusivity = inclusivity[0] === '('; const rightInclusivity = inclusivity[1] === ')'; - return (((leftInclusivity + return (leftInclusivity ? this.isAfter(left, unit) : !this.isBefore(left, unit)) && (rightInclusivity ? this.isBefore(right, unit) - : !this.isAfter(right, unit))) || - ((leftInclusivity + : !this.isAfter(right, unit)) || + (leftInclusivity ? this.isBefore(left, unit) : !this.isAfter(left, unit)) && (rightInclusivity ? this.isAfter(right, unit) - : !this.isBefore(right, unit)))); + : !this.isBefore(right, unit)); } /** * Returns flattened object of the date. Does not include literals @@ -1358,6 +1360,7 @@ } else if (inputElement instanceof Date) { o[key] = new Date(inputElement.valueOf()); + return; } o[key] = inputElement; if (typeof inputElement !== 'object' || @@ -1718,6 +1721,18 @@ const step = factor / 10, startYear = Math.floor(year / factor) * factor, endYear = startYear + step * 9, focusValue = Math.floor(year / step) * step; return [startYear, endYear, focusValue]; } + updateInput(target) { + if (!this.optionsStore.input) + return; + let newValue = this.formatInput(target); + if (this.optionsStore.options.multipleDates) { + newValue = this._dates + .map((d) => this.formatInput(d)) + .join(this.optionsStore.options.multipleDatesSeparator); + } + if (this.optionsStore.input.value != newValue) + this.optionsStore.input.value = newValue; + } /** * Attempts to either clear or set the `target` date at `index`. * If the `target` is null then the date will be cleared. @@ -1733,20 +1748,8 @@ if (!oldDate && !this.optionsStore.unset && noIndex && isClear) { oldDate = this.lastPicked; } - const updateInput = () => { - if (!this.optionsStore.input) - return; - let newValue = this.formatInput(target); - if (this.optionsStore.options.multipleDates) { - newValue = this._dates - .map((d) => this.formatInput(d)) - .join(this.optionsStore.options.multipleDatesSeparator); - } - if (this.optionsStore.input.value != newValue) - this.optionsStore.input.value = newValue; - }; if (target && oldDate?.isSame(target)) { - updateInput(); + this.updateInput(target); return; } // case of calling setValue(null) @@ -1760,7 +1763,7 @@ else { this._dates.splice(index, 1); } - updateInput(); + this.updateInput(); this._eventEmitters.triggerEvent.emit({ type: Namespace.events.change, date: undefined, @@ -1783,7 +1786,7 @@ if (this.validation.isValid(target)) { this._dates[index] = target; this._eventEmitters.updateViewDate.emit(target.clone); - updateInput(); + this.updateInput(target); this.optionsStore.unset = false; this._eventEmitters.updateDisplay.emit('all'); this._eventEmitters.triggerEvent.emit({ @@ -1798,7 +1801,7 @@ if (this.optionsStore.options.keepInvalid) { this._dates[index] = target; this._eventEmitters.updateViewDate.emit(target.clone); - updateInput(); + this.updateInput(target); this._eventEmitters.triggerEvent.emit({ type: Namespace.events.change, date: target, @@ -2908,6 +2911,8 @@ break; } picker.style.display = 'grid'; + if (this.optionsStore.options.display.sideBySide) + (this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]).style.display = 'grid'; this._updateCalendarHeader(); this._eventEmitters.viewUpdate.emit(); } @@ -2978,7 +2983,7 @@ previous.setAttribute('title', this.optionsStore.options.localization.previousMonth); switcher.setAttribute('title', this.optionsStore.options.localization.selectMonth); next.setAttribute('title', this.optionsStore.options.localization.nextMonth); - switcher.innerText = this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat); + switcher.setAttribute(showing, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)); break; } switcher.innerText = switcher.getAttribute(showing); @@ -3483,7 +3488,7 @@ return; const setViewDate = () => { if (this.dates.lastPicked) - this.viewDate = this.dates.lastPicked.clone; + this.optionsStore.viewDate = this.dates.lastPicked.clone; }; const value = this.optionsStore.input.value; if (this.optionsStore.options.multipleDates) { @@ -3649,7 +3654,7 @@ } this._subscribers[eventType].push(callBackArray[i]); returnArray.push({ - unsubscribe: this._unsubscribe.bind(this, eventType, this._subscribers[eventType].length - 1) + unsubscribe: this._unsubscribe.bind(this, eventType, this._subscribers[eventType].length - 1), }); if (eventTypes.length === 1) { return returnArray[0]; @@ -3683,7 +3688,7 @@ if (!asked) return; this.updateOptions({ - localization: asked + localization: asked, }); } /** @@ -3734,7 +3739,7 @@ _viewUpdate() { this._triggerEvent({ type: Namespace.events.update, - viewDate: this.optionsStore.viewDate.clone + viewDate: this.optionsStore.viewDate.clone, }); } _unsubscribe(eventName, index) { @@ -3806,6 +3811,8 @@ } if (!this.optionsStore.input) return; + if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate) + this.optionsStore.input.value = this.dates.formatInput(this.optionsStore.options.defaultDate); this.optionsStore.input.addEventListener('change', this._inputChangeEvent); if (this.optionsStore.options.allowInputToggle) { this.optionsStore.input.addEventListener('click', this._toggleClickEvent); @@ -3861,9 +3868,9 @@ if (this.display.widget) { this._eventEmitters.action.emit({ e: { - currentTarget: this.display.widget.querySelector(`.${Namespace.css.switch} div`) + currentTarget: this.display.widget.querySelector(`.${Namespace.css.switch} div`), }, - action: ActionTypes$1.togglePicker + action: ActionTypes$1.togglePicker, }); } }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay); @@ -3906,12 +3913,12 @@ return tempusDominus; if (!plugin.installed) { // install plugin only once - plugin(option, { TempusDominus, Dates, Display, DateTime, ErrorMessages }, tempusDominus); + plugin(option, { TempusDominus, Dates, Display, DateTime, Namespace }, tempusDominus); plugin.installed = true; } return tempusDominus; }; - const version = '6.2.6'; + const version = '6.2.7'; const tempusDominus = { TempusDominus, extend, diff --git a/dist/js/tempus-dominus.js.map b/dist/js/tempus-dominus.js.map index 6c29c1b5d..d7a689a03 100644 --- a/dist/js/tempus-dominus.js.map +++ b/dist/js/tempus-dominus.js.map @@ -1 +1 @@ -{"version":3,"file":"tempus-dominus.js","sources":["../../src/js/datetime.ts","../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/typeChecker.ts","../../src/js/utilities/optionProcessor.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export enum Unit {\r\n seconds = 'seconds',\r\n minutes = 'minutes',\r\n hours = 'hours',\r\n date = 'date',\r\n month = 'month',\r\n year = 'year',\r\n}\r\n\r\nconst twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: true,\r\n}\r\n\r\nconst twoDigitTwentyFourTemplate = {\r\n hour: '2-digit',\r\n hour12: false\r\n}\r\n\r\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\r\n timeStyle?: 'short' | 'medium' | 'long';\r\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\r\n numberingSystem?: string;\r\n}\r\n\r\nexport const getFormatByUnit = (unit: Unit): object => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric'\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n};\r\n\r\n/**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\nexport class DateTime extends Date {\r\n /**\r\n * Used with Intl.DateTimeFormat\r\n */\r\n locale = 'default';\r\n\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n */\r\n setLocale(value: string): this {\r\n this.locale = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale\r\n */\r\n static convert(date: Date, locale: string = 'default'): DateTime {\r\n if (!date) throw new Error(`A date is required`);\r\n return new DateTime(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ).setLocale(locale);\r\n }\r\n\r\n /**\r\n * Attempts to create a DateTime from a string. A customDateFormat is required for non US dates.\r\n * @param input\r\n * @param localization\r\n */\r\n static fromString(input: string, localization: any): DateTime {\r\n return new DateTime(input);\r\n }\r\n\r\n /**\r\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\r\n */\r\n get clone() {\r\n return new DateTime(\r\n this.year,\r\n this.month,\r\n this.date,\r\n this.hours,\r\n this.minutes,\r\n this.seconds,\r\n this.getMilliseconds()\r\n ).setLocale(this.locale);\r\n }\r\n\r\n /**\r\n * Sets the current date to the start of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\r\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\r\n * @param unit\r\n * @param startOfTheWeek Allows for the changing the start of the week.\r\n */\r\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(0);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(0, 0);\r\n break;\r\n case 'hours':\r\n this.setMinutes(0, 0, 0);\r\n break;\r\n case 'date':\r\n this.setHours(0, 0, 0, 0);\r\n break;\r\n case 'weekDay':\r\n this.startOf(Unit.date);\r\n if (this.weekDay === startOfTheWeek) break;\r\n let goBack = this.weekDay;\r\n if (startOfTheWeek !== 0 && this.weekDay === 0) goBack = 8 - startOfTheWeek;\r\n this.manipulate(startOfTheWeek - goBack, Unit.date);\r\n break;\r\n case 'month':\r\n this.startOf(Unit.date);\r\n this.setDate(1);\r\n break;\r\n case 'year':\r\n this.startOf(Unit.date);\r\n this.setMonth(0, 1);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the current date to the end of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\r\n * would return April 30, 2021, 11:59:59.999 PM\r\n * @param unit\r\n * @param startOfTheWeek\r\n */\r\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(999);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(59, 999);\r\n break;\r\n case 'hours':\r\n this.setMinutes(59, 59, 999);\r\n break;\r\n case 'date':\r\n this.setHours(23, 59, 59, 999);\r\n break;\r\n case 'weekDay':\r\n this.endOf(Unit.date);\r\n this.manipulate((6 + startOfTheWeek) - this.weekDay, Unit.date);\r\n break;\r\n case 'month':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.month);\r\n this.setDate(0);\r\n break;\r\n case 'year':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.year);\r\n this.setDate(0);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Change a {@link unit} value. Value can be positive or negative\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\r\n * would return May 30, 2021, 11:45:32.984 AM\r\n * @param value A positive or negative number\r\n * @param unit\r\n */\r\n manipulate(value: number, unit: Unit): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n this[unit] += value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a string format.\r\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\r\n * for valid templates and locale objects\r\n * @param template An object. Uses browser defaults otherwise.\r\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\r\n */\r\n format(template: DateTimeFormatOptions, locale = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, template).format(this);\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is before this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isBefore(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() < compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is after this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isAfter(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() > compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is same this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isSame(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() === compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n compare = DateTime.convert(compare);\r\n return (\r\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\r\n * @param left\r\n * @param right\r\n * @param unit.\r\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\r\n * If the inclusivity parameter is used, both indicators must be passed.\r\n */\r\n isBetween(\r\n left: DateTime,\r\n right: DateTime,\r\n unit?: Unit,\r\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\r\n ): boolean {\r\n if (unit && this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n const leftInclusivity = inclusivity[0] === '(';\r\n const rightInclusivity = inclusivity[1] === ')';\r\n\r\n return (\r\n ((leftInclusivity\r\n ? this.isAfter(left, unit)\r\n : !this.isBefore(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isBefore(right, unit)\r\n : !this.isAfter(right, unit))) ||\r\n ((leftInclusivity\r\n ? this.isBefore(left, unit)\r\n : !this.isAfter(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isAfter(right, unit)\r\n : !this.isBefore(right, unit)))\r\n );\r\n }\r\n\r\n /**\r\n * Returns flattened object of the date. Does not include literals\r\n * @param locale\r\n * @param template\r\n */\r\n parts(\r\n locale = this.locale,\r\n template: any = { dateStyle: 'full', timeStyle: 'long' }\r\n ): any {\r\n const parts = {};\r\n new Intl.DateTimeFormat(locale, template)\r\n .formatToParts(this)\r\n .filter((x) => x.type !== 'literal')\r\n .forEach((x) => (parts[x.type] = x.value));\r\n return parts;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getSeconds()\r\n */\r\n get seconds(): number {\r\n return this.getSeconds();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setSeconds()\r\n */\r\n set seconds(value: number) {\r\n this.setSeconds(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get secondsFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).second;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMinutes()\r\n */\r\n get minutes(): number {\r\n return this.getMinutes();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMinutes()\r\n */\r\n set minutes(value: number) {\r\n this.setMinutes(value);\r\n }\r\n\r\n /**\r\n * Returns two digit minutes\r\n */\r\n get minutesFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).minute;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getHours()\r\n */\r\n get hours(): number {\r\n return this.getHours();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setHours()\r\n */\r\n set hours(value: number) {\r\n this.setHours(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get hoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n }\r\n\r\n /**\r\n * Returns two digit hours but in twelve hour mode e.g. 13 -> 1\r\n */\r\n get twelveHoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).hour;\r\n }\r\n\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale: string = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true\r\n } as any)\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date(): number {\r\n return this.getDate();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value: number) {\r\n this.setDate(value);\r\n }\r\n\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay(): number {\r\n return this.getDay();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month(): number {\r\n return this.getMonth();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value: number) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year(): number {\r\n return this.getFullYear();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value: number) {\r\n this.setFullYear(value);\r\n }\r\n\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week(): number {\r\n const ordinal = this.computeOrdinal(),\r\n weekday = this.getUTCDay();\r\n\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear(this.year - 1);\r\n } else if (weekNumber > this.weeksInWeekYear(this.year)) {\r\n weekNumber = 1;\r\n }\r\n\r\n return weekNumber;\r\n }\r\n\r\n weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 =\r\n (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n\r\n get isLeapYear() {\r\n return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);\r\n }\r\n\r\n private computeOrdinal() {\r\n return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];\r\n }\r\n\r\n private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\r\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n}\r\n","export class TdError extends Error {\r\n code: number;\r\n}\r\n\r\nexport class ErrorMessages {\r\n private base = 'TD:';\r\n\r\n //#region out to console\r\n\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName: string) {\r\n const error = new TdError(\r\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\r\n );\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName: string[]) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(\r\n optionName: string,\r\n badValue: string,\r\n validOptions: string[]\r\n ) {\r\n const error = new TdError(\r\n `${\r\n this.base\r\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\r\n ', '\r\n )}`\r\n );\r\n error.code = 2;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName: string, badType: string, expectedType: string) {\r\n const error = new TdError(\r\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\r\n );\r\n error.code = 3;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\r\n const error = new TdError(\r\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\r\n );\r\n error.code = 4;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n failedToParseDate(optionName: string, date: any, soft = false) {\r\n const error = new TdError(\r\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\r\n );\r\n error.code = 5;\r\n if (!soft) throw error;\r\n console.warn(error);\r\n }\r\n\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(\r\n `${this.base} The subscribed events does not match the number of callbacks`\r\n );\r\n error.code = 7;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message?: string) {\r\n const error = new TdError(\r\n `${this.base} A configuration value conflicts with another rule. ${message}`\r\n );\r\n error.code = 8;\r\n throw error;\r\n }\r\n\r\n /**\r\n * customDateFormat errors\r\n */\r\n customDateFormatError(message?: string) {\r\n const error = new TdError(\r\n `${this.base} customDateFormat: ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Logs a warning if a date option value is provided as a string, instead of\r\n * a date/datetime object.\r\n */\r\n dateString() {\r\n console.warn(\r\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\r\n );\r\n }\r\n\r\n throwError(message) {\r\n const error = new TdError(\r\n `${this.base} ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region used with notify.error\r\n\r\n /**\r\n * Used with an Error Event type if the user selects a date that\r\n * fails restriction validation.\r\n */\r\n failedToSetInvalidDate = 'Failed to set invalid date';\r\n\r\n /**\r\n * Used with an Error Event type when a user changes the value of the\r\n * input field directly, and does not provide a valid date.\r\n */\r\n failedToParseInput = 'Failed parse input field';\r\n\r\n //#endregion\r\n}\r\n","import { ErrorMessages } from './errors';\r\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\r\nconst NAME = 'tempus-dominus',\r\n dataKey = 'td';\r\n\r\n/**\r\n * Events\r\n */\r\nclass Events {\r\n key = `.${dataKey}`;\r\n\r\n /**\r\n * Change event. Fired when the user selects a date.\r\n * See also EventTypes.ChangeEvent\r\n */\r\n change = `change${this.key}`;\r\n\r\n /**\r\n * Emit when the view changes for example from month view to the year view.\r\n * See also EventTypes.ViewUpdateEvent\r\n */\r\n update = `update${this.key}`;\r\n\r\n /**\r\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\r\n * See also EventTypes.FailEvent\r\n */\r\n error = `error${this.key}`;\r\n\r\n /**\r\n * Show event\r\n * @event Events#show\r\n */\r\n show = `show${this.key}`;\r\n\r\n /**\r\n * Hide event\r\n * @event Events#hide\r\n */\r\n hide = `hide${this.key}`;\r\n\r\n // blur and focus are used in the jQuery provider but are otherwise unused.\r\n // keyup/down will be used later for keybinding options\r\n\r\n blur = `blur${this.key}`;\r\n focus = `focus${this.key}`;\r\n keyup = `keyup${this.key}`;\r\n keydown = `keydown${this.key}`;\r\n}\r\n\r\nclass Css {\r\n /**\r\n * The outer element for the widget.\r\n */\r\n widget = `${NAME}-widget`;\r\n\r\n /**\r\n * Hold the previous, next and switcher divs\r\n */\r\n calendarHeader = 'calendar-header';\r\n\r\n /**\r\n * The element for the action to change the calendar view. E.g. month -> year.\r\n */\r\n switch = 'picker-switch';\r\n\r\n /**\r\n * The elements for all the toolbar options\r\n */\r\n toolbar = 'toolbar';\r\n\r\n /**\r\n * Disables the hover and rounding affect.\r\n */\r\n noHighlight = 'no-highlight';\r\n\r\n /**\r\n * Applied to the widget element when the side by side option is in use.\r\n */\r\n sideBySide = 'timepicker-sbs';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> July\r\n */\r\n previous = 'previous';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> September\r\n */\r\n next = 'next';\r\n\r\n /**\r\n * Applied to any action that would violate any restriction options. ALso applied\r\n * to an input field if the disabled function is called.\r\n */\r\n disabled = 'disabled';\r\n\r\n /**\r\n * Applied to any date that is less than requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n old = 'old';\r\n\r\n /**\r\n * Applied to any date that is greater than of requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n new = 'new';\r\n\r\n /**\r\n * Applied to any date that is currently selected.\r\n */\r\n active = 'active';\r\n\r\n //#region date element\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer element for the decades view.\r\n */\r\n decadesContainer = `${this.dateContainer}-decades`;\r\n\r\n /**\r\n * Applied to elements within the decades container, e.g. 2020, 2030\r\n */\r\n decade = 'decade';\r\n\r\n /**\r\n * The outer element for the years view.\r\n */\r\n yearsContainer = `${this.dateContainer}-years`;\r\n\r\n /**\r\n * Applied to elements within the years container, e.g. 2021, 2021\r\n */\r\n year = 'year';\r\n\r\n /**\r\n * The outer element for the month view.\r\n */\r\n monthsContainer = `${this.dateContainer}-months`;\r\n\r\n /**\r\n * Applied to elements within the month container, e.g. January, February\r\n */\r\n month = 'month';\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n daysContainer = `${this.dateContainer}-days`;\r\n\r\n /**\r\n * Applied to elements within the day container, e.g. 1, 2..31\r\n */\r\n day = 'day';\r\n\r\n /**\r\n * If display.calendarWeeks is enabled, a column displaying the week of year\r\n * is shown. This class is applied to each cell in that column.\r\n */\r\n calendarWeeks = 'cw';\r\n\r\n /**\r\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\r\n */\r\n dayOfTheWeek = 'dow';\r\n\r\n /**\r\n * Applied to the current date on the calendar view.\r\n */\r\n today = 'today';\r\n\r\n /**\r\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\r\n */\r\n weekend = 'weekend';\r\n\r\n //#endregion\r\n\r\n //#region time element\r\n\r\n /**\r\n * The outer element for all time related elements.\r\n */\r\n timeContainer = 'time-container';\r\n\r\n /**\r\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\r\n */\r\n separator = 'separator';\r\n\r\n /**\r\n * The outer element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer element for the seconds selection view.\r\n */\r\n secondContainer = `${this.timeContainer}-second`;\r\n\r\n /**\r\n * Applied to each element in the hours selection view.\r\n */\r\n hour = 'hour';\r\n\r\n /**\r\n * Applied to each element in the minutes selection view.\r\n */\r\n minute = 'minute';\r\n\r\n /**\r\n * Applied to each element in the seconds selection view.\r\n */\r\n second = 'second';\r\n\r\n /**\r\n * Applied AM/PM toggle button.\r\n */\r\n toggleMeridiem = 'toggleMeridiem';\r\n\r\n //#endregion\r\n\r\n //#region collapse\r\n\r\n /**\r\n * Applied the element of the current view mode, e.g. calendar or clock.\r\n */\r\n show = 'show';\r\n\r\n /**\r\n * Applied to the currently showing view mode during a transition\r\n * between calendar and clock views\r\n */\r\n collapsing = 'td-collapsing';\r\n\r\n /**\r\n * Applied to the currently hidden view mode.\r\n */\r\n collapse = 'td-collapse';\r\n\r\n //#endregion\r\n\r\n /**\r\n * Applied to the widget when the option display.inline is enabled.\r\n */\r\n inline = 'inline';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is light.\r\n */\r\n lightTheme = 'light';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n darkTheme = 'dark';\r\n\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\r\n}\r\n\r\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static dataKey = dataKey;\r\n\r\n static events = new Events();\r\n\r\n static css = new Css();\r\n\r\n static errorMessages = new ErrorMessages();\r\n}\r\n","export declare type Constructable = new (...args: any[]) => T;\r\n\r\nclass ServiceLocator {\r\n private cache: Map, unknown | Symbol> = new Map();\r\n\r\n locate(identifier: Constructable): T {\r\n const service = this.cache.get(identifier);\r\n if (service) return service as T;\r\n const value = new identifier();\r\n this.cache.set(identifier, value);\r\n return value;\r\n }\r\n}\r\nexport const setupServiceLocator = () => {\r\n serviceLocator = new ServiceLocator();\r\n}\r\n\r\nexport let serviceLocator: ServiceLocator;\r\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import { DateTime } from '../datetime';\r\nimport CalendarModes from './calendar-modes';\r\nimport ViewMode from './view-mode';\r\nimport Options from './options';\r\n\r\nexport class OptionsStore {\r\n options: Options;\r\n element: HTMLElement;\r\n input: HTMLInputElement;\r\n unset: boolean;\r\n private _currentCalendarViewMode = 0;\r\n\r\n get currentCalendarViewMode() {\r\n return this._currentCalendarViewMode;\r\n }\r\n\r\n set currentCalendarViewMode(value) {\r\n this._currentCalendarViewMode = value;\r\n this.currentView = CalendarModes[value].name;\r\n }\r\n\r\n _viewDate = new DateTime();\r\n\r\n get viewDate() {\r\n return this._viewDate;\r\n }\r\n\r\n set viewDate(v) {\r\n this._viewDate = v;\r\n if (this.options) this.options.viewDate = v;\r\n }\r\n\r\n /**\r\n * When switching back to the calendar from the clock,\r\n * this sets currentView to the correct calendar view.\r\n */\r\n refreshCurrentView() {\r\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\r\n }\r\n\r\n minimumCalendarViewMode = 0;\r\n currentView: keyof ViewMode = 'calendar';\r\n}\r\n","import { DateTime, Unit } from './datetime';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { OptionsStore } from './utilities/optionsStore';\r\n\r\n/**\r\n * Main class for date validation rules based on the options provided.\r\n */\r\nexport default class Validation {\r\n private optionsStore: OptionsStore;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n }\r\n\r\n /**\r\n * Checks to see if the target date is valid based on the rules provided in the options.\r\n * Granularity can be provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\r\n if (\r\n granularity !== Unit.month &&\r\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\r\n targetDate.weekDay\r\n ) !== -1\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(\r\n this.optionsStore.options.restrictions.minDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(\r\n this.optionsStore.options.restrictions.maxDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds\r\n ) {\r\n if (\r\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0\r\n ) {\r\n for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) {\r\n if (\r\n targetDate.isBetween(\r\n disabledTimeIntervals.from,\r\n disabledTimeIntervals.to\r\n )\r\n )\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0\r\n )\r\n return false;\r\n return this.optionsStore.options.restrictions.disabledDates\r\n .find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0\r\n )\r\n return true;\r\n return this.optionsStore.options.restrictions.enabledDates\r\n .find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n}\r\n","import { DateTime, Unit } from '../datetime';\r\nimport ActionTypes from './action-types';\r\nimport { BaseEvent } from './event-types';\r\n\r\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\r\n\r\nexport class EventEmitter {\r\n private subscribers: ((value?: T) => void)[] = [];\r\n\r\n subscribe(callback: (value: T) => void) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n\r\n unsubscribe(index: number) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n\r\n emit(value?: T) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n}\r\n\r\nexport class EventEmitters {\r\n triggerEvent = new EventEmitter();\r\n viewUpdate = new EventEmitter();\r\n updateDisplay = new EventEmitter();\r\n action = new EventEmitter<{ e: any; action?: ActionTypes }>();\r\n updateViewDate = new EventEmitter();\r\n\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n this.updateViewDate.destroy();\r\n }\r\n}\r\n","import Options from './options';\r\nimport { DateTime } from '../datetime';\r\n\r\nconst DefaultOptions: Options = {\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: []\r\n },\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark'\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined\r\n },\r\n inline: false,\r\n theme: 'auto'\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n defaultDate: undefined,\r\n localization: {\r\n today: 'Go to today',\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n selectMonth: 'Select Month',\r\n previousMonth: 'Previous Month',\r\n nextMonth: 'Next Month',\r\n selectYear: 'Select Year',\r\n previousYear: 'Previous Year',\r\n nextYear: 'Next Year',\r\n selectDecade: 'Select Decade',\r\n previousDecade: 'Previous Decade',\r\n nextDecade: 'Next Decade',\r\n previousCentury: 'Previous Century',\r\n nextCentury: 'Next Century',\r\n pickHour: 'Pick Hour',\r\n incrementHour: 'Increment Hour',\r\n decrementHour: 'Decrement Hour',\r\n pickMinute: 'Pick Minute',\r\n incrementMinute: 'Increment Minute',\r\n decrementMinute: 'Decrement Minute',\r\n pickSecond: 'Pick Second',\r\n incrementSecond: 'Increment Second',\r\n decrementSecond: 'Decrement Second',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n selectTime: 'Select Time',\r\n selectDate: 'Select Date',\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n locale: 'default',\r\n startOfTheWeek: 0,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n dateFormats: {\r\n LTS: 'h:mm:ss T',\r\n LT: 'h:mm T',\r\n L: 'MM/dd/yyyy',\r\n LL: 'MMMM d, yyyy',\r\n LLL: 'MMMM d, yyyy h:mm T',\r\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\r\n },\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n ordinal: (n) => n,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n format: 'L LT'\r\n },\r\n keepInvalid: false,\r\n debug: false,\r\n allowInputToggle: false,\r\n viewDate: new DateTime(),\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n meta: {},\r\n container: undefined\r\n};\r\n\r\nexport default DefaultOptions;\r\n","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport { FormatLocalization } from './options';\r\n\r\n/**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\nexport function tryConvertToDateTime(\r\n this: void,\r\n d: any,\r\n localization: FormatLocalization\r\n): DateTime | null {\r\n if (d.constructor.name === DateTime.name) return d;\r\n if (d.constructor.name === Date.name) {\r\n return DateTime.convert(d);\r\n }\r\n if (typeof d === typeof '') {\r\n const dateTime = DateTime.fromString(d, localization);\r\n if (JSON.stringify(dateTime) === 'null') {\r\n return null;\r\n }\r\n return dateTime;\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\nexport function convertToDateTime(\r\n this: void,\r\n d: any,\r\n optionName: string,\r\n localization: FormatLocalization\r\n): DateTime {\r\n if (typeof d === typeof '' && optionName !== 'input') {\r\n Namespace.errorMessages.dateString();\r\n }\r\n\r\n const converted = tryConvertToDateTime(d, localization);\r\n\r\n if (!converted) {\r\n Namespace.errorMessages.failedToParseDate(\r\n optionName,\r\n d,\r\n optionName === 'input'\r\n );\r\n }\r\n return converted;\r\n}\r\n\r\n/**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\nexport function typeCheckDateArray(\r\n this: void,\r\n optionName: string,\r\n value: any,\r\n providedType: string,\r\n localization: FormatLocalization\r\n) {\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of DateTime or Date'\r\n );\r\n }\r\n for (let i = 0; i < value.length; i++) {\r\n let d = value[i];\r\n const dateTime = convertToDateTime(d, optionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization?.locale ?? 'default');\r\n value[i] = dateTime;\r\n }\r\n}\r\n\r\n/**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\nexport function typeCheckNumberArray(\r\n this: void,\r\n optionName: string,\r\n value: any,\r\n providedType: string\r\n) {\r\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of numbers'\r\n );\r\n }\r\n}\r\n","import Namespace from './namespace';\r\nimport type { FormatLocalization } from './options';\r\nimport { convertToDateTime, typeCheckNumberArray, typeCheckDateArray } from './typeChecker';\r\n\r\ninterface OptionProcessorFunctionArguments {\r\n key: string,\r\n value: any,\r\n providedType: string,\r\n defaultType: string,\r\n path: string,\r\n localization: FormatLocalization;\r\n}\r\n\r\ntype OptionProcessorFunction = (\r\n this: void,\r\n args: OptionProcessorFunctionArguments\r\n) => any;\r\n\r\nfunction mandatoryDate(key: string): OptionProcessorFunction {\r\n return ({ value, providedType, localization }) => {\r\n const dateTime = convertToDateTime(value, key, localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n };\r\n}\r\n\r\nfunction optionalDate(key: string): OptionProcessorFunction {\r\n const mandatory = mandatoryDate(key);\r\n return (args) => {\r\n if (args.value === undefined) {\r\n return args.value;\r\n }\r\n return mandatory(args);\r\n };\r\n}\r\n\r\nfunction numbersInRange(key: string, lower: number, upper: number): OptionProcessorFunction {\r\n return ({ value, providedType }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckNumberArray(\r\n key,\r\n value,\r\n providedType\r\n );\r\n if ((value as number[]).some(x => x < lower || x > upper))\r\n Namespace.errorMessages.numbersOutOfRange(\r\n key,\r\n lower,\r\n upper\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nfunction validHourRange(key: string): OptionProcessorFunction {\r\n return numbersInRange(key, 0, 23);\r\n}\r\n\r\nfunction validDateArray(key: string): OptionProcessorFunction {\r\n return ({ value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckDateArray(\r\n key,\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\r\n return ({ value, path }) => {\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(\r\n path.substring(1),\r\n value,\r\n keyOptions\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nconst optionProcessors: { [key: string]: OptionProcessorFunction; } = Object.freeze({\r\n 'defaultDate': mandatoryDate('defaultDate'),\r\n 'viewDate': mandatoryDate('viewDate'),\r\n 'minDate': optionalDate('restrictions.minDate'),\r\n 'maxDate': optionalDate('restrictions.maxDate'),\r\n 'disabledHours': validHourRange('restrictions.disabledHours'),\r\n 'enabledHours': validHourRange('restrictions.enabledHours'),\r\n 'disabledDates': validDateArray('restrictions.disabledDates'),\r\n 'enabledDates': validDateArray('restrictions.enabledDates'),\r\n 'daysOfWeekDisabled': numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\r\n 'disabledTimeIntervals': ({ key, value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'array of { from: DateTime|Date, to: DateTime|Date }'\r\n );\r\n }\r\n const valueObject = value as { from: any; to: any; }[];\r\n for (let i = 0; i < valueObject.length; i++) {\r\n Object.keys(valueObject[i]).forEach((vk) => {\r\n const subOptionName = `${key}[${i}].${vk}`;\r\n const d = valueObject[i][vk];\r\n const dateTime = convertToDateTime(d, subOptionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n subOptionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization.locale);\r\n valueObject[i][vk] = dateTime;\r\n });\r\n }\r\n return valueObject;\r\n },\r\n 'toolbarPlacement': validKeyOption(['top', 'bottom', 'default']),\r\n 'type': validKeyOption(['icons', 'sprites']),\r\n 'viewMode': validKeyOption(['clock', 'calendar', 'months', 'years', 'decades']),\r\n 'theme': validKeyOption(['light', 'dark', 'auto']),\r\n 'meta': ({ value }) => value,\r\n 'dayViewHeaderFormat': ({ value }) => value,\r\n 'container': ({ value, path }) => {\r\n if (\r\n value &&\r\n !(\r\n value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild\r\n )\r\n ) {\r\n Namespace.errorMessages.typeMismatch(\r\n path.substring(1),\r\n typeof value,\r\n 'HTMLElement'\r\n );\r\n }\r\n return value;\r\n },\r\n 'useTwentyfourHour': ({ value, path, providedType, defaultType }) => {\r\n if (value === undefined || providedType === 'boolean') return value;\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n});\r\n\r\nconst defaultProcessor: OptionProcessorFunction = ({ value, defaultType, providedType, path }) => {\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n};\r\n\r\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\r\n return (optionProcessors[args.key] || defaultProcessor)(args);\r\n}\r\n","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport DefaultOptions from './default-options';\r\nimport Options, { FormatLocalization } from './options';\r\nimport { processKey } from './optionProcessor';\r\nimport { convertToDateTime, tryConvertToDateTime, typeCheckDateArray, typeCheckNumberArray } from './typeChecker';\r\n\r\nexport class OptionConverter {\r\n\r\n private static ignoreProperties = ['meta', 'dayViewHeaderFormat',\r\n 'container', 'dateForms', 'ordinal'];\r\n\r\n static deepCopy(input): Options {\r\n const o = {};\r\n\r\n Object.keys(input).forEach((key) => {\r\n const inputElement = input[key];\r\n\r\n if (inputElement instanceof DateTime) {\r\n o[key] = inputElement.clone\r\n return;\r\n }\r\n else if (inputElement instanceof Date) {\r\n o[key] = new Date(inputElement.valueOf())\r\n }\r\n\r\n o[key] = inputElement;\r\n if (typeof inputElement !== 'object' ||\r\n inputElement instanceof HTMLElement ||\r\n inputElement instanceof Element) return;\r\n if (!Array.isArray(inputElement)) {\r\n o[key] = OptionConverter.deepCopy(inputElement);\r\n }\r\n });\r\n\r\n return o;\r\n }\r\n\r\n private static isValue = a => a != null; // everything except undefined + null\r\n\r\n /**\r\n * Finds value out of an object based on a string, period delimited, path\r\n * @param paths\r\n * @param obj\r\n */\r\n static objectPath(paths: string, obj) {\r\n if (paths.charAt(0) === '.')\r\n paths = paths.slice(1);\r\n if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param localization\r\n */\r\n static spread(provided, copyTo, path = '', localization: FormatLocalization) {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).filter(key => key !== '__proto__' && key !== 'constructor').forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key))) {\r\n OptionConverter.spread(provided[key], copyTo[key], path, localization);\r\n } else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key: string, value: any, providedType: string, defaultType: string, path: string, localization: FormatLocalization) {\r\n return processKey({ key, value, providedType, defaultType, path, localization });\r\n }\r\n\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const localization =\r\n mergeTo.localization?.locale !== 'default'\r\n ? mergeTo.localization\r\n : providedOptions?.localization || DefaultOptions.localization;\r\n\r\n OptionConverter.spread(providedOptions, newConfig, '', localization);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n static _dateTypeCheck(d: any, localization: FormatLocalization): DateTime | null {\r\n return tryConvertToDateTime(d, localization);\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n localization: FormatLocalization\r\n ) {\r\n return typeCheckDateArray(optionName, value, providedType, localization);\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n static _typeCheckNumberArray(\r\n optionName: string,\r\n value,\r\n providedType: string\r\n ) {\r\n return typeCheckNumberArray(optionName, value, providedType);\r\n }\r\n\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n static dateConversion(d: any, optionName: string, localization: FormatLocalization): DateTime {\r\n return convertToDateTime(d, optionName, localization);\r\n }\r\n\r\n private static _flattenDefaults: string[];\r\n\r\n private static getFlattenDefaultOptions(): string[] {\r\n if (this._flattenDefaults) return this._flattenDefaults;\r\n const deepKeys = (t, pre = []) => {\r\n if (Array.isArray(t)) return [];\r\n if (Object(t) === t) {\r\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\r\n } else {\r\n return pre.join('.');\r\n }\r\n };\r\n\r\n this._flattenDefaults = deepKeys(DefaultOptions);\r\n\r\n return this._flattenDefaults;\r\n }\r\n\r\n /**\r\n * Some options conflict like min/max date. Verify that these kinds of options\r\n * are set correctly.\r\n * @param config\r\n */\r\n static _validateConflicts(config: Options) {\r\n if (\r\n config.display.sideBySide &&\r\n (!config.display.components.clock ||\r\n !(\r\n config.display.components.hours ||\r\n config.display.components.minutes ||\r\n config.display.components.seconds\r\n ))\r\n ) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'Cannot use side by side mode without the clock components'\r\n );\r\n }\r\n\r\n if (config.restrictions.minDate && config.restrictions.maxDate) {\r\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'minDate is after maxDate'\r\n );\r\n }\r\n\r\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'maxDate is before minDate'\r\n );\r\n }\r\n }\r\n }\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\r\nimport Validation from './validation';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\n\r\nexport default class Dates {\r\n private _dates: DateTime[] = [];\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n }\r\n\r\n /**\r\n * Returns the array of selected dates\r\n */\r\n get picked(): DateTime[] {\r\n return this._dates;\r\n }\r\n\r\n /**\r\n * Returns the last picked value.\r\n */\r\n get lastPicked(): DateTime {\r\n return this._dates[this.lastPickedIndex];\r\n }\r\n\r\n /**\r\n * Returns the length of picked dates -1 or 0 if none are selected.\r\n */\r\n get lastPickedIndex(): number {\r\n if (this._dates.length === 0) return 0;\r\n return this._dates.length - 1;\r\n }\r\n\r\n /**\r\n * Formats a DateTime object to a string. Used when setting the input value.\r\n * @param date\r\n */\r\n formatInput(date: DateTime): string {\r\n const components = this.optionsStore.options.display.components;\r\n if (!date) return '';\r\n return date.format({\r\n year: components.calendar && components.year ? 'numeric' : undefined,\r\n month: components.calendar && components.month ? '2-digit' : undefined,\r\n day: components.calendar && components.date ? '2-digit' : undefined,\r\n hour:\r\n components.clock && components.hours\r\n ? components.useTwentyfourHour\r\n ? '2-digit'\r\n : 'numeric'\r\n : undefined,\r\n minute: components.clock && components.minutes ? '2-digit' : undefined,\r\n second: components.clock && components.seconds ? '2-digit' : undefined,\r\n hour12: !components.useTwentyfourHour,\r\n });\r\n }\r\n \r\n /**\r\n * parse the value into a DateTime object.\r\n * this can be overwritten to supply your own parsing.\r\n */\r\n parseInput(value:any): DateTime {\r\n return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization);\r\n }\r\n\r\n /**\r\n * Tries to convert the provided value to a DateTime object.\r\n * If value is null|undefined then clear the value of the provided index (or 0).\r\n * @param value Value to convert or null|undefined\r\n * @param index When using multidates this is the index in the array\r\n */\r\n setFromInput(value: any, index?: number) {\r\n if (!value) {\r\n this.setValue(undefined, index);\r\n return;\r\n }\r\n const converted = this.parseInput(value);\r\n if (converted) {\r\n converted.setLocale(this.optionsStore.options.localization.locale);\r\n this.setValue(converted, index);\r\n }\r\n }\r\n\r\n /**\r\n * Adds a new DateTime to selected dates array\r\n * @param date\r\n */\r\n add(date: DateTime): void {\r\n this._dates.push(date);\r\n }\r\n\r\n /**\r\n * Returns true if the `targetDate` is part of the selected dates array.\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this._dates.find((x) => x === targetDate) !== undefined;\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return (\r\n this._dates\r\n .map((x) => x.format(format))\r\n .find((x) => x === innerDateFormatted) !== undefined\r\n );\r\n }\r\n\r\n /**\r\n * Returns the index at which `targetDate` is in the array.\r\n * This is used for updating or removing a date when multi-date is used\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\r\n if (!unit) return this._dates.indexOf(targetDate);\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\r\n }\r\n\r\n /**\r\n * Clears all selected dates.\r\n */\r\n clear() {\r\n this.optionsStore.unset = true;\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate: this.lastPicked,\r\n isClear: true,\r\n isValid: true,\r\n } as ChangeEvent);\r\n this._dates = [];\r\n }\r\n\r\n /**\r\n * Find the \"book end\" years given a `year` and a `factor`\r\n * @param factor e.g. 100 for decades\r\n * @param year e.g. 2021\r\n */\r\n static getStartEndYear(\r\n factor: number,\r\n year: number\r\n ): [number, number, number] {\r\n const step = factor / 10,\r\n startYear = Math.floor(year / factor) * factor,\r\n endYear = startYear + step * 9,\r\n focusValue = Math.floor(year / step) * step;\r\n return [startYear, endYear, focusValue];\r\n }\r\n\r\n /**\r\n * Attempts to either clear or set the `target` date at `index`.\r\n * If the `target` is null then the date will be cleared.\r\n * If multi-date is being used then it will be removed from the array.\r\n * If `target` is valid and multi-date is used then if `index` is\r\n * provided the date at that index will be replaced, otherwise it is appended.\r\n * @param target\r\n * @param index\r\n */\r\n setValue(target?: DateTime, index?: number): void {\r\n const noIndex = typeof index === 'undefined',\r\n isClear = !target && noIndex;\r\n let oldDate = this.optionsStore.unset ? null : this._dates[index];\r\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\r\n oldDate = this.lastPicked;\r\n }\r\n\r\n const updateInput = () => {\r\n if (!this.optionsStore.input) return;\r\n\r\n let newValue = this.formatInput(target);\r\n if (this.optionsStore.options.multipleDates) {\r\n newValue = this._dates\r\n .map((d) => this.formatInput(d))\r\n .join(this.optionsStore.options.multipleDatesSeparator);\r\n }\r\n if (this.optionsStore.input.value != newValue)\r\n this.optionsStore.input.value = newValue;\r\n };\r\n\r\n if (target && oldDate?.isSame(target)) {\r\n updateInput();\r\n return;\r\n }\r\n\r\n // case of calling setValue(null)\r\n if (!target) {\r\n if (\r\n !this.optionsStore.options.multipleDates ||\r\n this._dates.length === 1 ||\r\n isClear\r\n ) {\r\n this.optionsStore.unset = true;\r\n this._dates = [];\r\n } else {\r\n this._dates.splice(index, 1);\r\n }\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n\r\n this._eventEmitters.updateDisplay.emit('all');\r\n return;\r\n }\r\n\r\n index = index || 0;\r\n target = target.clone;\r\n\r\n // minute stepping is being used, force the minute to the closest value\r\n if (this.optionsStore.options.stepping !== 1) {\r\n target.minutes =\r\n Math.round(target.minutes / this.optionsStore.options.stepping) *\r\n this.optionsStore.options.stepping;\r\n target.seconds = 0;\r\n }\r\n\r\n if (this.validation.isValid(target)) {\r\n this._dates[index] = target;\r\n this._eventEmitters.updateViewDate.emit(target.clone);\r\n\r\n updateInput();\r\n\r\n this.optionsStore.unset = false;\r\n this._eventEmitters.updateDisplay.emit('all');\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.keepInvalid) {\r\n this._dates[index] = target;\r\n this._eventEmitters.updateViewDate.emit(target.clone);\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: false,\r\n } as ChangeEvent);\r\n }\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToSetInvalidDate,\r\n date: target,\r\n oldDate,\r\n } as FailEvent);\r\n }\r\n}\r\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport Dates from \"../../dates\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `date`\r\n */\r\nexport default class DateDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.daysContainer);\r\n\r\n container.append(...this._daysOfTheWeek());\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n\r\n for (let i = 0; i < 42; i++) {\r\n if (i !== 0 && i % 7 === 0) {\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n container.appendChild(div);\r\n }\r\n }\r\n\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDay);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.daysContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"calendar\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.daysContainer,\r\n this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n )\r\n );\r\n\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\r\n Unit.month\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\r\n Unit.month\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n\r\n container\r\n .querySelectorAll(\r\n `[data-action=\"${ActionTypes.selectDay}\"], .${Namespace.css.calendarWeeks}`\r\n )\r\n .forEach((containerClone: HTMLElement) => {\r\n if (\r\n this.optionsStore.options.display.calendarWeeks &&\r\n containerClone.classList.contains(Namespace.css.calendarWeeks)\r\n ) {\r\n if (containerClone.innerText === \"#\") return;\r\n containerClone.innerText = `${innerDate.week}`;\r\n return;\r\n }\r\n\r\n let classes: string[] = [];\r\n classes.push(Namespace.css.day);\r\n\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.date)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n\r\n paint(Unit.date, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`\r\n );\r\n containerClone.setAttribute(\"data-day\", `${innerDate.date}`);\r\n containerClone.innerText = innerDate.format({ day: \"numeric\" });\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n\r\n /***\r\n * Generates an html row that contains the days of the week.\r\n * @private\r\n */\r\n private _daysOfTheWeek(): HTMLElement[] {\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement(\"div\");\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = \"#\";\r\n row.push(htmlDivElement);\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.dayOfTheWeek,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = innerDate.format({ weekday: \"short\" });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n\r\n return row;\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { Paint } from '../index';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `month`\r\n */\r\nexport default class MonthDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMonth);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.monthsContainer\r\n )[0];\r\n\r\n if(this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switcher.setAttribute(\r\n Namespace.css.monthsContainer,\r\n this.optionsStore.viewDate.format({ year: 'numeric' })\r\n );\r\n\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\r\n Unit.year\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\r\n Unit.year\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n let classes = [];\r\n classes.push(Namespace.css.month);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n}\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Dates from \"../../dates\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `year`\r\n */\r\nexport default class YearDisplay {\r\n private _startYear: DateTime;\r\n private _endYear: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.yearsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectYear);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.yearsContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"years\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.yearsContainer,\r\n `${this._startYear.format({ year: \"numeric\" })}-${this._endYear.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.year);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\"data-value\", `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: \"numeric\" });\r\n\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n}\r\n","import Dates from \"../../dates\";\r\nimport { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class DecadeDisplay {\r\n private _startDecade: DateTime;\r\n private _endDecade: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.decadesContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n const [start, end] = Dates.getStartEndYear(\r\n 100,\r\n this.optionsStore.viewDate.year\r\n );\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.decadesContainer\r\n )[0];\r\n\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(\r\n Namespace.css.decadesContainer,\r\n `${this._startDecade.format({ year: \"numeric\" })}-${this._endDecade.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = \" \";\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute(\"data-value\", ``);\r\n return;\r\n } else {\r\n containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: \"numeric\" });\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n return;\r\n }\r\n }\r\n\r\n let classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n\r\n paint(\"decade\", this._startDecade, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n containerClone.innerText = `${this._startDecade.format({ year: \"numeric\" })}`;\r\n\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates the clock display\r\n */\r\nexport default class TimeDisplay {\r\n private _gridColumns = '';\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n\r\n container.append(...this._grid(iconTag));\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget: HTMLElement): void {\r\n const timesDiv = (\r\n widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0]\r\n );\r\n const lastPicked = (\r\n this.dates.lastPicked || this.optionsStore.viewDate\r\n ).clone;\r\n\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.hours}]`\r\n ).innerText = this.optionsStore.options.display.components.useTwentyfourHour\r\n ? lastPicked.hoursFormatted\r\n : lastPicked.twelveHoursFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.minutes}]`\r\n ).innerText = lastPicked.minutesFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.seconds}]`\r\n ).innerText = lastPicked.secondsFormatted;\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n const toggle = timesDiv.querySelector(\r\n `[data-action=${ActionTypes.toggleMeridiem}]`\r\n );\r\n\r\n toggle.innerText = lastPicked.meridiem();\r\n\r\n if (\r\n !this.validation.isValid(\r\n lastPicked.clone.manipulate(\r\n lastPicked.hours >= 12 ? -12 : 12,\r\n Unit.hours\r\n )\r\n )\r\n ) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n } else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\r\n this._gridColumns = '';\r\n const top = [],\r\n middle = [],\r\n bottom = [],\r\n separator = document.createElement('div'),\r\n upIcon = iconTag(\r\n this.optionsStore.options.display.icons.up\r\n ),\r\n downIcon = iconTag(\r\n this.optionsStore.options.display.icons.down\r\n );\r\n\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n\r\n const getSeparator = (colon = false): HTMLElement => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n\r\n let button = document.createElement('button');\r\n button.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.toggleMeridiem\r\n );\r\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) { //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else button.classList.add(Namespace.css.toggleMeridiem);\r\n\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n\r\n this._gridColumns = this._gridColumns.trim();\r\n\r\n return [...top, ...middle, ...bottom];\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `hours`\r\n */\r\nexport default class HourDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n\r\n for (\r\n let i = 0;\r\n i <\r\n (this.optionsStore.options.display.components.useTwentyfourHour ? 24 : 12);\r\n i++\r\n ) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectHour);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.hourContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.hour);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = this.optionsStore.options.display.components\r\n .useTwentyfourHour\r\n ? innerDate.hoursFormatted\r\n : innerDate.twelveHoursFormatted;\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `minutes`\r\n */\r\nexport default class MinuteDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMinute);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.minuteContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.minute);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n 'data-value',\r\n `${innerDate.minutes}`\r\n );\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class secondDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectSecond);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.secondContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.second);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n}\r\n","import Namespace from '../utilities/namespace';\r\n\r\n/**\r\n * Provides a collapse functionality to the view changes\r\n */\r\nexport default class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target: HTMLElement) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n } else {\r\n this.show(target);\r\n }\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n if (!target) return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport Namespace from '../utilities/namespace';\r\nimport { HideEvent } from '../utilities/event-types';\r\nimport Collapse from './collapse';\r\nimport Validation from '../validation';\r\nimport Dates from '../dates';\r\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\r\nimport { serviceLocator } from '../utilities/service-locator';\r\nimport ActionTypes from '../utilities/action-types';\r\nimport CalendarModes from '../utilities/calendar-modes';\r\nimport { OptionsStore } from '../utilities/optionsStore';\r\n\r\n/**\r\n * Main class for all things display related.\r\n */\r\nexport default class Display {\r\n private _widget: HTMLElement;\r\n private _popperInstance: any;\r\n private _isVisible = false;\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n dateDisplay: DateDisplay;\r\n monthDisplay: MonthDisplay;\r\n yearDisplay: YearDisplay;\r\n decadeDisplay: DecadeDisplay;\r\n timeDisplay: TimeDisplay;\r\n hourDisplay: HourDisplay;\r\n minuteDisplay: MinuteDisplay;\r\n secondDisplay: SecondDisplay;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n\r\n this.dateDisplay = serviceLocator.locate(DateDisplay);\r\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\r\n this.yearDisplay = serviceLocator.locate(YearDisplay);\r\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\r\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\r\n this.hourDisplay = serviceLocator.locate(HourDisplay);\r\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\r\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._widget = undefined;\r\n\r\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\r\n this._update(result);\r\n });\r\n }\r\n\r\n /**\r\n * Returns the widget body or undefined\r\n * @private\r\n */\r\n get widget(): HTMLElement | undefined {\r\n return this._widget;\r\n }\r\n\r\n /**\r\n * Returns this visible state of the picker (shown)\r\n */\r\n get isVisible() {\r\n return this._isVisible;\r\n }\r\n\r\n /**\r\n * Updates the table for a particular unit. Used when an option as changed or\r\n * whenever the class list might need to be refreshed.\r\n * @param unit\r\n * @private\r\n */\r\n _update(unit: ViewUpdateValues): void {\r\n if (!this.widget) return;\r\n //todo do I want some kind of error catching or other guards here?\r\n switch (unit) {\r\n case Unit.seconds:\r\n this.secondDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.minutes:\r\n this.minuteDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.hours:\r\n this.hourDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.date:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.month:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.year:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'clock':\r\n if (!this._hasTime) break;\r\n this.timeDisplay._update(this.widget);\r\n this._update(Unit.hours);\r\n this._update(Unit.minutes);\r\n this._update(Unit.seconds);\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n this._update(Unit.year);\r\n this._update(Unit.month);\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n this._updateCalendarHeader();\r\n break;\r\n case 'all':\r\n if (this._hasTime) {\r\n this._update('clock');\r\n }\r\n if (this._hasDate) {\r\n this._update('calendar');\r\n }\r\n }\r\n }\r\n\r\n // noinspection JSUnusedLocalSymbols\r\n /**\r\n * Allows developers to add/remove classes from an element.\r\n * @param _unit\r\n * @param _date\r\n * @param _classes\r\n * @param _element\r\n */\r\n paint(\r\n _unit: Unit | 'decade',\r\n _date: DateTime,\r\n _classes: string[],\r\n _element: HTMLElement\r\n ) {\r\n // implemented in plugin\r\n }\r\n\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * fires Events#show\r\n */\r\n show(): void {\r\n if (this.widget == undefined) {\r\n if (this.dates.picked.length == 0) {\r\n if (\r\n this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate\r\n ) {\r\n const date = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (\r\n this.optionsStore.options.restrictions.maxDate?.isBefore(date)\r\n ) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date)) {\r\n date.manipulate(direction, Unit.date);\r\n if (tries > 31) break;\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n\r\n this._buildWidget();\r\n this._updateTheme();\r\n\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n // otherwise return to the calendar view\r\n if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n\r\n if (\r\n !onlyClock &&\r\n this.optionsStore.options.display.viewMode !== 'clock'\r\n ) {\r\n if (this._hasTime) {\r\n if(!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n } else {\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n }\r\n }\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.dateContainer}`)\r\n );\r\n }\r\n\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n container.appendChild(this.widget);\r\n this.createPopup(this.optionsStore.element, this.widget, {\r\n modifiers: [{ name: 'eventListeners', enabled: true }],\r\n //#2400\r\n placement:\r\n document.documentElement.dir === 'rtl'\r\n ? 'bottom-end'\r\n : 'bottom-start',\r\n }).then();\r\n } else {\r\n this.optionsStore.element.appendChild(this.widget);\r\n }\r\n\r\n if (this.optionsStore.options.display.viewMode == 'clock') {\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.addEventListener('click', this._actionsClickEvent)\r\n );\r\n\r\n // show the clock when using sideBySide\r\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\r\n this.timeDisplay._update(this.widget);\r\n (\r\n this.widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0] as HTMLElement\r\n ).style.display = 'grid';\r\n }\r\n }\r\n\r\n this.widget.classList.add(Namespace.css.show);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.updatePopup();\r\n document.addEventListener('click', this._documentClickEvent);\r\n }\r\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\r\n this._isVisible = true;\r\n }\r\n\r\n async createPopup(element: HTMLElement, widget: HTMLElement, options: any): Promise {\r\n let createPopperFunction;\r\n if((window as any)?.Popper) {\r\n createPopperFunction = (window as any)?.Popper?.createPopper;\r\n }\r\n else {\r\n const { createPopper } = await import('@popperjs/core');\r\n createPopperFunction = createPopper;\r\n }\r\n if(createPopperFunction){\r\n this._popperInstance = createPopperFunction(element, widget, options);\r\n }\r\n }\r\n\r\n updatePopup(): void {\r\n this._popperInstance?.update();\r\n }\r\n\r\n /**\r\n * Changes the calendar view mode. E.g. month <-> year\r\n * @param direction -/+ number to move currentViewMode\r\n * @private\r\n */\r\n _showMode(direction?: number): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (direction) {\r\n const max = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\r\n );\r\n if (this.optionsStore.currentCalendarViewMode == max) return;\r\n this.optionsStore.currentCalendarViewMode = max;\r\n }\r\n\r\n this.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\r\n )\r\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\r\n\r\n const datePickerMode =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n let picker: HTMLElement = this.widget.querySelector(\r\n `.${datePickerMode.className}`\r\n );\r\n\r\n switch (datePickerMode.className) {\r\n case Namespace.css.decadesContainer:\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.daysContainer:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n }\r\n\r\n picker.style.display = 'grid';\r\n this._updateCalendarHeader();\r\n this._eventEmitters.viewUpdate.emit();\r\n }\r\n\r\n /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme) return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n } else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n\r\n _getThemeClass(): string {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\r\n\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n\r\n _updateCalendarHeader() {\r\n const showing = [\r\n ...this.widget.querySelector(\r\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\r\n ).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousCentury\r\n );\r\n switcher.setAttribute('title', '');\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextCentury\r\n );\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousDecade\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDecade\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextDecade\r\n );\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousYear\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectYear\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextYear\r\n );\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousMonth\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectMonth\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextMonth\r\n );\r\n switcher.innerText = this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n );\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * fires Events#hide\r\n */\r\n hide(): void {\r\n if (!this.widget || !this._isVisible) return;\r\n\r\n this.widget.classList.remove(Namespace.css.show);\r\n\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset\r\n ? null\r\n : this.dates.lastPicked\r\n ? this.dates.lastPicked.clone\r\n : void 0,\r\n } as HideEvent);\r\n this._isVisible = false;\r\n }\r\n\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget) return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.removeEventListener('click', this._actionsClickEvent)\r\n );\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n private _buildWidget(): HTMLElement {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(\r\n this.getHeadTemplate(),\r\n this.decadeDisplay.getPicker(),\r\n this.yearDisplay.getPicker(),\r\n this.monthDisplay.getPicker(),\r\n this.dateDisplay.getPicker()\r\n );\r\n\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n\r\n if (\r\n this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n if (this._hasDate) {\r\n if (this._hasTime) {\r\n dateView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode !== 'clock')\r\n dateView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(dateView);\r\n }\r\n\r\n if (this._hasTime) {\r\n if (this._hasDate) {\r\n timeView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode === 'clock')\r\n timeView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(timeView);\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n\r\n this._widget = template;\r\n }\r\n\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds)\r\n );\r\n }\r\n\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date)\r\n );\r\n }\r\n\r\n /**\r\n * Get the toolbar html based on options like buttons.today\r\n * @private\r\n */\r\n getToolbarElements(): HTMLElement[] {\r\n const toolbar = [];\r\n\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.today)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (\r\n !this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n } else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.togglePicker);\r\n div.setAttribute('title', title);\r\n\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.clear)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.close)\r\n );\r\n toolbar.push(div);\r\n }\r\n\r\n return toolbar;\r\n }\r\n\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate(): HTMLElement {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes.previous);\r\n previous.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.previous)\r\n );\r\n\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\r\n\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes.next);\r\n next.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.next)\r\n );\r\n\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons.type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass: string): HTMLElement | SVGElement {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n const icon = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'use'\r\n );\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n private _documentClickEvent = (e: MouseEvent) => {\r\n if (this.optionsStore.options.debug || (window as any).debug) return;\r\n\r\n if (\r\n this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n private _actionsClickEvent = (e: MouseEvent) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n if (wasVisible) this.hide();\r\n this._dispose();\r\n if (wasVisible) {\r\n this.show();\r\n }\r\n }\r\n}\r\n\r\nexport type Paint = (\r\n unit: Unit | 'decade',\r\n innerDate: DateTime,\r\n classes: string[],\r\n element: HTMLElement\r\n) => void;\r\n","import { DateTime, Unit } from \"./datetime\";\r\nimport Collapse from \"./display/collapse\";\r\nimport Namespace from \"./utilities/namespace\";\r\nimport Dates from \"./dates\";\r\nimport Validation from \"./validation\";\r\nimport Display from \"./display\";\r\nimport { EventEmitters } from \"./utilities/event-emitter\";\r\nimport { serviceLocator } from \"./utilities/service-locator.js\";\r\nimport ActionTypes from \"./utilities/action-types\";\r\nimport CalendarModes from \"./utilities/calendar-modes\";\r\nimport { OptionsStore } from \"./utilities/optionsStore\";\r\n\r\n/**\r\n *\r\n */\r\nexport default class Actions {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n private display: Display;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n do(e: any, action?: ActionTypes) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return false;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n\r\n switch (action) {\r\n case ActionTypes.next:\r\n case ActionTypes.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.selectMonth:\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n\r\n if (\r\n this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode\r\n ) {\r\n this.dates.setValue(\r\n this.optionsStore.viewDate,\r\n this.dates.lastPickedIndex\r\n );\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n } else {\r\n this.display._showMode(-1);\r\n }\r\n break;\r\n case ActionTypes.selectDay:\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n\r\n day.date = +currentTarget.dataset.day;\r\n let index = 0;\r\n if (this.optionsStore.options.multipleDates) {\r\n index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex + 1);\r\n }\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n\r\n if (\r\n !this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates\r\n ) {\r\n this.display.hide();\r\n }\r\n break;\r\n case ActionTypes.selectHour:\r\n let hour = +currentTarget.dataset.value;\r\n if (\r\n lastPicked.hours >= 12 &&\r\n !this.optionsStore.options.display.components.useTwentyfourHour\r\n )\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectMinute:\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectSecond:\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes.incrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping\r\n );\r\n break;\r\n case ActionTypes.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes.decrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping * -1\r\n );\r\n break;\r\n case ActionTypes.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes.toggleMeridiem:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.hours,\r\n this.dates.lastPicked.hours >= 12 ? -12 : 12\r\n );\r\n break;\r\n case ActionTypes.togglePicker:\r\n if (\r\n currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate\r\n ) {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectTime\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.time\r\n ).outerHTML;\r\n\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n } else {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDate\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.date\r\n ).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n\r\n this.display.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\r\n )\r\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n break;\r\n case ActionTypes.showClock:\r\n case ActionTypes.showHours:\r\n case ActionTypes.showMinutes:\r\n case ActionTypes.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this._eventEmitters.updateViewDate.emit(today);\r\n\r\n //todo this this really a good idea?\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport { OptionsStore } from './utilities/optionsStore';\r\nimport { OptionConverter } from './utilities/optionConverter';\r\nimport { ErrorMessages } from './utilities/errors';\r\n\r\n/**\r\n * A robust and powerful date/time picker component.\r\n */\r\nclass TempusDominus {\r\n _subscribers: { [key: string]: ((event: any) => {})[] } = {};\r\n private _isDisabled = false;\r\n private _toggle: HTMLElement;\r\n private _currentPromptTimeTimeout: any;\r\n private actions: Actions;\r\n private optionsStore: OptionsStore;\r\n private _eventEmitters: EventEmitters;\r\n display: Display;\r\n dates: Dates;\r\n\r\n constructor(element: HTMLElement, options: Options = {} as Options) {\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.unset = true;\r\n\r\n this._initializeInput();\r\n this._initializeToggle();\r\n\r\n if (this.optionsStore.options.display.inline) this.display.show();\r\n\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n\r\n this._eventEmitters.updateViewDate.subscribe(dateTime => {\r\n this.viewDate = dateTime;\r\n });\r\n }\r\n\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n\r\n set viewDate(value) {\r\n this.optionsStore.viewDate = value;\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.display._update(this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false): void {\r\n if (reset) this._initializeOptions(options, DefaultOptions);\r\n else this._initializeOptions(options, this.optionsStore.options);\r\n this.display._rebuild();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle(): void {\r\n if (this._isDisabled) return;\r\n this.display.toggle();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show(): void {\r\n if (this._isDisabled) return;\r\n this.display.show();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide(): void {\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable(): void {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable(): void {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear(): void {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(\r\n eventTypes: string | string[],\r\n callbacks: (event: any) => void | ((event: any) => void)[]\r\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray: any[];\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n } else {\r\n callBackArray = callbacks;\r\n }\r\n\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n\r\n const returnArray = [];\r\n\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(\r\n this,\r\n eventType,\r\n this._subscribers[eventType].length - 1\r\n )\r\n });\r\n\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n\r\n return returnArray;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this._eventEmitters.destroy();\r\n this.optionsStore.input?.removeEventListener(\r\n 'change',\r\n this._inputChangeEvent\r\n );\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener(\r\n 'click',\r\n this._toggleClickEvent\r\n );\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language: string) {\r\n let asked = loadedLocales[language];\r\n if (!asked) return;\r\n this.updateOptions({\r\n localization: asked\r\n });\r\n }\r\n\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n private _triggerEvent(event: BaseEvent) {\r\n event.viewMode = this.optionsStore.currentView;\r\n\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event as ChangeEvent;\r\n if (\r\n (date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)\r\n ) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event as ChangeEvent);\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent('change', { detail: event as any })\r\n );\r\n }\r\n\r\n this.optionsStore.element.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n if ((window as any).jQuery) {\r\n const $ = (window as any).jQuery;\r\n\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n } else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n\r\n this._publish(event);\r\n }\r\n\r\n private _publish(event: BaseEvent) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n private _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone\r\n } as ViewUpdateEvent);\r\n }\r\n\r\n private _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n private _initializeOptions(\r\n config: Options,\r\n mergeTo: Options,\r\n includeDataset = false\r\n ): void {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n newConfig\r\n );\r\n\r\n OptionConverter._validateConflicts(newConfig);\r\n\r\n newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n this.optionsStore.currentCalendarViewMode\r\n );\r\n\r\n // Update view mode if needed\r\n if (\r\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\r\n this.optionsStore.minimumCalendarViewMode\r\n );\r\n }\r\n\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n\r\n if (newConfig.display.components.useTwentyfourHour === undefined) {\r\n newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod;\r\n }\r\n\r\n this.optionsStore.options = newConfig;\r\n }\r\n\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n private _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\r\n } else {\r\n let query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n } else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n\r\n if (!this.optionsStore.input) return;\r\n\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n private _initializeToggle() {\r\n if (this.optionsStore.options.display.inline) return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n private _handleAfterChangeEvent(e: ChangeEvent) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer)\r\n )\r\n return;\r\n\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if (\r\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))\r\n ) {\r\n return;\r\n }\r\n\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector(\r\n `.${Namespace.css.switch} div`\r\n )\r\n },\r\n action: ActionTypes.togglePicker\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _inputChangeEvent = (event?: any) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered) return;\r\n\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.viewDate = this.dates.lastPicked.clone;\r\n };\r\n\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates) {\r\n try {\r\n const valueSplit = value.split(\r\n this.optionsStore.options.multipleDatesSeparator\r\n );\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n } catch {\r\n console.warn(\r\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\r\n );\r\n }\r\n } else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _toggleClickEvent = () => {\r\n if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return;\r\n this.toggle();\r\n };\r\n}\r\n\r\n/**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\nconst loadedLocales = {};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\nconst loadLocale = (l) => {\r\n if (loadedLocales[l.name]) return;\r\n loadedLocales[l.name] = l.localization;\r\n};\r\n\r\n/**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\nconst locale = (l: string) => {\r\n let asked = loadedLocales[l];\r\n if (!asked) return;\r\n DefaultOptions.localization = asked;\r\n};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\nconst extend = function(plugin, option) {\r\n if (!plugin) return tempusDominus;\r\n if (!plugin.installed) {\r\n // install plugin only once\r\n plugin(option, { TempusDominus, Dates, Display, DateTime, ErrorMessages }, tempusDominus);\r\n plugin.installed = true;\r\n }\r\n return tempusDominus;\r\n};\r\n\r\nconst version = '6.2.5';\r\n\r\nconst tempusDominus = {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version\r\n};\r\n\r\nexport {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version,\r\n DateTimeFormatOptions,\r\n Options\r\n};\r\n"],"names":["Unit","ActionTypes","SecondDisplay"],"mappings":";;;;;;;;;;;AAAYA,wBAOX;EAPD,CAAA,UAAY,IAAI,EAAA;EACd,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;EACnB,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;EACnB,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;EACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;EACb,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;EACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;EACf,CAAC,EAPWA,YAAI,KAAJA,YAAI,GAOf,EAAA,CAAA,CAAA,CAAA;EAED,MAAM,gBAAgB,GAAG;EACvB,IAAA,KAAK,EAAE,SAAS;EAChB,IAAA,GAAG,EAAE,SAAS;EACd,IAAA,IAAI,EAAE,SAAS;EACf,IAAA,IAAI,EAAE,SAAS;EACf,IAAA,MAAM,EAAE,SAAS;EACjB,IAAA,MAAM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/datetime.ts","../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/typeChecker.ts","../../src/js/utilities/optionProcessor.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export enum Unit {\r\n seconds = 'seconds',\r\n minutes = 'minutes',\r\n hours = 'hours',\r\n date = 'date',\r\n month = 'month',\r\n year = 'year',\r\n}\r\n\r\nconst twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: true,\r\n}\r\n\r\nconst twoDigitTwentyFourTemplate = {\r\n hour: '2-digit',\r\n hour12: false\r\n}\r\n\r\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\r\n timeStyle?: 'short' | 'medium' | 'long';\r\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\r\n numberingSystem?: string;\r\n}\r\n\r\nexport const getFormatByUnit = (unit: Unit): object => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric'\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n};\r\n\r\n/**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\nexport class DateTime extends Date {\r\n /**\r\n * Used with Intl.DateTimeFormat\r\n */\r\n locale = 'default';\r\n\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n */\r\n setLocale(value: string): this {\r\n this.locale = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale\r\n */\r\n static convert(date: Date, locale: string = 'default'): DateTime {\r\n if (!date) throw new Error(`A date is required`);\r\n return new DateTime(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ).setLocale(locale);\r\n }\r\n\r\n /**\r\n * Attempts to create a DateTime from a string. A customDateFormat is required for non US dates.\r\n * @param input\r\n * @param localization\r\n */\r\n static fromString(input: string, localization: any): DateTime {\r\n return new DateTime(input);\r\n }\r\n\r\n /**\r\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\r\n */\r\n get clone() {\r\n return new DateTime(\r\n this.year,\r\n this.month,\r\n this.date,\r\n this.hours,\r\n this.minutes,\r\n this.seconds,\r\n this.getMilliseconds()\r\n ).setLocale(this.locale);\r\n }\r\n\r\n /**\r\n * Sets the current date to the start of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\r\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\r\n * @param unit\r\n * @param startOfTheWeek Allows for the changing the start of the week.\r\n */\r\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(0);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(0, 0);\r\n break;\r\n case 'hours':\r\n this.setMinutes(0, 0, 0);\r\n break;\r\n case 'date':\r\n this.setHours(0, 0, 0, 0);\r\n break;\r\n case 'weekDay':\r\n this.startOf(Unit.date);\r\n if (this.weekDay === startOfTheWeek) break;\r\n let goBack = this.weekDay;\r\n if (startOfTheWeek !== 0 && this.weekDay === 0) goBack = 8 - startOfTheWeek;\r\n this.manipulate(startOfTheWeek - goBack, Unit.date);\r\n break;\r\n case 'month':\r\n this.startOf(Unit.date);\r\n this.setDate(1);\r\n break;\r\n case 'year':\r\n this.startOf(Unit.date);\r\n this.setMonth(0, 1);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the current date to the end of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\r\n * would return April 30, 2021, 11:59:59.999 PM\r\n * @param unit\r\n * @param startOfTheWeek\r\n */\r\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(999);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(59, 999);\r\n break;\r\n case 'hours':\r\n this.setMinutes(59, 59, 999);\r\n break;\r\n case 'date':\r\n this.setHours(23, 59, 59, 999);\r\n break;\r\n case 'weekDay':\r\n this.endOf(Unit.date);\r\n const endOfWeek = (6 + startOfTheWeek);\r\n if (this.weekDay === endOfWeek) break;\r\n this.manipulate(endOfWeek - this.weekDay, Unit.date);\r\n break;\r\n case 'month':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.month);\r\n this.setDate(0);\r\n break;\r\n case 'year':\r\n this.endOf(Unit.date);\r\n this.setMonth(11, 31);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Change a {@link unit} value. Value can be positive or negative\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\r\n * would return May 30, 2021, 11:45:32.984 AM\r\n * @param value A positive or negative number\r\n * @param unit\r\n */\r\n manipulate(value: number, unit: Unit): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n this[unit] += value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a string format.\r\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\r\n * for valid templates and locale objects\r\n * @param template An object. Uses browser defaults otherwise.\r\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\r\n */\r\n format(template: DateTimeFormatOptions, locale = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, template).format(this);\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is before this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isBefore(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() < compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is after this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isAfter(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() > compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is same this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isSame(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() === compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n compare = DateTime.convert(compare);\r\n return (\r\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\r\n * @param left\r\n * @param right\r\n * @param unit.\r\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\r\n * If the inclusivity parameter is used, both indicators must be passed.\r\n */\r\n isBetween(\r\n left: DateTime,\r\n right: DateTime,\r\n unit?: Unit,\r\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\r\n ): boolean {\r\n if (unit && this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n const leftInclusivity = inclusivity[0] === '(';\r\n const rightInclusivity = inclusivity[1] === ')';\r\n\r\n return (leftInclusivity\r\n ? this.isAfter(left, unit)\r\n : !this.isBefore(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isBefore(right, unit)\r\n : !this.isAfter(right, unit)) ||\r\n (leftInclusivity\r\n ? this.isBefore(left, unit)\r\n : !this.isAfter(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isAfter(right, unit)\r\n : !this.isBefore(right, unit));\r\n }\r\n\r\n /**\r\n * Returns flattened object of the date. Does not include literals\r\n * @param locale\r\n * @param template\r\n */\r\n parts(\r\n locale = this.locale,\r\n template: any = { dateStyle: 'full', timeStyle: 'long' }\r\n ): any {\r\n const parts = {};\r\n new Intl.DateTimeFormat(locale, template)\r\n .formatToParts(this)\r\n .filter((x) => x.type !== 'literal')\r\n .forEach((x) => (parts[x.type] = x.value));\r\n return parts;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getSeconds()\r\n */\r\n get seconds(): number {\r\n return this.getSeconds();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setSeconds()\r\n */\r\n set seconds(value: number) {\r\n this.setSeconds(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get secondsFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).second;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMinutes()\r\n */\r\n get minutes(): number {\r\n return this.getMinutes();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMinutes()\r\n */\r\n set minutes(value: number) {\r\n this.setMinutes(value);\r\n }\r\n\r\n /**\r\n * Returns two digit minutes\r\n */\r\n get minutesFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).minute;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getHours()\r\n */\r\n get hours(): number {\r\n return this.getHours();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setHours()\r\n */\r\n set hours(value: number) {\r\n this.setHours(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get hoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n }\r\n\r\n /**\r\n * Returns two digit hours but in twelve hour mode e.g. 13 -> 1\r\n */\r\n get twelveHoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).hour;\r\n }\r\n\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale: string = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true\r\n } as any)\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date(): number {\r\n return this.getDate();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value: number) {\r\n this.setDate(value);\r\n }\r\n\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay(): number {\r\n return this.getDay();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month(): number {\r\n return this.getMonth();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value: number) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year(): number {\r\n return this.getFullYear();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value: number) {\r\n this.setFullYear(value);\r\n }\r\n\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week(): number {\r\n const ordinal = this.computeOrdinal(),\r\n weekday = this.getUTCDay();\r\n\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear(this.year - 1);\r\n } else if (weekNumber > this.weeksInWeekYear(this.year)) {\r\n weekNumber = 1;\r\n }\r\n\r\n return weekNumber;\r\n }\r\n\r\n weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 =\r\n (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n\r\n get isLeapYear() {\r\n return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);\r\n }\r\n\r\n private computeOrdinal() {\r\n return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];\r\n }\r\n\r\n private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\r\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n}\r\n","export class TdError extends Error {\r\n code: number;\r\n}\r\n\r\nexport class ErrorMessages {\r\n private base = 'TD:';\r\n\r\n //#region out to console\r\n\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName: string) {\r\n const error = new TdError(\r\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\r\n );\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName: string[]) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(\r\n optionName: string,\r\n badValue: string,\r\n validOptions: string[]\r\n ) {\r\n const error = new TdError(\r\n `${\r\n this.base\r\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\r\n ', '\r\n )}`\r\n );\r\n error.code = 2;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName: string, badType: string, expectedType: string) {\r\n const error = new TdError(\r\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\r\n );\r\n error.code = 3;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\r\n const error = new TdError(\r\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\r\n );\r\n error.code = 4;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n failedToParseDate(optionName: string, date: any, soft = false) {\r\n const error = new TdError(\r\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\r\n );\r\n error.code = 5;\r\n if (!soft) throw error;\r\n console.warn(error);\r\n }\r\n\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(\r\n `${this.base} The subscribed events does not match the number of callbacks`\r\n );\r\n error.code = 7;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message?: string) {\r\n const error = new TdError(\r\n `${this.base} A configuration value conflicts with another rule. ${message}`\r\n );\r\n error.code = 8;\r\n throw error;\r\n }\r\n\r\n /**\r\n * customDateFormat errors\r\n */\r\n customDateFormatError(message?: string) {\r\n const error = new TdError(\r\n `${this.base} customDateFormat: ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Logs a warning if a date option value is provided as a string, instead of\r\n * a date/datetime object.\r\n */\r\n dateString() {\r\n console.warn(\r\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\r\n );\r\n }\r\n\r\n throwError(message) {\r\n const error = new TdError(\r\n `${this.base} ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region used with notify.error\r\n\r\n /**\r\n * Used with an Error Event type if the user selects a date that\r\n * fails restriction validation.\r\n */\r\n failedToSetInvalidDate = 'Failed to set invalid date';\r\n\r\n /**\r\n * Used with an Error Event type when a user changes the value of the\r\n * input field directly, and does not provide a valid date.\r\n */\r\n failedToParseInput = 'Failed parse input field';\r\n\r\n //#endregion\r\n}\r\n","import { ErrorMessages } from './errors';\r\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\r\nconst NAME = 'tempus-dominus',\r\n dataKey = 'td';\r\n\r\n/**\r\n * Events\r\n */\r\nclass Events {\r\n key = `.${dataKey}`;\r\n\r\n /**\r\n * Change event. Fired when the user selects a date.\r\n * See also EventTypes.ChangeEvent\r\n */\r\n change = `change${this.key}`;\r\n\r\n /**\r\n * Emit when the view changes for example from month view to the year view.\r\n * See also EventTypes.ViewUpdateEvent\r\n */\r\n update = `update${this.key}`;\r\n\r\n /**\r\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\r\n * See also EventTypes.FailEvent\r\n */\r\n error = `error${this.key}`;\r\n\r\n /**\r\n * Show event\r\n * @event Events#show\r\n */\r\n show = `show${this.key}`;\r\n\r\n /**\r\n * Hide event\r\n * @event Events#hide\r\n */\r\n hide = `hide${this.key}`;\r\n\r\n // blur and focus are used in the jQuery provider but are otherwise unused.\r\n // keyup/down will be used later for keybinding options\r\n\r\n blur = `blur${this.key}`;\r\n focus = `focus${this.key}`;\r\n keyup = `keyup${this.key}`;\r\n keydown = `keydown${this.key}`;\r\n}\r\n\r\nclass Css {\r\n /**\r\n * The outer element for the widget.\r\n */\r\n widget = `${NAME}-widget`;\r\n\r\n /**\r\n * Hold the previous, next and switcher divs\r\n */\r\n calendarHeader = 'calendar-header';\r\n\r\n /**\r\n * The element for the action to change the calendar view. E.g. month -> year.\r\n */\r\n switch = 'picker-switch';\r\n\r\n /**\r\n * The elements for all the toolbar options\r\n */\r\n toolbar = 'toolbar';\r\n\r\n /**\r\n * Disables the hover and rounding affect.\r\n */\r\n noHighlight = 'no-highlight';\r\n\r\n /**\r\n * Applied to the widget element when the side by side option is in use.\r\n */\r\n sideBySide = 'timepicker-sbs';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> July\r\n */\r\n previous = 'previous';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> September\r\n */\r\n next = 'next';\r\n\r\n /**\r\n * Applied to any action that would violate any restriction options. ALso applied\r\n * to an input field if the disabled function is called.\r\n */\r\n disabled = 'disabled';\r\n\r\n /**\r\n * Applied to any date that is less than requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n old = 'old';\r\n\r\n /**\r\n * Applied to any date that is greater than of requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n new = 'new';\r\n\r\n /**\r\n * Applied to any date that is currently selected.\r\n */\r\n active = 'active';\r\n\r\n //#region date element\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer element for the decades view.\r\n */\r\n decadesContainer = `${this.dateContainer}-decades`;\r\n\r\n /**\r\n * Applied to elements within the decades container, e.g. 2020, 2030\r\n */\r\n decade = 'decade';\r\n\r\n /**\r\n * The outer element for the years view.\r\n */\r\n yearsContainer = `${this.dateContainer}-years`;\r\n\r\n /**\r\n * Applied to elements within the years container, e.g. 2021, 2021\r\n */\r\n year = 'year';\r\n\r\n /**\r\n * The outer element for the month view.\r\n */\r\n monthsContainer = `${this.dateContainer}-months`;\r\n\r\n /**\r\n * Applied to elements within the month container, e.g. January, February\r\n */\r\n month = 'month';\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n daysContainer = `${this.dateContainer}-days`;\r\n\r\n /**\r\n * Applied to elements within the day container, e.g. 1, 2..31\r\n */\r\n day = 'day';\r\n\r\n /**\r\n * If display.calendarWeeks is enabled, a column displaying the week of year\r\n * is shown. This class is applied to each cell in that column.\r\n */\r\n calendarWeeks = 'cw';\r\n\r\n /**\r\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\r\n */\r\n dayOfTheWeek = 'dow';\r\n\r\n /**\r\n * Applied to the current date on the calendar view.\r\n */\r\n today = 'today';\r\n\r\n /**\r\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\r\n */\r\n weekend = 'weekend';\r\n\r\n //#endregion\r\n\r\n //#region time element\r\n\r\n /**\r\n * The outer element for all time related elements.\r\n */\r\n timeContainer = 'time-container';\r\n\r\n /**\r\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\r\n */\r\n separator = 'separator';\r\n\r\n /**\r\n * The outer element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer element for the seconds selection view.\r\n */\r\n secondContainer = `${this.timeContainer}-second`;\r\n\r\n /**\r\n * Applied to each element in the hours selection view.\r\n */\r\n hour = 'hour';\r\n\r\n /**\r\n * Applied to each element in the minutes selection view.\r\n */\r\n minute = 'minute';\r\n\r\n /**\r\n * Applied to each element in the seconds selection view.\r\n */\r\n second = 'second';\r\n\r\n /**\r\n * Applied AM/PM toggle button.\r\n */\r\n toggleMeridiem = 'toggleMeridiem';\r\n\r\n //#endregion\r\n\r\n //#region collapse\r\n\r\n /**\r\n * Applied the element of the current view mode, e.g. calendar or clock.\r\n */\r\n show = 'show';\r\n\r\n /**\r\n * Applied to the currently showing view mode during a transition\r\n * between calendar and clock views\r\n */\r\n collapsing = 'td-collapsing';\r\n\r\n /**\r\n * Applied to the currently hidden view mode.\r\n */\r\n collapse = 'td-collapse';\r\n\r\n //#endregion\r\n\r\n /**\r\n * Applied to the widget when the option display.inline is enabled.\r\n */\r\n inline = 'inline';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is light.\r\n */\r\n lightTheme = 'light';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n darkTheme = 'dark';\r\n\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\r\n}\r\n\r\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static dataKey = dataKey;\r\n\r\n static events = new Events();\r\n\r\n static css = new Css();\r\n\r\n static errorMessages = new ErrorMessages();\r\n}\r\n","export declare type Constructable = new (...args: any[]) => T;\r\n\r\nclass ServiceLocator {\r\n private cache: Map, unknown | Symbol> = new Map();\r\n\r\n locate(identifier: Constructable): T {\r\n const service = this.cache.get(identifier);\r\n if (service) return service as T;\r\n const value = new identifier();\r\n this.cache.set(identifier, value);\r\n return value;\r\n }\r\n}\r\nexport const setupServiceLocator = () => {\r\n serviceLocator = new ServiceLocator();\r\n}\r\n\r\nexport let serviceLocator: ServiceLocator;\r\n","import { Unit } from '../datetime';\r\nimport Namespace from './namespace';\r\nimport ViewMode from './view-mode';\r\n\r\nconst CalendarModes: {\r\n name: keyof ViewMode;\r\n className: string;\r\n unit: Unit;\r\n step: number;\r\n}[] = [\r\n {\r\n name: 'calendar',\r\n className: Namespace.css.daysContainer,\r\n unit: Unit.month,\r\n step: 1,\r\n },\r\n {\r\n name: 'months',\r\n className: Namespace.css.monthsContainer,\r\n unit: Unit.year,\r\n step: 1,\r\n },\r\n {\r\n name: 'years',\r\n className: Namespace.css.yearsContainer,\r\n unit: Unit.year,\r\n step: 10,\r\n },\r\n {\r\n name: 'decades',\r\n className: Namespace.css.decadesContainer,\r\n unit: Unit.year,\r\n step: 100,\r\n },\r\n];\r\n\r\nexport default CalendarModes;\r\n","import { DateTime } from '../datetime';\r\nimport CalendarModes from './calendar-modes';\r\nimport ViewMode from './view-mode';\r\nimport Options from './options';\r\n\r\nexport class OptionsStore {\r\n options: Options;\r\n element: HTMLElement;\r\n input: HTMLInputElement;\r\n unset: boolean;\r\n private _currentCalendarViewMode = 0;\r\n\r\n get currentCalendarViewMode() {\r\n return this._currentCalendarViewMode;\r\n }\r\n\r\n set currentCalendarViewMode(value) {\r\n this._currentCalendarViewMode = value;\r\n this.currentView = CalendarModes[value].name;\r\n }\r\n\r\n _viewDate = new DateTime();\r\n\r\n get viewDate() {\r\n return this._viewDate;\r\n }\r\n\r\n set viewDate(v) {\r\n this._viewDate = v;\r\n if (this.options) this.options.viewDate = v;\r\n }\r\n\r\n /**\r\n * When switching back to the calendar from the clock,\r\n * this sets currentView to the correct calendar view.\r\n */\r\n refreshCurrentView() {\r\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\r\n }\r\n\r\n minimumCalendarViewMode = 0;\r\n currentView: keyof ViewMode = 'calendar';\r\n}\r\n","import { DateTime, Unit } from './datetime';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { OptionsStore } from './utilities/optionsStore';\r\n\r\n/**\r\n * Main class for date validation rules based on the options provided.\r\n */\r\nexport default class Validation {\r\n private optionsStore: OptionsStore;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n }\r\n\r\n /**\r\n * Checks to see if the target date is valid based on the rules provided in the options.\r\n * Granularity can be provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\r\n if (\r\n granularity !== Unit.month &&\r\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\r\n targetDate.weekDay\r\n ) !== -1\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(\r\n this.optionsStore.options.restrictions.minDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(\r\n this.optionsStore.options.restrictions.maxDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds\r\n ) {\r\n if (\r\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0\r\n ) {\r\n for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) {\r\n if (\r\n targetDate.isBetween(\r\n disabledTimeIntervals.from,\r\n disabledTimeIntervals.to\r\n )\r\n )\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0\r\n )\r\n return false;\r\n return this.optionsStore.options.restrictions.disabledDates\r\n .find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0\r\n )\r\n return true;\r\n return this.optionsStore.options.restrictions.enabledDates\r\n .find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n}\r\n","import { DateTime, Unit } from '../datetime';\r\nimport ActionTypes from './action-types';\r\nimport { BaseEvent } from './event-types';\r\n\r\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\r\n\r\nexport class EventEmitter {\r\n private subscribers: ((value?: T) => void)[] = [];\r\n\r\n subscribe(callback: (value: T) => void) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n\r\n unsubscribe(index: number) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n\r\n emit(value?: T) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n}\r\n\r\nexport class EventEmitters {\r\n triggerEvent = new EventEmitter();\r\n viewUpdate = new EventEmitter();\r\n updateDisplay = new EventEmitter();\r\n action = new EventEmitter<{ e: any; action?: ActionTypes }>();\r\n updateViewDate = new EventEmitter();\r\n\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n this.updateViewDate.destroy();\r\n }\r\n}\r\n","import Options from './options';\r\nimport { DateTime } from '../datetime';\r\n\r\nconst DefaultOptions: Options = {\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: []\r\n },\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark'\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined\r\n },\r\n inline: false,\r\n theme: 'auto'\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n defaultDate: undefined,\r\n localization: {\r\n today: 'Go to today',\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n selectMonth: 'Select Month',\r\n previousMonth: 'Previous Month',\r\n nextMonth: 'Next Month',\r\n selectYear: 'Select Year',\r\n previousYear: 'Previous Year',\r\n nextYear: 'Next Year',\r\n selectDecade: 'Select Decade',\r\n previousDecade: 'Previous Decade',\r\n nextDecade: 'Next Decade',\r\n previousCentury: 'Previous Century',\r\n nextCentury: 'Next Century',\r\n pickHour: 'Pick Hour',\r\n incrementHour: 'Increment Hour',\r\n decrementHour: 'Decrement Hour',\r\n pickMinute: 'Pick Minute',\r\n incrementMinute: 'Increment Minute',\r\n decrementMinute: 'Decrement Minute',\r\n pickSecond: 'Pick Second',\r\n incrementSecond: 'Increment Second',\r\n decrementSecond: 'Decrement Second',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n selectTime: 'Select Time',\r\n selectDate: 'Select Date',\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n locale: 'default',\r\n startOfTheWeek: 0,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n dateFormats: {\r\n LTS: 'h:mm:ss T',\r\n LT: 'h:mm T',\r\n L: 'MM/dd/yyyy',\r\n LL: 'MMMM d, yyyy',\r\n LLL: 'MMMM d, yyyy h:mm T',\r\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\r\n },\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n ordinal: (n) => n,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n format: 'L LT'\r\n },\r\n keepInvalid: false,\r\n debug: false,\r\n allowInputToggle: false,\r\n viewDate: new DateTime(),\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n meta: {},\r\n container: undefined\r\n};\r\n\r\nexport default DefaultOptions;\r\n","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport { FormatLocalization } from './options';\r\n\r\n/**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\nexport function tryConvertToDateTime(\r\n this: void,\r\n d: any,\r\n localization: FormatLocalization\r\n): DateTime | null {\r\n if (d.constructor.name === DateTime.name) return d;\r\n if (d.constructor.name === Date.name) {\r\n return DateTime.convert(d);\r\n }\r\n if (typeof d === typeof '') {\r\n const dateTime = DateTime.fromString(d, localization);\r\n if (JSON.stringify(dateTime) === 'null') {\r\n return null;\r\n }\r\n return dateTime;\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\nexport function convertToDateTime(\r\n this: void,\r\n d: any,\r\n optionName: string,\r\n localization: FormatLocalization\r\n): DateTime {\r\n if (typeof d === typeof '' && optionName !== 'input') {\r\n Namespace.errorMessages.dateString();\r\n }\r\n\r\n const converted = tryConvertToDateTime(d, localization);\r\n\r\n if (!converted) {\r\n Namespace.errorMessages.failedToParseDate(\r\n optionName,\r\n d,\r\n optionName === 'input'\r\n );\r\n }\r\n return converted;\r\n}\r\n\r\n/**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\nexport function typeCheckDateArray(\r\n this: void,\r\n optionName: string,\r\n value: any,\r\n providedType: string,\r\n localization: FormatLocalization\r\n) {\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of DateTime or Date'\r\n );\r\n }\r\n for (let i = 0; i < value.length; i++) {\r\n let d = value[i];\r\n const dateTime = convertToDateTime(d, optionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization?.locale ?? 'default');\r\n value[i] = dateTime;\r\n }\r\n}\r\n\r\n/**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\nexport function typeCheckNumberArray(\r\n this: void,\r\n optionName: string,\r\n value: any,\r\n providedType: string\r\n) {\r\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of numbers'\r\n );\r\n }\r\n}\r\n","import Namespace from \"./namespace\";\r\nimport type { FormatLocalization } from \"./options\";\r\nimport { convertToDateTime, typeCheckNumberArray, typeCheckDateArray } from \"./typeChecker\";\r\n\r\ninterface OptionProcessorFunctionArguments {\r\n key: string,\r\n value: any,\r\n providedType: string,\r\n defaultType: string,\r\n path: string,\r\n localization: FormatLocalization;\r\n}\r\n\r\ntype OptionProcessorFunction = (\r\n this: void,\r\n args: OptionProcessorFunctionArguments\r\n) => any;\r\n\r\nfunction mandatoryDate(key: string): OptionProcessorFunction {\r\n return ({ value, providedType, localization }) => {\r\n const dateTime = convertToDateTime(value, key, localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n };\r\n}\r\n\r\nfunction optionalDate(key: string): OptionProcessorFunction {\r\n const mandatory = mandatoryDate(key);\r\n return (args) => {\r\n if (args.value === undefined) {\r\n return args.value;\r\n }\r\n return mandatory(args);\r\n };\r\n}\r\n\r\nfunction numbersInRange(key: string, lower: number, upper: number): OptionProcessorFunction {\r\n return ({ value, providedType }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckNumberArray(\r\n key,\r\n value,\r\n providedType\r\n );\r\n if ((value as number[]).some(x => x < lower || x > upper))\r\n Namespace.errorMessages.numbersOutOfRange(\r\n key,\r\n lower,\r\n upper\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nfunction validHourRange(key: string): OptionProcessorFunction {\r\n return numbersInRange(key, 0, 23);\r\n}\r\n\r\nfunction validDateArray(key: string): OptionProcessorFunction {\r\n return ({ value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckDateArray(\r\n key,\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\r\n return ({ value, path }) => {\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(\r\n path.substring(1),\r\n value,\r\n keyOptions\r\n );\r\n return value;\r\n };\r\n}\r\n\r\nconst optionProcessors: { [key: string]: OptionProcessorFunction; } = Object.freeze({\r\n 'defaultDate': mandatoryDate('defaultDate'),\r\n 'viewDate': mandatoryDate('viewDate'),\r\n 'minDate': optionalDate('restrictions.minDate'),\r\n 'maxDate': optionalDate('restrictions.maxDate'),\r\n 'disabledHours': validHourRange('restrictions.disabledHours'),\r\n 'enabledHours': validHourRange('restrictions.enabledHours'),\r\n 'disabledDates': validDateArray('restrictions.disabledDates'),\r\n 'enabledDates': validDateArray('restrictions.enabledDates'),\r\n 'daysOfWeekDisabled': numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\r\n 'disabledTimeIntervals': ({ key, value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'array of { from: DateTime|Date, to: DateTime|Date }'\r\n );\r\n }\r\n const valueObject = value as { from: any; to: any; }[];\r\n for (let i = 0; i < valueObject.length; i++) {\r\n Object.keys(valueObject[i]).forEach((vk) => {\r\n const subOptionName = `${key}[${i}].${vk}`;\r\n const d = valueObject[i][vk];\r\n const dateTime = convertToDateTime(d, subOptionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n subOptionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization.locale);\r\n valueObject[i][vk] = dateTime;\r\n });\r\n }\r\n return valueObject;\r\n },\r\n 'toolbarPlacement': validKeyOption(['top', 'bottom', 'default']),\r\n 'type': validKeyOption(['icons', 'sprites']),\r\n 'viewMode': validKeyOption(['clock', 'calendar', 'months', 'years', 'decades']),\r\n 'theme': validKeyOption(['light', 'dark', 'auto']),\r\n 'meta': ({ value }) => value,\r\n 'dayViewHeaderFormat': ({ value }) => value,\r\n 'container': ({ value, path }) => {\r\n if (\r\n value &&\r\n !(\r\n value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild\r\n )\r\n ) {\r\n Namespace.errorMessages.typeMismatch(\r\n path.substring(1),\r\n typeof value,\r\n 'HTMLElement'\r\n );\r\n }\r\n return value;\r\n },\r\n 'useTwentyfourHour': ({ value, path, providedType, defaultType }) => {\r\n if (value === undefined || providedType === 'boolean') return value;\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n});\r\n\r\nconst defaultProcessor: OptionProcessorFunction = ({ value, defaultType, providedType, path }) => {\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n};\r\n\r\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\r\n return (optionProcessors[args.key] || defaultProcessor)(args);\r\n};","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport DefaultOptions from './default-options';\r\nimport Options, { FormatLocalization } from './options';\r\nimport { processKey } from './optionProcessor';\r\nimport { convertToDateTime, tryConvertToDateTime, typeCheckDateArray, typeCheckNumberArray } from './typeChecker';\r\n\r\nexport class OptionConverter {\r\n\r\n private static ignoreProperties = ['meta', 'dayViewHeaderFormat',\r\n 'container', 'dateForms', 'ordinal'];\r\n\r\n static deepCopy(input): Options {\r\n const o = {};\r\n\r\n Object.keys(input).forEach((key) => {\r\n const inputElement = input[key];\r\n\r\n if (inputElement instanceof DateTime) {\r\n o[key] = inputElement.clone\r\n return;\r\n }\r\n else if (inputElement instanceof Date) {\r\n o[key] = new Date(inputElement.valueOf());\r\n return;\r\n }\r\n\r\n o[key] = inputElement;\r\n if (typeof inputElement !== 'object' ||\r\n inputElement instanceof HTMLElement ||\r\n inputElement instanceof Element) return;\r\n if (!Array.isArray(inputElement)) {\r\n o[key] = OptionConverter.deepCopy(inputElement);\r\n }\r\n });\r\n\r\n return o;\r\n }\r\n\r\n private static isValue = a => a != null; // everything except undefined + null\r\n\r\n /**\r\n * Finds value out of an object based on a string, period delimited, path\r\n * @param paths\r\n * @param obj\r\n */\r\n static objectPath(paths: string, obj) {\r\n if (paths.charAt(0) === '.')\r\n paths = paths.slice(1);\r\n if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param localization\r\n */\r\n static spread(provided, copyTo, path = '', localization: FormatLocalization) {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).filter(key => key !== '__proto__' && key !== 'constructor').forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key))) {\r\n OptionConverter.spread(provided[key], copyTo[key], path, localization);\r\n } else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key: string, value: any, providedType: string, defaultType: string, path: string, localization: FormatLocalization) {\r\n return processKey({ key, value, providedType, defaultType, path, localization });\r\n }\r\n\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const localization =\r\n mergeTo.localization?.locale !== 'default'\r\n ? mergeTo.localization\r\n : providedOptions?.localization || DefaultOptions.localization;\r\n\r\n OptionConverter.spread(providedOptions, newConfig, '', localization);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n static _dateTypeCheck(d: any, localization: FormatLocalization): DateTime | null {\r\n return tryConvertToDateTime(d, localization);\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n localization: FormatLocalization\r\n ) {\r\n return typeCheckDateArray(optionName, value, providedType, localization);\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n static _typeCheckNumberArray(\r\n optionName: string,\r\n value,\r\n providedType: string\r\n ) {\r\n return typeCheckNumberArray(optionName, value, providedType);\r\n }\r\n\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n static dateConversion(d: any, optionName: string, localization: FormatLocalization): DateTime {\r\n return convertToDateTime(d, optionName, localization);\r\n }\r\n\r\n private static _flattenDefaults: string[];\r\n\r\n private static getFlattenDefaultOptions(): string[] {\r\n if (this._flattenDefaults) return this._flattenDefaults;\r\n const deepKeys = (t, pre = []) => {\r\n if (Array.isArray(t)) return [];\r\n if (Object(t) === t) {\r\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\r\n } else {\r\n return pre.join('.');\r\n }\r\n };\r\n\r\n this._flattenDefaults = deepKeys(DefaultOptions);\r\n\r\n return this._flattenDefaults;\r\n }\r\n\r\n /**\r\n * Some options conflict like min/max date. Verify that these kinds of options\r\n * are set correctly.\r\n * @param config\r\n */\r\n static _validateConflicts(config: Options) {\r\n if (\r\n config.display.sideBySide &&\r\n (!config.display.components.clock ||\r\n !(\r\n config.display.components.hours ||\r\n config.display.components.minutes ||\r\n config.display.components.seconds\r\n ))\r\n ) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'Cannot use side by side mode without the clock components'\r\n );\r\n }\r\n\r\n if (config.restrictions.minDate && config.restrictions.maxDate) {\r\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'minDate is after maxDate'\r\n );\r\n }\r\n\r\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'maxDate is before minDate'\r\n );\r\n }\r\n }\r\n }\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\r\nimport Validation from './validation';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\n\r\nexport default class Dates {\r\n private _dates: DateTime[] = [];\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n }\r\n\r\n /**\r\n * Returns the array of selected dates\r\n */\r\n get picked(): DateTime[] {\r\n return this._dates;\r\n }\r\n\r\n /**\r\n * Returns the last picked value.\r\n */\r\n get lastPicked(): DateTime {\r\n return this._dates[this.lastPickedIndex];\r\n }\r\n\r\n /**\r\n * Returns the length of picked dates -1 or 0 if none are selected.\r\n */\r\n get lastPickedIndex(): number {\r\n if (this._dates.length === 0) return 0;\r\n return this._dates.length - 1;\r\n }\r\n\r\n /**\r\n * Formats a DateTime object to a string. Used when setting the input value.\r\n * @param date\r\n */\r\n formatInput(date: DateTime): string {\r\n const components = this.optionsStore.options.display.components;\r\n if (!date) return '';\r\n return date.format({\r\n year: components.calendar && components.year ? 'numeric' : undefined,\r\n month: components.calendar && components.month ? '2-digit' : undefined,\r\n day: components.calendar && components.date ? '2-digit' : undefined,\r\n hour:\r\n components.clock && components.hours\r\n ? components.useTwentyfourHour\r\n ? '2-digit'\r\n : 'numeric'\r\n : undefined,\r\n minute: components.clock && components.minutes ? '2-digit' : undefined,\r\n second: components.clock && components.seconds ? '2-digit' : undefined,\r\n hour12: !components.useTwentyfourHour,\r\n });\r\n }\r\n \r\n /**\r\n * parse the value into a DateTime object.\r\n * this can be overwritten to supply your own parsing.\r\n */\r\n parseInput(value:any): DateTime {\r\n return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization);\r\n }\r\n\r\n /**\r\n * Tries to convert the provided value to a DateTime object.\r\n * If value is null|undefined then clear the value of the provided index (or 0).\r\n * @param value Value to convert or null|undefined\r\n * @param index When using multidates this is the index in the array\r\n */\r\n setFromInput(value: any, index?: number) {\r\n if (!value) {\r\n this.setValue(undefined, index);\r\n return;\r\n }\r\n const converted = this.parseInput(value);\r\n if (converted) {\r\n converted.setLocale(this.optionsStore.options.localization.locale);\r\n this.setValue(converted, index);\r\n }\r\n }\r\n\r\n /**\r\n * Adds a new DateTime to selected dates array\r\n * @param date\r\n */\r\n add(date: DateTime): void {\r\n this._dates.push(date);\r\n }\r\n\r\n /**\r\n * Returns true if the `targetDate` is part of the selected dates array.\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this._dates.find((x) => x === targetDate) !== undefined;\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return (\r\n this._dates\r\n .map((x) => x.format(format))\r\n .find((x) => x === innerDateFormatted) !== undefined\r\n );\r\n }\r\n\r\n /**\r\n * Returns the index at which `targetDate` is in the array.\r\n * This is used for updating or removing a date when multi-date is used\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\r\n if (!unit) return this._dates.indexOf(targetDate);\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\r\n }\r\n\r\n /**\r\n * Clears all selected dates.\r\n */\r\n clear() {\r\n this.optionsStore.unset = true;\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate: this.lastPicked,\r\n isClear: true,\r\n isValid: true,\r\n } as ChangeEvent);\r\n this._dates = [];\r\n }\r\n\r\n /**\r\n * Find the \"book end\" years given a `year` and a `factor`\r\n * @param factor e.g. 100 for decades\r\n * @param year e.g. 2021\r\n */\r\n static getStartEndYear(\r\n factor: number,\r\n year: number\r\n ): [number, number, number] {\r\n const step = factor / 10,\r\n startYear = Math.floor(year / factor) * factor,\r\n endYear = startYear + step * 9,\r\n focusValue = Math.floor(year / step) * step;\r\n return [startYear, endYear, focusValue];\r\n }\r\n\r\n updateInput(target?: DateTime) {\r\n if (!this.optionsStore.input) return;\r\n\r\n let newValue = this.formatInput(target);\r\n if (this.optionsStore.options.multipleDates) {\r\n newValue = this._dates\r\n .map((d) => this.formatInput(d))\r\n .join(this.optionsStore.options.multipleDatesSeparator);\r\n }\r\n if (this.optionsStore.input.value != newValue)\r\n this.optionsStore.input.value = newValue;\r\n }\r\n\r\n /**\r\n * Attempts to either clear or set the `target` date at `index`.\r\n * If the `target` is null then the date will be cleared.\r\n * If multi-date is being used then it will be removed from the array.\r\n * If `target` is valid and multi-date is used then if `index` is\r\n * provided the date at that index will be replaced, otherwise it is appended.\r\n * @param target\r\n * @param index\r\n */\r\n setValue(target?: DateTime, index?: number): void {\r\n const noIndex = typeof index === 'undefined',\r\n isClear = !target && noIndex;\r\n let oldDate = this.optionsStore.unset ? null : this._dates[index];\r\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\r\n oldDate = this.lastPicked;\r\n }\r\n\r\n if (target && oldDate?.isSame(target)) {\r\n this.updateInput(target);\r\n return;\r\n }\r\n\r\n // case of calling setValue(null)\r\n if (!target) {\r\n if (\r\n !this.optionsStore.options.multipleDates ||\r\n this._dates.length === 1 ||\r\n isClear\r\n ) {\r\n this.optionsStore.unset = true;\r\n this._dates = [];\r\n } else {\r\n this._dates.splice(index, 1);\r\n }\r\n\r\n this.updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n\r\n this._eventEmitters.updateDisplay.emit('all');\r\n return;\r\n }\r\n\r\n index = index || 0;\r\n target = target.clone;\r\n\r\n // minute stepping is being used, force the minute to the closest value\r\n if (this.optionsStore.options.stepping !== 1) {\r\n target.minutes =\r\n Math.round(target.minutes / this.optionsStore.options.stepping) *\r\n this.optionsStore.options.stepping;\r\n target.seconds = 0;\r\n }\r\n\r\n if (this.validation.isValid(target)) {\r\n this._dates[index] = target;\r\n this._eventEmitters.updateViewDate.emit(target.clone);\r\n\r\n this.updateInput(target);\r\n\r\n this.optionsStore.unset = false;\r\n this._eventEmitters.updateDisplay.emit('all');\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.keepInvalid) {\r\n this._dates[index] = target;\r\n this._eventEmitters.updateViewDate.emit(target.clone);\r\n\r\n this.updateInput(target);\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: false,\r\n } as ChangeEvent);\r\n }\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToSetInvalidDate,\r\n date: target,\r\n oldDate,\r\n } as FailEvent);\r\n }\r\n}\r\n","enum ActionTypes {\r\n next = 'next',\r\n previous = 'previous',\r\n changeCalendarView = 'changeCalendarView',\r\n selectMonth = 'selectMonth',\r\n selectYear = 'selectYear',\r\n selectDecade = 'selectDecade',\r\n selectDay = 'selectDay',\r\n selectHour = 'selectHour',\r\n selectMinute = 'selectMinute',\r\n selectSecond = 'selectSecond',\r\n incrementHours = 'incrementHours',\r\n incrementMinutes = 'incrementMinutes',\r\n incrementSeconds = 'incrementSeconds',\r\n decrementHours = 'decrementHours',\r\n decrementMinutes = 'decrementMinutes',\r\n decrementSeconds = 'decrementSeconds',\r\n toggleMeridiem = 'toggleMeridiem',\r\n togglePicker = 'togglePicker',\r\n showClock = 'showClock',\r\n showHours = 'showHours',\r\n showMinutes = 'showMinutes',\r\n showSeconds = 'showSeconds',\r\n clear = 'clear',\r\n close = 'close',\r\n today = 'today',\r\n}\r\n\r\nexport default ActionTypes;\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport Dates from \"../../dates\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `date`\r\n */\r\nexport default class DateDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.daysContainer);\r\n\r\n container.append(...this._daysOfTheWeek());\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n\r\n for (let i = 0; i < 42; i++) {\r\n if (i !== 0 && i % 7 === 0) {\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n container.appendChild(div);\r\n }\r\n }\r\n\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDay);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.daysContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"calendar\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.daysContainer,\r\n this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n )\r\n );\r\n\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\r\n Unit.month\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\r\n Unit.month\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n\r\n container\r\n .querySelectorAll(\r\n `[data-action=\"${ActionTypes.selectDay}\"], .${Namespace.css.calendarWeeks}`\r\n )\r\n .forEach((containerClone: HTMLElement) => {\r\n if (\r\n this.optionsStore.options.display.calendarWeeks &&\r\n containerClone.classList.contains(Namespace.css.calendarWeeks)\r\n ) {\r\n if (containerClone.innerText === \"#\") return;\r\n containerClone.innerText = `${innerDate.week}`;\r\n return;\r\n }\r\n\r\n let classes: string[] = [];\r\n classes.push(Namespace.css.day);\r\n\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.date)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n\r\n paint(Unit.date, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`\r\n );\r\n containerClone.setAttribute(\"data-day\", `${innerDate.date}`);\r\n containerClone.innerText = innerDate.format({ day: \"numeric\" });\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n\r\n /***\r\n * Generates an html row that contains the days of the week.\r\n * @private\r\n */\r\n private _daysOfTheWeek(): HTMLElement[] {\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement(\"div\");\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = \"#\";\r\n row.push(htmlDivElement);\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.dayOfTheWeek,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = innerDate.format({ weekday: \"short\" });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n\r\n return row;\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { Paint } from '../index';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `month`\r\n */\r\nexport default class MonthDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMonth);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.monthsContainer\r\n )[0];\r\n\r\n if(this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switcher.setAttribute(\r\n Namespace.css.monthsContainer,\r\n this.optionsStore.viewDate.format({ year: 'numeric' })\r\n );\r\n\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\r\n Unit.year\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\r\n Unit.year\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n let classes = [];\r\n classes.push(Namespace.css.month);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n}\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Dates from \"../../dates\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `year`\r\n */\r\nexport default class YearDisplay {\r\n private _startYear: DateTime;\r\n private _endYear: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.yearsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectYear);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.yearsContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"years\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.yearsContainer,\r\n `${this._startYear.format({ year: \"numeric\" })}-${this._endYear.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.year);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\"data-value\", `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: \"numeric\" });\r\n\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n}\r\n","import Dates from \"../../dates\";\r\nimport { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class DecadeDisplay {\r\n private _startDecade: DateTime;\r\n private _endDecade: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.decadesContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n const [start, end] = Dates.getStartEndYear(\r\n 100,\r\n this.optionsStore.viewDate.year\r\n );\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.decadesContainer\r\n )[0];\r\n\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(\r\n Namespace.css.decadesContainer,\r\n `${this._startDecade.format({ year: \"numeric\" })}-${this._endDecade.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = \" \";\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute(\"data-value\", ``);\r\n return;\r\n } else {\r\n containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: \"numeric\" });\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n return;\r\n }\r\n }\r\n\r\n let classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n\r\n paint(\"decade\", this._startDecade, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n containerClone.innerText = `${this._startDecade.format({ year: \"numeric\" })}`;\r\n\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates the clock display\r\n */\r\nexport default class TimeDisplay {\r\n private _gridColumns = '';\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n\r\n container.append(...this._grid(iconTag));\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget: HTMLElement): void {\r\n const timesDiv = (\r\n widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0]\r\n );\r\n const lastPicked = (\r\n this.dates.lastPicked || this.optionsStore.viewDate\r\n ).clone;\r\n\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.hours}]`\r\n ).innerText = this.optionsStore.options.display.components.useTwentyfourHour\r\n ? lastPicked.hoursFormatted\r\n : lastPicked.twelveHoursFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.minutes}]`\r\n ).innerText = lastPicked.minutesFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.seconds}]`\r\n ).innerText = lastPicked.secondsFormatted;\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n const toggle = timesDiv.querySelector(\r\n `[data-action=${ActionTypes.toggleMeridiem}]`\r\n );\r\n\r\n toggle.innerText = lastPicked.meridiem();\r\n\r\n if (\r\n !this.validation.isValid(\r\n lastPicked.clone.manipulate(\r\n lastPicked.hours >= 12 ? -12 : 12,\r\n Unit.hours\r\n )\r\n )\r\n ) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n } else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\r\n this._gridColumns = '';\r\n const top = [],\r\n middle = [],\r\n bottom = [],\r\n separator = document.createElement('div'),\r\n upIcon = iconTag(\r\n this.optionsStore.options.display.icons.up\r\n ),\r\n downIcon = iconTag(\r\n this.optionsStore.options.display.icons.down\r\n );\r\n\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n\r\n const getSeparator = (colon = false): HTMLElement => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n\r\n let button = document.createElement('button');\r\n button.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.toggleMeridiem\r\n );\r\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) { //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else button.classList.add(Namespace.css.toggleMeridiem);\r\n\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n\r\n this._gridColumns = this._gridColumns.trim();\r\n\r\n return [...top, ...middle, ...bottom];\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `hours`\r\n */\r\nexport default class HourDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n\r\n for (\r\n let i = 0;\r\n i <\r\n (this.optionsStore.options.display.components.useTwentyfourHour ? 24 : 12);\r\n i++\r\n ) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectHour);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.hourContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.hour);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = this.optionsStore.options.display.components\r\n .useTwentyfourHour\r\n ? innerDate.hoursFormatted\r\n : innerDate.twelveHoursFormatted;\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `minutes`\r\n */\r\nexport default class MinuteDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMinute);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.minuteContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.minute);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n 'data-value',\r\n `${innerDate.minutes}`\r\n );\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class secondDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectSecond);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.secondContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.second);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n}\r\n","import Namespace from '../utilities/namespace';\r\n\r\n/**\r\n * Provides a collapse functionality to the view changes\r\n */\r\nexport default class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target: HTMLElement) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n } else {\r\n this.show(target);\r\n }\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n if (!target) return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport Namespace from '../utilities/namespace';\r\nimport { HideEvent } from '../utilities/event-types';\r\nimport Collapse from './collapse';\r\nimport Validation from '../validation';\r\nimport Dates from '../dates';\r\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\r\nimport { serviceLocator } from '../utilities/service-locator';\r\nimport ActionTypes from '../utilities/action-types';\r\nimport CalendarModes from '../utilities/calendar-modes';\r\nimport { OptionsStore } from '../utilities/optionsStore';\r\n\r\n/**\r\n * Main class for all things display related.\r\n */\r\nexport default class Display {\r\n private _widget: HTMLElement;\r\n private _popperInstance: any;\r\n private _isVisible = false;\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n dateDisplay: DateDisplay;\r\n monthDisplay: MonthDisplay;\r\n yearDisplay: YearDisplay;\r\n decadeDisplay: DecadeDisplay;\r\n timeDisplay: TimeDisplay;\r\n hourDisplay: HourDisplay;\r\n minuteDisplay: MinuteDisplay;\r\n secondDisplay: SecondDisplay;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n\r\n this.dateDisplay = serviceLocator.locate(DateDisplay);\r\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\r\n this.yearDisplay = serviceLocator.locate(YearDisplay);\r\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\r\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\r\n this.hourDisplay = serviceLocator.locate(HourDisplay);\r\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\r\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._widget = undefined;\r\n\r\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\r\n this._update(result);\r\n });\r\n }\r\n\r\n /**\r\n * Returns the widget body or undefined\r\n * @private\r\n */\r\n get widget(): HTMLElement | undefined {\r\n return this._widget;\r\n }\r\n\r\n /**\r\n * Returns this visible state of the picker (shown)\r\n */\r\n get isVisible() {\r\n return this._isVisible;\r\n }\r\n\r\n /**\r\n * Updates the table for a particular unit. Used when an option as changed or\r\n * whenever the class list might need to be refreshed.\r\n * @param unit\r\n * @private\r\n */\r\n _update(unit: ViewUpdateValues): void {\r\n if (!this.widget) return;\r\n //todo do I want some kind of error catching or other guards here?\r\n switch (unit) {\r\n case Unit.seconds:\r\n this.secondDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.minutes:\r\n this.minuteDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.hours:\r\n this.hourDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.date:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.month:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.year:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'clock':\r\n if (!this._hasTime) break;\r\n this.timeDisplay._update(this.widget);\r\n this._update(Unit.hours);\r\n this._update(Unit.minutes);\r\n this._update(Unit.seconds);\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n this._update(Unit.year);\r\n this._update(Unit.month);\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n this._updateCalendarHeader();\r\n break;\r\n case 'all':\r\n if (this._hasTime) {\r\n this._update('clock');\r\n }\r\n if (this._hasDate) {\r\n this._update('calendar');\r\n }\r\n }\r\n }\r\n\r\n // noinspection JSUnusedLocalSymbols\r\n /**\r\n * Allows developers to add/remove classes from an element.\r\n * @param _unit\r\n * @param _date\r\n * @param _classes\r\n * @param _element\r\n */\r\n paint(\r\n _unit: Unit | 'decade',\r\n _date: DateTime,\r\n _classes: string[],\r\n _element: HTMLElement\r\n ) {\r\n // implemented in plugin\r\n }\r\n\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * fires Events#show\r\n */\r\n show(): void {\r\n if (this.widget == undefined) {\r\n if (this.dates.picked.length == 0) {\r\n if (\r\n this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate\r\n ) {\r\n const date = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (\r\n this.optionsStore.options.restrictions.maxDate?.isBefore(date)\r\n ) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date)) {\r\n date.manipulate(direction, Unit.date);\r\n if (tries > 31) break;\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n\r\n this._buildWidget();\r\n this._updateTheme();\r\n\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n // otherwise return to the calendar view\r\n if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n\r\n if (\r\n !onlyClock &&\r\n this.optionsStore.options.display.viewMode !== 'clock'\r\n ) {\r\n if (this._hasTime) {\r\n if(!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n } else {\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n }\r\n }\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.dateContainer}`)\r\n );\r\n }\r\n\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n container.appendChild(this.widget);\r\n this.createPopup(this.optionsStore.element, this.widget, {\r\n modifiers: [{ name: 'eventListeners', enabled: true }],\r\n //#2400\r\n placement:\r\n document.documentElement.dir === 'rtl'\r\n ? 'bottom-end'\r\n : 'bottom-start',\r\n }).then();\r\n } else {\r\n this.optionsStore.element.appendChild(this.widget);\r\n }\r\n\r\n if (this.optionsStore.options.display.viewMode == 'clock') {\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.addEventListener('click', this._actionsClickEvent)\r\n );\r\n\r\n // show the clock when using sideBySide\r\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\r\n this.timeDisplay._update(this.widget);\r\n (\r\n this.widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0] as HTMLElement\r\n ).style.display = 'grid';\r\n }\r\n }\r\n\r\n this.widget.classList.add(Namespace.css.show);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.updatePopup();\r\n document.addEventListener('click', this._documentClickEvent);\r\n }\r\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\r\n this._isVisible = true;\r\n }\r\n\r\n async createPopup(element: HTMLElement, widget: HTMLElement, options: any): Promise {\r\n let createPopperFunction;\r\n if((window as any)?.Popper) {\r\n createPopperFunction = (window as any)?.Popper?.createPopper;\r\n }\r\n else {\r\n const { createPopper } = await import('@popperjs/core');\r\n createPopperFunction = createPopper;\r\n }\r\n if(createPopperFunction){\r\n this._popperInstance = createPopperFunction(element, widget, options);\r\n }\r\n }\r\n\r\n updatePopup(): void {\r\n this._popperInstance?.update();\r\n }\r\n\r\n /**\r\n * Changes the calendar view mode. E.g. month <-> year\r\n * @param direction -/+ number to move currentViewMode\r\n * @private\r\n */\r\n _showMode(direction?: number): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (direction) {\r\n const max = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\r\n );\r\n if (this.optionsStore.currentCalendarViewMode == max) return;\r\n this.optionsStore.currentCalendarViewMode = max;\r\n }\r\n\r\n this.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\r\n )\r\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\r\n\r\n const datePickerMode =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n let picker: HTMLElement = this.widget.querySelector(\r\n `.${datePickerMode.className}`\r\n );\r\n\r\n switch (datePickerMode.className) {\r\n case Namespace.css.decadesContainer:\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.daysContainer:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n }\r\n\r\n picker.style.display = 'grid';\r\n\r\n if (this.optionsStore.options.display.sideBySide)\r\n ((this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0])).style.display = 'grid';\r\n\r\n this._updateCalendarHeader();\r\n this._eventEmitters.viewUpdate.emit();\r\n }\r\n\r\n /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme) return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n } else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n\r\n _getThemeClass(): string {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\r\n\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n\r\n _updateCalendarHeader() {\r\n const showing = [\r\n ...this.widget.querySelector(\r\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\r\n ).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousCentury\r\n );\r\n switcher.setAttribute('title', '');\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextCentury\r\n );\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousDecade\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDecade\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextDecade\r\n );\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousYear\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectYear\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextYear\r\n );\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousMonth\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectMonth\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextMonth\r\n );\r\n switcher.setAttribute(showing, this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n ));\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * fires Events#hide\r\n */\r\n hide(): void {\r\n if (!this.widget || !this._isVisible) return;\r\n\r\n this.widget.classList.remove(Namespace.css.show);\r\n\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset\r\n ? null\r\n : this.dates.lastPicked\r\n ? this.dates.lastPicked.clone\r\n : void 0,\r\n } as HideEvent);\r\n this._isVisible = false;\r\n }\r\n\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget) return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.removeEventListener('click', this._actionsClickEvent)\r\n );\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n private _buildWidget(): HTMLElement {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(\r\n this.getHeadTemplate(),\r\n this.decadeDisplay.getPicker(),\r\n this.yearDisplay.getPicker(),\r\n this.monthDisplay.getPicker(),\r\n this.dateDisplay.getPicker()\r\n );\r\n\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n\r\n if (\r\n this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n if (this._hasDate) {\r\n if (this._hasTime) {\r\n dateView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode !== 'clock')\r\n dateView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(dateView);\r\n }\r\n\r\n if (this._hasTime) {\r\n if (this._hasDate) {\r\n timeView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode === 'clock')\r\n timeView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(timeView);\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n\r\n this._widget = template;\r\n }\r\n\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds)\r\n );\r\n }\r\n\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date)\r\n );\r\n }\r\n\r\n /**\r\n * Get the toolbar html based on options like buttons.today\r\n * @private\r\n */\r\n getToolbarElements(): HTMLElement[] {\r\n const toolbar = [];\r\n\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.today)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (\r\n !this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n } else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.togglePicker);\r\n div.setAttribute('title', title);\r\n\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.clear)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.close)\r\n );\r\n toolbar.push(div);\r\n }\r\n\r\n return toolbar;\r\n }\r\n\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate(): HTMLElement {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes.previous);\r\n previous.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.previous)\r\n );\r\n\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\r\n\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes.next);\r\n next.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.next)\r\n );\r\n\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons.type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass: string): HTMLElement | SVGElement {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n const icon = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'use'\r\n );\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n private _documentClickEvent = (e: MouseEvent) => {\r\n if (this.optionsStore.options.debug || (window as any).debug) return;\r\n\r\n if (\r\n this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n private _actionsClickEvent = (e: MouseEvent) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n if (wasVisible) this.hide();\r\n this._dispose();\r\n if (wasVisible) {\r\n this.show();\r\n }\r\n }\r\n}\r\n\r\nexport type Paint = (\r\n unit: Unit | 'decade',\r\n innerDate: DateTime,\r\n classes: string[],\r\n element: HTMLElement\r\n) => void;\r\n","import { DateTime, Unit } from \"./datetime\";\r\nimport Collapse from \"./display/collapse\";\r\nimport Namespace from \"./utilities/namespace\";\r\nimport Dates from \"./dates\";\r\nimport Validation from \"./validation\";\r\nimport Display from \"./display\";\r\nimport { EventEmitters } from \"./utilities/event-emitter\";\r\nimport { serviceLocator } from \"./utilities/service-locator.js\";\r\nimport ActionTypes from \"./utilities/action-types\";\r\nimport CalendarModes from \"./utilities/calendar-modes\";\r\nimport { OptionsStore } from \"./utilities/optionsStore\";\r\n\r\n/**\r\n *\r\n */\r\nexport default class Actions {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n private display: Display;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n do(e: any, action?: ActionTypes) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return false;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n\r\n switch (action) {\r\n case ActionTypes.next:\r\n case ActionTypes.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.selectMonth:\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n\r\n if (\r\n this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode\r\n ) {\r\n this.dates.setValue(\r\n this.optionsStore.viewDate,\r\n this.dates.lastPickedIndex\r\n );\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n } else {\r\n this.display._showMode(-1);\r\n }\r\n break;\r\n case ActionTypes.selectDay:\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n\r\n day.date = +currentTarget.dataset.day;\r\n let index = 0;\r\n if (this.optionsStore.options.multipleDates) {\r\n index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex + 1);\r\n }\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n\r\n if (\r\n !this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates\r\n ) {\r\n this.display.hide();\r\n }\r\n break;\r\n case ActionTypes.selectHour:\r\n let hour = +currentTarget.dataset.value;\r\n if (\r\n lastPicked.hours >= 12 &&\r\n !this.optionsStore.options.display.components.useTwentyfourHour\r\n )\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectMinute:\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectSecond:\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes.incrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping\r\n );\r\n break;\r\n case ActionTypes.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes.decrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping * -1\r\n );\r\n break;\r\n case ActionTypes.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes.toggleMeridiem:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.hours,\r\n this.dates.lastPicked.hours >= 12 ? -12 : 12\r\n );\r\n break;\r\n case ActionTypes.togglePicker:\r\n if (\r\n currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate\r\n ) {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectTime\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.time\r\n ).outerHTML;\r\n\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n } else {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDate\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.date\r\n ).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n\r\n this.display.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\r\n )\r\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n break;\r\n case ActionTypes.showClock:\r\n case ActionTypes.showHours:\r\n case ActionTypes.showMinutes:\r\n case ActionTypes.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this._eventEmitters.updateViewDate.emit(today);\r\n\r\n //todo this this really a good idea?\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent,\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator,\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\nimport { ErrorMessages } from './utilities/errors';\r\n\r\n/**\r\n * A robust and powerful date/time picker component.\r\n */\r\nclass TempusDominus {\r\n _subscribers: { [key: string]: ((event: any) => {})[] } = {};\r\n private _isDisabled = false;\r\n private _toggle: HTMLElement;\r\n private _currentPromptTimeTimeout: any;\r\n private actions: Actions;\r\n private optionsStore: OptionsStore;\r\n private _eventEmitters: EventEmitters;\r\n display: Display;\r\n dates: Dates;\r\n\r\n constructor(element: HTMLElement, options: Options = {} as Options) {\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.unset = true;\r\n\r\n this._initializeInput();\r\n this._initializeToggle();\r\n\r\n if (this.optionsStore.options.display.inline) this.display.show();\r\n\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n\r\n this._eventEmitters.updateViewDate.subscribe(dateTime => {\r\n this.viewDate = dateTime;\r\n });\r\n }\r\n\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n\r\n set viewDate(value) {\r\n this.optionsStore.viewDate = value;\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.display._update(this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false): void {\r\n if (reset) this._initializeOptions(options, DefaultOptions);\r\n else this._initializeOptions(options, this.optionsStore.options);\r\n this.display._rebuild();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle(): void {\r\n if (this._isDisabled) return;\r\n this.display.toggle();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show(): void {\r\n if (this._isDisabled) return;\r\n this.display.show();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide(): void {\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable(): void {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable(): void {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear(): void {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(\r\n eventTypes: string | string[],\r\n callbacks: (event: any) => void | ((event: any) => void)[]\r\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray: any[];\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n } else {\r\n callBackArray = callbacks;\r\n }\r\n\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n\r\n const returnArray = [];\r\n\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(\r\n this,\r\n eventType,\r\n this._subscribers[eventType].length - 1\r\n ),\r\n });\r\n\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n\r\n return returnArray;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this._eventEmitters.destroy();\r\n this.optionsStore.input?.removeEventListener(\r\n 'change',\r\n this._inputChangeEvent\r\n );\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener(\r\n 'click',\r\n this._toggleClickEvent\r\n );\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language: string) {\r\n let asked = loadedLocales[language];\r\n if (!asked) return;\r\n this.updateOptions({\r\n localization: asked,\r\n });\r\n }\r\n\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n private _triggerEvent(event: BaseEvent) {\r\n event.viewMode = this.optionsStore.currentView;\r\n\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event as ChangeEvent;\r\n if (\r\n (date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)\r\n ) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event as ChangeEvent);\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent('change', { detail: event as any })\r\n );\r\n }\r\n\r\n this.optionsStore.element.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n if ((window as any).jQuery) {\r\n const $ = (window as any).jQuery;\r\n\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n } else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n\r\n this._publish(event);\r\n }\r\n\r\n private _publish(event: BaseEvent) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n private _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone,\r\n } as ViewUpdateEvent);\r\n }\r\n\r\n private _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n private _initializeOptions(\r\n config: Options,\r\n mergeTo: Options,\r\n includeDataset = false\r\n ): void {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n newConfig\r\n );\r\n\r\n OptionConverter._validateConflicts(newConfig);\r\n\r\n newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n this.optionsStore.currentCalendarViewMode\r\n );\r\n\r\n // Update view mode if needed\r\n if (\r\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\r\n this.optionsStore.minimumCalendarViewMode\r\n );\r\n }\r\n\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n\r\n if (newConfig.display.components.useTwentyfourHour === undefined) {\r\n newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod;\r\n }\r\n\r\n\r\n this.optionsStore.options = newConfig;\r\n }\r\n\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n private _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\r\n } else {\r\n let query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n } else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n\r\n if (!this.optionsStore.input) return;\r\n\r\n if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\r\n this.optionsStore.input.value = this.dates.formatInput(this.optionsStore.options.defaultDate);\r\n\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n private _initializeToggle() {\r\n if (this.optionsStore.options.display.inline) return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n private _handleAfterChangeEvent(e: ChangeEvent) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer)\r\n )\r\n return;\r\n\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if (\r\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))\r\n ) {\r\n return;\r\n }\r\n\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector(\r\n `.${Namespace.css.switch} div`\r\n ),\r\n },\r\n action: ActionTypes.togglePicker,\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _inputChangeEvent = (event?: any) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered) return;\r\n\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\r\n };\r\n\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates) {\r\n try {\r\n const valueSplit = value.split(\r\n this.optionsStore.options.multipleDatesSeparator\r\n );\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n } catch {\r\n console.warn(\r\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\r\n );\r\n }\r\n } else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _toggleClickEvent = () => {\r\n if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return\r\n this.toggle();\r\n };\r\n}\r\n\r\n/**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\nconst loadedLocales = {};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\nconst loadLocale = (l) => {\r\n if (loadedLocales[l.name]) return;\r\n loadedLocales[l.name] = l.localization;\r\n};\r\n\r\n/**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\nconst locale = (l: string) => {\r\n let asked = loadedLocales[l];\r\n if (!asked) return;\r\n DefaultOptions.localization = asked;\r\n};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\nconst extend = function (plugin, option) {\r\n if (!plugin) return tempusDominus;\r\n if (!plugin.installed) {\r\n // install plugin only once\r\n plugin(option, { TempusDominus, Dates, Display, DateTime, Namespace }, tempusDominus);\r\n plugin.installed = true;\r\n }\r\n return tempusDominus;\r\n};\r\n\r\nconst version = '6.2.7';\r\n\r\nconst tempusDominus = {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version\r\n};\r\n\r\nexport {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version,\r\n DateTimeFormatOptions,\r\n Options\r\n}\r\n"],"names":["Unit","ActionTypes","SecondDisplay"],"mappings":";;;;;;;;;;;AAAYA,wBAOX;EAPD,CAAA,UAAY,IAAI,EAAA;EACd,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;EACnB,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;EACnB,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;EACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;EACb,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;EACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;EACf,CAAC,EAPWA,YAAI,KAAJA,YAAI,GAOf,EAAA,CAAA,CAAA,CAAA;EAED,MAAM,gBAAgB,GAAG;EACvB,IAAA,KAAK,EAAE,SAAS;EAChB,IAAA,GAAG,EAAE,SAAS;EACd,IAAA,IAA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AAA,IAAI,CAAC,KAAK;UAAE,OAAO;EACnB,IAAA,cAAc,CAAC,YAAY,GAAG,KAAK,CAAC;EACtC,EAAE;EAEF;EACA;;;;EAIG;AACH,QAAM,MAAM,GAAG,UAAU,MAAM,EAAE,MAAM,EAAA;EACrC,IAAA,IAAI,CAAC,MAAM;EAAE,QAAA,OAAO,aAAa,CAAC;EAClC,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;;EAErB,QAAA,MAAM,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,aAAa,CAAC,CAAC;EACtF,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;EACzB,KAAA;EACD,IAAA,OAAO,aAAa,CAAC;EACvB,EAAE;AAEI,QAAA,OAAO,GAAG,QAAQ;EAExB,MAAM,aAAa,GAAG;MACpB,aAAa;MACb,MAAM;MACN,UAAU;MACV,MAAM;MACN,SAAS;MACT,cAAc;MACd,QAAQ;YACRD,YAAI;MACJ,OAAO;GACR;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/js/tempus-dominus.min.js b/dist/js/tempus-dominus.min.js index 577074b68..bf5a65907 100644 --- a/dist/js/tempus-dominus.min.js +++ b/dist/js/tempus-dominus.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).tempusDominus={})}(this,(function(t){"use strict";var e;t.Unit=void 0,(e=t.Unit||(t.Unit={})).seconds="seconds",e.minutes="minutes",e.hours="hours",e.date="date",e.month="month",e.year="year";const s={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},i={hour:"2-digit",hour12:!1},o=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}};class a extends Date{constructor(){super(...arguments),this.locale="default",this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335]}setLocale(t){return this.locale=t,this}static convert(t,e="default"){if(!t)throw new Error("A date is required");return new a(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocale(e)}static fromString(t,e){return new a(t)}get clone(){return new a(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":if(this.startOf(t.Unit.date),this.weekDay===s)break;let e=this.weekDay;0!==s&&0===this.weekDay&&(e=8-s),this.manipulate(s-e,t.Unit.date);break;case"month":this.startOf(t.Unit.date),this.setDate(1);break;case"year":this.startOf(t.Unit.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":this.endOf(t.Unit.date),this.manipulate(6+s-this.weekDay,t.Unit.date);break;case"month":this.endOf(t.Unit.date),this.manipulate(1,t.Unit.month),this.setDate(0);break;case"year":this.endOf(t.Unit.date),this.manipulate(1,t.Unit.year),this.setDate(0)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}format(t,e=this.locale){return new Intl.DateTimeFormat(e,t).format(this)}isBefore(t,e){if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=a.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1];return(o?this.isAfter(t,s):!this.isBefore(t,s))&&(a?this.isBefore(e,s):!this.isAfter(e,s))||(o?this.isBefore(t,s):!this.isAfter(t,s))&&(a?this.isAfter(e,s):!this.isBefore(e,s))}parts(t=this.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,s).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,s).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){return this.parts(void 0,i).hour}get twelveHoursFormatted(){return this.parts(void 0,s).hour}meridiem(t=this.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,s).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,s).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear(this.year-1):s>this.weeksInWeekYear(this.year)&&(s=1),s}weeksInWeekYear(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,s=t-1,i=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===e||3===i?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}}class n extends Error{}class r{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new n(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new n(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new n(`${this.base} Unexpected option value: ${t} does not accept a value of "${e}". Valid values are: ${s.join(", ")}`);throw i.code=2,i}typeMismatch(t,e,s){const i=new n(`${this.base} Mismatch types: ${t} has a type of ${e} instead of the required ${s}`);throw i.code=3,i}numbersOutOfRange(t,e,s){const i=new n(`${this.base} ${t} expected an array of number between ${e} and ${s}.`);throw i.code=4,i}failedToParseDate(t,e,s=!1){const i=new n(`${this.base} Could not correctly parse "${e}" to a date for ${t}.`);if(i.code=5,!s)throw i;console.warn(i)}mustProvideElement(){const t=new n(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new n(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new n(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}customDateFormatError(t){const e=new n(`${this.base} customDateFormat: ${t}`);throw e.code=9,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}throwError(t){const e=new n(`${this.base} ${t}`);throw e.code=9,e}}const d="tempus-dominus";class c{}c.NAME=d,c.dataKey="td",c.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},c.css=new class{constructor(){this.widget=`${d}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},c.errorMessages=new r;class l{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let h;const p=[{name:"calendar",className:c.css.daysContainer,unit:t.Unit.month,step:1},{name:"months",className:c.css.monthsContainer,unit:t.Unit.year,step:1},{name:"years",className:c.css.yearsContainer,unit:t.Unit.year,step:10},{name:"decades",className:c.css.decadesContainer,unit:t.Unit.year,step:100}];class u{constructor(){this._currentCalendarViewMode=0,this._viewDate=new a,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=p[t].name}get viewDate(){return this._viewDate}set viewDate(t){this._viewDate=t,this.options&&(this.options.viewDate=t)}refreshCurrentView(){this.currentView=p[this.currentCalendarViewMode].name}}class m{constructor(){this.optionsStore=h.locate(u)}isValid(e,s){if(s!==t.Unit.month&&this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))return!1;if(s!==t.Unit.month&&this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))return!1;if(s!==t.Unit.month&&s!==t.Unit.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&e.isBefore(this.optionsStore.options.restrictions.minDate,s))return!1;if(this.optionsStore.options.restrictions.maxDate&&e.isAfter(this.optionsStore.options.restrictions.maxDate,s))return!1;if(s===t.Unit.hours||s===t.Unit.minutes||s===t.Unit.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(e))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(e))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let t of this.optionsStore.options.restrictions.disabledTimeIntervals)if(e.isBetween(t.from,t.to))return!1}return!0}_isInDisabledDates(e){return!(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)&&this.optionsStore.options.restrictions.disabledDates.find((s=>s.isSame(e,t.Unit.date)))}_isInEnabledDates(e){return!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length||this.optionsStore.options.restrictions.enabledDates.find((s=>s.isSame(e,t.Unit.date)))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.find((t=>t===e))}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.find((t=>t===e))}}class y{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class g{constructor(){this.triggerEvent=new y,this.viewUpdate=new y,this.updateDisplay=new y,this.action=new y,this.updateViewDate=new y}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy(),this.updateViewDate.destroy()}}const v={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto"},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>t,format:"L LT"},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new a,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};function w(t,e){if(t.constructor.name===a.name)return t;if(t.constructor.name===Date.name)return a.convert(t);if("string"==typeof t){const s=a.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}function S(t,e,s){"string"==typeof t&&"input"!==e&&c.errorMessages.dateString();const i=w(t,s);return i||c.errorMessages.failedToParseDate(e,t,"input"===e),i}function f(t,e,s,i){Array.isArray(e)||c.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||c.errorMessages.typeMismatch(t,s,"array of numbers")}function D(t){return({value:e,providedType:s,localization:i})=>{const o=S(e,t,i);if(void 0!==o)return o.setLocale(i.locale),o;c.errorMessages.typeMismatch(t,s,"DateTime or Date")}}function _(t){const e=D(t);return t=>void 0===t.value?t.value:e(t)}function k(t,e,s){return({value:i,providedType:o})=>void 0===i?[]:(b(t,i,o),i.some((t=>ts))&&c.errorMessages.numbersOutOfRange(t,e,s),i)}function C(t){return k(t,0,23)}function E(t){return({value:e,providedType:s,localization:i})=>void 0===e?[]:(f(t,e,s,i),e)}function M(t){return({value:e,path:s})=>(t.includes(e)||c.errorMessages.unexpectedOptionValue(s.substring(1),e,t),e)}const T=Object.freeze({defaultDate:D("defaultDate"),viewDate:D("viewDate"),minDate:_("restrictions.minDate"),maxDate:_("restrictions.maxDate"),disabledHours:C("restrictions.disabledHours"),enabledHours:C("restrictions.enabledHours"),disabledDates:E("restrictions.disabledDates"),enabledDates:E("restrictions.enabledDates"),daysOfWeekDisabled:k("restrictions.daysOfWeekDisabled",0,6),disabledTimeIntervals:({key:t,value:e,providedType:s,localization:i})=>{if(void 0===e)return[];Array.isArray(e)||c.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const o=e;for(let e=0;e{const a=`${t}[${e}].${s}`,n=o[e][s],r=S(n,a,i);r||c.errorMessages.typeMismatch(a,typeof n,"DateTime or Date"),r.setLocale(i.locale),o[e][s]=r}));return o},toolbarPlacement:M(["top","bottom","default"]),type:M(["icons","sprites"]),viewMode:M(["clock","calendar","months","years","decades"]),theme:M(["light","dark","auto"]),meta:({value:t})=>t,dayViewHeaderFormat:({value:t})=>t,container:({value:t,path:e})=>(t&&!(t instanceof HTMLElement||t instanceof Element||t?.appendChild)&&c.errorMessages.typeMismatch(e.substring(1),typeof t,"HTMLElement"),t),useTwentyfourHour:({value:t,path:e,providedType:s,defaultType:i})=>{if(void 0===t||"boolean"===s)return t;c.errorMessages.typeMismatch(e,s,i)}}),L=({value:t,defaultType:e,providedType:s,path:i})=>{switch(e){case"boolean":return"true"===t||!0===t;case"number":return+t;case"string":return t.toString();case"object":return{};case"function":return t;default:c.errorMessages.typeMismatch(i,s,e)}};function U(t){return(T[t.key]||L)(t)}class A{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];i instanceof a?e[s]=i.clone:(i instanceof Date&&(e[s]=new Date(i.valueOf())),e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||Array.isArray(i)||(e[s]=A.deepCopy(i)))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>A.isValue(t)||A.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i){const o=A.objectPath(s,v),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=A.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));c.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,c=t[a];if(null==c)return e[a]=c,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||A.ignoreProperties.includes(a)?e[a]=A.processKey(a,c,r,d,s,i):A.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){return U({key:t,value:e,providedType:s,defaultType:i,path:o,localization:a})}static _mergeOptions(t,e){const s=A.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||v.localization;return A.spread(t,s,"",i),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;let i={};const o=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},a=(t,e,s,i)=>{const n=o(s)[t[e].toLowerCase()],r={};return void 0===n||(s[n].constructor===Object?(e++,r[n]=a(t,e,s[n],i)):r[n]=i),r},n=o(e);return Object.keys(s).filter((t=>t.startsWith(c.dataKey))).map((t=>t.substring(2))).forEach((t=>{let o=n[t.toLowerCase()];if(t.includes("_")){const r=t.split("_");o=n[r[0].toLowerCase()],void 0!==o&&e[o].constructor===Object&&(i[o]=a(r,1,e[o],s[`td${t}`]))}else void 0!==o&&(i[o]=s[`td${t}`])})),this._mergeOptions(i,e)}static _dateTypeCheck(t,e){return w(t,e)}static _typeCheckDateArray(t,e,s,i){return f(t,e,s,i)}static _typeCheckNumberArray(t,e,s){return b(t,e,s)}static dateConversion(t,e,s){return S(t,e,s)}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(v),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||c.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&c.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&c.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}A.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],A.isValue=t=>null!=t;class V{constructor(){this._dates=[],this.optionsStore=h.locate(u),this.validation=h.locate(m),this._eventEmitters=h.locate(g)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){const e=this.optionsStore.options.display.components;return t?t.format({year:e.calendar&&e.year?"numeric":void 0,month:e.calendar&&e.month?"2-digit":void 0,day:e.calendar&&e.date?"2-digit":void 0,hour:e.clock&&e.hours?e.useTwentyfourHour?"2-digit":"numeric":void 0,minute:e.clock&&e.minutes?"2-digit":void 0,second:e.clock&&e.seconds?"2-digit":void 0,hour12:!e.useTwentyfourHour}):""}parseInput(t){return A.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocale(this.optionsStore.options.localization.locale),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!e)return void 0!==this._dates.find((e=>e===t));const s=o(e);let i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!e)return this._dates.indexOf(t);const s=o(e);let i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:c.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[]}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}setValue(t,e){const s=void 0===e,i=!t&&s;let o=this.optionsStore.unset?null:this._dates[e];!o&&!this.optionsStore.unset&&s&&i&&(o=this.lastPicked);const a=()=>{if(!this.optionsStore.input)return;let e=this.formatInput(t);this.optionsStore.options.multipleDates&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)};if(t&&o?.isSame(t))a();else{if(!t)return!this.optionsStore.options.multipleDates||1===this._dates.length||i?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),a(),this._eventEmitters.triggerEvent.emit({type:c.events.change,date:void 0,oldDate:o,isClear:i,isValid:!0}),void this._eventEmitters.updateDisplay.emit("all");if(e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.seconds=0),this.validation.isValid(t))return this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),a(),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),void this._eventEmitters.triggerEvent.emit({type:c.events.change,date:t,oldDate:o,isClear:i,isValid:!0});this.optionsStore.options.keepInvalid&&(this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),a(),this._eventEmitters.triggerEvent.emit({type:c.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:c.events.error,reason:c.errorMessages.failedToSetInvalidDate,date:t,oldDate:o})}}}var $;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}($||($={}));var O=$;class H{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(V),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");if(t.classList.add(c.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(c.css.calendarWeeks,c.css.noHighlight),t.appendChild(e)}for(let e=0;e<42;e++){if(0!==e&&e%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(c.css.calendarWeeks,c.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",O.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.daysContainer)[0];if("calendar"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(c.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?s.classList.remove(c.css.disabled):s.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.month),t.Unit.month)?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.month),t.Unit.month)?o.classList.remove(c.css.disabled):o.classList.add(c.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.Unit.hours);i.querySelectorAll(`[data-action="${O.selectDay}"], .${c.css.calendarWeeks}`).forEach((e=>{if(this.optionsStore.options.display.calendarWeeks&&e.classList.contains(c.css.calendarWeeks)){if("#"===e.innerText)return;return void(e.innerText=`${o.week}`)}let i=[];i.push(c.css.day),o.isBefore(this.optionsStore.viewDate,t.Unit.month)&&i.push(c.css.old),o.isAfter(this.optionsStore.viewDate,t.Unit.month)&&i.push(c.css.new),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.date)&&i.push(c.css.active),this.validation.isValid(o,t.Unit.date)||i.push(c.css.disabled),o.isSame(new a,t.Unit.date)&&i.push(c.css.today),0!==o.weekDay&&6!==o.weekDay||i.push(c.css.weekend),s(t.Unit.date,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}-${o.monthFormatted}-${o.dateFormatted}`),e.setAttribute("data-day",`${o.date}`),e.innerText=o.format({day:"numeric"}),o.manipulate(1,t.Unit.date)}))}_daysOfTheWeek(){let e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.Unit.date);const s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(c.css.calendarWeeks,c.css.noHighlight),t.innerText="#",s.push(t)}for(let i=0;i<7;i++){const i=document.createElement("div");i.classList.add(c.css.dayOfTheWeek,c.css.noHighlight),i.innerText=e.format({weekday:"short"}),e.manipulate(1,t.Unit.date),s.push(i)}return s}}class x{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(V),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(c.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(c.css.disabled):s.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),t.Unit.year)?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.year),t.Unit.year)?o.classList.remove(c.css.disabled):o.classList.add(c.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.year);i.querySelectorAll(`[data-action="${O.selectMonth}"]`).forEach(((e,i)=>{let a=[];a.push(c.css.month),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.month)&&a.push(c.css.active),this.validation.isValid(o,t.Unit.month)||a.push(c.css.disabled),s(t.Unit.month,o,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${i}`),e.innerText=`${o.format({month:"short"})}`,o.manipulate(1,t.Unit.month)}))}}class P{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(V),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.Unit.year);const i=e.getElementsByClassName(c.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(c.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(c.css.disabled):s.classList.add(c.css.disabled),this.validation.isValid(this._startYear,t.Unit.year)?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled),this.validation.isValid(this._endYear,t.Unit.year)?o.classList.remove(c.css.disabled):o.classList.add(c.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.year).manipulate(-1,t.Unit.year);i.querySelectorAll(`[data-action="${O.selectYear}"]`).forEach((e=>{let i=[];i.push(c.css.year),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.year)&&i.push(c.css.active),this.validation.isValid(o,t.Unit.year)||i.push(c.css.disabled),s(t.Unit.year,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}`),e.innerText=o.format({year:"numeric"}),o.manipulate(1,t.Unit.year)}))}}class I{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(V),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=V.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._endDecade.year=o;const a=e.getElementsByClassName(c.css.decadesContainer)[0],[n,r,d]=a.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(r.setAttribute(c.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.Unit.year)?n.classList.remove(c.css.disabled):n.classList.add(c.css.disabled),this.validation.isValid(this._endDecade,t.Unit.year)?d.classList.remove(c.css.disabled):d.classList.add(c.css.disabled));const l=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${O.selectDecade}"]`).forEach(((e,i)=>{if(0===i)return e.classList.add(c.css.old),this._startDecade.year-10<0?(e.textContent=" ",n.classList.add(c.css.disabled),e.classList.add(c.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.Unit.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));let o=[];o.push(c.css.decade);const a=this._startDecade.year,r=this._startDecade.year+9;!this.optionsStore.unset&&l.filter((t=>t>=a&&t<=r)).length>0&&o.push(c.css.active),s("decade",this._startDecade,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.Unit.year)}))}}class z{constructor(){this._gridColumns="",this.optionsStore=h.locate(u),this.dates=h.locate(V),this.validation=h.locate(m)}getPicker(t){const e=document.createElement("div");return e.classList.add(c.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(c.css.clockContainer)[0],i=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(c.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${O.incrementHours}]`).classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${O.decrementHours}]`).classList.add(c.css.disabled),s.querySelector(`[data-time-component=${t.Unit.hours}]`).innerText=this.optionsStore.options.display.components.useTwentyfourHour?i.hoursFormatted:i.twelveHoursFormatted),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${O.incrementMinutes}]`).classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${O.decrementMinutes}]`).classList.add(c.css.disabled),s.querySelector(`[data-time-component=${t.Unit.minutes}]`).innerText=i.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${O.incrementSeconds}]`).classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${O.decrementSeconds}]`).classList.add(c.css.disabled),s.querySelector(`[data-time-component=${t.Unit.seconds}]`).innerText=i.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const e=s.querySelector(`[data-action=${O.toggleMeridiem}]`);e.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,t.Unit.hours))?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],i=[],o=[],a=document.createElement("div"),n=e(this.optionsStore.options.display.icons.up),r=e(this.optionsStore.options.display.icons.down);a.classList.add(c.css.separator,c.css.noHighlight);const d=a.cloneNode(!0);d.innerHTML=":";const l=(t=!1)=>t?d.cloneNode(!0):a.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",O.incrementHours),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",O.showHours),e.setAttribute("data-time-component",t.Unit.hours),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",O.decrementHours),e.appendChild(r.cloneNode(!0)),o.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",O.incrementMinutes),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",O.showMinutes),e.setAttribute("data-time-component",t.Unit.minutes),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",O.decrementMinutes),e.appendChild(r.cloneNode(!0)),o.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",O.incrementSeconds),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",O.showSeconds),e.setAttribute("data-time-component",t.Unit.seconds),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",O.decrementSeconds),e.appendChild(r.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=l();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",O.toggleMeridiem),e.setAttribute("tabindex","-1"),c.css.toggleMeridiem.includes(",")?e.classList.add(...c.css.toggleMeridiem.split(",")):e.classList.add(c.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(c.css.noHighlight),t.appendChild(e),i.push(t),t=l(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class N{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.hourContainer);for(let e=0;e<(this.optionsStore.options.display.components.useTwentyfourHour?24:12);e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectHour),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.date);i.querySelectorAll(`[data-action="${O.selectHour}"]`).forEach((e=>{let i=[];i.push(c.css.hour),this.validation.isValid(o,t.Unit.hours)||i.push(c.css.disabled),s(t.Unit.hours,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.hours}`),e.innerText=this.optionsStore.options.display.components.useTwentyfourHour?o.hoursFormatted:o.twelveHoursFormatted,o.manipulate(1,t.Unit.hours)}))}}class F{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.minuteContainer);let e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",O.selectMinute),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.hours),a=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${O.selectMinute}"]`).forEach((e=>{let i=[];i.push(c.css.minute),this.validation.isValid(o,t.Unit.minutes)||i.push(c.css.disabled),s(t.Unit.minutes,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.minutes}`),e.innerText=o.minutesFormatted,o.manipulate(a,t.Unit.minutes)}))}}class B{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectSecond),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.minutes);i.querySelectorAll(`[data-action="${O.selectSecond}"]`).forEach((e=>{let i=[];i.push(c.css.second),this.validation.isValid(o,t.Unit.seconds)||i.push(c.css.disabled),s(t.Unit.seconds,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.seconds}`),e.innerText=o.secondsFormatted,o.manipulate(5,t.Unit.seconds)}))}}class q{static toggle(t){t.classList.contains(c.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(c.css.collapsing),t.classList.add(c.css.collapse,c.css.show),t.style.height=""}static show(t){if(t.classList.contains(c.css.collapsing)||t.classList.contains(c.css.show))return;t.style.height="0",t.classList.remove(c.css.collapse),t.classList.add(c.css.collapsing),setTimeout((()=>{q.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(c.css.collapsing,c.css.show),t.classList.add(c.css.collapse))}static hide(t){if(t.classList.contains(c.css.collapsing)||!t.classList.contains(c.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(c.css.collapse,c.css.show),t.classList.add(c.css.collapsing),t.style.height="",setTimeout((()=>{q.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}q.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class W{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=h.locate(u),this.validation=h.locate(m),this.dates=h.locate(V),this.dateDisplay=h.locate(H),this.monthDisplay=h.locate(x),this.yearDisplay=h.locate(P),this.decadeDisplay=h.locate(I),this.timeDisplay=h.locate(z),this.hourDisplay=h.locate(N),this.minuteDisplay=h.locate(F),this.secondDisplay=h.locate(B),this._eventEmitters=h.locate(g),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.Unit.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.Unit.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.Unit.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.Unit.date:this.dateDisplay._update(this.widget,this.paint);break;case t.Unit.month:this.monthDisplay._update(this.widget,this.paint);break;case t.Unit.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.Unit.hours),this._update(t.Unit.minutes),this._update(t.Unit.seconds);break;case"calendar":this._update(t.Unit.date),this._update(t.Unit.year),this._update(t.Unit.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new a).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!(this.validation.isValid(e)||(e.manipulate(i,t.Unit.date),s>31));)s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget(),this._updateTheme();const e=this._hasTime&&!this._hasDate;if(e&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:O.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),e||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?q.show(this.widget.querySelector(`div.${c.css.timeContainer}`)):q.hideImmediately(this.widget.querySelector(`div.${c.css.timeContainer}`))),q.show(this.widget.querySelector(`div.${c.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{(this.optionsStore.options?.container||document.body).appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:O.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(c.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(c.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:c.events.show}),this._isVisible=!0}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${c.css.dateContainer} > div:not(.${c.css.calendarHeader}), .${c.css.timeContainer} > div:not(.${c.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=p[this.optionsStore.currentCalendarViewMode];let s=this.widget.querySelector(`.${e.className}`);switch(e.className){case c.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case c.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case c.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case c.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(c.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(c.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(c.css.isDarkPreferredQuery).matches;switch(t){case"light":return c.css.lightTheme;case"dark":return c.css.darkTheme;case"auto":return e?c.css.darkTheme:c.css.lightTheme}}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${c.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(c.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case c.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case c.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),i.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case c.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),i.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case c.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),i.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.innerText=this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(c.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:c.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?this.dates.lastPicked.clone:void 0}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(c.css.widget);const e=document.createElement("div");e.classList.add(c.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(c.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const i=document.createElement("div");if(i.classList.add(c.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(c.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(c.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");return o.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),o.appendChild(e),o.appendChild(s),t.appendChild(o),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),void(this._widget=t)}"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),this._hasDate&&(this._hasTime&&(e.classList.add(c.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(c.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(c.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(c.css.show)),t.appendChild(s)),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");o.classList.add("arrow"),o.setAttribute("data-popper-arrow",""),t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",O.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",O.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",O.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",O.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(c.css.calendarHeader);const e=document.createElement("div");e.classList.add(c.css.previous),e.setAttribute("data-action",O.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(c.css.switch),s.setAttribute("data-action",O.changeCalendarView);const i=document.createElement("div");return i.classList.add(c.css.next),i.setAttribute("data-action",O.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class Y{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(V),this.validation=h.locate(m),this.display=h.locate(W),this._eventEmitters=h.locate(g),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const i=e?.currentTarget;if(i?.classList?.contains(c.css.disabled))return!1;s=s||i?.dataset?.action;const o=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case O.next:case O.previous:this.handleNextPrevious(s);break;case O.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case O.selectMonth:case O.selectYear:case O.selectDecade:const n=+i.dataset.value;switch(s){case O.selectMonth:this.optionsStore.viewDate.month=n;break;case O.selectYear:case O.selectDecade:this.optionsStore.viewDate.year=n}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1);break;case O.selectDay:const r=this.optionsStore.viewDate.clone;i.classList.contains(c.css.old)&&r.manipulate(-1,t.Unit.month),i.classList.contains(c.css.new)&&r.manipulate(1,t.Unit.month),r.date=+i.dataset.day;let d=0;this.optionsStore.options.multipleDates?(d=this.dates.pickedIndex(r,t.Unit.date),-1!==d?this.dates.setValue(null,d):this.dates.setValue(r,this.dates.lastPickedIndex+1)):this.dates.setValue(r,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.display.hide();break;case O.selectHour:let l=+i.dataset.value;o.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(l+=12),o.hours=l,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case O.selectMinute:o.minutes=+i.dataset.value,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case O.selectSecond:o.seconds=+i.dataset.value,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case O.incrementHours:this.manipulateAndSet(o,t.Unit.hours);break;case O.incrementMinutes:this.manipulateAndSet(o,t.Unit.minutes,this.optionsStore.options.stepping);break;case O.incrementSeconds:this.manipulateAndSet(o,t.Unit.seconds);break;case O.decrementHours:this.manipulateAndSet(o,t.Unit.hours,-1);break;case O.decrementMinutes:this.manipulateAndSet(o,t.Unit.minutes,-1*this.optionsStore.options.stepping);break;case O.decrementSeconds:this.manipulateAndSet(o,t.Unit.seconds,-1);break;case O.toggleMeridiem:this.manipulateAndSet(o,t.Unit.hours,this.dates.lastPicked.hours>=12?-12:12);break;case O.togglePicker:i.getAttribute("title")===this.optionsStore.options.localization.selectDate?(i.setAttribute("title",this.optionsStore.options.localization.selectTime),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(i.setAttribute("title",this.optionsStore.options.localization.selectDate),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(O.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${c.css.dateContainer}, .${c.css.timeContainer}`).forEach((t=>q.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case O.showClock:case O.showHours:case O.showMinutes:case O.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(q.hideImmediately(this.display.widget.querySelector(`div.${c.css.dateContainer}`)),q.showImmediately(this.display.widget.querySelector(`div.${c.css.timeContainer}`))),this.handleShowClockContainers(s);break;case O.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case O.close:this.display.hide();break;case O.today:const h=(new a).setLocale(this.optionsStore.options.localization.locale);this._eventEmitters.updateViewDate.emit(h),this.validation.isValid(h,t.Unit.date)&&this.dates.setValue(h,this.dates.lastPickedIndex)}}handleShowClockContainers(e){if(!this.display._hasTime)return void c.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${c.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case O.showClock:s=c.css.clockContainer,this.display._update("clock");break;case O.showHours:s=c.css.hourContainer,this.display._update(t.Unit.hours);break;case O.showMinutes:s=c.css.minuteContainer,this.display._update(t.Unit.minutes);break;case O.showSeconds:s=c.css.secondContainer,this.display._update(t.Unit.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=p[this.optionsStore.currentCalendarViewMode];t===O.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,O.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class j{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},h=new l,this._eventEmitters=h.locate(g),this.optionsStore=h.locate(u),this.display=h.locate(W),this.dates=h.locate(V),this.actions=h.locate(Y),t||c.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,v,!0),this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()})),this._eventEmitters.updateViewDate.subscribe((t=>{this.viewDate=t}))}get viewDate(){return this.optionsStore.viewDate}set viewDate(t){this.optionsStore.viewDate=t,this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.display._update("clock"===this.optionsStore.currentView?"clock":"calendar")}updateOptions(t,e=!1){e?this._initializeOptions(t,v):this._initializeOptions(t,this.optionsStore.options),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&c.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:c.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=A.deepCopy(t);i=A._mergeOptions(i,e),s&&(i=A._dataToOptions(this.optionsStore.element,i)),A._validateConflicts(i),i.viewDate=i.viewDate.setLocale(i.localization.locale),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),p[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(p.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),void 0===i.display.components.useTwentyfourHour&&(i.display.components.useTwentyfourHour=!i.viewDate.parts()?.dayPeriod),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{let t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(c.css.show)[0].classList.contains(c.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${c.css.switch} div`)},action:O.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const Q={},K=t=>{Q[t.name]||(Q[t.name]=t.localization)},J=t=>{let e=Q[t];e&&(v.localization=e)},R=function(t,e){return t?(t.installed||(t(e,{TempusDominus:j,Dates:V,Display:W,DateTime:a,ErrorMessages:r},X),t.installed=!0),X):X},G="6.2.6",X={TempusDominus:j,extend:R,loadLocale:K,locale:J,Namespace:c,DefaultOptions:v,DateTime:a,Unit:t.Unit,version:G};t.DateTime=a,t.DefaultOptions=v,t.Namespace=c,t.TempusDominus=j,t.extend=R,t.loadLocale=K,t.locale=J,t.version=G,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).tempusDominus={})}(this,(function(t){"use strict";var e;t.Unit=void 0,(e=t.Unit||(t.Unit={})).seconds="seconds",e.minutes="minutes",e.hours="hours",e.date="date",e.month="month",e.year="year";const s={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},i={hour:"2-digit",hour12:!1},o=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}};class a extends Date{constructor(){super(...arguments),this.locale="default",this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335]}setLocale(t){return this.locale=t,this}static convert(t,e="default"){if(!t)throw new Error("A date is required");return new a(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocale(e)}static fromString(t,e){return new a(t)}get clone(){return new a(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":if(this.startOf(t.Unit.date),this.weekDay===s)break;let e=this.weekDay;0!==s&&0===this.weekDay&&(e=8-s),this.manipulate(s-e,t.Unit.date);break;case"month":this.startOf(t.Unit.date),this.setDate(1);break;case"year":this.startOf(t.Unit.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":this.endOf(t.Unit.date);const e=6+s;if(this.weekDay===e)break;this.manipulate(e-this.weekDay,t.Unit.date);break;case"month":this.endOf(t.Unit.date),this.manipulate(1,t.Unit.month),this.setDate(0);break;case"year":this.endOf(t.Unit.date),this.setMonth(11,31)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}format(t,e=this.locale){return new Intl.DateTimeFormat(e,t).format(this)}isBefore(t,e){if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=a.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1];return(o?this.isAfter(t,s):!this.isBefore(t,s))&&(a?this.isBefore(e,s):!this.isAfter(e,s))||(o?this.isBefore(t,s):!this.isAfter(t,s))&&(a?this.isAfter(e,s):!this.isBefore(e,s))}parts(t=this.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,s).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,s).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){return this.parts(void 0,i).hour}get twelveHoursFormatted(){return this.parts(void 0,s).hour}meridiem(t=this.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,s).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,s).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear(this.year-1):s>this.weeksInWeekYear(this.year)&&(s=1),s}weeksInWeekYear(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,s=t-1,i=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===e||3===i?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}}class n extends Error{}const r="tempus-dominus";class d{}d.NAME=r,d.dataKey="td",d.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},d.css=new class{constructor(){this.widget=`${r}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},d.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new n(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new n(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new n(`${this.base} Unexpected option value: ${t} does not accept a value of "${e}". Valid values are: ${s.join(", ")}`);throw i.code=2,i}typeMismatch(t,e,s){const i=new n(`${this.base} Mismatch types: ${t} has a type of ${e} instead of the required ${s}`);throw i.code=3,i}numbersOutOfRange(t,e,s){const i=new n(`${this.base} ${t} expected an array of number between ${e} and ${s}.`);throw i.code=4,i}failedToParseDate(t,e,s=!1){const i=new n(`${this.base} Could not correctly parse "${e}" to a date for ${t}.`);if(i.code=5,!s)throw i;console.warn(i)}mustProvideElement(){const t=new n(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new n(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new n(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}customDateFormatError(t){const e=new n(`${this.base} customDateFormat: ${t}`);throw e.code=9,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}throwError(t){const e=new n(`${this.base} ${t}`);throw e.code=9,e}};class c{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let l;const h=[{name:"calendar",className:d.css.daysContainer,unit:t.Unit.month,step:1},{name:"months",className:d.css.monthsContainer,unit:t.Unit.year,step:1},{name:"years",className:d.css.yearsContainer,unit:t.Unit.year,step:10},{name:"decades",className:d.css.decadesContainer,unit:t.Unit.year,step:100}];class p{constructor(){this._currentCalendarViewMode=0,this._viewDate=new a,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=h[t].name}get viewDate(){return this._viewDate}set viewDate(t){this._viewDate=t,this.options&&(this.options.viewDate=t)}refreshCurrentView(){this.currentView=h[this.currentCalendarViewMode].name}}class u{constructor(){this.optionsStore=l.locate(p)}isValid(e,s){if(s!==t.Unit.month&&this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))return!1;if(s!==t.Unit.month&&this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))return!1;if(s!==t.Unit.month&&s!==t.Unit.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&e.isBefore(this.optionsStore.options.restrictions.minDate,s))return!1;if(this.optionsStore.options.restrictions.maxDate&&e.isAfter(this.optionsStore.options.restrictions.maxDate,s))return!1;if(s===t.Unit.hours||s===t.Unit.minutes||s===t.Unit.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(e))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(e))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let t of this.optionsStore.options.restrictions.disabledTimeIntervals)if(e.isBetween(t.from,t.to))return!1}return!0}_isInDisabledDates(e){return!(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)&&this.optionsStore.options.restrictions.disabledDates.find((s=>s.isSame(e,t.Unit.date)))}_isInEnabledDates(e){return!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length||this.optionsStore.options.restrictions.enabledDates.find((s=>s.isSame(e,t.Unit.date)))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.find((t=>t===e))}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.find((t=>t===e))}}class m{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class y{constructor(){this.triggerEvent=new m,this.viewUpdate=new m,this.updateDisplay=new m,this.action=new m,this.updateViewDate=new m}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy(),this.updateViewDate.destroy()}}const g={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto"},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>t,format:"L LT"},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new a,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};function v(t,e){if(t.constructor.name===a.name)return t;if(t.constructor.name===Date.name)return a.convert(t);if("string"==typeof t){const s=a.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}function S(t,e,s){"string"==typeof t&&"input"!==e&&d.errorMessages.dateString();const i=v(t,s);return i||d.errorMessages.failedToParseDate(e,t,"input"===e),i}function w(t,e,s,i){Array.isArray(e)||d.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||d.errorMessages.typeMismatch(t,s,"array of numbers")}function b(t){return({value:e,providedType:s,localization:i})=>{const o=S(e,t,i);if(void 0!==o)return o.setLocale(i.locale),o;d.errorMessages.typeMismatch(t,s,"DateTime or Date")}}function D(t){const e=b(t);return t=>void 0===t.value?t.value:e(t)}function _(t,e,s){return({value:i,providedType:o})=>void 0===i?[]:(f(t,i,o),i.some((t=>ts))&&d.errorMessages.numbersOutOfRange(t,e,s),i)}function k(t){return _(t,0,23)}function C(t){return({value:e,providedType:s,localization:i})=>void 0===e?[]:(w(t,e,s,i),e)}function E(t){return({value:e,path:s})=>(t.includes(e)||d.errorMessages.unexpectedOptionValue(s.substring(1),e,t),e)}const M=Object.freeze({defaultDate:b("defaultDate"),viewDate:b("viewDate"),minDate:D("restrictions.minDate"),maxDate:D("restrictions.maxDate"),disabledHours:k("restrictions.disabledHours"),enabledHours:k("restrictions.enabledHours"),disabledDates:C("restrictions.disabledDates"),enabledDates:C("restrictions.enabledDates"),daysOfWeekDisabled:_("restrictions.daysOfWeekDisabled",0,6),disabledTimeIntervals:({key:t,value:e,providedType:s,localization:i})=>{if(void 0===e)return[];Array.isArray(e)||d.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const o=e;for(let e=0;e{const a=`${t}[${e}].${s}`,n=o[e][s],r=S(n,a,i);r||d.errorMessages.typeMismatch(a,typeof n,"DateTime or Date"),r.setLocale(i.locale),o[e][s]=r}));return o},toolbarPlacement:E(["top","bottom","default"]),type:E(["icons","sprites"]),viewMode:E(["clock","calendar","months","years","decades"]),theme:E(["light","dark","auto"]),meta:({value:t})=>t,dayViewHeaderFormat:({value:t})=>t,container:({value:t,path:e})=>(t&&!(t instanceof HTMLElement||t instanceof Element||t?.appendChild)&&d.errorMessages.typeMismatch(e.substring(1),typeof t,"HTMLElement"),t),useTwentyfourHour:({value:t,path:e,providedType:s,defaultType:i})=>{if(void 0===t||"boolean"===s)return t;d.errorMessages.typeMismatch(e,s,i)}}),T=({value:t,defaultType:e,providedType:s,path:i})=>{switch(e){case"boolean":return"true"===t||!0===t;case"number":return+t;case"string":return t.toString();case"object":return{};case"function":return t;default:d.errorMessages.typeMismatch(i,s,e)}};function L(t){return(M[t.key]||T)(t)}class U{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];i instanceof a?e[s]=i.clone:i instanceof Date?e[s]=new Date(i.valueOf()):(e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||Array.isArray(i)||(e[s]=U.deepCopy(i)))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>U.isValue(t)||U.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i){const o=U.objectPath(s,g),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=U.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));d.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,c=t[a];if(null==c)return e[a]=c,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||U.ignoreProperties.includes(a)?e[a]=U.processKey(a,c,r,d,s,i):U.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){return L({key:t,value:e,providedType:s,defaultType:i,path:o,localization:a})}static _mergeOptions(t,e){const s=U.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||g.localization;return U.spread(t,s,"",i),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;let i={};const o=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},a=(t,e,s,i)=>{const n=o(s)[t[e].toLowerCase()],r={};return void 0===n||(s[n].constructor===Object?(e++,r[n]=a(t,e,s[n],i)):r[n]=i),r},n=o(e);return Object.keys(s).filter((t=>t.startsWith(d.dataKey))).map((t=>t.substring(2))).forEach((t=>{let o=n[t.toLowerCase()];if(t.includes("_")){const r=t.split("_");o=n[r[0].toLowerCase()],void 0!==o&&e[o].constructor===Object&&(i[o]=a(r,1,e[o],s[`td${t}`]))}else void 0!==o&&(i[o]=s[`td${t}`])})),this._mergeOptions(i,e)}static _dateTypeCheck(t,e){return v(t,e)}static _typeCheckDateArray(t,e,s,i){return w(t,e,s,i)}static _typeCheckNumberArray(t,e,s){return f(t,e,s)}static dateConversion(t,e,s){return S(t,e,s)}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(g),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||d.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&d.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&d.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}U.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],U.isValue=t=>null!=t;class A{constructor(){this._dates=[],this.optionsStore=l.locate(p),this.validation=l.locate(u),this._eventEmitters=l.locate(y)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){const e=this.optionsStore.options.display.components;return t?t.format({year:e.calendar&&e.year?"numeric":void 0,month:e.calendar&&e.month?"2-digit":void 0,day:e.calendar&&e.date?"2-digit":void 0,hour:e.clock&&e.hours?e.useTwentyfourHour?"2-digit":"numeric":void 0,minute:e.clock&&e.minutes?"2-digit":void 0,second:e.clock&&e.seconds?"2-digit":void 0,hour12:!e.useTwentyfourHour}):""}parseInput(t){return U.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocale(this.optionsStore.options.localization.locale),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!e)return void 0!==this._dates.find((e=>e===t));const s=o(e);let i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!e)return this._dates.indexOf(t);const s=o(e);let i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:d.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[]}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}updateInput(t){if(!this.optionsStore.input)return;let e=this.formatInput(t);this.optionsStore.options.multipleDates&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)}setValue(t,e){const s=void 0===e,i=!t&&s;let o=this.optionsStore.unset?null:this._dates[e];if(!o&&!this.optionsStore.unset&&s&&i&&(o=this.lastPicked),t&&o?.isSame(t))this.updateInput(t);else{if(!t)return!this.optionsStore.options.multipleDates||1===this._dates.length||i?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),this.updateInput(),this._eventEmitters.triggerEvent.emit({type:d.events.change,date:void 0,oldDate:o,isClear:i,isValid:!0}),void this._eventEmitters.updateDisplay.emit("all");if(e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.seconds=0),this.validation.isValid(t))return this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),this.updateInput(t),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),void this._eventEmitters.triggerEvent.emit({type:d.events.change,date:t,oldDate:o,isClear:i,isValid:!0});this.optionsStore.options.keepInvalid&&(this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),this.updateInput(t),this._eventEmitters.triggerEvent.emit({type:d.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:d.events.error,reason:d.errorMessages.failedToSetInvalidDate,date:t,oldDate:o})}}}var $;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}($||($={}));var V=$;class O{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(A),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");if(t.classList.add(d.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.appendChild(e)}for(let e=0;e<42;e++){if(0!==e&&e%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",V.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.daysContainer)[0];if("calendar"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.month),t.Unit.month)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.month),t.Unit.month)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.Unit.hours);i.querySelectorAll(`[data-action="${V.selectDay}"], .${d.css.calendarWeeks}`).forEach((e=>{if(this.optionsStore.options.display.calendarWeeks&&e.classList.contains(d.css.calendarWeeks)){if("#"===e.innerText)return;return void(e.innerText=`${o.week}`)}let i=[];i.push(d.css.day),o.isBefore(this.optionsStore.viewDate,t.Unit.month)&&i.push(d.css.old),o.isAfter(this.optionsStore.viewDate,t.Unit.month)&&i.push(d.css.new),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.date)&&i.push(d.css.active),this.validation.isValid(o,t.Unit.date)||i.push(d.css.disabled),o.isSame(new a,t.Unit.date)&&i.push(d.css.today),0!==o.weekDay&&6!==o.weekDay||i.push(d.css.weekend),s(t.Unit.date,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}-${o.monthFormatted}-${o.dateFormatted}`),e.setAttribute("data-day",`${o.date}`),e.innerText=o.format({day:"numeric"}),o.manipulate(1,t.Unit.date)}))}_daysOfTheWeek(){let e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.Unit.date);const s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.innerText="#",s.push(t)}for(let i=0;i<7;i++){const i=document.createElement("div");i.classList.add(d.css.dayOfTheWeek,d.css.noHighlight),i.innerText=e.format({weekday:"short"}),e.manipulate(1,t.Unit.date),s.push(i)}return s}}class H{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(A),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",V.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),t.Unit.year)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.year),t.Unit.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.year);i.querySelectorAll(`[data-action="${V.selectMonth}"]`).forEach(((e,i)=>{let a=[];a.push(d.css.month),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.month)&&a.push(d.css.active),this.validation.isValid(o,t.Unit.month)||a.push(d.css.disabled),s(t.Unit.month,o,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${i}`),e.innerText=`${o.format({month:"short"})}`,o.manipulate(1,t.Unit.month)}))}}class x{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(A),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",V.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.Unit.year);const i=e.getElementsByClassName(d.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this._startYear,t.Unit.year)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this._endYear,t.Unit.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.year).manipulate(-1,t.Unit.year);i.querySelectorAll(`[data-action="${V.selectYear}"]`).forEach((e=>{let i=[];i.push(d.css.year),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.year)&&i.push(d.css.active),this.validation.isValid(o,t.Unit.year)||i.push(d.css.disabled),s(t.Unit.year,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}`),e.innerText=o.format({year:"numeric"}),o.manipulate(1,t.Unit.year)}))}}class P{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(A),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",V.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=A.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._endDecade.year=o;const a=e.getElementsByClassName(d.css.decadesContainer)[0],[n,r,c]=a.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(r.setAttribute(d.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.Unit.year)?n.classList.remove(d.css.disabled):n.classList.add(d.css.disabled),this.validation.isValid(this._endDecade,t.Unit.year)?c.classList.remove(d.css.disabled):c.classList.add(d.css.disabled));const l=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${V.selectDecade}"]`).forEach(((e,i)=>{if(0===i)return e.classList.add(d.css.old),this._startDecade.year-10<0?(e.textContent=" ",n.classList.add(d.css.disabled),e.classList.add(d.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.Unit.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));let o=[];o.push(d.css.decade);const a=this._startDecade.year,r=this._startDecade.year+9;!this.optionsStore.unset&&l.filter((t=>t>=a&&t<=r)).length>0&&o.push(d.css.active),s("decade",this._startDecade,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.Unit.year)}))}}class I{constructor(){this._gridColumns="",this.optionsStore=l.locate(p),this.dates=l.locate(A),this.validation=l.locate(u)}getPicker(t){const e=document.createElement("div");return e.classList.add(d.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(d.css.clockContainer)[0],i=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(d.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${V.incrementHours}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${V.decrementHours}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.Unit.hours}]`).innerText=this.optionsStore.options.display.components.useTwentyfourHour?i.hoursFormatted:i.twelveHoursFormatted),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${V.incrementMinutes}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${V.decrementMinutes}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.Unit.minutes}]`).innerText=i.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${V.incrementSeconds}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${V.decrementSeconds}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.Unit.seconds}]`).innerText=i.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const e=s.querySelector(`[data-action=${V.toggleMeridiem}]`);e.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,t.Unit.hours))?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],i=[],o=[],a=document.createElement("div"),n=e(this.optionsStore.options.display.icons.up),r=e(this.optionsStore.options.display.icons.down);a.classList.add(d.css.separator,d.css.noHighlight);const c=a.cloneNode(!0);c.innerHTML=":";const l=(t=!1)=>t?c.cloneNode(!0):a.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",V.incrementHours),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",V.showHours),e.setAttribute("data-time-component",t.Unit.hours),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",V.decrementHours),e.appendChild(r.cloneNode(!0)),o.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",V.incrementMinutes),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",V.showMinutes),e.setAttribute("data-time-component",t.Unit.minutes),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",V.decrementMinutes),e.appendChild(r.cloneNode(!0)),o.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",V.incrementSeconds),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",V.showSeconds),e.setAttribute("data-time-component",t.Unit.seconds),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",V.decrementSeconds),e.appendChild(r.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=l();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",V.toggleMeridiem),e.setAttribute("tabindex","-1"),d.css.toggleMeridiem.includes(",")?e.classList.add(...d.css.toggleMeridiem.split(",")):e.classList.add(d.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(d.css.noHighlight),t.appendChild(e),i.push(t),t=l(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class z{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.hourContainer);for(let e=0;e<(this.optionsStore.options.display.components.useTwentyfourHour?24:12);e++){const e=document.createElement("div");e.setAttribute("data-action",V.selectHour),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.date);i.querySelectorAll(`[data-action="${V.selectHour}"]`).forEach((e=>{let i=[];i.push(d.css.hour),this.validation.isValid(o,t.Unit.hours)||i.push(d.css.disabled),s(t.Unit.hours,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.hours}`),e.innerText=this.optionsStore.options.display.components.useTwentyfourHour?o.hoursFormatted:o.twelveHoursFormatted,o.manipulate(1,t.Unit.hours)}))}}class N{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.minuteContainer);let e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",V.selectMinute),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.hours),a=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${V.selectMinute}"]`).forEach((e=>{let i=[];i.push(d.css.minute),this.validation.isValid(o,t.Unit.minutes)||i.push(d.css.disabled),s(t.Unit.minutes,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.minutes}`),e.innerText=o.minutesFormatted,o.manipulate(a,t.Unit.minutes)}))}}class F{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",V.selectSecond),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.minutes);i.querySelectorAll(`[data-action="${V.selectSecond}"]`).forEach((e=>{let i=[];i.push(d.css.second),this.validation.isValid(o,t.Unit.seconds)||i.push(d.css.disabled),s(t.Unit.seconds,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.seconds}`),e.innerText=o.secondsFormatted,o.manipulate(5,t.Unit.seconds)}))}}class B{static toggle(t){t.classList.contains(d.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(d.css.collapsing),t.classList.add(d.css.collapse,d.css.show),t.style.height=""}static show(t){if(t.classList.contains(d.css.collapsing)||t.classList.contains(d.css.show))return;t.style.height="0",t.classList.remove(d.css.collapse),t.classList.add(d.css.collapsing),setTimeout((()=>{B.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(d.css.collapsing,d.css.show),t.classList.add(d.css.collapse))}static hide(t){if(t.classList.contains(d.css.collapsing)||!t.classList.contains(d.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(d.css.collapse,d.css.show),t.classList.add(d.css.collapsing),t.style.height="",setTimeout((()=>{B.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}B.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class q{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=l.locate(p),this.validation=l.locate(u),this.dates=l.locate(A),this.dateDisplay=l.locate(O),this.monthDisplay=l.locate(H),this.yearDisplay=l.locate(x),this.decadeDisplay=l.locate(P),this.timeDisplay=l.locate(I),this.hourDisplay=l.locate(z),this.minuteDisplay=l.locate(N),this.secondDisplay=l.locate(F),this._eventEmitters=l.locate(y),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.Unit.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.Unit.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.Unit.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.Unit.date:this.dateDisplay._update(this.widget,this.paint);break;case t.Unit.month:this.monthDisplay._update(this.widget,this.paint);break;case t.Unit.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.Unit.hours),this._update(t.Unit.minutes),this._update(t.Unit.seconds);break;case"calendar":this._update(t.Unit.date),this._update(t.Unit.year),this._update(t.Unit.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new a).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!(this.validation.isValid(e)||(e.manipulate(i,t.Unit.date),s>31));)s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget(),this._updateTheme();const e=this._hasTime&&!this._hasDate;if(e&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:V.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),e||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?B.show(this.widget.querySelector(`div.${d.css.timeContainer}`)):B.hideImmediately(this.widget.querySelector(`div.${d.css.timeContainer}`))),B.show(this.widget.querySelector(`div.${d.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{(this.optionsStore.options?.container||document.body).appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:V.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(d.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(d.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:d.events.show}),this._isVisible=!0}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${d.css.dateContainer} > div:not(.${d.css.calendarHeader}), .${d.css.timeContainer} > div:not(.${d.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=h[this.optionsStore.currentCalendarViewMode];let s=this.widget.querySelector(`.${e.className}`);switch(e.className){case d.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case d.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case d.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case d.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this.optionsStore.options.display.sideBySide&&(this.widget.querySelectorAll(`.${d.css.clockContainer}`)[0].style.display="grid"),this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(d.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(d.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(d.css.isDarkPreferredQuery).matches;switch(t){case"light":return d.css.lightTheme;case"dark":return d.css.darkTheme;case"auto":return e?d.css.darkTheme:d.css.lightTheme}}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${d.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(d.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case d.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case d.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),i.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case d.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),i.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case d.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),i.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.setAttribute(t,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat))}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(d.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:d.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?this.dates.lastPicked.clone:void 0}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(d.css.widget);const e=document.createElement("div");e.classList.add(d.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(d.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const i=document.createElement("div");if(i.classList.add(d.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(d.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(d.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");return o.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),o.appendChild(e),o.appendChild(s),t.appendChild(o),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),void(this._widget=t)}"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),this._hasDate&&(this._hasTime&&(e.classList.add(d.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(d.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(d.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(d.css.show)),t.appendChild(s)),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");o.classList.add("arrow"),o.setAttribute("data-popper-arrow",""),t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",V.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",V.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",V.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",V.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(d.css.calendarHeader);const e=document.createElement("div");e.classList.add(d.css.previous),e.setAttribute("data-action",V.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(d.css.switch),s.setAttribute("data-action",V.changeCalendarView);const i=document.createElement("div");return i.classList.add(d.css.next),i.setAttribute("data-action",V.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class W{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(A),this.validation=l.locate(u),this.display=l.locate(q),this._eventEmitters=l.locate(y),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const i=e?.currentTarget;if(i?.classList?.contains(d.css.disabled))return!1;s=s||i?.dataset?.action;const o=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case V.next:case V.previous:this.handleNextPrevious(s);break;case V.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case V.selectMonth:case V.selectYear:case V.selectDecade:const n=+i.dataset.value;switch(s){case V.selectMonth:this.optionsStore.viewDate.month=n;break;case V.selectYear:case V.selectDecade:this.optionsStore.viewDate.year=n}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1);break;case V.selectDay:const r=this.optionsStore.viewDate.clone;i.classList.contains(d.css.old)&&r.manipulate(-1,t.Unit.month),i.classList.contains(d.css.new)&&r.manipulate(1,t.Unit.month),r.date=+i.dataset.day;let c=0;this.optionsStore.options.multipleDates?(c=this.dates.pickedIndex(r,t.Unit.date),-1!==c?this.dates.setValue(null,c):this.dates.setValue(r,this.dates.lastPickedIndex+1)):this.dates.setValue(r,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.display.hide();break;case V.selectHour:let l=+i.dataset.value;o.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(l+=12),o.hours=l,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case V.selectMinute:o.minutes=+i.dataset.value,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case V.selectSecond:o.seconds=+i.dataset.value,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case V.incrementHours:this.manipulateAndSet(o,t.Unit.hours);break;case V.incrementMinutes:this.manipulateAndSet(o,t.Unit.minutes,this.optionsStore.options.stepping);break;case V.incrementSeconds:this.manipulateAndSet(o,t.Unit.seconds);break;case V.decrementHours:this.manipulateAndSet(o,t.Unit.hours,-1);break;case V.decrementMinutes:this.manipulateAndSet(o,t.Unit.minutes,-1*this.optionsStore.options.stepping);break;case V.decrementSeconds:this.manipulateAndSet(o,t.Unit.seconds,-1);break;case V.toggleMeridiem:this.manipulateAndSet(o,t.Unit.hours,this.dates.lastPicked.hours>=12?-12:12);break;case V.togglePicker:i.getAttribute("title")===this.optionsStore.options.localization.selectDate?(i.setAttribute("title",this.optionsStore.options.localization.selectTime),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(i.setAttribute("title",this.optionsStore.options.localization.selectDate),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(V.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${d.css.dateContainer}, .${d.css.timeContainer}`).forEach((t=>B.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case V.showClock:case V.showHours:case V.showMinutes:case V.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(B.hideImmediately(this.display.widget.querySelector(`div.${d.css.dateContainer}`)),B.showImmediately(this.display.widget.querySelector(`div.${d.css.timeContainer}`))),this.handleShowClockContainers(s);break;case V.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case V.close:this.display.hide();break;case V.today:const h=(new a).setLocale(this.optionsStore.options.localization.locale);this._eventEmitters.updateViewDate.emit(h),this.validation.isValid(h,t.Unit.date)&&this.dates.setValue(h,this.dates.lastPickedIndex)}}handleShowClockContainers(e){if(!this.display._hasTime)return void d.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${d.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case V.showClock:s=d.css.clockContainer,this.display._update("clock");break;case V.showHours:s=d.css.hourContainer,this.display._update(t.Unit.hours);break;case V.showMinutes:s=d.css.minuteContainer,this.display._update(t.Unit.minutes);break;case V.showSeconds:s=d.css.secondContainer,this.display._update(t.Unit.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=h[this.optionsStore.currentCalendarViewMode];t===V.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,V.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class Y{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},l=new c,this._eventEmitters=l.locate(y),this.optionsStore=l.locate(p),this.display=l.locate(q),this.dates=l.locate(A),this.actions=l.locate(W),t||d.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,g,!0),this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()})),this._eventEmitters.updateViewDate.subscribe((t=>{this.viewDate=t}))}get viewDate(){return this.optionsStore.viewDate}set viewDate(t){this.optionsStore.viewDate=t,this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.display._update("clock"===this.optionsStore.currentView?"clock":"calendar")}updateOptions(t,e=!1){e?this._initializeOptions(t,g):this._initializeOptions(t,this.optionsStore.options),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&d.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:d.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=U.deepCopy(t);i=U._mergeOptions(i,e),s&&(i=U._dataToOptions(this.optionsStore.element,i)),U._validateConflicts(i),i.viewDate=i.viewDate.setLocale(i.localization.locale),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),h[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(h.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),void 0===i.display.components.useTwentyfourHour&&(i.display.components.useTwentyfourHour=!i.viewDate.parts()?.dayPeriod),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{let t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(!this.optionsStore.input.value&&this.optionsStore.options.defaultDate&&(this.optionsStore.input.value=this.dates.formatInput(this.optionsStore.options.defaultDate)),this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(d.css.show)[0].classList.contains(d.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${d.css.switch} div`)},action:V.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const j={},Q=t=>{j[t.name]||(j[t.name]=t.localization)},K=t=>{let e=j[t];e&&(g.localization=e)},J=function(t,e){return t?(t.installed||(t(e,{TempusDominus:Y,Dates:A,Display:q,DateTime:a,Namespace:d},G),t.installed=!0),G):G},R="6.2.7",G={TempusDominus:Y,extend:J,loadLocale:Q,locale:K,Namespace:d,DefaultOptions:g,DateTime:a,Unit:t.Unit,version:R};t.DateTime=a,t.DefaultOptions=g,t.Namespace=d,t.TempusDominus=Y,t.extend=J,t.loadLocale=Q,t.locale=K,t.version=R,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/dist/locales/ar-SA.js b/dist/locales/ar-SA.js index 8d4398edb..8ffdf0a0d 100644 --- a/dist/locales/ar-SA.js +++ b/dist/locales/ar-SA.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/ar.js b/dist/locales/ar.js index 69f488977..199a8e454 100644 --- a/dist/locales/ar.js +++ b/dist/locales/ar.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/de.js b/dist/locales/de.js index f79823020..c56890e09 100644 --- a/dist/locales/de.js +++ b/dist/locales/de.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/es.js b/dist/locales/es.js index 440404d51..16f465c23 100644 --- a/dist/locales/es.js +++ b/dist/locales/es.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/fi.js b/dist/locales/fi.js index 56e23c9ee..3585675e6 100644 --- a/dist/locales/fi.js +++ b/dist/locales/fi.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/fr.js b/dist/locales/fr.js index 339e0547a..3a787b7c0 100644 --- a/dist/locales/fr.js +++ b/dist/locales/fr.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/it.js b/dist/locales/it.js index f037bd43e..977a15663 100644 --- a/dist/locales/it.js +++ b/dist/locales/it.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/nl.js b/dist/locales/nl.js index 936700b55..f997a44c5 100644 --- a/dist/locales/nl.js +++ b/dist/locales/nl.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/pl.js b/dist/locales/pl.js index dc9d3f5b3..696a7fe0b 100644 --- a/dist/locales/pl.js +++ b/dist/locales/pl.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/ro.js b/dist/locales/ro.js index ee0d26c84..2f78a12a5 100644 --- a/dist/locales/ro.js +++ b/dist/locales/ro.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/ru.js b/dist/locales/ru.js index 9d79a667a..b41523d9d 100644 --- a/dist/locales/ru.js +++ b/dist/locales/ru.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/sl.js b/dist/locales/sl.js index 387e28de6..e5b7b4a47 100644 --- a/dist/locales/sl.js +++ b/dist/locales/sl.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/tr.js b/dist/locales/tr.js index 5d90533e4..d10f1234e 100644 --- a/dist/locales/tr.js +++ b/dist/locales/tr.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/plugins/customDateFormat.js b/dist/plugins/customDateFormat.js index e3e258f6d..58e2ac89d 100644 --- a/dist/plugins/customDateFormat.js +++ b/dist/plugins/customDateFormat.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -13,9 +13,9 @@ L: 'MM/dd/yyyy', LL: 'MMMM d, yyyy', LLL: 'MMMM d, yyyy h:mm T', - LLLL: 'dddd, MMMM d, yyyy h:mm T', + LLLL: 'dddd, MMMM d, yyyy h:mm T' }; - this.formattingTokens = /(\[[^[]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?|z|ZZ?)/g; + this.formattingTokens = /(\[[^[]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?|z|zz?z?)/g; this.match1 = /\d/; // 0 - 9 this.match2 = /\d\d/; // 00 - 99 this.match3 = /\d{3}/; // 000 - 999 @@ -28,26 +28,26 @@ this.matchOffset, (obj, input) => { obj.offset = this.offsetFromString(input); - }, + } ]; this.expressions = { t: [ this.matchWord, (ojb, input) => { ojb.afternoon = this.meridiemMatch(input); - }, + } ], T: [ this.matchWord, (ojb, input) => { ojb.afternoon = this.meridiemMatch(input); - }, + } ], fff: [ this.match3, (ojb, input) => { ojb.milliseconds = +input; - }, + } ], s: [this.match1to2, this.addInput('seconds')], ss: [this.match1to2, this.addInput('seconds')], @@ -70,7 +70,7 @@ ojb.day = i; } } - }, + } ], M: [this.match1to2, this.addInput('month')], MM: [this.match2, this.addInput('month')], @@ -84,7 +84,7 @@ throw new Error(); } obj.month = matchIndex % 12 || matchIndex; - }, + } ], MMMM: [ this.matchWord, @@ -95,18 +95,19 @@ throw new Error(); } obj.month = matchIndex % 12 || matchIndex; - }, + } ], y: [this.matchSigned, this.addInput('year')], yy: [ this.match2, (obj, input) => { obj.year = this.parseTwoDigitYear(input); - }, + } ], yyyy: [this.match4, this.addInput('year')], - Z: this.zoneExpressions, - ZZ: this.zoneExpressions, + // z: this.zoneExpressions, + // zz: this.zoneExpressions, + // zzz: this.zoneExpressions }; this.parseFormattedInput = (input) => { if (!this.localization.format) { @@ -174,10 +175,29 @@ }; } ; + /** + * z = -4, zz = -04, zzz = -0400 + * @param date + * @param style + * @private + */ + zoneInformation(date, style) { + let name = date.parts(this.localization.locale, { timeZoneName: 'longOffset' }) + .timeZoneName + .replace('GMT', '') + .replace(':', ''); + let negative = name.includes('-'); + name = name.replace('-'); + if (style === 'z') + name = name.substring(1, 2); + else if (style === 'zz') + name = name.substring(0, 2); + return `${negative ? '-' : ''}${name}`; + } meridiemMatch(input) { const meridiem = new Intl.DateTimeFormat(this.localization.locale, { hour: 'numeric', - hour12: true, + hour12: true }) .formatToParts(new Date(2022, 3, 4, 13)) .find((p) => p.type === 'dayPeriod')?.value; @@ -251,8 +271,8 @@ MMMM: this.getAllMonths()[dateTime.getMonth()], d: dateTime.date, dd: dateTime.dateFormatted, - ddd: formatter({ weekday: "short" }), - dddd: formatter({ weekday: "long" }), + ddd: formatter({ weekday: 'short' }), + dddd: formatter({ weekday: 'long' }), H: dateTime.getHours(), HH: dateTime.hoursFormatted, h: dateTime.hours > 12 ? dateTime.hours - 12 : dateTime.hours, @@ -264,7 +284,9 @@ s: dateTime.seconds, ss: dateTime.secondsFormatted, fff: dateTime.getMilliseconds(), - //z: dateTime.getTimezoneOffset() todo zones are stupid + // z: this.zoneInformation(dateTime, 'z'), //-4 + // zz: this.zoneInformation(dateTime, 'zz'), //-04 + // zzz: this.zoneInformation(dateTime, 'zzz') //-0400 }; return format.replace(this.REGEX_FORMAT, (match, $1) => { return $1 || matches[match]; @@ -272,9 +294,11 @@ } } var index = (_, tdClasses, __) => { - const customDateFormat = new CustomDateFormat(tdClasses.DateTime, tdClasses.ErrorMessages); + const customDateFormat = new CustomDateFormat(tdClasses.DateTime, tdClasses.Namespace.errorMessages); // noinspection JSUnusedGlobalSymbols tdClasses.Dates.prototype.formatInput = function (date) { + if (!date) + return ''; customDateFormat.localization = this.optionsStore.options.localization; return customDateFormat.format(date); }; diff --git a/dist/plugins/fa-five.js b/dist/plugins/fa-five.js index a3d4561bd..b65dbd7d6 100644 --- a/dist/plugins/fa-five.js +++ b/dist/plugins/fa-five.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/plugins/moment-parse.js b/dist/plugins/moment-parse.js index 624ee6c67..cb78b771c 100644 --- a/dist/plugins/moment-parse.js +++ b/dist/plugins/moment-parse.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/package-lock.json b/package-lock.json index 474b8fa14..d9e73fd17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,18 @@ { "name": "@eonasdan/tempus-dominus", - "version": "6.2.6", + "version": "6.2.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@eonasdan/tempus-dominus", - "version": "6.2.6", + "version": "6.2.7", "license": "MIT", "devDependencies": { "@popperjs/core": "^2.11.6", "@rollup/plugin-node-resolve": "^14.1.0", "@types/node": "^18.7.20", + "@vitest/coverage-c8": "^0.24.5", "bootstrap": "^5.2.1", "browser-sync": "^2.27.10", "chokidar": "^3.5.3", @@ -24,13 +25,16 @@ "jsdom": "^20.0.0", "prettier": "^2.7.1", "rollup": "^2.79.1", + "rollup-plugin-ignore": "^1.0.10", "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-ts": "^3.0.2", "sass": "^1.55.0", "terser": "^5.15.0", "tslib": "^2.4.0", - "typescript": "~4.8.3" + "typescript": "~4.8.3", + "vitest": "^0.24.5", + "vitest-github-actions-reporter": "^0.9.0" }, "funding": { "url": "https://ko-fi.com/eonasdan" @@ -39,6 +43,25 @@ "@popperjs/core": "^2.10.1" } }, + "node_modules/@actions/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", + "dev": true, + "dependencies": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, + "node_modules/@actions/http-client": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", + "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", + "dev": true, + "dependencies": { + "tunnel": "^0.0.6" + } + }, "node_modules/@babel/code-frame": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", @@ -136,6 +159,53 @@ "node": ">=4" } }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@esbuild/android-arm": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.13.tgz", + "integrity": "sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.13.tgz", + "integrity": "sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", @@ -306,6 +376,21 @@ "node": ">=10.13.0" } }, + "node_modules/@types/chai": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.3.tgz", + "integrity": "sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g==", + "dev": true + }, + "node_modules/@types/chai-subset": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", + "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "dev": true, + "dependencies": { + "@types/chai": "*" + } + }, "node_modules/@types/cookie": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", @@ -324,6 +409,12 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, "node_modules/@types/node": { "version": "18.7.23", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.23.tgz", @@ -357,6 +448,19 @@ "integrity": "sha512-N1rW+njavs70y2cApeIw1vLMYXRwfBy+7trgavGuuTfOd7j1Yh7QTRc/yqsPl6ncokt72ZXuxEU0PiCp9bSwNQ==", "dev": true }, + "node_modules/@vitest/coverage-c8": { + "version": "0.24.5", + "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.24.5.tgz", + "integrity": "sha512-955yK/SdSBZPYrSXgXB0F+0JnOX5EY9kSL7ywJ4rNajmkFUhwLjuKm13Xb6YKSyIY/g5WvbBnyowqfNRxBJ3ww==", + "dev": true, + "dependencies": { + "c8": "^7.12.0", + "vitest": "0.24.5" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/@wessberg/stringutil": { "version": "1.0.19", "resolved": "https://registry.npmjs.org/@wessberg/stringutil/-/stringutil-1.0.19.tgz", @@ -518,6 +622,15 @@ "node": ">=8" } }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", @@ -829,6 +942,59 @@ "node": ">= 0.8" } }, + "node_modules/c8": { + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.12.0.tgz", + "integrity": "sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.1.4", + "rimraf": "^3.0.2", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.0.0", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/c8/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/c8/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/camel-case": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", @@ -867,6 +1033,24 @@ } ] }, + "node_modules/chai": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -895,6 +1079,15 @@ "node": ">=8" } }, + "node_modules/check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -1080,6 +1273,12 @@ "node": ">=0.8" } }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/cookie": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", @@ -1102,6 +1301,20 @@ "node": ">= 0.10" } }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/crosspath": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crosspath/-/crosspath-2.0.0.tgz", @@ -1339,6 +1552,18 @@ "integrity": "sha512-F29o+vci4DodHYT9UrR5IEbfBw9pE5eSapIJdTqXK5+6hq+t8VRxwQyKlW2i+KDKFkkJQRvFyI/QXD83h8LyQw==", "dev": true }, + "node_modules/deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=0.12" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -1694,6 +1919,363 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/esbuild": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.13.tgz", + "integrity": "sha512-Cu3SC84oyzzhrK/YyN4iEVy2jZu5t2fz66HEOShHURcjSkOSAVL8C/gfUT+lDJxkVHpg8GZ10DD0rMHRPqMFaQ==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.15.13", + "@esbuild/linux-loong64": "0.15.13", + "esbuild-android-64": "0.15.13", + "esbuild-android-arm64": "0.15.13", + "esbuild-darwin-64": "0.15.13", + "esbuild-darwin-arm64": "0.15.13", + "esbuild-freebsd-64": "0.15.13", + "esbuild-freebsd-arm64": "0.15.13", + "esbuild-linux-32": "0.15.13", + "esbuild-linux-64": "0.15.13", + "esbuild-linux-arm": "0.15.13", + "esbuild-linux-arm64": "0.15.13", + "esbuild-linux-mips64le": "0.15.13", + "esbuild-linux-ppc64le": "0.15.13", + "esbuild-linux-riscv64": "0.15.13", + "esbuild-linux-s390x": "0.15.13", + "esbuild-netbsd-64": "0.15.13", + "esbuild-openbsd-64": "0.15.13", + "esbuild-sunos-64": "0.15.13", + "esbuild-windows-32": "0.15.13", + "esbuild-windows-64": "0.15.13", + "esbuild-windows-arm64": "0.15.13" + } + }, + "node_modules/esbuild-android-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.13.tgz", + "integrity": "sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.13.tgz", + "integrity": "sha512-TKzyymLD6PiVeyYa4c5wdPw87BeAiTXNtK6amWUcXZxkV51gOk5u5qzmDaYSwiWeecSNHamFsaFjLoi32QR5/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.13.tgz", + "integrity": "sha512-WAx7c2DaOS6CrRcoYCgXgkXDliLnFv3pQLV6GeW1YcGEZq2Gnl8s9Pg7ahValZkpOa0iE/ojRVQ87sbUhF1Cbg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.13.tgz", + "integrity": "sha512-U6jFsPfSSxC3V1CLiQqwvDuj3GGrtQNB3P3nNC3+q99EKf94UGpsG9l4CQ83zBs1NHrk1rtCSYT0+KfK5LsD8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.13.tgz", + "integrity": "sha512-whItJgDiOXaDG/idy75qqevIpZjnReZkMGCgQaBWZuKHoElDJC1rh7MpoUgupMcdfOd+PgdEwNQW9DAE6i8wyA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.13.tgz", + "integrity": "sha512-6pCSWt8mLUbPtygv7cufV0sZLeylaMwS5Fznj6Rsx9G2AJJsAjQ9ifA+0rQEIg7DwJmi9it+WjzNTEAzzdoM3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.13.tgz", + "integrity": "sha512-VbZdWOEdrJiYApm2kkxoTOgsoCO1krBZ3quHdYk3g3ivWaMwNIVPIfEE0f0XQQ0u5pJtBsnk2/7OPiCFIPOe/w==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.13.tgz", + "integrity": "sha512-rXmnArVNio6yANSqDQlIO4WiP+Cv7+9EuAHNnag7rByAqFVuRusLbGi2697A5dFPNXoO//IiogVwi3AdcfPC6A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.13.tgz", + "integrity": "sha512-Ac6LpfmJO8WhCMQmO253xX2IU2B3wPDbl4IvR0hnqcPrdfCaUa2j/lLMGTjmQ4W5JsJIdHEdW12dG8lFS0MbxQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.13.tgz", + "integrity": "sha512-alEMGU4Z+d17U7KQQw2IV8tQycO6T+rOrgW8OS22Ua25x6kHxoG6Ngry6Aq6uranC+pNWNMB6aHFPh7aTQdORQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.13.tgz", + "integrity": "sha512-47PgmyYEu+yN5rD/MbwS6DxP2FSGPo4Uxg5LwIdxTiyGC2XKwHhHyW7YYEDlSuXLQXEdTO7mYe8zQ74czP7W8A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.13.tgz", + "integrity": "sha512-z6n28h2+PC1Ayle9DjKoBRcx/4cxHoOa2e689e2aDJSaKug3jXcQw7mM+GLg+9ydYoNzj8QxNL8ihOv/OnezhA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.13.tgz", + "integrity": "sha512-+Lu4zuuXuQhgLUGyZloWCqTslcCAjMZH1k3Xc9MSEJEpEFdpsSU0sRDXAnk18FKOfEjhu4YMGaykx9xjtpA6ow==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.13.tgz", + "integrity": "sha512-BMeXRljruf7J0TMxD5CIXS65y7puiZkAh+s4XFV9qy16SxOuMhxhVIXYLnbdfLrsYGFzx7U9mcdpFWkkvy/Uag==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.13.tgz", + "integrity": "sha512-EHj9QZOTel581JPj7UO3xYbltFTYnHy+SIqJVq6yd3KkCrsHRbapiPb0Lx3EOOtybBEE9EyqbmfW1NlSDsSzvQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.13.tgz", + "integrity": "sha512-nkuDlIjF/sfUhfx8SKq0+U+Fgx5K9JcPq1mUodnxI0x4kBdCv46rOGWbuJ6eof2n3wdoCLccOoJAbg9ba/bT2w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.13.tgz", + "integrity": "sha512-jVeu2GfxZQ++6lRdY43CS0Tm/r4WuQQ0Pdsrxbw+aOrHQPHV0+LNOLnvbN28M7BSUGnJnHkHm2HozGgNGyeIRw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.13.tgz", + "integrity": "sha512-XoF2iBf0wnqo16SDq+aDGi/+QbaLFpkiRarPVssMh9KYbFNCqPLlGAWwDvxEVz+ywX6Si37J2AKm+AXq1kC0JA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.13.tgz", + "integrity": "sha512-Et6htEfGycjDrtqb2ng6nT+baesZPYQIW+HUEHK4D1ncggNrDNk3yoboYQ5KtiVrw/JaDMNttz8rrPubV/fvPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.13.tgz", + "integrity": "sha512-3bv7tqntThQC9SWLRouMDmZnlOukBhOCTlkzNqzGCmrkCJI7io5LLjwJBOVY6kOUlIvdxbooNZwjtBvj+7uuVg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -1853,6 +2435,22 @@ "node": ">= 0.8" } }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", @@ -1873,6 +2471,19 @@ } } }, + "node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -1951,6 +2562,15 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -2081,6 +2701,12 @@ "node": ">=12" } }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, "node_modules/html-minifier-terser": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz", @@ -2454,6 +3080,60 @@ "node": ">=12" } }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", + "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -2578,6 +3258,18 @@ "node": ">= 12.13.0" } }, + "node_modules/local-pkg": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.2.tgz", + "integrity": "sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/localtunnel": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.2.tgz", @@ -2646,6 +3338,21 @@ "node": ">=10" } }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -2676,6 +3383,15 @@ "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", "dev": true }, + "node_modules/loupe": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", + "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.0" + } + }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -2709,6 +3425,30 @@ "node": ">=12" } }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/mdn-data": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", @@ -2802,7 +3542,6 @@ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", "dev": true, - "peer": true, "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -2954,7 +3693,37 @@ "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", "dev": true, "engines": { - "node": ">=4" + "node": ">=4" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-queue": { @@ -3026,6 +3795,15 @@ "tslib": "^2.0.3" } }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -3035,6 +3813,15 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -3050,6 +3837,15 @@ "node": ">=8" } }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -3095,9 +3891,9 @@ } }, "node_modules/postcss": { - "version": "8.4.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.16.tgz", - "integrity": "sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==", + "version": "8.4.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.18.tgz", + "integrity": "sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==", "dev": true, "funding": [ { @@ -3109,7 +3905,6 @@ "url": "https://tidelift.com/funding/github/npm/postcss" } ], - "peer": true, "dependencies": { "nanoid": "^3.3.4", "picocolors": "^1.0.0", @@ -3851,6 +4646,21 @@ "node": ">=0.10.0" } }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/rollup": { "version": "2.79.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", @@ -3866,6 +4676,12 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup-plugin-ignore": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/rollup-plugin-ignore/-/rollup-plugin-ignore-1.0.10.tgz", + "integrity": "sha512-VsbnfwwaTv2Dxl2onubetX/3RnSnplNnjdix0hvF8y2YpqdzlZrjIq6zkcuVJ08XysS8zqW3gt3ORBndFDgsrg==", + "dev": true + }, "node_modules/rollup-plugin-postcss": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/rollup-plugin-postcss/-/rollup-plugin-postcss-4.0.2.tgz", @@ -4295,12 +5111,39 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/shell-quote": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", "dev": true }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -4540,6 +5383,18 @@ "node": ">=8" } }, + "node_modules/strip-literal": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-0.4.2.tgz", + "integrity": "sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==", + "dev": true, + "dependencies": { + "acorn": "^8.8.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/style-inject": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/style-inject/-/style-inject-0.3.0.tgz", @@ -4658,6 +5513,20 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/tfunk": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/tfunk/-/tfunk-4.0.0.tgz", @@ -4723,6 +5592,30 @@ "node": ">=0.8.0" } }, + "node_modules/tinybench": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.3.1.tgz", + "integrity": "sha512-hGYWYBMPr7p4g5IarQE7XhlyWveh1EKhy4wUBS1LrHXCKYgvz+4/jCqgmJqZxxldesn05vccrtME2RLLZNW7iA==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.3.0.tgz", + "integrity": "sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-1.0.2.tgz", + "integrity": "sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -4814,6 +5707,15 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, "node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -4826,6 +5728,15 @@ "node": ">= 0.8.0" } }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/typescript": { "version": "4.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz", @@ -4927,6 +5838,29 @@ "node": ">= 0.4.0" } }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz", + "integrity": "sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -4936,6 +5870,141 @@ "node": ">= 0.8" } }, + "node_modules/vite": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.2.tgz", + "integrity": "sha512-pLrhatFFOWO9kS19bQ658CnRYzv0WLbsPih6R+iFeEEhDOuYgYCX2rztUViMz/uy/V8cLCJvLFeiOK7RJEzHcw==", + "dev": true, + "dependencies": { + "esbuild": "^0.15.9", + "postcss": "^8.4.18", + "resolve": "^1.22.1", + "rollup": "^2.79.1" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "less": "*", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "0.24.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.24.5.tgz", + "integrity": "sha512-zw6JhPUHtLILQDe5Q39b/SzoITkG+R7hcFjuthp4xsi6zpmfQPOZcHodZ+3bqoWl4EdGK/p1fuMiEwdxgbGLOA==", + "dev": true, + "dependencies": { + "@types/chai": "^4.3.3", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "chai": "^4.3.6", + "debug": "^4.3.4", + "local-pkg": "^0.4.2", + "strip-literal": "^0.4.2", + "tinybench": "^2.3.1", + "tinypool": "^0.3.0", + "tinyspy": "^1.0.2", + "vite": "^3.0.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": ">=v14.16.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@vitest/browser": "*", + "@vitest/ui": "*", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest-github-actions-reporter": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/vitest-github-actions-reporter/-/vitest-github-actions-reporter-0.9.0.tgz", + "integrity": "sha512-tCC9exD0HLH4oTdZBuAMapwkVU9RAcU2GpbtO4a5nqYG4Ty2LW61z90srbWqk3rZHL8IxGo2WfL8r7U+EeeYug==", + "dev": true, + "dependencies": { + "@actions/core": "^1.10.0" + }, + "engines": { + "node": ">=14.16.0" + }, + "peerDependencies": { + "vitest": ">=0.16.0" + } + }, + "node_modules/vitest/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -5012,6 +6081,21 @@ "node": ">=12" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -5139,9 +6223,40 @@ "engines": { "node": ">=12" } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } }, "dependencies": { + "@actions/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", + "dev": true, + "requires": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, + "@actions/http-client": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", + "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", + "dev": true, + "requires": { + "tunnel": "^0.0.6" + } + }, "@babel/code-frame": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", @@ -5220,6 +6335,32 @@ } } }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@esbuild/android-arm": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.13.tgz", + "integrity": "sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.13.tgz", + "integrity": "sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag==", + "dev": true, + "optional": true + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, "@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", @@ -5350,6 +6491,21 @@ "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", "dev": true }, + "@types/chai": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.3.tgz", + "integrity": "sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g==", + "dev": true + }, + "@types/chai-subset": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", + "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "dev": true, + "requires": { + "@types/chai": "*" + } + }, "@types/cookie": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", @@ -5368,6 +6524,12 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, + "@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, "@types/node": { "version": "18.7.23", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.23.tgz", @@ -5401,6 +6563,16 @@ "integrity": "sha512-N1rW+njavs70y2cApeIw1vLMYXRwfBy+7trgavGuuTfOd7j1Yh7QTRc/yqsPl6ncokt72ZXuxEU0PiCp9bSwNQ==", "dev": true }, + "@vitest/coverage-c8": { + "version": "0.24.5", + "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.24.5.tgz", + "integrity": "sha512-955yK/SdSBZPYrSXgXB0F+0JnOX5EY9kSL7ywJ4rNajmkFUhwLjuKm13Xb6YKSyIY/g5WvbBnyowqfNRxBJ3ww==", + "dev": true, + "requires": { + "c8": "^7.12.0", + "vitest": "0.24.5" + } + }, "@wessberg/stringutil": { "version": "1.0.19", "resolved": "https://registry.npmjs.org/@wessberg/stringutil/-/stringutil-1.0.19.tgz", @@ -5516,6 +6688,12 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, "async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", @@ -5748,6 +6926,49 @@ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true }, + "c8": { + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.12.0.tgz", + "integrity": "sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.1.4", + "rimraf": "^3.0.2", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.0.0", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9" + }, + "dependencies": { + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + } + } + }, "camel-case": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", @@ -5776,6 +6997,21 @@ "integrity": "sha512-+TeEIee1gS5bYOiuf+PS/kp2mrXic37Hl66VY6EAfxasIk5fELTktK2oOezYed12H8w7jt3s512PpulQidPjwA==", "dev": true }, + "chai": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -5797,6 +7033,12 @@ } } }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "dev": true + }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -5939,6 +7181,12 @@ "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", "dev": true }, + "convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "cookie": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", @@ -5955,6 +7203,17 @@ "vary": "^1" } }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "crosspath": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crosspath/-/crosspath-2.0.0.tgz", @@ -6133,6 +7392,15 @@ "integrity": "sha512-F29o+vci4DodHYT9UrR5IEbfBw9pE5eSapIJdTqXK5+6hq+t8VRxwQyKlW2i+KDKFkkJQRvFyI/QXD83h8LyQw==", "dev": true }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -6387,6 +7655,176 @@ "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", "dev": true }, + "esbuild": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.13.tgz", + "integrity": "sha512-Cu3SC84oyzzhrK/YyN4iEVy2jZu5t2fz66HEOShHURcjSkOSAVL8C/gfUT+lDJxkVHpg8GZ10DD0rMHRPqMFaQ==", + "dev": true, + "requires": { + "@esbuild/android-arm": "0.15.13", + "@esbuild/linux-loong64": "0.15.13", + "esbuild-android-64": "0.15.13", + "esbuild-android-arm64": "0.15.13", + "esbuild-darwin-64": "0.15.13", + "esbuild-darwin-arm64": "0.15.13", + "esbuild-freebsd-64": "0.15.13", + "esbuild-freebsd-arm64": "0.15.13", + "esbuild-linux-32": "0.15.13", + "esbuild-linux-64": "0.15.13", + "esbuild-linux-arm": "0.15.13", + "esbuild-linux-arm64": "0.15.13", + "esbuild-linux-mips64le": "0.15.13", + "esbuild-linux-ppc64le": "0.15.13", + "esbuild-linux-riscv64": "0.15.13", + "esbuild-linux-s390x": "0.15.13", + "esbuild-netbsd-64": "0.15.13", + "esbuild-openbsd-64": "0.15.13", + "esbuild-sunos-64": "0.15.13", + "esbuild-windows-32": "0.15.13", + "esbuild-windows-64": "0.15.13", + "esbuild-windows-arm64": "0.15.13" + } + }, + "esbuild-android-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.13.tgz", + "integrity": "sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==", + "dev": true, + "optional": true + }, + "esbuild-android-arm64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.13.tgz", + "integrity": "sha512-TKzyymLD6PiVeyYa4c5wdPw87BeAiTXNtK6amWUcXZxkV51gOk5u5qzmDaYSwiWeecSNHamFsaFjLoi32QR5/w==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.13.tgz", + "integrity": "sha512-WAx7c2DaOS6CrRcoYCgXgkXDliLnFv3pQLV6GeW1YcGEZq2Gnl8s9Pg7ahValZkpOa0iE/ojRVQ87sbUhF1Cbg==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.13.tgz", + "integrity": "sha512-U6jFsPfSSxC3V1CLiQqwvDuj3GGrtQNB3P3nNC3+q99EKf94UGpsG9l4CQ83zBs1NHrk1rtCSYT0+KfK5LsD8A==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.13.tgz", + "integrity": "sha512-whItJgDiOXaDG/idy75qqevIpZjnReZkMGCgQaBWZuKHoElDJC1rh7MpoUgupMcdfOd+PgdEwNQW9DAE6i8wyA==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.13.tgz", + "integrity": "sha512-6pCSWt8mLUbPtygv7cufV0sZLeylaMwS5Fznj6Rsx9G2AJJsAjQ9ifA+0rQEIg7DwJmi9it+WjzNTEAzzdoM3Q==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.13.tgz", + "integrity": "sha512-VbZdWOEdrJiYApm2kkxoTOgsoCO1krBZ3quHdYk3g3ivWaMwNIVPIfEE0f0XQQ0u5pJtBsnk2/7OPiCFIPOe/w==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.13.tgz", + "integrity": "sha512-rXmnArVNio6yANSqDQlIO4WiP+Cv7+9EuAHNnag7rByAqFVuRusLbGi2697A5dFPNXoO//IiogVwi3AdcfPC6A==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.13.tgz", + "integrity": "sha512-Ac6LpfmJO8WhCMQmO253xX2IU2B3wPDbl4IvR0hnqcPrdfCaUa2j/lLMGTjmQ4W5JsJIdHEdW12dG8lFS0MbxQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.13.tgz", + "integrity": "sha512-alEMGU4Z+d17U7KQQw2IV8tQycO6T+rOrgW8OS22Ua25x6kHxoG6Ngry6Aq6uranC+pNWNMB6aHFPh7aTQdORQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.13.tgz", + "integrity": "sha512-47PgmyYEu+yN5rD/MbwS6DxP2FSGPo4Uxg5LwIdxTiyGC2XKwHhHyW7YYEDlSuXLQXEdTO7mYe8zQ74czP7W8A==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.13.tgz", + "integrity": "sha512-z6n28h2+PC1Ayle9DjKoBRcx/4cxHoOa2e689e2aDJSaKug3jXcQw7mM+GLg+9ydYoNzj8QxNL8ihOv/OnezhA==", + "dev": true, + "optional": true + }, + "esbuild-linux-riscv64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.13.tgz", + "integrity": "sha512-+Lu4zuuXuQhgLUGyZloWCqTslcCAjMZH1k3Xc9MSEJEpEFdpsSU0sRDXAnk18FKOfEjhu4YMGaykx9xjtpA6ow==", + "dev": true, + "optional": true + }, + "esbuild-linux-s390x": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.13.tgz", + "integrity": "sha512-BMeXRljruf7J0TMxD5CIXS65y7puiZkAh+s4XFV9qy16SxOuMhxhVIXYLnbdfLrsYGFzx7U9mcdpFWkkvy/Uag==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.13.tgz", + "integrity": "sha512-EHj9QZOTel581JPj7UO3xYbltFTYnHy+SIqJVq6yd3KkCrsHRbapiPb0Lx3EOOtybBEE9EyqbmfW1NlSDsSzvQ==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.13.tgz", + "integrity": "sha512-nkuDlIjF/sfUhfx8SKq0+U+Fgx5K9JcPq1mUodnxI0x4kBdCv46rOGWbuJ6eof2n3wdoCLccOoJAbg9ba/bT2w==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.13.tgz", + "integrity": "sha512-jVeu2GfxZQ++6lRdY43CS0Tm/r4WuQQ0Pdsrxbw+aOrHQPHV0+LNOLnvbN28M7BSUGnJnHkHm2HozGgNGyeIRw==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.13.tgz", + "integrity": "sha512-XoF2iBf0wnqo16SDq+aDGi/+QbaLFpkiRarPVssMh9KYbFNCqPLlGAWwDvxEVz+ywX6Si37J2AKm+AXq1kC0JA==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.13.tgz", + "integrity": "sha512-Et6htEfGycjDrtqb2ng6nT+baesZPYQIW+HUEHK4D1ncggNrDNk3yoboYQ5KtiVrw/JaDMNttz8rrPubV/fvPQ==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.15.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.13.tgz", + "integrity": "sha512-3bv7tqntThQC9SWLRouMDmZnlOukBhOCTlkzNqzGCmrkCJI7io5LLjwJBOVY6kOUlIvdxbooNZwjtBvj+7uuVg==", + "dev": true, + "optional": true + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -6506,12 +7944,32 @@ "unpipe": "~1.0.0" } }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, "follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "dev": true }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, "form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -6574,6 +8032,12 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "dev": true + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -6670,6 +8134,12 @@ "whatwg-encoding": "^2.0.0" } }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, "html-minifier-terser": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz", @@ -6957,6 +8427,50 @@ "integrity": "sha512-+KD6q1BBtw0iK9aGBGSfxJ31/ZgizKRjhm8ebgJUBMx0aeeQuIJ1I72beCoIrltIZGrSm4vmrxRxrG5n1aUTtw==", "dev": true }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-reports": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", + "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, "jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -7057,6 +8571,12 @@ "integrity": "sha512-HVl9ZqccQihZ7JM85dco1MvO9G+ONvxoGa9rkhzFsneGLKSUg1gJf9bWzhRhcvm2qChhWpebQhP44qxjKIUCaQ==", "dev": true }, + "local-pkg": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.2.tgz", + "integrity": "sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==", + "dev": true + }, "localtunnel": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.2.tgz", @@ -7107,6 +8627,15 @@ } } }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -7137,6 +8666,15 @@ "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", "dev": true }, + "loupe": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", + "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "dev": true, + "requires": { + "get-func-name": "^2.0.0" + } + }, "lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -7164,6 +8702,23 @@ "sourcemap-codec": "^1.4.8" } }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "mdn-data": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", @@ -7238,8 +8793,7 @@ "version": "3.3.4", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", - "dev": true, - "peer": true + "dev": true }, "negotiator": { "version": "0.6.3", @@ -7355,6 +8909,24 @@ "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", "dev": true }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, "p-queue": { "version": "6.6.2", "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", @@ -7409,12 +8981,24 @@ "tslib": "^2.0.3" } }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -7427,6 +9011,12 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -7456,11 +9046,10 @@ } }, "postcss": { - "version": "8.4.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.16.tgz", - "integrity": "sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==", + "version": "8.4.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.18.tgz", + "integrity": "sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==", "dev": true, - "peer": true, "requires": { "nanoid": "^3.3.4", "picocolors": "^1.0.0", @@ -7931,6 +9520,15 @@ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "rollup": { "version": "2.79.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", @@ -7940,6 +9538,12 @@ "fsevents": "~2.3.2" } }, + "rollup-plugin-ignore": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/rollup-plugin-ignore/-/rollup-plugin-ignore-1.0.10.tgz", + "integrity": "sha512-VsbnfwwaTv2Dxl2onubetX/3RnSnplNnjdix0hvF8y2YpqdzlZrjIq6zkcuVJ08XysS8zqW3gt3ORBndFDgsrg==", + "dev": true + }, "rollup-plugin-postcss": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/rollup-plugin-postcss/-/rollup-plugin-postcss-4.0.2.tgz", @@ -8250,12 +9854,33 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, "shell-quote": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", "dev": true }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -8445,6 +10070,15 @@ "ansi-regex": "^5.0.1" } }, + "strip-literal": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-0.4.2.tgz", + "integrity": "sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==", + "dev": true, + "requires": { + "acorn": "^8.8.0" + } + }, "style-inject": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/style-inject/-/style-inject-0.3.0.tgz", @@ -8531,6 +10165,17 @@ } } }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, "tfunk": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/tfunk/-/tfunk-4.0.0.tgz", @@ -8583,6 +10228,24 @@ } } }, + "tinybench": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.3.1.tgz", + "integrity": "sha512-hGYWYBMPr7p4g5IarQE7XhlyWveh1EKhy4wUBS1LrHXCKYgvz+4/jCqgmJqZxxldesn05vccrtME2RLLZNW7iA==", + "dev": true + }, + "tinypool": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.3.0.tgz", + "integrity": "sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==", + "dev": true + }, + "tinyspy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-1.0.2.tgz", + "integrity": "sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==", + "dev": true + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -8648,6 +10311,12 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -8657,6 +10326,12 @@ "prelude-ls": "~1.1.2" } }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, "typescript": { "version": "4.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz", @@ -8713,12 +10388,87 @@ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "dev": true }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + }, + "v8-to-istanbul": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz", + "integrity": "sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + } + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "dev": true }, + "vite": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.2.tgz", + "integrity": "sha512-pLrhatFFOWO9kS19bQ658CnRYzv0WLbsPih6R+iFeEEhDOuYgYCX2rztUViMz/uy/V8cLCJvLFeiOK7RJEzHcw==", + "dev": true, + "requires": { + "esbuild": "^0.15.9", + "fsevents": "~2.3.2", + "postcss": "^8.4.18", + "resolve": "^1.22.1", + "rollup": "^2.79.1" + } + }, + "vitest": { + "version": "0.24.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.24.5.tgz", + "integrity": "sha512-zw6JhPUHtLILQDe5Q39b/SzoITkG+R7hcFjuthp4xsi6zpmfQPOZcHodZ+3bqoWl4EdGK/p1fuMiEwdxgbGLOA==", + "dev": true, + "requires": { + "@types/chai": "^4.3.3", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "chai": "^4.3.6", + "debug": "^4.3.4", + "local-pkg": "^0.4.2", + "strip-literal": "^0.4.2", + "tinybench": "^2.3.1", + "tinypool": "^0.3.0", + "tinyspy": "^1.0.2", + "vite": "^3.0.0" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "vitest-github-actions-reporter": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/vitest-github-actions-reporter/-/vitest-github-actions-reporter-0.9.0.tgz", + "integrity": "sha512-tCC9exD0HLH4oTdZBuAMapwkVU9RAcU2GpbtO4a5nqYG4Ty2LW61z90srbWqk3rZHL8IxGo2WfL8r7U+EeeYug==", + "dev": true, + "requires": { + "@actions/core": "^1.10.0" + } + }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -8779,6 +10529,15 @@ "webidl-conversions": "^7.0.0" } }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -8865,6 +10624,12 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true } } } diff --git a/package.json b/package.json index 170c50a92..05883b21a 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "Jonathan Peterson" }, "name": "@eonasdan/tempus-dominus", - "version": "6.2.6", + "version": "6.2.7", "style": "dist/css/tempus-dominus.css", "sass": "scss/tempus-dominus.scss", "main": "dist/js/tempus-dominus.js", @@ -17,6 +17,9 @@ ], "scripts": { "start": "npm run build && concurrently \"npm:*-watch\" \"npm run serve\"", + "test": "vitest", + "test:silent": "vitest --run --silent", + "coverage": "vitest run --coverage", "serve": "browser-sync start --config build/browser-sync-config.js", "build": "node ./build/copyToDist.js && npm run rollup && npm run build:plugins-and-locales", "build:plugins": "node ./build/plugins.js -p", @@ -29,7 +32,7 @@ "prettier": "prettier --write .", "docs": "node ./src/docs/make.js", "docs-watch": "node ./src/docs/make.js --watch", - "release": "npm run build && npm run build:declarations", + "release": "npm run test:silent && npm run build && npm run build:declarations", "release:version": "npm run release && node build/change-version.js" }, "bugs": { @@ -43,6 +46,7 @@ "@popperjs/core": "^2.11.6", "@rollup/plugin-node-resolve": "^14.1.0", "@types/node": "^18.7.20", + "@vitest/coverage-c8": "^0.24.5", "bootstrap": "^5.2.1", "browser-sync": "^2.27.10", "chokidar": "^3.5.3", @@ -55,13 +59,16 @@ "jsdom": "^20.0.0", "prettier": "^2.7.1", "rollup": "^2.79.1", + "rollup-plugin-ignore": "^1.0.10", "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-ts": "^3.0.2", "sass": "^1.55.0", "terser": "^5.15.0", "tslib": "^2.4.0", - "typescript": "~4.8.3" + "typescript": "~4.8.3", + "vitest": "^0.24.5", + "vitest-github-actions-reporter": "^0.9.0" }, "homepage": "https://getdatepicker.com/", "keywords": [ diff --git a/src/docs/partials/change-log.html b/src/docs/partials/change-log.html index 012f312fe..921fd9846 100644 --- a/src/docs/partials/change-log.html +++ b/src/docs/partials/change-log.html @@ -3,17 +3,28 @@

Version 6

-

6.2.6

+

6.2.7

Bug fixes

    -
  • Fixed disabled/enabled dates performance issue. This also should fix the next/previous month selection #2658
  • -
  • Fixed view date syncing across options and not updating correctly #2611
  • +
  • Fixed customDateFormat shows 'undefined' when you manually erase the date #2693
  • +
  • Fixed calendar header not updating correctly #2685
  • +
  • Fixed clock components disappearing when using side by side #2684
  • +
  • Fixed some doc issues #2706

New

    +
  • Unit tests! #2711
  • +
+
- - +
+

6.2.6

+

Bug fixes

+
    +
  • Fixed disabled/enabled dates performance issue. This also should fix the next/previous month selection #2658
  • +
  • Fixed view date syncing across options and not updating correctly #2611
  • +
+

6.2.5

diff --git a/src/docs/templates/index.html b/src/docs/templates/index.html index cc63885f5..58690bfc4 100644 --- a/src/docs/templates/index.html +++ b/src/docs/templates/index.html @@ -17,7 +17,7 @@

Powerful and robust date and time picker

- Currently v6.2.6 + Currently v6.2.7 · v5 docs

diff --git a/src/docs/templates/shell.html b/src/docs/templates/shell.html index 8889a4fea..b641f5e1d 100644 --- a/src/docs/templates/shell.html +++ b/src/docs/templates/shell.html @@ -181,7 +181,7 @@ target='_blank' rel='license noopener'>MIT, docs CC BY 3.0. -
  • Currently v6.2.6
  • +
  • Currently v6.2.7
  • @@ -238,6 +238,17 @@
    Community
    'floating-chat.donateButton.text-color': '#fff' }); + + + diff --git a/src/js/dates.ts b/src/js/dates.ts index f16e52bf1..93c2f07fe 100644 --- a/src/js/dates.ts +++ b/src/js/dates.ts @@ -166,6 +166,19 @@ export default class Dates { return [startYear, endYear, focusValue]; } + updateInput(target?: DateTime) { + if (!this.optionsStore.input) return; + + let newValue = this.formatInput(target); + if (this.optionsStore.options.multipleDates) { + newValue = this._dates + .map((d) => this.formatInput(d)) + .join(this.optionsStore.options.multipleDatesSeparator); + } + if (this.optionsStore.input.value != newValue) + this.optionsStore.input.value = newValue; + } + /** * Attempts to either clear or set the `target` date at `index`. * If the `target` is null then the date will be cleared. @@ -183,21 +196,8 @@ export default class Dates { oldDate = this.lastPicked; } - const updateInput = () => { - if (!this.optionsStore.input) return; - - let newValue = this.formatInput(target); - if (this.optionsStore.options.multipleDates) { - newValue = this._dates - .map((d) => this.formatInput(d)) - .join(this.optionsStore.options.multipleDatesSeparator); - } - if (this.optionsStore.input.value != newValue) - this.optionsStore.input.value = newValue; - }; - if (target && oldDate?.isSame(target)) { - updateInput(); + this.updateInput(target); return; } @@ -214,7 +214,7 @@ export default class Dates { this._dates.splice(index, 1); } - updateInput(); + this.updateInput(); this._eventEmitters.triggerEvent.emit({ type: Namespace.events.change, @@ -243,7 +243,7 @@ export default class Dates { this._dates[index] = target; this._eventEmitters.updateViewDate.emit(target.clone); - updateInput(); + this.updateInput(target); this.optionsStore.unset = false; this._eventEmitters.updateDisplay.emit('all'); @@ -261,7 +261,7 @@ export default class Dates { this._dates[index] = target; this._eventEmitters.updateViewDate.emit(target.clone); - updateInput(); + this.updateInput(target); this._eventEmitters.triggerEvent.emit({ type: Namespace.events.change, diff --git a/src/js/datetime.ts b/src/js/datetime.ts index 28bea07e1..25e05acba 100644 --- a/src/js/datetime.ts +++ b/src/js/datetime.ts @@ -169,7 +169,9 @@ export class DateTime extends Date { break; case 'weekDay': this.endOf(Unit.date); - this.manipulate((6 + startOfTheWeek) - this.weekDay, Unit.date); + const endOfWeek = (6 + startOfTheWeek); + if (this.weekDay === endOfWeek) break; + this.manipulate(endOfWeek - this.weekDay, Unit.date); break; case 'month': this.endOf(Unit.date); @@ -178,8 +180,7 @@ export class DateTime extends Date { break; case 'year': this.endOf(Unit.date); - this.manipulate(1, Unit.year); - this.setDate(0); + this.setMonth(11, 31); break; } return this; @@ -270,20 +271,18 @@ export class DateTime extends Date { const leftInclusivity = inclusivity[0] === '('; const rightInclusivity = inclusivity[1] === ')'; - return ( - ((leftInclusivity - ? this.isAfter(left, unit) - : !this.isBefore(left, unit)) && - (rightInclusivity - ? this.isBefore(right, unit) - : !this.isAfter(right, unit))) || - ((leftInclusivity - ? this.isBefore(left, unit) - : !this.isAfter(left, unit)) && - (rightInclusivity - ? this.isAfter(right, unit) - : !this.isBefore(right, unit))) - ); + return (leftInclusivity + ? this.isAfter(left, unit) + : !this.isBefore(left, unit)) && + (rightInclusivity + ? this.isBefore(right, unit) + : !this.isAfter(right, unit)) || + (leftInclusivity + ? this.isBefore(left, unit) + : !this.isAfter(left, unit)) && + (rightInclusivity + ? this.isAfter(right, unit) + : !this.isBefore(right, unit)); } /** diff --git a/src/js/display/index.ts b/src/js/display/index.ts index 65b8408c1..a4731a85a 100644 --- a/src/js/display/index.ts +++ b/src/js/display/index.ts @@ -339,6 +339,10 @@ export default class Display { } picker.style.display = 'grid'; + + if (this.optionsStore.options.display.sideBySide) + ((this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0])).style.display = 'grid'; + this._updateCalendarHeader(); this._eventEmitters.viewUpdate.emit(); } @@ -452,9 +456,9 @@ export default class Display { 'title', this.optionsStore.options.localization.nextMonth ); - switcher.innerText = this.optionsStore.viewDate.format( + switcher.setAttribute(showing, this.optionsStore.viewDate.format( this.optionsStore.options.localization.dayViewHeaderFormat - ); + )); break; } switcher.innerText = switcher.getAttribute(showing); diff --git a/src/js/jQuery-provider.js b/src/js/jQuery-provider.js index ddddc9c26..cf260026e 100644 --- a/src/js/jQuery-provider.js +++ b/src/js/jQuery-provider.js @@ -2,7 +2,7 @@ /*global $, tempusDominus */ /*! - * Tempus Dominus v6.2.6 (https://getdatepicker.com/) + * Tempus Dominus v6.2.7 (https://getdatepicker.com/) * Copyright 2013-2021 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/src/js/tempus-dominus.ts b/src/js/tempus-dominus.ts index ea9d7b781..ea7e110d9 100644 --- a/src/js/tempus-dominus.ts +++ b/src/js/tempus-dominus.ts @@ -7,18 +7,18 @@ import Options from './utilities/options'; import { BaseEvent, ChangeEvent, - ViewUpdateEvent + ViewUpdateEvent, } from './utilities/event-types'; import { EventEmitters } from './utilities/event-emitter'; import { serviceLocator, - setupServiceLocator + setupServiceLocator, } from './utilities/service-locator'; import CalendarModes from './utilities/calendar-modes'; import DefaultOptions from './utilities/default-options'; import ActionTypes from './utilities/action-types'; -import { OptionsStore } from './utilities/optionsStore'; -import { OptionConverter } from './utilities/optionConverter'; +import {OptionsStore} from "./utilities/optionsStore"; +import {OptionConverter} from "./utilities/optionConverter"; import { ErrorMessages } from './utilities/errors'; /** @@ -199,7 +199,7 @@ class TempusDominus { this, eventType, this._subscribers[eventType].length - 1 - ) + ), }); if (eventTypes.length === 1) { @@ -242,7 +242,7 @@ class TempusDominus { let asked = loadedLocales[language]; if (!asked) return; this.updateOptions({ - localization: asked + localization: asked, }); } @@ -271,7 +271,7 @@ class TempusDominus { ); this.optionsStore.input?.dispatchEvent( - new CustomEvent('change', { detail: event as any }) + new CustomEvent('change', { detail: event as any }) ); } @@ -311,7 +311,7 @@ class TempusDominus { private _viewUpdate() { this._triggerEvent({ type: Namespace.events.update, - viewDate: this.optionsStore.viewDate.clone + viewDate: this.optionsStore.viewDate.clone, } as ViewUpdateEvent); } @@ -385,6 +385,7 @@ class TempusDominus { newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod; } + this.optionsStore.options = newConfig; } @@ -409,6 +410,9 @@ class TempusDominus { if (!this.optionsStore.input) return; + if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate) + this.optionsStore.input.value = this.dates.formatInput(this.optionsStore.options.defaultDate); + this.optionsStore.input.addEventListener('change', this._inputChangeEvent); if (this.optionsStore.options.allowInputToggle) { this.optionsStore.input.addEventListener('click', this._toggleClickEvent); @@ -473,9 +477,9 @@ class TempusDominus { e: { currentTarget: this.display.widget.querySelector( `.${Namespace.css.switch} div` - ) + ), }, - action: ActionTypes.togglePicker + action: ActionTypes.togglePicker, }); } }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay); @@ -492,7 +496,7 @@ class TempusDominus { const setViewDate = () => { if (this.dates.lastPicked) - this.viewDate = this.dates.lastPicked.clone; + this.optionsStore.viewDate = this.dates.lastPicked.clone; }; const value = this.optionsStore.input.value; @@ -522,7 +526,7 @@ class TempusDominus { * @private */ private _toggleClickEvent = () => { - if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return; + if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return this.toggle(); }; } @@ -560,17 +564,17 @@ const locale = (l: string) => { * @param plugin * @param option */ -const extend = function(plugin, option) { +const extend = function (plugin, option) { if (!plugin) return tempusDominus; if (!plugin.installed) { // install plugin only once - plugin(option, { TempusDominus, Dates, Display, DateTime, ErrorMessages }, tempusDominus); + plugin(option, { TempusDominus, Dates, Display, DateTime, Namespace }, tempusDominus); plugin.installed = true; } return tempusDominus; }; -const version = '6.2.6'; +const version = '6.2.7'; const tempusDominus = { TempusDominus, @@ -596,4 +600,4 @@ export { version, DateTimeFormatOptions, Options -}; +} diff --git a/src/js/utilities/optionConverter.ts b/src/js/utilities/optionConverter.ts index 7f9140fab..1ebafceb1 100644 --- a/src/js/utilities/optionConverter.ts +++ b/src/js/utilities/optionConverter.ts @@ -21,7 +21,8 @@ export class OptionConverter { return; } else if (inputElement instanceof Date) { - o[key] = new Date(inputElement.valueOf()) + o[key] = new Date(inputElement.valueOf()); + return; } o[key] = inputElement; diff --git a/src/js/utilities/optionProcessor.ts b/src/js/utilities/optionProcessor.ts index 743ffa173..42b5a284d 100644 --- a/src/js/utilities/optionProcessor.ts +++ b/src/js/utilities/optionProcessor.ts @@ -1,191 +1,191 @@ -import Namespace from './namespace'; -import type { FormatLocalization } from './options'; -import { convertToDateTime, typeCheckNumberArray, typeCheckDateArray } from './typeChecker'; +import Namespace from "./namespace"; +import type { FormatLocalization } from "./options"; +import { convertToDateTime, typeCheckNumberArray, typeCheckDateArray } from "./typeChecker"; interface OptionProcessorFunctionArguments { - key: string, - value: any, - providedType: string, - defaultType: string, - path: string, - localization: FormatLocalization; + key: string, + value: any, + providedType: string, + defaultType: string, + path: string, + localization: FormatLocalization; } type OptionProcessorFunction = ( - this: void, - args: OptionProcessorFunctionArguments + this: void, + args: OptionProcessorFunctionArguments ) => any; function mandatoryDate(key: string): OptionProcessorFunction { - return ({ value, providedType, localization }) => { - const dateTime = convertToDateTime(value, key, localization); - if (dateTime !== undefined) { - dateTime.setLocale(localization.locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch( - key, - providedType, - 'DateTime or Date' - ); - }; + return ({ value, providedType, localization }) => { + const dateTime = convertToDateTime(value, key, localization); + if (dateTime !== undefined) { + dateTime.setLocale(localization.locale); + return dateTime; + } + Namespace.errorMessages.typeMismatch( + key, + providedType, + 'DateTime or Date' + ); + }; } function optionalDate(key: string): OptionProcessorFunction { - const mandatory = mandatoryDate(key); - return (args) => { - if (args.value === undefined) { - return args.value; - } - return mandatory(args); - }; + const mandatory = mandatoryDate(key); + return (args) => { + if (args.value === undefined) { + return args.value; + } + return mandatory(args); + }; } function numbersInRange(key: string, lower: number, upper: number): OptionProcessorFunction { - return ({ value, providedType }) => { - if (value === undefined) { - return []; - } - typeCheckNumberArray( - key, - value, - providedType - ); - if ((value as number[]).some(x => x < lower || x > upper)) - Namespace.errorMessages.numbersOutOfRange( - key, - lower, - upper - ); - return value; - }; + return ({ value, providedType }) => { + if (value === undefined) { + return []; + } + typeCheckNumberArray( + key, + value, + providedType + ); + if ((value as number[]).some(x => x < lower || x > upper)) + Namespace.errorMessages.numbersOutOfRange( + key, + lower, + upper + ); + return value; + }; } function validHourRange(key: string): OptionProcessorFunction { - return numbersInRange(key, 0, 23); + return numbersInRange(key, 0, 23); } function validDateArray(key: string): OptionProcessorFunction { - return ({ value, providedType, localization }) => { - if (value === undefined) { - return []; - } - typeCheckDateArray( - key, - value, - providedType, - localization - ); - return value; - }; + return ({ value, providedType, localization }) => { + if (value === undefined) { + return []; + } + typeCheckDateArray( + key, + value, + providedType, + localization + ); + return value; + }; } function validKeyOption(keyOptions: string[]): OptionProcessorFunction { - return ({ value, path }) => { - if (!keyOptions.includes(value)) - Namespace.errorMessages.unexpectedOptionValue( - path.substring(1), - value, - keyOptions - ); - return value; - }; + return ({ value, path }) => { + if (!keyOptions.includes(value)) + Namespace.errorMessages.unexpectedOptionValue( + path.substring(1), + value, + keyOptions + ); + return value; + }; } const optionProcessors: { [key: string]: OptionProcessorFunction; } = Object.freeze({ - 'defaultDate': mandatoryDate('defaultDate'), - 'viewDate': mandatoryDate('viewDate'), - 'minDate': optionalDate('restrictions.minDate'), - 'maxDate': optionalDate('restrictions.maxDate'), - 'disabledHours': validHourRange('restrictions.disabledHours'), - 'enabledHours': validHourRange('restrictions.enabledHours'), - 'disabledDates': validDateArray('restrictions.disabledDates'), - 'enabledDates': validDateArray('restrictions.enabledDates'), - 'daysOfWeekDisabled': numbersInRange('restrictions.daysOfWeekDisabled', 0, 6), - 'disabledTimeIntervals': ({ key, value, providedType, localization }) => { - if (value === undefined) { - return []; - } - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch( - key, - providedType, - 'array of { from: DateTime|Date, to: DateTime|Date }' - ); - } - const valueObject = value as { from: any; to: any; }[]; - for (let i = 0; i < valueObject.length; i++) { - Object.keys(valueObject[i]).forEach((vk) => { - const subOptionName = `${key}[${i}].${vk}`; - const d = valueObject[i][vk]; - const dateTime = convertToDateTime(d, subOptionName, localization); - if (!dateTime) { - Namespace.errorMessages.typeMismatch( - subOptionName, - typeof d, - 'DateTime or Date' - ); + 'defaultDate': mandatoryDate('defaultDate'), + 'viewDate': mandatoryDate('viewDate'), + 'minDate': optionalDate('restrictions.minDate'), + 'maxDate': optionalDate('restrictions.maxDate'), + 'disabledHours': validHourRange('restrictions.disabledHours'), + 'enabledHours': validHourRange('restrictions.enabledHours'), + 'disabledDates': validDateArray('restrictions.disabledDates'), + 'enabledDates': validDateArray('restrictions.enabledDates'), + 'daysOfWeekDisabled': numbersInRange('restrictions.daysOfWeekDisabled', 0, 6), + 'disabledTimeIntervals': ({ key, value, providedType, localization }) => { + if (value === undefined) { + return []; } - dateTime.setLocale(localization.locale); - valueObject[i][vk] = dateTime; - }); - } - return valueObject; - }, - 'toolbarPlacement': validKeyOption(['top', 'bottom', 'default']), - 'type': validKeyOption(['icons', 'sprites']), - 'viewMode': validKeyOption(['clock', 'calendar', 'months', 'years', 'decades']), - 'theme': validKeyOption(['light', 'dark', 'auto']), - 'meta': ({ value }) => value, - 'dayViewHeaderFormat': ({ value }) => value, - 'container': ({ value, path }) => { - if ( - value && - !( - value instanceof HTMLElement || - value instanceof Element || - value?.appendChild - ) - ) { - Namespace.errorMessages.typeMismatch( - path.substring(1), - typeof value, - 'HTMLElement' - ); + if (!Array.isArray(value)) { + Namespace.errorMessages.typeMismatch( + key, + providedType, + 'array of { from: DateTime|Date, to: DateTime|Date }' + ); + } + const valueObject = value as { from: any; to: any; }[]; + for (let i = 0; i < valueObject.length; i++) { + Object.keys(valueObject[i]).forEach((vk) => { + const subOptionName = `${key}[${i}].${vk}`; + const d = valueObject[i][vk]; + const dateTime = convertToDateTime(d, subOptionName, localization); + if (!dateTime) { + Namespace.errorMessages.typeMismatch( + subOptionName, + typeof d, + 'DateTime or Date' + ); + } + dateTime.setLocale(localization.locale); + valueObject[i][vk] = dateTime; + }); + } + return valueObject; + }, + 'toolbarPlacement': validKeyOption(['top', 'bottom', 'default']), + 'type': validKeyOption(['icons', 'sprites']), + 'viewMode': validKeyOption(['clock', 'calendar', 'months', 'years', 'decades']), + 'theme': validKeyOption(['light', 'dark', 'auto']), + 'meta': ({ value }) => value, + 'dayViewHeaderFormat': ({ value }) => value, + 'container': ({ value, path }) => { + if ( + value && + !( + value instanceof HTMLElement || + value instanceof Element || + value?.appendChild + ) + ) { + Namespace.errorMessages.typeMismatch( + path.substring(1), + typeof value, + 'HTMLElement' + ); + } + return value; + }, + 'useTwentyfourHour': ({ value, path, providedType, defaultType }) => { + if (value === undefined || providedType === 'boolean') return value; + Namespace.errorMessages.typeMismatch( + path, + providedType, + defaultType + ); } - return value; - }, - 'useTwentyfourHour': ({ value, path, providedType, defaultType }) => { - if (value === undefined || providedType === 'boolean') return value; - Namespace.errorMessages.typeMismatch( - path, - providedType, - defaultType - ); - } }); const defaultProcessor: OptionProcessorFunction = ({ value, defaultType, providedType, path }) => { - switch (defaultType) { - case 'boolean': - return value === 'true' || value === true; - case 'number': - return +value; - case 'string': - return value.toString(); - case 'object': - return {}; - case 'function': - return value; - default: - Namespace.errorMessages.typeMismatch( - path, - providedType, - defaultType - ); - } + switch (defaultType) { + case 'boolean': + return value === 'true' || value === true; + case 'number': + return +value; + case 'string': + return value.toString(); + case 'object': + return {}; + case 'function': + return value; + default: + Namespace.errorMessages.typeMismatch( + path, + providedType, + defaultType + ); + } }; export function processKey(this: void, args: OptionProcessorFunctionArguments) { - return (optionProcessors[args.key] || defaultProcessor)(args); -} + return (optionProcessors[args.key] || defaultProcessor)(args); +}; \ No newline at end of file diff --git a/src/nuget/TempusDominus.nuspec b/src/nuget/TempusDominus.nuspec index 952ac5957..5304e8351 100644 --- a/src/nuget/TempusDominus.nuspec +++ b/src/nuget/TempusDominus.nuspec @@ -2,7 +2,7 @@ TempusDominus - 6.2.6 + 6.2.7 Tempus Dominus Eonasdan Eonasdan diff --git a/src/nuget/TempusDominus.scss.nuspec b/src/nuget/TempusDominus.scss.nuspec index 71a1741c0..e2a67a7db 100644 --- a/src/nuget/TempusDominus.scss.nuspec +++ b/src/nuget/TempusDominus.scss.nuspec @@ -2,7 +2,7 @@ TempusDominus.scss - 6.2.6 + 6.2.7 Tempus Dominus Eonasdan Eonasdan diff --git a/src/plugins/customDateFormat/index.ts b/src/plugins/customDateFormat/index.ts index 98140749f..3dac9d65f 100644 --- a/src/plugins/customDateFormat/index.ts +++ b/src/plugins/customDateFormat/index.ts @@ -1,16 +1,19 @@ +import { DateTime } from '../../js/datetime'; +import { ErrorMessages } from '../../js/utilities/errors'; + class CustomDateFormat { localization: any; - private readonly DateTime: any; //I don't want to import - private readonly errorMessages: any; + private readonly DateTime: typeof DateTime; + private readonly errorMessages: ErrorMessages; constructor(dateTime, errorMessages: any) { this.DateTime = dateTime; this.errorMessages = errorMessages; } - private REGEX_FORMAT = /\[([^\]]+)]|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|Z{1,2}/g + private REGEX_FORMAT = /\[([^\]]+)]|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|Z{1,2}/g; - private getAllMonths(format: "2-digit" | "numeric" | "long" | "short" | "narrow" = 'long') { + private getAllMonths(format: '2-digit' | 'numeric' | 'long' | 'short' | 'narrow' = 'long') { const applyFormat = new Intl.DateTimeFormat(this.localization.locale, { month: format }).format; return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m))); } @@ -26,7 +29,8 @@ class CustomDateFormat { return formatStr.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => { const B = b && b.toUpperCase(); return a || this.englishFormats[b] || this.replaceExtendedTokens(formats[B]); - })} + }); + } // noinspection SpellCheckingInspection private englishFormats = { @@ -35,11 +39,11 @@ class CustomDateFormat { L: 'MM/dd/yyyy', LL: 'MMMM d, yyyy', LLL: 'MMMM d, yyyy h:mm T', - LLLL: 'dddd, MMMM d, yyyy h:mm T', + LLLL: 'dddd, MMMM d, yyyy h:mm T' }; private formattingTokens = - /(\[[^[]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?|z|ZZ?)/g; + /(\[[^[]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?|z|zz?z?)/g; private match1 = /\d/; // 0 - 9 private match2 = /\d\d/; // 00 - 99 @@ -69,17 +73,39 @@ class CustomDateFormat { }; }; + /** + * z = -4, zz = -04, zzz = -0400 + * @param date + * @param style + * @private + */ + private zoneInformation(date: DateTime, style: 'z' | 'zz' | 'zzz') { + let name = date.parts(this.localization.locale, { timeZoneName: 'longOffset' }) + .timeZoneName + .replace('GMT', '') + .replace(':', ''); + + let negative = name.includes('-'); + + name = name.replace('-'); + + if (style === 'z') name = name.substring(1, 2); + else if (style === 'zz') name = name.substring(0, 2); + + return `${negative ? '-' : ''}${name}`; + } + private zoneExpressions = [ this.matchOffset, (obj, input) => { obj.offset = this.offsetFromString(input); - }, + } ]; private meridiemMatch(input) { const meridiem = new Intl.DateTimeFormat(this.localization.locale, { hour: 'numeric', - hour12: true, + hour12: true }) .formatToParts(new Date(2022, 3, 4, 13)) .find((p) => p.type === 'dayPeriod')?.value; @@ -92,19 +118,19 @@ class CustomDateFormat { this.matchWord, (ojb, input) => { ojb.afternoon = this.meridiemMatch(input); - }, + } ], T: [ this.matchWord, (ojb, input) => { ojb.afternoon = this.meridiemMatch(input); - }, + } ], fff: [ this.match3, (ojb, input) => { ojb.milliseconds = +input; - }, + } ], s: [this.match1to2, this.addInput('seconds')], ss: [this.match1to2, this.addInput('seconds')], @@ -126,7 +152,7 @@ class CustomDateFormat { ojb.day = i; } } - }, + } ], M: [this.match1to2, this.addInput('month')], MM: [this.match2, this.addInput('month')], @@ -141,7 +167,7 @@ class CustomDateFormat { throw new Error(); } obj.month = matchIndex % 12 || matchIndex; - }, + } ], MMMM: [ this.matchWord, @@ -152,18 +178,19 @@ class CustomDateFormat { throw new Error(); } obj.month = matchIndex % 12 || matchIndex; - }, + } ], y: [this.matchSigned, this.addInput('year')], yy: [ this.match2, (obj, input) => { obj.year = this.parseTwoDigitYear(input); - }, + } ], yyyy: [this.match4, this.addInput('year')], - Z: this.zoneExpressions, - ZZ: this.zoneExpressions, + // z: this.zoneExpressions, + // zz: this.zoneExpressions, + // zzz: this.zoneExpressions }; private correctHours(time) { @@ -265,8 +292,8 @@ class CustomDateFormat { MMMM: this.getAllMonths()[dateTime.getMonth()], d: dateTime.date, dd: dateTime.dateFormatted, - ddd: formatter({ weekday: "short" }), - dddd: formatter({ weekday: "long" }), + ddd: formatter({ weekday: 'short' }), + dddd: formatter({ weekday: 'long' }), H: dateTime.getHours(), HH: dateTime.hoursFormatted, h: dateTime.hours > 12 ? dateTime.hours - 12 : dateTime.hours, @@ -278,32 +305,35 @@ class CustomDateFormat { s: dateTime.seconds, ss: dateTime.secondsFormatted, fff: dateTime.getMilliseconds(), - //z: dateTime.getTimezoneOffset() todo zones are stupid - } + // z: this.zoneInformation(dateTime, 'z'), //-4 + // zz: this.zoneInformation(dateTime, 'zz'), //-04 + // zzz: this.zoneInformation(dateTime, 'zzz') //-0400 + }; return format.replace(this.REGEX_FORMAT, (match, $1) => { return $1 || matches[match]; - }) + }); } } export default (_, tdClasses, __) => { - const customDateFormat = new CustomDateFormat(tdClasses.DateTime, tdClasses.ErrorMessages); + const customDateFormat = new CustomDateFormat(tdClasses.DateTime, tdClasses.Namespace.errorMessages); // noinspection JSUnusedGlobalSymbols tdClasses.Dates.prototype.formatInput = function(date) { + if (!date) return ''; customDateFormat.localization = this.optionsStore.options.localization; return customDateFormat.format(date); - } + }; // noinspection JSUnusedGlobalSymbols tdClasses.Dates.prototype.parseInput = function(input) { customDateFormat.localization = this.optionsStore.options.localization; return customDateFormat.parseFormattedInput(input); - } + }; - tdClasses.DateTime.fromString = function (input: string, localization: any) { + tdClasses.DateTime.fromString = function(input: string, localization: any) { customDateFormat.localization = localization; return customDateFormat.parseFormattedInput(input); - } + }; } diff --git a/test/datetime.test.ts b/test/datetime.test.ts new file mode 100644 index 000000000..09380c196 --- /dev/null +++ b/test/datetime.test.ts @@ -0,0 +1,254 @@ +import { expect, test } from 'vitest'; +import { DateTime, getFormatByUnit, Unit } from '../src/js/datetime'; + +test('getFormatByUnit', () => { + expect(getFormatByUnit(Unit.date)).toEqual({ dateStyle: 'short' }); + expect(getFormatByUnit(Unit.month)).toEqual({ + month: 'numeric', + year: 'numeric' + }); + expect(getFormatByUnit(Unit.year)).toEqual({ year: 'numeric' }); +}); + +test('Can create with string (ctor)', () => { + const dt = new DateTime('12/31/2022'); + expect(dt.month).toBe(12 - 1); //minus 1 because javascript 🙄 + expect(dt.date).toBe(31); + expect(dt.year).toBe(2022); +}); + +test('Locale is stored', () => { + const dt = new DateTime(); + expect(dt.locale).toBe('default'); + dt.setLocale('en-US'); + expect(dt.locale).toBe('en-US'); +}); + +test('Can convert from a Date object', () => { + const d = new Date(2022, 11, 14); + const dt = DateTime.convert(d); + + expect(dt.valueOf()).toBe(d.valueOf()); +}); + +test('Convert fails with no parameter', () => { + expect(() => DateTime.convert(null)).toThrow('A date is required'); +}); + +test('Can create with string', () => { + //Presently, this is just a function for the custom date format plugin to overwrite + const dt = DateTime.fromString('12/31/2022', null); + expect(dt.month).toBe(12 - 1); //minus 1 because javascript 🙄 + expect(dt.date).toBe(31); + expect(dt.year).toBe(2022); +}); + +test('Can create clone', () => { + const dt = new DateTime(2022, 11, 14); + const d = dt.clone; + + expect(dt.valueOf()).toBe(d.valueOf()); +}); +new Date() +test('startOf', () => { + let dt = new DateTime(2022, 11, 14, 13, 42, 59, 500); + + //12/31/2022 13:42:59:0 + dt = dt.startOf(Unit.seconds); + expect(dt.getMilliseconds()).toBe(0); + + dt = dt.startOf(Unit.minutes); + expect(dt.valueOf()).toBe(new Date(2022, 11, 14, 13, 42, 0).valueOf()); + + dt = dt.startOf(Unit.hours); + expect(dt.valueOf()).toBe(new Date(2022, 11, 14, 13, 0, 0).valueOf()); + + dt = dt.startOf(Unit.date); + expect(dt.valueOf()).toBe(new Date(2022, 11, 14, 0, 0, 0).valueOf()); + + dt = dt.startOf('weekDay'); + expect(dt.valueOf()).toBe(new Date(2022, 11, 11, 0, 0, 0).valueOf()); + + dt = dt.startOf(Unit.month); + expect(dt.valueOf()).toBe(new Date(2022, 11, 1, 0, 0, 0).valueOf()); + + dt = dt.startOf(Unit.year); + expect(dt.valueOf()).toBe(new DateTime(2022, 0, 1, 0, 0, 0).valueOf()); + + // @ts-ignore + expect(() => dt.startOf('foo')).toThrow(`Unit 'foo' is not valid`); + + //check if skip the process of the start of the week is the same weekday + dt = new DateTime(2022, 11, 25, 0, 0, 0); + dt = dt.startOf('weekDay'); + expect(dt.valueOf()).toBe(new Date(2022, 11, 25, 0, 0, 0).valueOf()); + + //check if weekday works if the week doesn't start on Sunday + dt = new DateTime(2022, 11, 18, 0, 0, 0); + dt = dt.startOf('weekDay', 1); + expect(dt.valueOf()).toBe(new Date(2022, 11, 12, 0, 0, 0).valueOf()); +}); + +test('endOf', () => { + let dt = new DateTime(2022, 11, 14, 13, 42, 59, 50); + + //12/31/2022 13:42:59:0 + dt = dt.endOf(Unit.seconds); + expect(dt.getMilliseconds()).toBe(999); + + dt = dt.endOf(Unit.minutes); + expect(dt.valueOf()).toBe(new Date(2022, 11, 14, 13, 42, 59, 999).valueOf()); + + dt = dt.endOf(Unit.hours); + expect(dt.valueOf()).toBe(new Date(2022, 11, 14, 13, 59, 59, 999).valueOf()); + + dt = dt.endOf(Unit.date); + expect(dt.valueOf()).toBe(new Date(2022, 11, 14, 23, 59, 59, 999).valueOf()); + + dt = dt.endOf('weekDay'); + expect(dt.valueOf()).toBe(new Date(2022, 11, 17, 23, 59, 59, 999).valueOf()); + + dt = dt.endOf(Unit.month); + expect(dt.valueOf()).toBe(new Date(2022, 11, 31, 23, 59, 59, 999).valueOf()); + + dt = dt.endOf(Unit.year); + expect(dt.valueOf()).toBe(new Date(2022, 11, 31, 23, 59, 59, 999).valueOf()); + + // @ts-ignore + expect(() => dt.endOf('foo')).toThrow(`Unit 'foo' is not valid`); + + //check if skip the process of the end of the week is the same weekday + dt = new DateTime(2022, 11, 17, 0, 0, 0); + dt = dt.endOf('weekDay'); + expect(dt.valueOf()).toBe(new Date(2022, 11, 17, 23, 59, 59, 999).valueOf()); + + //check if weekday works if the week doesn't start on Sunday + dt = new DateTime(2022, 11, 14, 0, 0, 0); + dt = dt.endOf('weekDay', 1); + expect(dt.valueOf()).toBe(new Date(2022, 11, 18, 23, 59, 59, 999).valueOf()); +}); + +test('manipulate throws an error with invalid part', () => { + // @ts-ignore + expect(() => new DateTime().manipulate(1, 'foo')).toThrow(`Unit 'foo' is not valid`); +}); + +test('Format should return formatted date', () => { + const dt = new DateTime(2022, 11, 17, 0, 0, 0); + + expect(dt.format({ dateStyle: 'full' })).toBe('Saturday, December 17, 2022'); +}); + +test('isBefore', () => { + const dt1 = new DateTime(2022, 11, 16, 0, 0, 0); + const dt2 = new DateTime(2022, 11, 17, 0, 0, 0); + + expect(dt1.isBefore(dt2)).toBe(true); + + expect(dt1.isBefore(dt2, Unit.date)).toBe(true); + + // @ts-ignore + expect(() => dt1.isBefore(dt2, 'foo')).toThrow(`Unit 'foo' is not valid`); +}); + +test('isAfter', () => { + const dt1 = new DateTime(2022, 11, 16, 0, 0, 0); + const dt2 = new DateTime(2022, 11, 17, 0, 0, 0); + + expect(dt2.isAfter(dt1)).toBe(true); + + expect(dt2.isAfter(dt1, Unit.date)).toBe(true); + + // @ts-ignore + expect(() => dt2.isAfter(dt1, 'foo')).toThrow(`Unit 'foo' is not valid`); +}); + +test('isSame', () => { + const dt1 = new DateTime(2022, 11, 16, 0, 0, 0); + const dt2 = new DateTime(2022, 11, 16, 0, 0, 0); + + expect(dt1.isSame(dt2)).toBe(true); + + expect(dt1.isSame(dt2, Unit.date)).toBe(true); + + // @ts-ignore + expect(() => dt1.isSame(dt2, 'foo')).toThrow(`Unit 'foo' is not valid`); +}); + +//todo this is missing some conditions: https://github.com/moment/moment/blob/master/src/test/moment/is_between.js +//but it hurts my brain +test('isBetween', () => { + const dt1 = new DateTime(2022, 11, 16, 0, 0, 0); + const left = new DateTime(2022, 11, 15, 0, 0, 0); + const right = new DateTime(2022, 11, 17, 0, 0, 0); + + expect(dt1.isBetween(left, right)).toBe(true); + + expect(dt1.isBetween(left, right, Unit.date)).toBe(true); + + // @ts-ignore + expect(() => dt1.isBetween(left, right, 'foo')).toThrow(`Unit 'foo' is not valid`); + + const dateTime = new DateTime('2016-10-30'); + + expect(dateTime.isBetween(dateTime, new DateTime('2016-12-30'), undefined, '()')).toBe(false); + expect(dateTime.isBetween(dateTime, dateTime, undefined, '[]')).toBe(true); + expect(dateTime.isBetween(new DateTime('2016-01-01'), dateTime, undefined, '(]')).toBe(true); + expect(dateTime.isBetween(dateTime, new DateTime('2016-12-30'), undefined, '[)')).toBe(true); +}); + +test('Getters/Setters', () => { + const dt = new DateTime(2022, 11, 17, 0, 0, 0); + + dt.seconds = 4; + + expect(dt.seconds).toBe(4); + expect(dt.secondsFormatted).toBe('04'); + + dt.minutes = 4; + + expect(dt.minutes).toBe(4); + expect(dt.minutesFormatted).toBe('04'); + + dt.hours = 4; + + expect(dt.hours).toBe(4); + expect(dt.hoursFormatted).toBe('04'); + + dt.hours = 14; + + expect(dt.hours).toBe(14); + expect(dt.hoursFormatted).toBe('14'); + expect(dt.twelveHoursFormatted).toBe('02'); + + dt.date = 4; + + expect(dt.date).toBe(4); + expect(dt.dateFormatted).toBe('04'); + + dt.month = 4; + + expect(dt.month).toBe(4); + expect(dt.monthFormatted).toBe('05'); + + //test date bubbling. JS doesn't handle a date of May 31st => June 31st but DateTime does. + dt.date = 31; + dt.month = 5; + expect(dt.monthFormatted).toBe('06'); + + dt.year = 2023; + + expect(dt.year).toBe(2023); + + expect(dt.week).toBe(26); + + expect(dt.weeksInWeekYear(dt.year)).toBe(52); + + dt.year = 2024 + expect(dt.isLeapYear).toBe(true); + + dt.year = 2026; + expect(dt.weeksInWeekYear(dt.year)).toBe(53); + + expect(dt.meridiem()).toBe('PM'); +}); diff --git a/types/dates.d.ts b/types/dates.d.ts index 2a88d7c82..bac3841f2 100644 --- a/types/dates.d.ts +++ b/types/dates.d.ts @@ -64,6 +64,7 @@ export default class Dates { * @param year e.g. 2021 */ static getStartEndYear(factor: number, year: number): [number, number, number]; + updateInput(target?: DateTime): void; /** * Attempts to either clear or set the `target` date at `index`. * If the `target` is null then the date will be cleared. diff --git a/types/tempus-dominus.d.ts b/types/tempus-dominus.d.ts index 7c54ba287..9621f54ea 100644 --- a/types/tempus-dominus.d.ts +++ b/types/tempus-dominus.d.ts @@ -159,5 +159,5 @@ declare const extend: (plugin: any, option: any) => { Unit: typeof Unit; version: string; }; -declare const version = "6.2.6"; +declare const version = "6.2.7"; export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Unit, version, DateTimeFormatOptions, Options }; diff --git a/types/tempus-dominus.esm.d.ts b/types/tempus-dominus.esm.d.ts index 092fad0ee..84cddbd40 100644 --- a/types/tempus-dominus.esm.d.ts +++ b/types/tempus-dominus.esm.d.ts @@ -582,6 +582,7 @@ declare class Dates { number, number ]; + updateInput(target?: DateTime): void; /** * Attempts to either clear or set the `target` date at `index`. * If the `target` is null then the date will be cleared. @@ -1252,5 +1253,5 @@ declare const extend: (plugin: any, option: any) => { Unit: typeof Unit; version: string; }; -declare const version = "6.2.6"; +declare const version = "6.2.7"; export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Unit, version, DateTimeFormatOptions, Options }; diff --git a/types/tempus-dominus.esm.min.d.ts b/types/tempus-dominus.esm.min.d.ts index 092fad0ee..84cddbd40 100644 --- a/types/tempus-dominus.esm.min.d.ts +++ b/types/tempus-dominus.esm.min.d.ts @@ -582,6 +582,7 @@ declare class Dates { number, number ]; + updateInput(target?: DateTime): void; /** * Attempts to either clear or set the `target` date at `index`. * If the `target` is null then the date will be cleared. @@ -1252,5 +1253,5 @@ declare const extend: (plugin: any, option: any) => { Unit: typeof Unit; version: string; }; -declare const version = "6.2.6"; +declare const version = "6.2.7"; export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Unit, version, DateTimeFormatOptions, Options }; diff --git a/types/tempus-dominus.min.d.ts b/types/tempus-dominus.min.d.ts index 092fad0ee..84cddbd40 100644 --- a/types/tempus-dominus.min.d.ts +++ b/types/tempus-dominus.min.d.ts @@ -582,6 +582,7 @@ declare class Dates { number, number ]; + updateInput(target?: DateTime): void; /** * Attempts to either clear or set the `target` date at `index`. * If the `target` is null then the date will be cleared. @@ -1252,5 +1253,5 @@ declare const extend: (plugin: any, option: any) => { Unit: typeof Unit; version: string; }; -declare const version = "6.2.6"; +declare const version = "6.2.7"; export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Unit, version, DateTimeFormatOptions, Options }; diff --git a/types/utilities/optionProcessor.d.ts b/types/utilities/optionProcessor.d.ts index 786ef9f61..10628240e 100644 --- a/types/utilities/optionProcessor.d.ts +++ b/types/utilities/optionProcessor.d.ts @@ -1,4 +1,4 @@ -import type { FormatLocalization } from './options'; +import type { FormatLocalization } from "./options"; interface OptionProcessorFunctionArguments { key: string; value: any; diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 000000000..a260ba93d --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'vitest/config' +import GithubActionsReporter from 'vitest-github-actions-reporter' + +export default defineConfig({ + test: { + coverage: { + reporter: ['text', 'json', 'html'], + }, + reporters: process.env.GITHUB_ACTIONS + ? ['default', new GithubActionsReporter()] + : 'default' + }, +})