\r\n );\r\n};\r\nexport default ModWebParts;\r\n","const Aux = (props) => {return props.children;};\r\nexport default Aux;","import App from './App';\r\nimport React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\n\r\nwindow.AppComponent = App;\r\nwindow.React = React;\r\nwindow.ReactDOM = ReactDOM;\r\n\r\n\r\n//ReactDOM.render(window.AppComponent, document.getElementById('welcomespuser'));\r\n//const App=() =>\r\n\r\n/*ReactDOM.render(\r\n { \r\n window.AppComponent = myAppComponent\r\n console.log(myAppComponent);\r\n \r\n }}/>,\r\n document.getElementById('welcomespuser') \r\n); \r\n */","export default function _assertThisInitialized(self) {\r\n if (self === void 0) {\r\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\r\n }\r\n return self;\r\n}\r\n","export default function _extends() {\r\n _extends = Object.assign || function (target) {\r\n for (var i = 1; i < arguments.length; i++) {\r\n var source = arguments[i];\r\n for (var key in source) {\r\n if (Object.prototype.hasOwnProperty.call(source, key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n };\r\n return _extends.apply(this, arguments);\r\n}\r\n","export default function _inheritsLoose(subClass, superClass) {\r\n subClass.prototype = Object.create(superClass.prototype);\r\n subClass.prototype.constructor = subClass;\r\n subClass.__proto__ = superClass;\r\n}\r\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\r\n if (source == null) return {};\r\n var target = {};\r\n var sourceKeys = Object.keys(source);\r\n var key, i;\r\n for (i = 0; i < sourceKeys.length; i++) {\r\n key = sourceKeys[i];\r\n if (excluded.indexOf(key) >= 0) continue;\r\n target[key] = source[key];\r\n }\r\n return target;\r\n}\r\n","function _interopRequireDefault(obj) {\r\n return obj && obj.__esModule ? obj : {\r\n \"default\": obj\r\n };\r\n}\r\nmodule.exports = _interopRequireDefault;\r\n","exports = module.exports = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \".footerCont{margin-top: 100px}\\r\\nbutton.contact-us-but{\\r\\n font-size: 13px !important;\\r\\n font-family: 'open_sans_hebrewbold';\\r\\n \\r\\n background-color: #185EF1;\\r\\n color: white;\\r\\n position: absolute;\\r\\n bottom: 3px;\\r\\n width: 147px;\\r\\n text-align: center;\\r\\n margin: 0 auto;\\r\\n background-position: right 10px center;\\r\\n\\r\\n}\\r\\nbutton.contact-us-but:lang(en){\\r\\n background-position: left 10px center;\\r\\n}\\r\\n.horizontal-footer{\\r\\n color:white;\\r\\n display: block;\\r\\n text-align: center;\\r\\n}\\r\\n.btn-outline-secondary:hover {\\r\\n color: #fff;\\r\\n background-color: #185EF1;\\r\\n border-color: #185EF1;\\r\\n}\\r\\n.horizontal-footer-item:not(:first-child)::before{\\r\\n content: \\\"|\\\";\\r\\n font-size: 1.5em !important;\\r\\n}\\r\\n\\r\\n.footer-item-child:hover{\\r\\n cursor: pointer;\\r\\n text-decoration: underline;\\r\\n}\\r\\n/* .horizontal-footer-item{\\r\\n margin: 0 10px; \\r\\n} */\\r\\n.footer-item-child{\\r\\n padding:0px 10px;\\r\\n /* font-size: 1.5em !important; */\\r\\n}\\r\\na#PageLinkPrev,a#PageLinkNext{\\r\\n border: none;\\r\\n}\\r\\na.horizontal-footer-item {\\r\\n color: white;\\r\\n}\\r\\n\\r\\n\\r\\n.modal-body button.close-icon-div{\\r\\n background-color: transparent; \\r\\n border:none;\\r\\n}\\r\\n\\r\\n/* @media screen and (min-width:768px) */\\r\\n@media screen and (min-width:961px) \\r\\n{\\r\\n .horizontal-footer{\\r\\n position: relative;\\r\\n }\\r\\n .contact-us-but{\\r\\n position: absolute ;\\r\\n float: right;\\r\\n right: 10px;\\r\\n height: 30px;\\r\\n top: -5px;\\r\\n}\\r\\n.footer-item-child{\\r\\n \\r\\n font-size: 16px ;\\r\\n line-height: 28px;\\r\\n}\\r\\n}\\r\\n /* @media screen and (max-width:768px) */\\r\\n @media screen and (max-width:960px)\\r\\n {\\r\\n .footerDetails\\r\\n {\\r\\n background-color: transparent;\\r\\n }\\r\\n \\r\\n .contact-us-but{\\r\\n top: 40px;\\r\\n height: 33px;\\r\\n margin: 0 auto;\\r\\n left: 30%;\\r\\n float: none;\\r\\n }\\r\\n .footer-item-child{\\r\\n \\r\\n font-size: 14px ;\\r\\n line-height: 18px;\\r\\n }\\r\\n}\", \"\"]);\n","exports = module.exports = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \".modGrid\\r\\n{\\r\\n direction: ltr;\\r\\n text-align: left;\\r\\n}\\r\\n.modAccordion .headerTitle\\r\\n{\\r\\n font-family: 'opensanshebrew-regularregular';\\r\\n font-size: 14px;\\r\\n line-height: 18px;\\r\\n}\\r\\n.modAccordion .headerText\\r\\n{\\r\\n font-family: 'opensanshebrew-regularregular';\\r\\n font-size: 16px;\\r\\n line-height: 24px;\\r\\n font-weight: 700 !important;\\r\\n}\\r\\n.modAccordion .p-accordion-header a, .modAccordion .p-accordion-header a:link,.modAccordion .p-accordion-header a:hover \\r\\n{\\r\\n color: #000;\\r\\n text-decoration: none;\\r\\n}\\r\\n.modAccordion .p-accordion-header\\r\\n{\\r\\n background-color: #e5edfd;\\r\\n margin: 10px 0;\\r\\n border-radius: 15px 15px 0 0;\\r\\n padding: 15px;\\r\\n}\\r\\n.modAccordion ul {\\r\\n list-style: none;\\r\\n font-family: 'opensanshebrew-regularregular';\\r\\n padding: 0;\\r\\n}\\r\\n.modAccordion li::before{\\r\\n content: attr(aria-label);\\r\\n font-size: 14px;\\r\\n line-height: 18px;\\r\\n font-weight: normal;\\r\\n white-space: pre;\\r\\n /* margin-top: -15px; */\\r\\n}\\r\\n.modAccordion li {\\r\\n padding: 5px 15px;\\r\\n}\\r\\n.modAccordion li p{\\r\\n font-size: 16px;\\r\\n line-height: 24px;\\r\\n font-weight: 700 !important;\\r\\n}\\r\\n.modAccordion .p-accordion-tab\\r\\n{\\r\\n border-radius: 0 0 15px 15px;\\r\\n background-color: #fff;\\r\\n}\\r\\np.modNote\\r\\n{\\r\\n white-space: pre-wrap;\\r\\n}\\r\\n.gridHeader\\r\\n{\\r\\n font-family: 'opensanshebrew-regularregular';\\r\\n font-size: 20px;\\r\\n line-height: 28px;\\r\\n font-weight: 700 !important;\\r\\n}\\r\\n/* primereact and primeicons */\\r\\n.p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-toggle-icon {\\r\\n margin-right: 0.5rem;\\r\\n}\\r\\n\\r\\n.pi {\\r\\n font-size: 1rem;\\r\\n /* font-family: 'primeicons'; */\\r\\n font-family: \\\"Font Awesome 5 Free\\\";\\r\\n speak: none;\\r\\n font-style: normal;\\r\\n /* font-weight: normal; */\\r\\n font-weight: 900;\\r\\n font-variant: normal;\\r\\n text-transform: none;\\r\\n line-height: 1;\\r\\n display: inline-block;\\r\\n -webkit-font-smoothing: antialiased;\\r\\n -moz-osx-font-smoothing: grayscale;\\r\\n}\\r\\n.pi-chevron-right:before {\\r\\n content: \\\"\\\\f078\\\";\\r\\n color: #000;\\r\\n font-size: 20px;\\r\\n line-height: 15px;\\r\\n}\\r\\n.pi-chevron-down:before {\\r\\n content: \\\"\\\\f077\\\";\\r\\n color: #000;\\r\\n font-size: 20px;\\r\\n line-height: 15px;\\r\\n}\\r\\n.pi:before {\\r\\n --webkit-backface-visibility: hidden;\\r\\n backface-visibility: hidden;\\r\\n}\\r\\nspan.p-accordion-toggle-icon.pi {\\r\\n position: absolute;\\r\\n right: 50px;\\r\\n}\\r\\n\", \"\"]);\n","exports = module.exports = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \"\\r\\n.wp-icons .wp-title{\\r\\n font-size: 28px;\\r\\n color: #212121;\\r\\n font-weight: 700;\\r\\n /* font-family: 'Open Sans Hebrew'; */\\r\\n margin-bottom: 50px;\\r\\n position: relative;\\r\\n}\\r\\n.wp-icons .wp-title:before{\\r\\n content: '';\\r\\n width:42px ;\\r\\n height: 4px;\\r\\n background:#185EF1 ;\\r\\n position: absolute;\\r\\n bottom: -14px;\\r\\n}\\r\\n.wp-icons {\\r\\n display: flex;\\r\\n align-content: center;\\r\\n flex-direction: column;\\r\\n justify-content: center;\\r\\n margin:0 auto;\\r\\n /* align-items: center; */\\r\\n \\r\\n /* margin-top: 30px;*/\\r\\n}\\r\\n.wp-icons .icon-item{\\r\\n display: flex; \\r\\n \\r\\n}\\r\\n.wp-icons .icon-item.flex-direction-col{\\r\\n flex-direction: column;\\r\\n}\\r\\n.wp-icons .icon-item-text{\\r\\n font-size: 20px;\\r\\n line-height: 24px;\\r\\n}\\r\\n .wp-icons .img-link-icon {\\r\\n height: 48px;\\r\\n /*width: 58px;*/\\r\\n width: 48px;\\r\\n }\\r\\n\\r\\n.modWPIcons\\r\\n{\\r\\n margin:auto;margin-top: 230px;\\r\\n color:#fff;\\r\\n}\\r\\n.modWPIcons h2\\r\\n{\\r\\n color:#fff;\\r\\n font-size: 64px;\\r\\n}\\r\\n.IconWrap\\r\\n{\\r\\n padding-right: 5px;\\r\\n padding-left: 5px;\\r\\n margin-top: 49px;\\r\\n}\\r\\n\\r\\n.modWPIcons .card\\r\\n{\\r\\n background-color: #30526c;\\r\\n}\\r\\n.modWPIcons .card a:hover\\r\\n{\\r\\n text-decoration: none;\\r\\n}\\r\\n#IconCard4\\r\\n{\\r\\n background-color: #f7bb49;\\r\\n}\\r\\n.modWPIcons .card-body\\r\\n{\\r\\n padding: 12px;\\r\\n}\\r\\n.cardImg\\r\\n{\\r\\n display: block;\\r\\n margin: auto;\\r\\n margin-top: 15px;\\r\\n margin-bottom: 15px;\\r\\n}\\r\\n.modWPIcons .card-text\\r\\n{\\r\\n font-size: 22px;\\r\\n text-align: center;\\r\\n color:#fff;\\r\\n text-decoration: none;\\r\\n height: 32px;\\r\\n}\\r\\n#IconCard4 .traingle-bottom\\r\\n{\\r\\n border-bottom: 16px solid #30526c;\\r\\n}\\r\\n.IconWrap .traingle-bottom\\r\\n{\\r\\n margin-left: 0;\\r\\n} \\r\\n.message-title .wp-title,.wp-icons .wp-title,.wp-icons .icon-title .wp-title{\\r\\n font-family: 'open_sans_hebrewbold' !important;\\r\\n}\\r\\n/* @media screen and (max-width:768px) */\\r\\n@media screen and (max-width:960px) \\r\\n{\\r\\n .modWPIcons .card-text {\\r\\n font-size: 28px;\\r\\n }\\r\\n .wp-icons {\\r\\n align-content: right;\\r\\n justify-content: start;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n /* align-items: center; */\\r\\n \\r\\n }\\r\\n .wp-icons .icon-item{\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n justify-items: center;\\r\\n align-content: center;\\r\\n align-items: center;\\r\\n }\\r\\n .wp-icons .icon-item-text{\\r\\n margin: 10px 10px;\\r\\n }\\r\\n .wp-icons .img-link-icon{\\r\\n height: 28px;\\r\\n width: 28px;\\r\\n }\\r\\n .wp-icons .wp-title{\\r\\n margin-bottom: 20px;\\r\\n }\\r\\n .wp-icons .wp-title:before{\\r\\n bottom: -15px;\\r\\n }\\r\\n .wp-icons .wp-title:before{\\r\\n /* right: 43%; */\\r\\n }\\r\\n .Icons_first .wp-icons .wp-title, .Icons_second .wp-icons .wp-title {\\r\\n /* text-align: center;*/\\r\\n text-align: right;\\r\\n font-size:20px;\\r\\n }\\r\\n .Icons_first .wp-icons .wp-title:lang(en), .Icons_second .wp-icons .wp-title:lang(en) {\\r\\n /* text-align: center;*/\\r\\n text-align: left;\\r\\n }\\r\\n \\r\\n .icon-items .icon-item .icon-item-text{\\r\\n font-size:16px;\\r\\n }\\r\\n \\r\\n \\r\\n}\\r\\n\\r\\n/* @media screen and (min-width:768px) */\\r\\n@media screen and (min-width:961px) \\r\\n{\\r\\n /* .Icons_second{\\r\\n max-width: 75%;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n flex-direction: row;\\r\\n margin: auto;\\r\\n } */\\r\\n .dvBottomZone{\\r\\n display:flex;\\r\\n justify-content: center;\\r\\n }\\r\\n .wp-icons {\\r\\n min-height: 300px;\\r\\n \\r\\n }\\r\\n .icon-title{\\r\\n display: flex;\\r\\n }\\r\\n .icon-items{\\r\\n display: flex;\\r\\n \\r\\n }\\r\\n .bottom-geometry-zone > .col-md-8{\\r\\n float: none;\\r\\n }\\r\\n}\", \"\"]);\n","exports = module.exports = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \".LinksTitle{font-size:40px;font-weight:300;text-align:center;color:#25465F}\\r\\n\\r\\n.message-wp .modWPContainer .links .common-actions{\\r\\n\\r\\n \\r\\n color:#2D3A54;\\r\\n height: 157px;\\r\\n background-color: #ffffff;\\r\\n margin-left: 15px;\\r\\n margin-right: 15px;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n border-radius: 6px;\\r\\n /* width:158px; */\\r\\n \\r\\n}\\r\\n.common-actions .img-parent{\\r\\n display: block;\\r\\n margin: auto;\\r\\n}\\r\\n.common-actions .common-action-img{\\r\\n\\r\\n position: relative;\\r\\n top: -60px;\\r\\n}\\r\\n.message-wp .modWPContainer .links .common-actions .common-actions-card {\\r\\n font-family: 'open_sans_hebrewbold';\\r\\n text-align: center;\\r\\n margin: auto;\\r\\n position: relative;\\r\\n top: -25%;\\r\\n line-height:26px;\\r\\n}\\r\\n.links-warpper{\\r\\n display: flex;\\r\\n\\r\\n flex-direction: row;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n text-align: center;\\r\\n z-index: 9999;\\r\\n}\\r\\n.links .common-actions a{\\r\\n color:#2D3A54;\\r\\n}\\r\\n.modWPLinks h2\\r\\n{\\r\\n color:#30526c;\\r\\n margin-top:40px;\\r\\n margin-bottom: 10px;\\r\\n font-size: 36px;\\r\\n}\\r\\n.modWPLinks .card-body\\r\\n{\\r\\n position: absolute;\\r\\n background-color: #223b4f;\\r\\n top:34px;\\r\\n right: 24px;\\r\\n color:#fff;\\r\\n width:55%;\\r\\n height: 267px;\\r\\n}\\r\\n.col-md-3.common-actions{\\r\\n width: 20%;\\r\\n}\\r\\n.modWPLinks .card-text\\r\\n{\\r\\n columns: #e0e0e0;\\r\\n line-height: normal;\\r\\n}\\r\\n.modWPLinks .card-icon span{\\r\\n padding-right: 10px;\\r\\n vertical-align: middle;\\r\\n}\\r\\n.modWPLinks .card-link\\r\\n{\\r\\n background-color: #f7bb49;\\r\\n position: absolute;\\r\\n top: 267px;\\r\\n right: 59px;\\r\\n width:215px;\\r\\n height: 60px;\\r\\n}\\r\\n.modWPLinks .link-text\\r\\n{\\r\\n color:#223b4f;\\r\\n font-size: 20px;\\r\\n padding-top: 16px;\\r\\n text-align: center;\\r\\n}\\r\\n\\r\\nimg.additionaLinks{margin-top: 50px}\\r\\n@media (min-width:1801px)\\r\\n{\\r\\n .message-wp .modWPContainer .links .common-actions{\\r\\n padding-left: 15px;\\r\\n padding-right: 15px;\\r\\n font-size: 20px;\\r\\n }\\r\\n}\\r\\n@media (max-width:1800px)\\r\\n{\\r\\n .common-actions{\\r\\n font-size: 16px;\\r\\n padding-left: 0px ; \\r\\n padding-right: 0px ;\\r\\n }\\r\\n .common-actions .img-parent img{\\r\\n width: 96px;\\r\\n height: 96px;\\r\\n \\r\\n }\\r\\n}\\r\\n\\r\\n@media (max-width:960px)\\r\\n{\\r\\n .links{\\r\\n top: 0px;\\r\\n position: relative;\\r\\n background-color: #051433;\\r\\n }\\r\\n .links-warpper{\\r\\n display: flex;\\r\\n overflow-x: auto;\\r\\n overflow-y: none;\\r\\n min-width: 360px;\\r\\n height: 200px;\\r\\n justify-content: unset;\\r\\n }\\r\\n /* .common-actions{\\r\\n flex-shrink: 0;\\r\\n \\r\\n width: 106px;\\r\\n height: 106px;\\r\\n } */\\r\\n .common-actions .img-parent img{\\r\\n position: relative;\\r\\n top: -30px;\\r\\n width: 62px;\\r\\n height: 62px;\\r\\n }\\r\\n\\r\\n img.additionaLinks{display:block;margin-right:auto;margin-left:auto}\\r\\n .message-wp .modWPContainer .links .common-actions{\\r\\n flex-shrink: 0;\\r\\n /* width: 140px; */\\r\\n /* width: 106px; */\\r\\n height: 130px;\\r\\n font-size: 14px;\\r\\n font-weight: 700;\\r\\n }\\r\\n .message-wp .modWPContainer .links .common-actions .common-actions-card{\\r\\n top: -25%;\\r\\n }\\r\\n}\\r\\n/* @media (min-width:760px) */\\r\\n\\r\\n@media (min-width:961px) {\\r\\n .top-links-wrapper{\\r\\n width: 100%;\\r\\n position: relative;\\r\\n min-height: 1px;\\r\\n float: left;\\r\\n\\r\\n } \\r\\n}\\r\\n\\r\\n.common-actions.col-lg-2{\\r\\n margin: 40px 15px 0;\\r\\n }\\r\\n /* .common-actions.col-md-3{\\r\\n margin: 0px 15px 0;\\r\\n } */\", \"\"]);\n","exports = module.exports = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \".modWPMessages h2:lang(he) {\\r\\n color: #25465F;\\r\\n text-align: right;\\r\\n font-weight:300;\\r\\n font-size: 30px;\\r\\n\\r\\n}\\r\\n.modWPMessages h2:lang(en) {\\r\\n color: #182855;\\r\\n text-align: left;\\r\\n font-weight:300;\\r\\n font-size: 30px;\\r\\n\\r\\n}\\r\\n\\r\\n.newsCont img\\r\\n{ \\r\\n max-width: 210px; \\r\\n margin-right: auto;\\r\\n margin-left: auto;\\r\\n display: block;\\r\\n}\\r\\n.newsText:lang(he){\\r\\n margin-top:12px;\\r\\n min-height: 84px;\\r\\n max-height: 84px;\\r\\n overflow: hidden;\\r\\n max-width: 238px;\\r\\n color: #232A3A;\\r\\n font-size: 16px;\\r\\n line-height: 20px;\\r\\n margin-right: auto;\\r\\n margin-left: auto;\\r\\n text-align:right;\\r\\n padding-right: 12px;\\r\\n}\\r\\n.newsText p:lang(he),.newsText p:hover:lang(he){\\r\\n text-align: right !important;\\r\\n text-decoration:none;\\r\\n\\r\\n}\\r\\n\\r\\n\\r\\n.newsText:lang(en){margin-right: auto;margin-left: auto;padding-left: 12px;min-height: 95px;max-height:95px;overflow:hidden;max-width:238px; color:#232A3A;font-size:16px;text-align:left;line-height: 24px}\\r\\n.newsText p{padding: 0;margin: 0}\\r\\n.newsCont{border-bottom: 2px #182855 solid;margin-top:10px;box-shadow: 0 20px 45px 0 rgba(35,42,58,0.16);}\\r\\n.allNewsLink:lang(he),.allNewsLink:hover:lang(he),.allNewsLink:visited:lang(he)\\r\\n,.allNewsLink:lang(ar),.allNewsLink:hover:lang(ar),.allNewsLink:visited:lang(ar){\\r\\n bottom: 0;font-size: 16px;\\r\\n letter-spacing: 0.09px;\\r\\n color:#185EF1;\\r\\n text-align: right;\\r\\n}\\r\\n .allNewsLink:lang(en),.allNewsLink:hover:lang(en),.allNewsLink:visited:lang(en){\\r\\n bottom: 0;font-size: 16px;\\r\\n letter-spacing: 0.09px;\\r\\n color:#185EF1;\\r\\n text-align: left\\r\\n ;padding-right:5px}\\r\\n .allNewsLink:lang(en) i:before{font-size: 16px;padding-left: 5px}\\r\\n \\r\\n .newsDate:lang(he){color: #6D6D6d;font-size: 14px;text-align: right;letter-spacing: 0.07px;padding:8px 12px}\\r\\n .newsDate:lang(en){color: #6D6D6d;font-size: 16px;text-align: left;letter-spacing: 0.07px;padding-left: 10px}\\r\\n .message-pub{\\r\\n display: flex;\\r\\n /* flex-direction: column; */\\r\\n flex-flow: wrap;\\r\\n border-bottom-right-radius: 8px;\\r\\n border-bottom-left-radius: 8px;\\r\\n \\r\\n }\\r\\n .wp-messages{\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n }\\r\\n .wp-messages .message-title {\\r\\n font-size: 28px;\\r\\n color: #212121;\\r\\n font-weight: 700;\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n margin-bottom: 50px;\\r\\n position: relative;\\r\\n \\r\\n}\\r\\n\\r\\n.wp-messages .wp-title:before {\\r\\n content: '';\\r\\n width: 42px;\\r\\n height: 4px;\\r\\n background: #185EF1;\\r\\n position: absolute;\\r\\n bottom: -14px;\\r\\n}\\r\\n .message-pub .allNewsLink{\\r\\n /* position: absolute;\\r\\n bottom: 0px; */\\r\\n margin-left: 15px; \\r\\n }\\r\\n \\r\\n.message-pub .message-pub-child{\\r\\n background-color: #ffffff;\\r\\n border-radius: 8px; \\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n padding-bottom:20px;\\r\\n}\\r\\n.message-pub-child .allNewsLink{\\r\\n padding-right: 10px;\\r\\n margin-top: auto;\\r\\n}\\r\\n.message-pub .message-pub-child img\\r\\n{\\r\\n border-top-right-radius: 8px;\\r\\n border-top-left-radius: 8px;\\r\\n}\\r\\n.message-pub .card-title h3{\\r\\n /* padding: 0px 5px 15px; */\\r\\n margin: 20px 0;\\r\\n font-family: 'open_sans_hebrewbold' !important;\\r\\n font-size: 20px;\\r\\n line-height: 20px;\\r\\n}\\r\\n.message-pub .card-text{\\r\\n /* padding: 0px 5px 15px; */\\r\\n margin: 5px 0;\\r\\n font-family: 'opensanshebrew-regularregular';\\r\\n font-size: 16px;\\r\\n text-overflow: ellipsis;\\r\\n}\\r\\n.message-pub .card-text.card-date{\\r\\n color: #555F74;\\r\\n margin-bottom: 12px;\\r\\n font-size: 14px;\\r\\n}\\r\\n.col-md-4.message-pub.card{\\r\\n padding-left: 0px;\\r\\n padding-right: 0px;\\r\\n border-radius: 8px;\\r\\n}\\r\\n.Messages_first .message-pub-child i.fa{\\r\\n margin:0 10px;\\r\\n}\\r\\n.allNewsLink {\\r\\n font-size: 16px;\\r\\n font-family: 'open_sans_hebrewbold';\\r\\n margin-top: 8px;\\r\\n}\\r\\n/* @media screen and (min-width:768px) */\\r\\n @media screen and (min-width:1099px) \\r\\n/* @media screen and (max-width:1740px) */\\r\\n{\\r\\n .modWPMessages{\\r\\n min-height: 350px;\\r\\n height:350px;\\r\\n\\r\\n } \\r\\n .modWPMessages div{height:inherit}\\r\\n .message-allNewsLink{text-align: end;}\\r\\n .message-items{\\r\\n display: flex;\\r\\n /* flex-direction: column; */\\r\\n }\\r\\n .marqueeCont{ \\r\\n text-align: center;\\r\\n height: 350px;\\r\\n overflow:hidden;\\r\\n }\\r\\n \\r\\n .message-pub{\\r\\n width: 386px; \\r\\n margin-left: 15px;\\r\\n \\r\\n margin-bottom: 15px;\\r\\n }\\r\\n\\r\\n .message-pub-child .card-title{\\r\\n /* width:386px; */\\r\\n overflow:hidden;\\r\\n line-height: 2rem;\\r\\n max-height: 6rem;\\r\\n -webkit-box-orient: vertical;\\r\\n display: -webkit-box;\\r\\n overflow: hidden !important;\\r\\n text-overflow: ellipsis;\\r\\n -webkit-line-clamp: 2;\\r\\n }\\r\\n \\r\\n}\\r\\n@media screen and (min-width:1500px) {\\r\\n .message-items {\\r\\n flex-direction: row;\\r\\n }\\r\\n}\\r\\n@media screen and (min-width:1746px) \\r\\n{\\r\\n .message-items{\\r\\n flex-direction: row;\\r\\n }\\r\\n /* .col-lg-4.message-pub{\\r\\n margin-bottom: 15px;\\r\\n } */\\r\\n \\r\\n}\\r\\n/* @media screen and (max-width:768px) */\\r\\n.message-items >.col-lg-4.message-pub{\\r\\n padding-left: 0 !important;\\r\\n padding-right: 0 !important;\\r\\n}\\r\\n/* @media screen and (max-width:1100px) */\\r\\n@media screen and (max-width:1090px) \\r\\n{\\r\\n .message-wp{\\r\\n padding: 0px;\\r\\n }\\r\\n .wp-messages .message-title{\\r\\n display: flex;\\r\\n flex-direction: row; \\r\\n\\r\\n padding-left: 0px;\\r\\n padding-right: 0px;\\r\\n margin-bottom: 0px;\\r\\n font-size:20px;\\r\\n }\\r\\n .wp-messages .message-title .col-0{\\r\\n padding: 0px;\\r\\n }\\r\\n .allNewsLink:lang(en),.allNewsLink:hover:lang(en),.allNewsLink:visited:lang(en){\\r\\n /* position: absolute; */\\r\\n bottom: 0;font-size: 11px;font-weight:bold;letter-spacing: 0.09px;\\r\\n /* color:#182855; */\\r\\n \\r\\n /* width: 80%; */\\r\\n text-align: left;padding-right:5px}\\r\\n .allNewsLink:lang(en) i:before{font-size: 13px;padding-left: 5px}\\r\\n .allNewsLink .my-link, .allNewsLink .my-link:lang(en),.allNewsLink .my-link:hover:lang(en),.allNewsLink .my-link:visited:lang(en){ \\r\\n color: #185EF1;\\r\\n }\\r\\n .newsDate:lang(he){text-align: center}\\r\\n .modWPMessages .fa-arrow-left:before{font-size:12px;margin-right:5px;}\\r\\n .message-pub{\\r\\n margin-top: 20px;\\r\\n }\\r\\n .Messages_first .wp-messages {\\r\\n padding-left: 0px;\\r\\n padding-right: 0px;\\r\\n margin: 40px 0px 36px; \\r\\n }\\r\\n\\r\\n .Messages_first .wp-messages .message-title > .message-allNewsLink \\r\\n {\\r\\n padding-left: 0px;\\r\\n text-align: end;\\r\\n }\\r\\n .message-pub .card-title h3 {\\r\\n font-size:16px;\\r\\n font-size: 16px;\\r\\n /* width: 386px; */\\r\\n overflow: hidden;\\r\\n line-height: 2rem;\\r\\n max-height: 4rem;\\r\\n -webkit-box-orient: vertical;\\r\\n display: -webkit-box;\\r\\n overflow: hidden !important;\\r\\n text-overflow: ellipsis;\\r\\n -webkit-line-clamp: 2;\\r\\n }\\r\\n .Messages_first .wp-messages .message-title .wp-title {\\r\\n padding-right: 0px;\\r\\n }\\r\\n .Messages_first .wp-messages .message-title .wp-title:before{\\r\\n /* right: 0%;*/\\r\\n bottom: -8px;\\r\\n \\r\\n }\\r\\n .message-items{\\r\\n display: flex;\\r\\n flex-direction: column; \\r\\n padding: 0;\\r\\n }\\r\\n \\r\\n}\\r\\n\\r\\n\\r\\n\\r\\n \", \"\"]);\n","exports = module.exports = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \".wp-pagesLink{\\r\\n margin-top: 88px;\\r\\n}\\r\\n.wp-pagesLink .wp-title{\\r\\n font-size: 28px;\\r\\n color: #212121;\\r\\n font-weight: 700;\\r\\n font-family: 'open_sans_hebrewbold'; \\r\\n margin-bottom: 50px;\\r\\n position: relative;\\r\\n}\\r\\n.wp-pagesLink .wp-title:before{\\r\\n content: '';\\r\\n width:42px ;\\r\\n height: 4px;\\r\\n background:#185EF1 ;\\r\\n position: absolute;\\r\\n bottom: -14px;\\r\\n}\\r\\n.PagesLinksCont{\\r\\n display: flex;flex-direction: column;\\r\\n margin-bottom: 150px;\\r\\n}\\r\\n.pagesLinksWarpper:lang(he),.pagesLinksWarpper:lang(ar){\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n flex-wrap: wrap;\\r\\n\\r\\n}\\r\\n.pagesLinksWarpper:lang(en){\\r\\n display: flex;\\r\\n flex-direction:row-reverse;\\r\\n flex-wrap: wrap;\\r\\n\\r\\n}\\r\\n.pagesLinksItem.col-5{\\r\\n width:49% ; \\r\\n max-width: 49%;\\r\\n flex:0 0 49%;\\r\\n}\\r\\n.text-date{\\r\\n \\r\\n color: #7D8595;\\r\\n font-size: 14px;\\r\\n margin: 30px 0px 10px 0px;\\r\\n \\r\\n}\\r\\n.text-title{\\r\\n font-size: 18px;\\r\\n margin: 0px 0px 30px 0px;\\r\\n line-height: 24px;\\r\\n font-weight: 700;\\r\\n color: #051433;\\r\\n\\r\\n /* width: 320px; */\\r\\n overflow: hidden;\\r\\n max-height: 72px;\\r\\n -webkit-box-orient: vertical;\\r\\n display: -webkit-box;\\r\\n overflow: hidden !important;\\r\\n text-overflow: ellipsis;\\r\\n -webkit-line-clamp: 3;\\r\\n}\\r\\n.img-page-link:lang(he),.img-page-link:lang(ar){\\r\\n padding: 0px 0px 0px 0px;\\r\\n min-height: 89px;\\r\\n border-top-right-radius: 8px;\\r\\n border-bottom-right-radius: 8px;\\r\\n background-size: cover;\\r\\n object-fit: cover;\\r\\n justify-content: center;\\r\\n}\\r\\n.img-page-link:lang(en){\\r\\n padding: 0px 0px 0px 0px;\\r\\n min-height: 89px;\\r\\n border-top-left-radius: 8px;\\r\\n border-bottom-left-radius: 8px;\\r\\n background-size: cover;\\r\\n object-fit: cover;\\r\\n justify-content: center;\\r\\n}\\r\\n.pagesLinksItem:lang(he),.pagesLinksItem:lang(ar)\\r\\n {float:right;\\r\\n /* border-right: 4px #393E4D solid; */\\r\\n border-radius: 8px;\\r\\n margin-bottom:20px;\\r\\n min-height: 89px;\\r\\n padding: 0px 0px 0px 15px;\\r\\n background-color:#FFFFFF;box-shadow: 0 0 15px 0 rgba(0,0,0,0.1);\\r\\n /* padding-top:25px;padding-right: 25px; */\\r\\n}\\r\\n.pagesLinksItem:lang(en){\\r\\n /* border-right: 4px #393E4D solid; */\\r\\n \\r\\n border-radius: 8px;\\r\\n margin-bottom:20px;\\r\\n min-height: 89px;\\r\\n padding: 0px 0px 0px 15px;\\r\\n background-color:#FFFFFF;\\r\\n box-shadow: 0 0 15px 0 rgba(0,0,0,0.1);\\r\\n /* padding-top:25px;padding-left: 25px; */\\r\\n}\\r\\n\\r\\na .pagesTeaser:lang(he){float: right;text-overflow: ellipsis;white-space:nowrap;\\r\\n color: #232A3A;\\r\\n font-size: 18px;\\r\\n line-height: 24px;\\r\\n display: inline-block;\\r\\n text-align: right;\\r\\n max-width:50%;min-width:50%;overflow:hidden}\\r\\na .pagesTeaser:lang(en){\\r\\n font-size: 18px;\\r\\n line-height: 24px; \\r\\n float: left;\\r\\n text-overflow: ellipsis;\\r\\n white-space: nowrap;\\r\\n color: #232A3A;\\r\\n \\r\\n display: inline-block;\\r\\n \\r\\n text-align: left;\\r\\n max-width: 50%;\\r\\n min-width: 50%;\\r\\n overflow: hidden;}\\r\\n.articleLink:lang(he),.articleLink a:visited:lang(he){text-align: left;color:#0E72D5!important;font-size:16px;letter-spacing:0.07px;\\r\\n display: inline-block;width:47%;}\\r\\n .articleLink:lang(en),.articleLink a:visited:lang(en){text-align: right;color:#0E72D5!important;font-size:16px;letter-spacing:0.07px;\\r\\n display: inline-block;width:47%;}\\r\\n .articleLink a{font-weight:bold}\\r\\n .artTitle{font-weight: bold}\\r\\n .articleLink i:lang(he){margin-right:10px}\\r\\n .articleLink i:lang(en){margin-left:10px}\\r\\n .articleLink .fa-arrow-left:before{font-size:15px}\\r\\n /* @media (max-width:760px) */\\r\\n @media (max-width:960px)\\r\\n {\\r\\n .link-item{\\r\\n display: flex;\\r\\n flex-direction: row-reverse;\\r\\n }\\r\\n.pagesLinksItem.col-12:lang(en){\\r\\n \\r\\n padding-left:0px;\\r\\n }\\r\\n .wp-pagesLink .wp-title{\\r\\n font-size: 20px;\\r\\n }\\r\\n .text-title{\\r\\n width:210px;\\r\\n }\\r\\n}\\r\\n /* @media (min-width:760px) */\\r\\n @media (min-width:961px) \\r\\n {\\r\\n .pagesLinksItem.col-md-5{\\r\\n width:49% ; \\r\\n /* !important */\\r\\n max-width: 49%;\\r\\n flex:0 0 49%;\\r\\n }\\r\\n .pagesLinksWarpper .pagesLinksItem:nth-child(odd){\\r\\n margin-left: 15px;\\r\\n }\\r\\n .img-page-link{\\r\\n height: 100%;\\r\\n }\\r\\n .pagesLinksItem:lang(en){\\r\\n padding-left:0px ;\\r\\n }\\r\\n .link-item:lang(en) .col-md-9{\\r\\n float:right;\\r\\n /* display: flex;\\r\\n flex-direction: row-reverse; */\\r\\n } \\r\\n \\r\\n \\r\\n }\", \"\"]);\n","exports = module.exports = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \"\\r\\n.modal.show\\r\\n{\\r\\n display: block;\\r\\n\\r\\n}\\r\\n/* .modal{\\r\\n background-color: (0,0,0);\\r\\n background-color:(#051433,0.85);\\r\\n} */\\r\\n.modModal .modal-body\\r\\n{ color: black !important;\\r\\n font-size: 18px ;\\r\\n margin-bottom: 20px!important;\\r\\n}\\r\\n.modModal .btn-secondary \\r\\n{\\r\\n float:left;\\r\\n}\\r\\n.fade.show{\\r\\n opacity: 0.75;\\r\\n background: #051433; \\r\\n}\\r\\n.modal-dialog.modal-dialog-centered{\\r\\n z-index: 1100;\\r\\n \\r\\ncolor: #212121;\\r\\nfont-size: 20px;\\r\\nfont-weight: 700;\\r\\ndisplay: flex;\\r\\nflex-direction: column;\\r\\n\\r\\njustify-content: center;\\r\\nalign-items: stretch;\\r\\nposition: relative;\\r\\ntop: 43%;\\r\\n\\r\\n}\\r\\n.modal-content {\\r\\n padding: 40px;\\r\\n}\\r\\n.modal-body{\\r\\n text-align: center;\\r\\n}\\r\\n.modal-footer{\\r\\n border-top: none;\\r\\n text-align: center;\\r\\n align-items: center;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n margin-top: 30px;\\r\\n}\\r\\n.modal-footer .submitButModal{\\r\\n background-color: #185EF1;\\r\\n color: white;\\r\\n font-size: 16px;\\r\\n padding: 13px 28px;\\r\\n \\r\\n\\r\\n letter-spacing: 2px;\\r\\n border-radius: 2px;\\r\\n font-weight: 500;\\r\\n font-family: 'open_sans_hebrewbold';\\r\\n}\\r\\n\\r\\n/* @media screen and (min-width:767px) */\\r\\n@media screen and (min-width:961px)\\r\\n{\\r\\n .updateregistration #mod-modal-form{\\r\\n position: absolute;\\r\\n /* top: -1900px; */\\r\\n left: 30%;\\r\\n }\\r\\n .home-page-newsletter .updateregistration #mod-modal-form{\\r\\n \\r\\n top: -1900px;\\r\\n \\r\\n }\\r\\n}\\r\\n/* @media screen and (max-width:767px) */\\r\\n@media screen and (max-width:960px)\\r\\n{\\r\\n .news-letter-form> .updateregistration> div>div{\\r\\n width: 360px !important;\\r\\n }\\r\\n .modal-dialog{\\r\\n width: 100% !important; \\r\\n }\\r\\n}\", \"\"]);\n","exports = module.exports = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \"\\r\\n.dvCUTitle{font-size:18px;width:100%;font-weight:400;color:#182855;\\r\\n text-align: center;\\r\\n margin:0 0 55px 0;\\r\\n}\\r\\n/* .ContactUsForm{margin-top:50px} */\\r\\n.terrorSuspectForm{\\r\\n \\r\\n background-color:#F6F6F8;\\r\\n background-clip: content-box;\\r\\n \\r\\n}\\r\\n.modWPContactUs \\r\\n{\\r\\n display:-webkit-flex;\\r\\n /* display: flex; */\\r\\n position: relative;\\r\\n}\\r\\n.modWPContactUs h3\\r\\n{\\r\\n font-size: 40px;\\r\\n color:#1b4e79;\\r\\n font-family: Assistant_ExtraBold;\\r\\n}\\r\\n.modWPContactUs form\\r\\n{\\r\\n display: flex;\\r\\n flex-wrap: wrap;\\r\\n justify-content: space-between;\\r\\n}\\r\\n.contactUs60\\r\\n{\\r\\n flex:60%;\\r\\n}\\r\\n.contactUs40\\r\\n{\\r\\n flex:40%;\\r\\n}\\r\\n.ContactUs_second{\\r\\n margin-top:95px;\\r\\n}\\r\\n.ContactUs_second .wp-title{\\r\\n font-size: 28px;\\r\\n color: #212121;\\r\\n font-weight: 700;\\r\\n margin-bottom: 50px;\\r\\n position: relative;\\r\\n}\\r\\n.ContactUs_second .sub-wrapper{\\r\\n /* margin-bottom: 50px; */\\r\\n min-height: 40px;\\r\\n margin-bottom: 70px;\\r\\n}\\r\\n.ContactUs_second .sub-title{\\r\\n font-size: 20px;\\r\\n font-weight: 700;\\r\\n margin-bottom: 22px;\\r\\n}\\r\\n.ContactUs_second .contactus-text{\\r\\n font-size: 18px;\\r\\n font-weight: 400;\\r\\n /* margin-top: 24px; */\\r\\n}\\r\\n.ContactUsForm{\\r\\n background: white;\\r\\n border-radius: 14px;\\r\\n box-shadow: 0px 2px 8px rgb(5 20 51 / 4%);\\r\\n padding: 31px;\\r\\n}\\r\\n/* .ContactUsForm .dvCUTitle{} */\\r\\n.cu-field{\\r\\n line-height: 43px;\\r\\n font-size: 14px;\\r\\n}\\r\\n.cu-field input, .cu-field textarea,.cu-field input.input-background, .cu-field .contactus-input{\\r\\n background:#F6F9FE !important;\\r\\n border: 0.5px solid #D1DFFC;\\r\\n border-radius: 2px;\\r\\n}\\r\\n.contactus-text>a{\\r\\n text-decoration:underline;\\r\\n}\\r\\n.cu-field textarea{\\r\\n height: 120px;\\r\\n}\\r\\n.submitWrap{\\r\\n height: 43px;\\r\\n}\\r\\n\\r\\n.contact-us .submitBut.btn.btn-outline-secondary:lang(he), .contact-us .submitBut.btn.btn-outline-secondary:lang(ar) {\\r\\n position: absolute;\\r\\n bottom: 3px;\\r\\n left: 3px;\\r\\n background-color: #185EF1;\\r\\n color: white;\\r\\n margin-left: 12px;\\r\\n}\\r\\n.submitBut.btn.btn-outline-secondary:lang(en){\\r\\n position: absolute;\\r\\n bottom: 3px;\\r\\n right: 20px;\\r\\n background-color: #185EF1;\\r\\n color: white;\\r\\n margin-left: 12px;\\r\\n}\\r\\n/*.edit-mode-panel .secondaryPageTitle{\\r\\n display: none;\\r\\n}*/\\r\\n.centerIcon\\r\\n{\\r\\n position: absolute;\\r\\n width:60px;\\r\\n height: 60px;\\r\\n top:50%;\\r\\n left:50%;\\r\\n z-index: -1;\\r\\n}\\r\\n.fa-spinner\\r\\n{\\r\\n font-size: 50px;\\r\\n}\\r\\n.markedFields{font-size:20px;line-height:23px;color:#172642;letter-spacing:0.09px}\\r\\n.fa-star-of-life { /*color: red;*/\\r\\n color: #ff6363;\\r\\n font-size: 11px;\\r\\n margin-right: 5px\\r\\n}\\r\\n.fieldDivCU input:lang(en){margin-left: 0}\\r\\n.rowFieldDiv textarea:lang(en) {margin-left:0}\\r\\n.rowFieldDiv .inputMODEAdress:lang(he){margin-right:2%;}\\r\\n.rowFieldDiv .inputMODEAdress:lang(en){margin-left: 0}\\r\\n\\r\\n/* @media screen and (max-width:768px){ */\\r\\n @media screen and (max-width:960px){\\r\\n .form-contactus .form-contactus-container{\\r\\n display: flex;\\r\\n flex-direction: column-reverse; \\r\\n }\\r\\n .dvCUTitle{font-size:18px;line-height: 25px;}\\r\\n .fieldDivCU{width:100%}\\r\\n .modWPContactUs textarea{width: 90%}\\r\\n .modWPContactUs label\\r\\n {\\r\\n font-size: 14px;\\r\\n }\\r\\n\\r\\n}\\r\\n.error-border{\\r\\n border: solid thin red !important;\\r\\n}\", \"\"]);\n","exports = module.exports = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \"\\r\\n.terrorSuspectForm{\\r\\n /* background-color:#F6F6F8; */\\r\\n background-color:#F6F9F8;\\r\\n background-clip: content-box;\\r\\n}\\r\\n.updateregistration \\r\\n{\\r\\n display:-webkit-flex;\\r\\n display: -ms-flex;\\r\\n position: relative;\\r\\n padding:20px;\\r\\n}\\r\\n.updateregistration h3\\r\\n{\\r\\n font-size: 40px;\\r\\n color:#1b4e79;\\r\\n font-family: Assistant_ExtraBold;\\r\\n}\\r\\n\\r\\n.updateregistration form\\r\\n{\\r\\n flex-direction: row;\\r\\n flex-wrap: wrap;\\r\\n justify-content: space-between;\\r\\n}\\r\\n/* .updateregistration .fieldDiv{\\r\\n padding-left: 0px;\\r\\n padding-right: 0px; \\r\\n} */\\r\\n/* .fieldDiv.col-6{\\r\\n padding-right: 15px; \\r\\n}\\r\\n.updateregistration .fieldDiv.col-6:nth-child(2){\\r\\n \\r\\n padding-right: 0px; \\r\\n} */\\r\\n.news-letter-warapper{\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n color: white;\\r\\n text-align: center;\\r\\n margin: auto;\\r\\n}\\r\\n.news-letter-warapper .news-letter-Title{\\r\\n font-size: 28px;\\r\\n line-height: 30px;\\r\\n font-weight: 700;\\r\\n font-family: 'open_sans_hebrewbold';\\r\\n}\\r\\n.news-letter-warapper .news-letter-subTitle {\\r\\n font-size: 18px;\\r\\n font-weight: 400;\\r\\n margin: 8px;\\r\\n}\\r\\n.news-letter-warapper .registraion-form{\\r\\n display: flex;\\r\\n flex-shrink: inherit;\\r\\n flex-wrap: wrap;\\r\\n}\\r\\n.contactUs60\\r\\n{\\r\\n flex:60%;\\r\\n}\\r\\n.contactUs40\\r\\n{\\r\\n flex:40%;\\r\\n}\\r\\n.fieldDiv {\\r\\n \\r\\n margin-top: 15px;\\r\\n flex-basis:0;\\r\\n flex-grow:1;\\r\\n /* margin-right: 20px; */\\r\\n -ms-flex-basis:0;\\r\\n -ms-flex-grow:1;\\r\\n }\\r\\n.fieldDiv label{\\r\\n color: white;\\r\\n}\\r\\ninput[type=text]{\\r\\n background-color: rgba(255, 255, 255, 1);\\r\\n \\r\\n}\\r\\n\\r\\n.fieldDiv input{\\r\\n color: black;\\r\\n font-size: 22px !important;\\r\\n}\\r\\n.rowFieldDiv\\r\\n{\\r\\n flex:0 0 100%;\\r\\n flex:0 0 100%;\\r\\n}\\r\\nform:first-child .rowFieldDiv{\\r\\n margin-top: 15px;\\r\\n}\\r\\n.modWPIcons{\\r\\n margin-top: 0;\\r\\n}\\r\\n.updateregistration input\\r\\n{\\r\\n font-size:16px;\\r\\n /* width: 100%; */\\r\\n border:none;\\r\\n background-color: white;\\r\\n height: 26px;\\r\\n border-radius: 4px;\\r\\n display: block;\\r\\n margin-top: 10px;\\r\\n margin-bottom: 10px;\\r\\n /* border-bottom: 1px gray solid; */\\r\\n}\\r\\n.updateregistration input::placeholder\\r\\n{\\r\\n font-size: 16px;\\r\\n margin: 0 25px 15px 0;\\r\\n padding: 0px 21px 9px;\\r\\n color: #212121;\\r\\n}\\r\\ninput.inputMODEAdress{width:95% !important}\\r\\n.updateregistration label\\r\\n{\\r\\n font-size: 20px;\\r\\n color:#172642;\\r\\n font-family: Assistant_SemiBold;\\r\\n display: block;\\r\\n margin-right: 10px;\\r\\n}\\r\\n.updateregistration textarea\\r\\n{\\r\\n font-size: 16px;\\r\\n width: 95%;\\r\\n display: block;\\r\\n margin-top: 10px;\\r\\n margin-bottom: 10px;\\r\\n border-radius: 4px;\\r\\n border-color: #808080;\\r\\n border: none;\\r\\n border-bottom: 1px solid;\\r\\n}\\r\\n/* .updateregistration .registerBtn\\r\\n{\\r\\n flex-direction: row-reverse;\\r\\n flex-basis: 100%;\\r\\n margin-left: 0;\\r\\n \\r\\n} */\\r\\n.fieldDiv.input-group{\\r\\n position: relative;\\r\\n /* margin-right: 15px; */\\r\\n}\\r\\n/* .fieldDiv.input-group> */\\r\\n.updateregistration .submitBut.btn.btn-outline-secondary:lang(he),.updateregistration .submitBut.btn.btn-outline-secondary:lang(ar){\\r\\n\\r\\n position: absolute;\\r\\n bottom: 14px;\\r\\n left: 5px;\\r\\n background-color: #185EF1;\\r\\n color: white;\\r\\n\\r\\n padding-left: 16px;\\r\\n padding-bottom: 8px;\\r\\n padding-right: 16px;\\r\\n padding-top: 8px;\\r\\n}\\r\\n.updateregistration .submitBut.btn.btn-outline-secondary:lang(en) {\\r\\n position: absolute;\\r\\n /* bottom: 14px;\\r\\n right: 25px;*/\\r\\n bottom: 14px;\\r\\n right: 5px;\\r\\n background-color: #185EF1;\\r\\n color: white;\\r\\n padding: 8px 16px 8px 16px;\\r\\n}\\r\\ninput,textarea{margin-left: auto;margin-right: auto}\\r\\nbutton.submitBut\\r\\n{\\r\\n /* background-color: #44c4F3; */\\r\\n background-color: #185EF1;\\r\\n color:#182855;\\r\\n /* font-size: 20px; */\\r\\n /* width:250px; */\\r\\n cursor: pointer;\\r\\n border-radius: 3px;\\r\\n float: left;\\r\\n}\\r\\nbutton[disabled].submitBut\\r\\n{\\r\\n /* background-color:#44c4F3; */\\r\\n background-color: #185EF1;\\r\\n color:#182855;\\r\\n /* font-size: 20px; */\\r\\n /* width:250px; */\\r\\n cursor:not-allowed;\\r\\n border-radius: 3px;\\r\\n float: left;\\r\\n}\\r\\n.fieldDiv input{\\r\\n width: 100%;\\r\\n line-height: 43px;\\r\\n height: 49px;\\r\\n}\\r\\n.col-md-12.cu-field input, .col-md-12.cu-field textarea{\\r\\n width: 100%;\\r\\n}\\r\\n.col-md-12.cu-field:not(:first-child){\\r\\n margin-top: 16px;\\r\\n}\\r\\n.centerIcon\\r\\n{\\r\\n position: absolute;\\r\\n width:60px;\\r\\n height: 60px;\\r\\n top:50%;\\r\\n left:50%;\\r\\n z-index: -1;\\r\\n}\\r\\n.fa-spinner\\r\\n{\\r\\n font-size: 50px;\\r\\n}\\r\\n.fa-star-of-life {\\r\\n color: #ff6363;\\r\\n font-size: 11px;\\r\\n margin-right: 5px\\r\\n}\\r\\n.btn[disabled]{\\r\\n opacity: 1;\\r\\n}\\r\\n.news-letter-page-warapper{\\r\\n margin-top: 80px;\\r\\n font-size: 28px;\\r\\n line-height: 26px;\\r\\n color: #212121;\\r\\n /* float: right;\\r\\n */\\r\\n /* margin-top: 30px; */\\r\\n}\\r\\n.news-letter-page-title{\\r\\n /* margin-top: 80px; */\\r\\n text-align: right;\\r\\n float:right;\\r\\n color: #212121;\\r\\n font-weight: 700;\\r\\n}\\r\\n.news-letter-page-title:lang(en){\\r\\n /* margin-top: 80px; */\\r\\n text-align: left;\\r\\n float:left;\\r\\n \\r\\n}\\r\\n.news-letter-page-title:before {\\r\\n content: '';\\r\\n width: 42px;\\r\\n height: 4px;\\r\\n background: #185EF1;\\r\\n position: absolute;\\r\\n bottom: -14px;\\r\\n}\\r\\n.updateregistration .banner-button{\\r\\n font-weight:700;\\r\\n letter-spacing: 1.2px;\\r\\n font-size:16px;\\r\\n}\\r\\n\\r\\n/* .updateregistration .banner-button .fas.thin-icon::before{\\r\\n font-weight: 300;\\r\\n \\r\\n} */\\r\\n/* @media screen and (min-width:769px) */\\r\\n@media screen and (min-width:961px){\\r\\n .updateregistration .fieldDiv{\\r\\n padding-left: 0px;\\r\\n padding-right: 0px; \\r\\n }\\r\\n}\\r\\n/* @media screen and (max-width:768px){ */\\r\\n @media screen and (max-width:960px){\\r\\n .updateregistration label\\r\\n {\\r\\n font-size: 14px;\\r\\n }\\r\\n .fieldDiv{\\r\\n flex-basis: auto;\\r\\n /* padding-right:0px; */\\r\\n }\\r\\n \\r\\n .updateregistration \\r\\n{\\r\\n \\r\\n padding:20px 0px;\\r\\n}\\r\\n.updateregistration .registraion-form{\\r\\n padding: 0px;\\r\\n}\\r\\n.updateregistration .registraion-form input::placeholder\\r\\n{\\r\\n font-size: 13px;\\r\\n /* margin: 0 25px 15px 0; */\\r\\n padding: 14px 14px 14px;\\r\\n\\r\\n\\r\\n}\\r\\n.registraion-form .col-6 ,.registraion-form .col-md-3 {\\r\\n padding-right: 0px;\\r\\n padding-left: 0px;\\r\\n}\\r\\n/* .updateregistration .registraion-form .fieldDiv:nth-child(1) { */\\r\\n .updateregistration .registraion-form .fieldDiv:first-child{\\r\\n /* margin-right:15px; */\\r\\n /* padding-right: 7px; */\\r\\n}\\r\\n.updateregistration .registraion-form .fieldDiv:nth-child(2){\\r\\n /* margin-right:15px; */\\r\\n \\r\\n padding-left: 15px;\\r\\n}\\r\\n.fieldDiv.col-6{\\r\\n margin-bottom: 15px;\\r\\n}\\r\\n.updateregistration .registraion-form .fieldDiv:nth-child(2):lang(en){\\r\\n /* margin-right:15px; */\\r\\n \\r\\n padding-left: 0px;\\r\\n padding-right: 15px;\\r\\n}\\r\\n.news-letter-warapper .news-letter-Title{\\r\\n font-size: 20px;\\r\\n line-height: 28px;\\r\\n \\r\\n \\r\\n}\\r\\n .updateregistration input\\r\\n {\\r\\n margin-top: 0px;\\r\\n margin-bottom: 0px;\\r\\n height: 49px;\\r\\n }\\r\\n .updateregistration .submitBut.btn.btn-outline-secondary:lang(he),\\r\\n .updateregistration .submitBut.btn.btn-outline-secondary:lang(ar),\\r\\n .updateregistration .submitBut.btn.btn-outline-secondary:lang(en){\\r\\n bottom: 4px;\\r\\n \\r\\n }\\r\\n .updateregistration .submitBut.btn.btn-outline-secondary:lang(en) {\\r\\n right:5px;\\r\\n }\\r\\n .news-letter-page-warapper{\\r\\n margin-top: 100px;\\r\\n }\\r\\n}\\r\\n\\r\\n.error-border{\\r\\n border: solid 2px red !important;\\r\\n}\", \"\"]);\n","\"use strict\";\r\n/*\r\n MIT License http://www.opensource.org/licenses/mit-license.php\r\n Author Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\n// eslint-disable-next-line func-names\r\nmodule.exports = function (useSourceMap) {\r\n var list = []; // return the list of modules as css string\r\n list.toString = function toString() {\r\n return this.map(function (item) {\r\n var content = cssWithMappingToString(item, useSourceMap);\r\n if (item[2]) {\r\n return \"@media \".concat(item[2], \"{\").concat(content, \"}\");\r\n }\r\n return content;\r\n }).join('');\r\n }; // import a list of modules into the list\r\n // eslint-disable-next-line func-names\r\n list.i = function (modules, mediaQuery) {\r\n if (typeof modules === 'string') {\r\n // eslint-disable-next-line no-param-reassign\r\n modules = [[null, modules, '']];\r\n }\r\n var alreadyImportedModules = {};\r\n for (var i = 0; i < this.length; i++) {\r\n // eslint-disable-next-line prefer-destructuring\r\n var id = this[i][0];\r\n if (id != null) {\r\n alreadyImportedModules[id] = true;\r\n }\r\n }\r\n for (var _i = 0; _i < modules.length; _i++) {\r\n var item = modules[_i]; // skip already imported module\r\n // this implementation is not 100% perfect for weird media query combinations\r\n // when a module is imported multiple times with different media queries.\r\n // I hope this will never occur (Hey this way we have smaller bundles)\r\n if (item[0] == null || !alreadyImportedModules[item[0]]) {\r\n if (mediaQuery && !item[2]) {\r\n item[2] = mediaQuery;\r\n } else if (mediaQuery) {\r\n item[2] = \"(\".concat(item[2], \") and (\").concat(mediaQuery, \")\");\r\n }\r\n list.push(item);\r\n }\r\n }\r\n };\r\n return list;\r\n};\r\nfunction cssWithMappingToString(item, useSourceMap) {\r\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\r\n var cssMapping = item[3];\r\n if (!cssMapping) {\r\n return content;\r\n }\r\n if (useSourceMap && typeof btoa === 'function') {\r\n var sourceMapping = toComment(cssMapping);\r\n var sourceURLs = cssMapping.sources.map(function (source) {\r\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot).concat(source, \" */\");\r\n });\r\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\r\n }\r\n return [content].join('\\n');\r\n} // Adapted from convert-source-map (MIT)\r\nfunction toComment(sourceMap) {\r\n // eslint-disable-next-line no-undef\r\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\r\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\r\n return \"/*# \".concat(data, \" */\");\r\n}\r\n","export default function addLeadingZeros(number, targetLength) {\r\n var sign = number < 0 ? '-' : '';\r\n var output = Math.abs(number).toString();\r\n while (output.length < targetLength) {\r\n output = '0' + output;\r\n }\r\n return sign + output;\r\n}\r\n","export default function assign(target, dirtyObject) {\r\n if (target == null) {\r\n throw new TypeError('assign requires that input parameter not be null or undefined');\r\n }\r\n dirtyObject = dirtyObject || {};\r\n for (var property in dirtyObject) {\r\n if (dirtyObject.hasOwnProperty(property)) {\r\n target[property] = dirtyObject[property];\r\n }\r\n }\r\n return target;\r\n}\r\n","import assign from '../assign/index.js';\r\nexport default function cloneObject(dirtyObject) {\r\n return assign({}, dirtyObject);\r\n}\r\n","import lightFormatters from '../lightFormatters/index.js';\r\nimport getUTCDayOfYear from '../../../_lib/getUTCDayOfYear/index.js';\r\nimport getUTCISOWeek from '../../../_lib/getUTCISOWeek/index.js';\r\nimport getUTCISOWeekYear from '../../../_lib/getUTCISOWeekYear/index.js';\r\nimport getUTCWeek from '../../../_lib/getUTCWeek/index.js';\r\nimport getUTCWeekYear from '../../../_lib/getUTCWeekYear/index.js';\r\nimport addLeadingZeros from '../../addLeadingZeros/index.js';\r\nvar dayPeriodEnum = {\r\n am: 'am',\r\n pm: 'pm',\r\n midnight: 'midnight',\r\n noon: 'noon',\r\n morning: 'morning',\r\n afternoon: 'afternoon',\r\n evening: 'evening',\r\n night: 'night'\r\n /*\r\n * | | Unit | | Unit |\r\n * |-----|--------------------------------|-----|--------------------------------|\r\n * | a | AM, PM | A* | Milliseconds in day |\r\n * | b | AM, PM, noon, midnight | B | Flexible day period |\r\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\r\n * | d | Day of month | D | Day of year |\r\n * | e | Local day of week | E | Day of week |\r\n * | f | | F* | Day of week in month |\r\n * | g* | Modified Julian day | G | Era |\r\n * | h | Hour [1-12] | H | Hour [0-23] |\r\n * | i! | ISO day of week | I! | ISO week of year |\r\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\r\n * | k | Hour [1-24] | K | Hour [0-11] |\r\n * | l* | (deprecated) | L | Stand-alone month |\r\n * | m | Minute | M | Month |\r\n * | n | | N | |\r\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\r\n * | p! | Long localized time | P! | Long localized date |\r\n * | q | Stand-alone quarter | Q | Quarter |\r\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\r\n * | s | Second | S | Fraction of second |\r\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\r\n * | u | Extended year | U* | Cyclic year |\r\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\r\n * | w | Local week of year | W* | Week of month |\r\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\r\n * | y | Year (abs) | Y | Local week-numbering year |\r\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\r\n *\r\n * Letters marked by * are not implemented but reserved by Unicode standard.\r\n *\r\n * Letters marked by ! are non-standard, but implemented by date-fns:\r\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\r\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\r\n * i.e. 7 for Sunday, 1 for Monday, etc.\r\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\r\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\r\n * `R` is supposed to be used in conjunction with `I` and `i`\r\n * for universal ISO week-numbering date, whereas\r\n * `Y` is supposed to be used in conjunction with `w` and `e`\r\n * for week-numbering date specific to the locale.\r\n * - `P` is long localized date format\r\n * - `p` is long localized time format\r\n */\r\n};\r\nvar formatters = {\r\n // Era\r\n G: function (date, token, localize) {\r\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\r\n switch (token) {\r\n // AD, BC\r\n case 'G':\r\n case 'GG':\r\n case 'GGG':\r\n return localize.era(era, {\r\n width: 'abbreviated'\r\n });\r\n // A, B\r\n case 'GGGGG':\r\n return localize.era(era, {\r\n width: 'narrow'\r\n });\r\n // Anno Domini, Before Christ\r\n case 'GGGG':\r\n default:\r\n return localize.era(era, {\r\n width: 'wide'\r\n });\r\n }\r\n },\r\n // Year\r\n y: function (date, token, localize) {\r\n // Ordinal number\r\n if (token === 'yo') {\r\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\r\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\r\n return localize.ordinalNumber(year, {\r\n unit: 'year'\r\n });\r\n }\r\n return lightFormatters.y(date, token);\r\n },\r\n // Local week-numbering year\r\n Y: function (date, token, localize, options) {\r\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\r\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\r\n if (token === 'YY') {\r\n var twoDigitYear = weekYear % 100;\r\n return addLeadingZeros(twoDigitYear, 2);\r\n } // Ordinal number\r\n if (token === 'Yo') {\r\n return localize.ordinalNumber(weekYear, {\r\n unit: 'year'\r\n });\r\n } // Padding\r\n return addLeadingZeros(weekYear, token.length);\r\n },\r\n // ISO week-numbering year\r\n R: function (date, token) {\r\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\r\n return addLeadingZeros(isoWeekYear, token.length);\r\n },\r\n // Extended year. This is a single number designating the year of this calendar system.\r\n // The main difference between `y` and `u` localizers are B.C. years:\r\n // | Year | `y` | `u` |\r\n // |------|-----|-----|\r\n // | AC 1 | 1 | 1 |\r\n // | BC 1 | 1 | 0 |\r\n // | BC 2 | 2 | -1 |\r\n // Also `yy` always returns the last two digits of a year,\r\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\r\n u: function (date, token) {\r\n var year = date.getUTCFullYear();\r\n return addLeadingZeros(year, token.length);\r\n },\r\n // Quarter\r\n Q: function (date, token, localize) {\r\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\r\n switch (token) {\r\n // 1, 2, 3, 4\r\n case 'Q':\r\n return String(quarter);\r\n // 01, 02, 03, 04\r\n case 'QQ':\r\n return addLeadingZeros(quarter, 2);\r\n // 1st, 2nd, 3rd, 4th\r\n case 'Qo':\r\n return localize.ordinalNumber(quarter, {\r\n unit: 'quarter'\r\n });\r\n // Q1, Q2, Q3, Q4\r\n case 'QQQ':\r\n return localize.quarter(quarter, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n });\r\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\r\n case 'QQQQQ':\r\n return localize.quarter(quarter, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // 1st quarter, 2nd quarter, ...\r\n case 'QQQQ':\r\n default:\r\n return localize.quarter(quarter, {\r\n width: 'wide',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n // Stand-alone quarter\r\n q: function (date, token, localize) {\r\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\r\n switch (token) {\r\n // 1, 2, 3, 4\r\n case 'q':\r\n return String(quarter);\r\n // 01, 02, 03, 04\r\n case 'qq':\r\n return addLeadingZeros(quarter, 2);\r\n // 1st, 2nd, 3rd, 4th\r\n case 'qo':\r\n return localize.ordinalNumber(quarter, {\r\n unit: 'quarter'\r\n });\r\n // Q1, Q2, Q3, Q4\r\n case 'qqq':\r\n return localize.quarter(quarter, {\r\n width: 'abbreviated',\r\n context: 'standalone'\r\n });\r\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\r\n case 'qqqqq':\r\n return localize.quarter(quarter, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n // 1st quarter, 2nd quarter, ...\r\n case 'qqqq':\r\n default:\r\n return localize.quarter(quarter, {\r\n width: 'wide',\r\n context: 'standalone'\r\n });\r\n }\r\n },\r\n // Month\r\n M: function (date, token, localize) {\r\n var month = date.getUTCMonth();\r\n switch (token) {\r\n case 'M':\r\n case 'MM':\r\n return lightFormatters.M(date, token);\r\n // 1st, 2nd, ..., 12th\r\n case 'Mo':\r\n return localize.ordinalNumber(month + 1, {\r\n unit: 'month'\r\n });\r\n // Jan, Feb, ..., Dec\r\n case 'MMM':\r\n return localize.month(month, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n });\r\n // J, F, ..., D\r\n case 'MMMMM':\r\n return localize.month(month, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // January, February, ..., December\r\n case 'MMMM':\r\n default:\r\n return localize.month(month, {\r\n width: 'wide',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n // Stand-alone month\r\n L: function (date, token, localize) {\r\n var month = date.getUTCMonth();\r\n switch (token) {\r\n // 1, 2, ..., 12\r\n case 'L':\r\n return String(month + 1);\r\n // 01, 02, ..., 12\r\n case 'LL':\r\n return addLeadingZeros(month + 1, 2);\r\n // 1st, 2nd, ..., 12th\r\n case 'Lo':\r\n return localize.ordinalNumber(month + 1, {\r\n unit: 'month'\r\n });\r\n // Jan, Feb, ..., Dec\r\n case 'LLL':\r\n return localize.month(month, {\r\n width: 'abbreviated',\r\n context: 'standalone'\r\n });\r\n // J, F, ..., D\r\n case 'LLLLL':\r\n return localize.month(month, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n // January, February, ..., December\r\n case 'LLLL':\r\n default:\r\n return localize.month(month, {\r\n width: 'wide',\r\n context: 'standalone'\r\n });\r\n }\r\n },\r\n // Local week of year\r\n w: function (date, token, localize, options) {\r\n var week = getUTCWeek(date, options);\r\n if (token === 'wo') {\r\n return localize.ordinalNumber(week, {\r\n unit: 'week'\r\n });\r\n }\r\n return addLeadingZeros(week, token.length);\r\n },\r\n // ISO week of year\r\n I: function (date, token, localize) {\r\n var isoWeek = getUTCISOWeek(date);\r\n if (token === 'Io') {\r\n return localize.ordinalNumber(isoWeek, {\r\n unit: 'week'\r\n });\r\n }\r\n return addLeadingZeros(isoWeek, token.length);\r\n },\r\n // Day of the month\r\n d: function (date, token, localize) {\r\n if (token === 'do') {\r\n return localize.ordinalNumber(date.getUTCDate(), {\r\n unit: 'date'\r\n });\r\n }\r\n return lightFormatters.d(date, token);\r\n },\r\n // Day of year\r\n D: function (date, token, localize) {\r\n var dayOfYear = getUTCDayOfYear(date);\r\n if (token === 'Do') {\r\n return localize.ordinalNumber(dayOfYear, {\r\n unit: 'dayOfYear'\r\n });\r\n }\r\n return addLeadingZeros(dayOfYear, token.length);\r\n },\r\n // Day of week\r\n E: function (date, token, localize) {\r\n var dayOfWeek = date.getUTCDay();\r\n switch (token) {\r\n // Tue\r\n case 'E':\r\n case 'EE':\r\n case 'EEE':\r\n return localize.day(dayOfWeek, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n });\r\n // T\r\n case 'EEEEE':\r\n return localize.day(dayOfWeek, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // Tu\r\n case 'EEEEEE':\r\n return localize.day(dayOfWeek, {\r\n width: 'short',\r\n context: 'formatting'\r\n });\r\n // Tuesday\r\n case 'EEEE':\r\n default:\r\n return localize.day(dayOfWeek, {\r\n width: 'wide',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n // Local day of week\r\n e: function (date, token, localize, options) {\r\n var dayOfWeek = date.getUTCDay();\r\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\r\n switch (token) {\r\n // Numerical value (Nth day of week with current locale or weekStartsOn)\r\n case 'e':\r\n return String(localDayOfWeek);\r\n // Padded numerical value\r\n case 'ee':\r\n return addLeadingZeros(localDayOfWeek, 2);\r\n // 1st, 2nd, ..., 7th\r\n case 'eo':\r\n return localize.ordinalNumber(localDayOfWeek, {\r\n unit: 'day'\r\n });\r\n case 'eee':\r\n return localize.day(dayOfWeek, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n });\r\n // T\r\n case 'eeeee':\r\n return localize.day(dayOfWeek, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // Tu\r\n case 'eeeeee':\r\n return localize.day(dayOfWeek, {\r\n width: 'short',\r\n context: 'formatting'\r\n });\r\n // Tuesday\r\n case 'eeee':\r\n default:\r\n return localize.day(dayOfWeek, {\r\n width: 'wide',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n // Stand-alone local day of week\r\n c: function (date, token, localize, options) {\r\n var dayOfWeek = date.getUTCDay();\r\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\r\n switch (token) {\r\n // Numerical value (same as in `e`)\r\n case 'c':\r\n return String(localDayOfWeek);\r\n // Padded numerical value\r\n case 'cc':\r\n return addLeadingZeros(localDayOfWeek, token.length);\r\n // 1st, 2nd, ..., 7th\r\n case 'co':\r\n return localize.ordinalNumber(localDayOfWeek, {\r\n unit: 'day'\r\n });\r\n case 'ccc':\r\n return localize.day(dayOfWeek, {\r\n width: 'abbreviated',\r\n context: 'standalone'\r\n });\r\n // T\r\n case 'ccccc':\r\n return localize.day(dayOfWeek, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n // Tu\r\n case 'cccccc':\r\n return localize.day(dayOfWeek, {\r\n width: 'short',\r\n context: 'standalone'\r\n });\r\n // Tuesday\r\n case 'cccc':\r\n default:\r\n return localize.day(dayOfWeek, {\r\n width: 'wide',\r\n context: 'standalone'\r\n });\r\n }\r\n },\r\n // ISO day of week\r\n i: function (date, token, localize) {\r\n var dayOfWeek = date.getUTCDay();\r\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\r\n switch (token) {\r\n // 2\r\n case 'i':\r\n return String(isoDayOfWeek);\r\n // 02\r\n case 'ii':\r\n return addLeadingZeros(isoDayOfWeek, token.length);\r\n // 2nd\r\n case 'io':\r\n return localize.ordinalNumber(isoDayOfWeek, {\r\n unit: 'day'\r\n });\r\n // Tue\r\n case 'iii':\r\n return localize.day(dayOfWeek, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n });\r\n // T\r\n case 'iiiii':\r\n return localize.day(dayOfWeek, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // Tu\r\n case 'iiiiii':\r\n return localize.day(dayOfWeek, {\r\n width: 'short',\r\n context: 'formatting'\r\n });\r\n // Tuesday\r\n case 'iiii':\r\n default:\r\n return localize.day(dayOfWeek, {\r\n width: 'wide',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n // AM or PM\r\n a: function (date, token, localize) {\r\n var hours = date.getUTCHours();\r\n var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\r\n switch (token) {\r\n case 'a':\r\n case 'aa':\r\n case 'aaa':\r\n return localize.dayPeriod(dayPeriodEnumValue, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n });\r\n case 'aaaaa':\r\n return localize.dayPeriod(dayPeriodEnumValue, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n case 'aaaa':\r\n default:\r\n return localize.dayPeriod(dayPeriodEnumValue, {\r\n width: 'wide',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n // AM, PM, midnight, noon\r\n b: function (date, token, localize) {\r\n var hours = date.getUTCHours();\r\n var dayPeriodEnumValue;\r\n if (hours === 12) {\r\n dayPeriodEnumValue = dayPeriodEnum.noon;\r\n } else if (hours === 0) {\r\n dayPeriodEnumValue = dayPeriodEnum.midnight;\r\n } else {\r\n dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\r\n }\r\n switch (token) {\r\n case 'b':\r\n case 'bb':\r\n case 'bbb':\r\n return localize.dayPeriod(dayPeriodEnumValue, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n });\r\n case 'bbbbb':\r\n return localize.dayPeriod(dayPeriodEnumValue, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n case 'bbbb':\r\n default:\r\n return localize.dayPeriod(dayPeriodEnumValue, {\r\n width: 'wide',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n // in the morning, in the afternoon, in the evening, at night\r\n B: function (date, token, localize) {\r\n var hours = date.getUTCHours();\r\n var dayPeriodEnumValue;\r\n if (hours >= 17) {\r\n dayPeriodEnumValue = dayPeriodEnum.evening;\r\n } else if (hours >= 12) {\r\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\r\n } else if (hours >= 4) {\r\n dayPeriodEnumValue = dayPeriodEnum.morning;\r\n } else {\r\n dayPeriodEnumValue = dayPeriodEnum.night;\r\n }\r\n switch (token) {\r\n case 'B':\r\n case 'BB':\r\n case 'BBB':\r\n return localize.dayPeriod(dayPeriodEnumValue, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n });\r\n case 'BBBBB':\r\n return localize.dayPeriod(dayPeriodEnumValue, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n case 'BBBB':\r\n default:\r\n return localize.dayPeriod(dayPeriodEnumValue, {\r\n width: 'wide',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n // Hour [1-12]\r\n h: function (date, token, localize) {\r\n if (token === 'ho') {\r\n var hours = date.getUTCHours() % 12;\r\n if (hours === 0) hours = 12;\r\n return localize.ordinalNumber(hours, {\r\n unit: 'hour'\r\n });\r\n }\r\n return lightFormatters.h(date, token);\r\n },\r\n // Hour [0-23]\r\n H: function (date, token, localize) {\r\n if (token === 'Ho') {\r\n return localize.ordinalNumber(date.getUTCHours(), {\r\n unit: 'hour'\r\n });\r\n }\r\n return lightFormatters.H(date, token);\r\n },\r\n // Hour [0-11]\r\n K: function (date, token, localize) {\r\n var hours = date.getUTCHours() % 12;\r\n if (token === 'Ko') {\r\n return localize.ordinalNumber(hours, {\r\n unit: 'hour'\r\n });\r\n }\r\n return addLeadingZeros(hours, token.length);\r\n },\r\n // Hour [1-24]\r\n k: function (date, token, localize) {\r\n var hours = date.getUTCHours();\r\n if (hours === 0) hours = 24;\r\n if (token === 'ko') {\r\n return localize.ordinalNumber(hours, {\r\n unit: 'hour'\r\n });\r\n }\r\n return addLeadingZeros(hours, token.length);\r\n },\r\n // Minute\r\n m: function (date, token, localize) {\r\n if (token === 'mo') {\r\n return localize.ordinalNumber(date.getUTCMinutes(), {\r\n unit: 'minute'\r\n });\r\n }\r\n return lightFormatters.m(date, token);\r\n },\r\n // Second\r\n s: function (date, token, localize) {\r\n if (token === 'so') {\r\n return localize.ordinalNumber(date.getUTCSeconds(), {\r\n unit: 'second'\r\n });\r\n }\r\n return lightFormatters.s(date, token);\r\n },\r\n // Fraction of second\r\n S: function (date, token) {\r\n return lightFormatters.S(date, token);\r\n },\r\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\r\n X: function (date, token, _localize, options) {\r\n var originalDate = options._originalDate || date;\r\n var timezoneOffset = originalDate.getTimezoneOffset();\r\n if (timezoneOffset === 0) {\r\n return 'Z';\r\n }\r\n switch (token) {\r\n // Hours and optional minutes\r\n case 'X':\r\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\r\n // Hours, minutes and optional seconds without `:` delimiter\r\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\r\n // so this token always has the same output as `XX`\r\n case 'XXXX':\r\n case 'XX':\r\n // Hours and minutes without `:` delimiter\r\n return formatTimezone(timezoneOffset);\r\n // Hours, minutes and optional seconds with `:` delimiter\r\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\r\n // so this token always has the same output as `XXX`\r\n case 'XXXXX':\r\n case 'XXX': // Hours and minutes with `:` delimiter\r\n default:\r\n return formatTimezone(timezoneOffset, ':');\r\n }\r\n },\r\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\r\n x: function (date, token, _localize, options) {\r\n var originalDate = options._originalDate || date;\r\n var timezoneOffset = originalDate.getTimezoneOffset();\r\n switch (token) {\r\n // Hours and optional minutes\r\n case 'x':\r\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\r\n // Hours, minutes and optional seconds without `:` delimiter\r\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\r\n // so this token always has the same output as `xx`\r\n case 'xxxx':\r\n case 'xx':\r\n // Hours and minutes without `:` delimiter\r\n return formatTimezone(timezoneOffset);\r\n // Hours, minutes and optional seconds with `:` delimiter\r\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\r\n // so this token always has the same output as `xxx`\r\n case 'xxxxx':\r\n case 'xxx': // Hours and minutes with `:` delimiter\r\n default:\r\n return formatTimezone(timezoneOffset, ':');\r\n }\r\n },\r\n // Timezone (GMT)\r\n O: function (date, token, _localize, options) {\r\n var originalDate = options._originalDate || date;\r\n var timezoneOffset = originalDate.getTimezoneOffset();\r\n switch (token) {\r\n // Short\r\n case 'O':\r\n case 'OO':\r\n case 'OOO':\r\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\r\n // Long\r\n case 'OOOO':\r\n default:\r\n return 'GMT' + formatTimezone(timezoneOffset, ':');\r\n }\r\n },\r\n // Timezone (specific non-location)\r\n z: function (date, token, _localize, options) {\r\n var originalDate = options._originalDate || date;\r\n var timezoneOffset = originalDate.getTimezoneOffset();\r\n switch (token) {\r\n // Short\r\n case 'z':\r\n case 'zz':\r\n case 'zzz':\r\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\r\n // Long\r\n case 'zzzz':\r\n default:\r\n return 'GMT' + formatTimezone(timezoneOffset, ':');\r\n }\r\n },\r\n // Seconds timestamp\r\n t: function (date, token, _localize, options) {\r\n var originalDate = options._originalDate || date;\r\n var timestamp = Math.floor(originalDate.getTime() / 1000);\r\n return addLeadingZeros(timestamp, token.length);\r\n },\r\n // Milliseconds timestamp\r\n T: function (date, token, _localize, options) {\r\n var originalDate = options._originalDate || date;\r\n var timestamp = originalDate.getTime();\r\n return addLeadingZeros(timestamp, token.length);\r\n }\r\n};\r\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\r\n var sign = offset > 0 ? '-' : '+';\r\n var absOffset = Math.abs(offset);\r\n var hours = Math.floor(absOffset / 60);\r\n var minutes = absOffset % 60;\r\n if (minutes === 0) {\r\n return sign + String(hours);\r\n }\r\n var delimiter = dirtyDelimiter || '';\r\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\r\n}\r\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\r\n if (offset % 60 === 0) {\r\n var sign = offset > 0 ? '-' : '+';\r\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\r\n }\r\n return formatTimezone(offset, dirtyDelimiter);\r\n}\r\nfunction formatTimezone(offset, dirtyDelimiter) {\r\n var delimiter = dirtyDelimiter || '';\r\n var sign = offset > 0 ? '-' : '+';\r\n var absOffset = Math.abs(offset);\r\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\r\n var minutes = addLeadingZeros(absOffset % 60, 2);\r\n return sign + hours + delimiter + minutes;\r\n}\r\nexport default formatters;\r\n","import addLeadingZeros from '../../addLeadingZeros/index.js';\r\n/*\r\n * | | Unit | | Unit |\r\n * |-----|--------------------------------|-----|--------------------------------|\r\n * | a | AM, PM | A* | |\r\n * | d | Day of month | D | |\r\n * | h | Hour [1-12] | H | Hour [0-23] |\r\n * | m | Minute | M | Month |\r\n * | s | Second | S | Fraction of second |\r\n * | y | Year (abs) | Y | |\r\n *\r\n * Letters marked by * are not implemented but reserved by Unicode standard.\r\n */\r\nvar formatters = {\r\n // Year\r\n y: function (date, token) {\r\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\r\n // | Year | y | yy | yyy | yyyy | yyyyy |\r\n // |----------|-------|----|-------|-------|-------|\r\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\r\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\r\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\r\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\r\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\r\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\r\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\r\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\r\n },\r\n // Month\r\n M: function (date, token) {\r\n var month = date.getUTCMonth();\r\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\r\n },\r\n // Day of the month\r\n d: function (date, token) {\r\n return addLeadingZeros(date.getUTCDate(), token.length);\r\n },\r\n // AM or PM\r\n a: function (date, token) {\r\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\r\n switch (token) {\r\n case 'a':\r\n case 'aa':\r\n case 'aaa':\r\n return dayPeriodEnumValue.toUpperCase();\r\n case 'aaaaa':\r\n return dayPeriodEnumValue[0];\r\n case 'aaaa':\r\n default:\r\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\r\n }\r\n },\r\n // Hour [1-12]\r\n h: function (date, token) {\r\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\r\n },\r\n // Hour [0-23]\r\n H: function (date, token) {\r\n return addLeadingZeros(date.getUTCHours(), token.length);\r\n },\r\n // Minute\r\n m: function (date, token) {\r\n return addLeadingZeros(date.getUTCMinutes(), token.length);\r\n },\r\n // Second\r\n s: function (date, token) {\r\n return addLeadingZeros(date.getUTCSeconds(), token.length);\r\n },\r\n // Fraction of second\r\n S: function (date, token) {\r\n var numberOfDigits = token.length;\r\n var milliseconds = date.getUTCMilliseconds();\r\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\r\n return addLeadingZeros(fractionalSeconds, token.length);\r\n }\r\n};\r\nexport default formatters;\r\n","function dateLongFormatter(pattern, formatLong) {\r\n switch (pattern) {\r\n case 'P':\r\n return formatLong.date({\r\n width: 'short'\r\n });\r\n case 'PP':\r\n return formatLong.date({\r\n width: 'medium'\r\n });\r\n case 'PPP':\r\n return formatLong.date({\r\n width: 'long'\r\n });\r\n case 'PPPP':\r\n default:\r\n return formatLong.date({\r\n width: 'full'\r\n });\r\n }\r\n}\r\nfunction timeLongFormatter(pattern, formatLong) {\r\n switch (pattern) {\r\n case 'p':\r\n return formatLong.time({\r\n width: 'short'\r\n });\r\n case 'pp':\r\n return formatLong.time({\r\n width: 'medium'\r\n });\r\n case 'ppp':\r\n return formatLong.time({\r\n width: 'long'\r\n });\r\n case 'pppp':\r\n default:\r\n return formatLong.time({\r\n width: 'full'\r\n });\r\n }\r\n}\r\nfunction dateTimeLongFormatter(pattern, formatLong) {\r\n var matchResult = pattern.match(/(P+)(p+)?/);\r\n var datePattern = matchResult[1];\r\n var timePattern = matchResult[2];\r\n if (!timePattern) {\r\n return dateLongFormatter(pattern, formatLong);\r\n }\r\n var dateTimeFormat;\r\n switch (datePattern) {\r\n case 'P':\r\n dateTimeFormat = formatLong.dateTime({\r\n width: 'short'\r\n });\r\n break;\r\n case 'PP':\r\n dateTimeFormat = formatLong.dateTime({\r\n width: 'medium'\r\n });\r\n break;\r\n case 'PPP':\r\n dateTimeFormat = formatLong.dateTime({\r\n width: 'long'\r\n });\r\n break;\r\n case 'PPPP':\r\n default:\r\n dateTimeFormat = formatLong.dateTime({\r\n width: 'full'\r\n });\r\n break;\r\n }\r\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\r\n}\r\nvar longFormatters = {\r\n p: timeLongFormatter,\r\n P: dateTimeLongFormatter\r\n};\r\nexport default longFormatters;\r\n","var MILLISECONDS_IN_MINUTE = 60000;\r\n/**\r\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\r\n * They usually appear for dates that denote time before the timezones were introduced\r\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\r\n * and GMT+01:00:00 after that date)\r\n *\r\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\r\n * which would lead to incorrect calculations.\r\n *\r\n * This function returns the timezone offset in milliseconds that takes seconds in account.\r\n */\r\nexport default function getTimezoneOffsetInMilliseconds(dirtyDate) {\r\n var date = new Date(dirtyDate.getTime());\r\n var baseTimezoneOffset = date.getTimezoneOffset();\r\n date.setSeconds(0, 0);\r\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\r\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\r\n}\r\n","import toDate from '../../toDate/index.js';\r\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function getUTCDayOfYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var timestamp = date.getTime();\r\n date.setUTCMonth(0, 1);\r\n date.setUTCHours(0, 0, 0, 0);\r\n var startOfYearTimestamp = date.getTime();\r\n var difference = timestamp - startOfYearTimestamp;\r\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\r\n}\r\n","import toDate from '../../toDate/index.js';\r\nimport startOfUTCISOWeek from '../startOfUTCISOWeek/index.js';\r\nimport startOfUTCISOWeekYear from '../startOfUTCISOWeekYear/index.js';\r\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function getUTCISOWeek(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\r\n // because the number of milliseconds in a week is not constant\r\n // (e.g. it's different in the week of the daylight saving time clock shift)\r\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\r\n}\r\n","import toDate from '../../toDate/index.js';\r\nimport startOfUTCISOWeek from '../startOfUTCISOWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function getUTCISOWeekYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getUTCFullYear();\r\n var fourthOfJanuaryOfNextYear = new Date(0);\r\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\r\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\r\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\r\n var fourthOfJanuaryOfThisYear = new Date(0);\r\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\r\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\r\n var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);\r\n if (date.getTime() >= startOfNextYear.getTime()) {\r\n return year + 1;\r\n } else if (date.getTime() >= startOfThisYear.getTime()) {\r\n return year;\r\n } else {\r\n return year - 1;\r\n }\r\n}\r\n","import toDate from '../../toDate/index.js';\r\nimport startOfUTCWeek from '../startOfUTCWeek/index.js';\r\nimport startOfUTCWeekYear from '../startOfUTCWeekYear/index.js';\r\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function getUTCWeek(dirtyDate, options) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\r\n // because the number of milliseconds in a week is not constant\r\n // (e.g. it's different in the week of the daylight saving time clock shift)\r\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\r\n}\r\n","import toInteger from '../toInteger/index.js';\r\nimport toDate from '../../toDate/index.js';\r\nimport startOfUTCWeek from '../startOfUTCWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function getUTCWeekYear(dirtyDate, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate, dirtyOptions);\r\n var year = date.getUTCFullYear();\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\r\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\r\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\r\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\r\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\r\n }\r\n var firstWeekOfNextYear = new Date(0);\r\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\r\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\r\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);\r\n var firstWeekOfThisYear = new Date(0);\r\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\r\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\r\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);\r\n if (date.getTime() >= startOfNextYear.getTime()) {\r\n return year + 1;\r\n } else if (date.getTime() >= startOfThisYear.getTime()) {\r\n return year;\r\n } else {\r\n return year - 1;\r\n }\r\n}\r\n","var protectedDayOfYearTokens = ['D', 'DD'];\r\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\r\nexport function isProtectedDayOfYearToken(token) {\r\n return protectedDayOfYearTokens.indexOf(token) !== -1;\r\n}\r\nexport function isProtectedWeekYearToken(token) {\r\n return protectedWeekYearTokens.indexOf(token) !== -1;\r\n}\r\nexport function throwProtectedError(token) {\r\n if (token === 'YYYY') {\r\n throw new RangeError('Use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr');\r\n } else if (token === 'YY') {\r\n throw new RangeError('Use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr');\r\n } else if (token === 'D') {\r\n throw new RangeError('Use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr');\r\n } else if (token === 'DD') {\r\n throw new RangeError('Use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr');\r\n }\r\n}\r\n","import toInteger from '../toInteger/index.js';\r\nimport toDate from '../../toDate/index.js'; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\r\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\r\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\r\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\r\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\r\n }\r\n var date = toDate(dirtyDate);\r\n var day = toInteger(dirtyDay);\r\n var currentDay = date.getUTCDay();\r\n var remainder = day % 7;\r\n var dayIndex = (remainder + 7) % 7;\r\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\r\n date.setUTCDate(date.getUTCDate() + diff);\r\n return date;\r\n}\r\n","import toInteger from '../toInteger/index.js';\r\nimport toDate from '../../toDate/index.js'; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var day = toInteger(dirtyDay);\r\n if (day % 7 === 0) {\r\n day = day - 7;\r\n }\r\n var weekStartsOn = 1;\r\n var date = toDate(dirtyDate);\r\n var currentDay = date.getUTCDay();\r\n var remainder = day % 7;\r\n var dayIndex = (remainder + 7) % 7;\r\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\r\n date.setUTCDate(date.getUTCDate() + diff);\r\n return date;\r\n}\r\n","import toInteger from '../toInteger/index.js';\r\nimport toDate from '../../toDate/index.js';\r\nimport getUTCISOWeek from '../getUTCISOWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var isoWeek = toInteger(dirtyISOWeek);\r\n var diff = getUTCISOWeek(date) - isoWeek;\r\n date.setUTCDate(date.getUTCDate() - diff * 7);\r\n return date;\r\n}\r\n","import toInteger from '../toInteger/index.js';\r\nimport toDate from '../../toDate/index.js';\r\nimport getUTCWeek from '../getUTCWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var week = toInteger(dirtyWeek);\r\n var diff = getUTCWeek(date, options) - week;\r\n date.setUTCDate(date.getUTCDate() - diff * 7);\r\n return date;\r\n}\r\n","import toDate from '../../toDate/index.js'; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function startOfUTCISOWeek(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var weekStartsOn = 1;\r\n var date = toDate(dirtyDate);\r\n var day = date.getUTCDay();\r\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\r\n date.setUTCDate(date.getUTCDate() - diff);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import getUTCISOWeekYear from '../getUTCISOWeekYear/index.js';\r\nimport startOfUTCISOWeek from '../startOfUTCISOWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function startOfUTCISOWeekYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var year = getUTCISOWeekYear(dirtyDate);\r\n var fourthOfJanuary = new Date(0);\r\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\r\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\r\n var date = startOfUTCISOWeek(fourthOfJanuary);\r\n return date;\r\n}\r\n","import toInteger from '../toInteger/index.js';\r\nimport toDate from '../../toDate/index.js'; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function startOfUTCWeek(dirtyDate, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\r\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\r\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\r\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\r\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\r\n }\r\n var date = toDate(dirtyDate);\r\n var day = date.getUTCDay();\r\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\r\n date.setUTCDate(date.getUTCDate() - diff);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import toInteger from '../toInteger/index.js';\r\nimport getUTCWeekYear from '../getUTCWeekYear/index.js';\r\nimport startOfUTCWeek from '../startOfUTCWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\r\n// See issue: https://github.com/date-fns/date-fns/issues/376\r\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\r\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\r\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\r\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\r\n var firstWeek = new Date(0);\r\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\r\n firstWeek.setUTCHours(0, 0, 0, 0);\r\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\r\n return date;\r\n}\r\n","export default function toInteger(dirtyNumber) {\r\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\r\n return NaN;\r\n }\r\n var number = Number(dirtyNumber);\r\n if (isNaN(number)) {\r\n return number;\r\n }\r\n return number < 0 ? Math.ceil(number) : Math.floor(number);\r\n}\r\n","import isWeekend from '../isWeekend/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name addBusinessDays\r\n * @category Day Helpers\r\n * @summary Add the specified number of business days (mon - fri) to the given date.\r\n *\r\n * @description\r\n * Add the specified number of business days (mon - fri) to the given date, ignoring weekends.\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of business days to be added\r\n * @returns {Date} the new date with the business days added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 10 business days to 1 September 2014:\r\n * var result = addBusinessDays(new Date(2014, 8, 1), 10)\r\n * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)\r\n */\r\nexport default function addBusinessDays(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var amount = toInteger(dirtyAmount);\r\n if (isNaN(amount)) return new Date(NaN);\r\n var hours = date.getHours();\r\n var sign = amount < 0 ? -1 : 1;\r\n date.setDate(date.getDate() + toInteger(amount / 5) * 7);\r\n amount %= 5; // to get remaining days not part of a full week\r\n // only loops over remaining days or if day is a weekend, ensures a business day is returned\r\n while (amount || isWeekend(date)) {\r\n date.setDate(date.getDate() + sign);\r\n if (!isWeekend(date)) amount -= sign;\r\n }\r\n date.setHours(hours);\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name addDays\r\n * @category Day Helpers\r\n * @summary Add the specified number of days to the given date.\r\n *\r\n * @description\r\n * Add the specified number of days to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of days to be added\r\n * @returns {Date} the new date with the days added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 10 days to 1 September 2014:\r\n * var result = addDays(new Date(2014, 8, 1), 10)\r\n * //=> Thu Sep 11 2014 00:00:00\r\n */\r\nexport default function addDays(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var amount = toInteger(dirtyAmount);\r\n date.setDate(date.getDate() + amount);\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addMilliseconds from '../addMilliseconds/index.js';\r\nvar MILLISECONDS_IN_HOUR = 3600000;\r\n/**\r\n * @name addHours\r\n * @category Hour Helpers\r\n * @summary Add the specified number of hours to the given date.\r\n *\r\n * @description\r\n * Add the specified number of hours to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of hours to be added\r\n * @returns {Date} the new date with the hours added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 2 hours to 10 July 2014 23:00:00:\r\n * var result = addHours(new Date(2014, 6, 10, 23, 0), 2)\r\n * //=> Fri Jul 11 2014 01:00:00\r\n */\r\nexport default function addHours(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport getISOWeekYear from '../getISOWeekYear/index.js';\r\nimport setISOWeekYear from '../setISOWeekYear/index.js';\r\n/**\r\n * @name addISOWeekYears\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Add the specified number of ISO week-numbering years to the given date.\r\n *\r\n * @description\r\n * Add the specified number of ISO week-numbering years to the given date.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `addISOYears` to `addISOWeekYears`.\r\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\r\n * This change makes the name consistent with\r\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of ISO week-numbering years to be added\r\n * @returns {Date} the new date with the ISO week-numbering years added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 5 ISO week-numbering years to 2 July 2010:\r\n * var result = addISOWeekYears(new Date(2010, 6, 2), 5)\r\n * //=> Fri Jun 26 2015 00:00:00\r\n */\r\nexport default function addISOWeekYears(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return setISOWeekYear(dirtyDate, getISOWeekYear(dirtyDate) + amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name addMilliseconds\r\n * @category Millisecond Helpers\r\n * @summary Add the specified number of milliseconds to the given date.\r\n *\r\n * @description\r\n * Add the specified number of milliseconds to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of milliseconds to be added\r\n * @returns {Date} the new date with the milliseconds added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\r\n * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\r\n * //=> Thu Jul 10 2014 12:45:30.750\r\n */\r\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var timestamp = toDate(dirtyDate).getTime();\r\n var amount = toInteger(dirtyAmount);\r\n return new Date(timestamp + amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addMilliseconds from '../addMilliseconds/index.js';\r\nvar MILLISECONDS_IN_MINUTE = 60000;\r\n/**\r\n * @name addMinutes\r\n * @category Minute Helpers\r\n * @summary Add the specified number of minutes to the given date.\r\n *\r\n * @description\r\n * Add the specified number of minutes to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of minutes to be added\r\n * @returns {Date} the new date with the minutes added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 30 minutes to 10 July 2014 12:00:00:\r\n * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\r\n * //=> Thu Jul 10 2014 12:30:00\r\n */\r\nexport default function addMinutes(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport getDaysInMonth from '../getDaysInMonth/index.js';\r\n/**\r\n * @name addMonths\r\n * @category Month Helpers\r\n * @summary Add the specified number of months to the given date.\r\n *\r\n * @description\r\n * Add the specified number of months to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of months to be added\r\n * @returns {Date} the new date with the months added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 5 months to 1 September 2014:\r\n * var result = addMonths(new Date(2014, 8, 1), 5)\r\n * //=> Sun Feb 01 2015 00:00:00\r\n */\r\nexport default function addMonths(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var amount = toInteger(dirtyAmount);\r\n var desiredMonth = date.getMonth() + amount;\r\n var dateWithDesiredMonth = new Date(0);\r\n dateWithDesiredMonth.setFullYear(date.getFullYear(), desiredMonth, 1);\r\n dateWithDesiredMonth.setHours(0, 0, 0, 0);\r\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth); // Set the last day of the new month\r\n // if the original date was the last day of the longer month\r\n date.setMonth(desiredMonth, Math.min(daysInMonth, date.getDate()));\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addMonths from '../addMonths/index.js';\r\n/**\r\n * @name addQuarters\r\n * @category Quarter Helpers\r\n * @summary Add the specified number of year quarters to the given date.\r\n *\r\n * @description\r\n * Add the specified number of year quarters to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of quarters to be added\r\n * @returns {Date} the new date with the quarters added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 1 quarter to 1 September 2014:\r\n * var result = addQuarters(new Date(2014, 8, 1), 1)\r\n * //=> Mon Dec 01 2014 00:00:00\r\n */\r\nexport default function addQuarters(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n var months = amount * 3;\r\n return addMonths(dirtyDate, months);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addMilliseconds from '../addMilliseconds/index.js';\r\n/**\r\n * @name addSeconds\r\n * @category Second Helpers\r\n * @summary Add the specified number of seconds to the given date.\r\n *\r\n * @description\r\n * Add the specified number of seconds to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of seconds to be added\r\n * @returns {Date} the new date with the seconds added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 30 seconds to 10 July 2014 12:45:00:\r\n * var result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\r\n * //=> Thu Jul 10 2014 12:45:30\r\n */\r\nexport default function addSeconds(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addMilliseconds(dirtyDate, amount * 1000);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addDays from '../addDays/index.js';\r\n/**\r\n * @name addWeeks\r\n * @category Week Helpers\r\n * @summary Add the specified number of weeks to the given date.\r\n *\r\n * @description\r\n * Add the specified number of week to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of weeks to be added\r\n * @returns {Date} the new date with the weeks added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 4 weeks to 1 September 2014:\r\n * var result = addWeeks(new Date(2014, 8, 1), 4)\r\n * //=> Mon Sep 29 2014 00:00:00\r\n */\r\nexport default function addWeeks(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n var days = amount * 7;\r\n return addDays(dirtyDate, days);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addMonths from '../addMonths/index.js';\r\n/**\r\n * @name addYears\r\n * @category Year Helpers\r\n * @summary Add the specified number of years to the given date.\r\n *\r\n * @description\r\n * Add the specified number of years to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of years to be added\r\n * @returns {Date} the new date with the years added\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Add 5 years to 1 September 2014:\r\n * var result = addYears(new Date(2014, 8, 1), 5)\r\n * //=> Sun Sep 01 2019 00:00:00\r\n */\r\nexport default function addYears(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addMonths(dirtyDate, amount * 12);\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name areIntervalsOverlapping\r\n * @category Interval Helpers\r\n * @summary Is the given time interval overlapping with another time interval?\r\n *\r\n * @description\r\n * Is the given time interval overlapping with another time interval?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `areRangesOverlapping` to `areIntervalsOverlapping`.\r\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\r\n *\r\n * ```\r\n * 2.1.3\r\n * time interval\r\n * part of the time axis limited by two instants\r\n * ```\r\n *\r\n * Also, this function now accepts an object with `start` and `end` properties\r\n * instead of two arguments as an interval.\r\n * This function now throws `RangeError` if the start of the interval is after its end\r\n * or if any date in the interval is `Invalid Date`.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n *\r\n * areRangesOverlapping(\r\n * new Date(2014, 0, 10), new Date(2014, 0, 20),\r\n * new Date(2014, 0, 17), new Date(2014, 0, 21)\r\n * )\r\n *\r\n * // v2.0.0 onward\r\n *\r\n * areIntervalsOverlapping(\r\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\r\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\r\n * )\r\n * ```\r\n *\r\n * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link docs/types/Interval}\r\n * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link docs/types/Interval}\r\n * @returns {Boolean} whether the time intervals are overlapping\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} The start of an interval cannot be after its end\r\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\r\n *\r\n * @example\r\n * // For overlapping time intervals:\r\n * areIntervalsOverlapping(\r\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\r\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\r\n * )\r\n * //=> true\r\n *\r\n * @example\r\n * // For non-overlapping time intervals:\r\n * areIntervalsOverlapping(\r\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\r\n * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }\r\n * )\r\n * //=> false\r\n */\r\nexport default function areIntervalsOverlapping(dirtyIntervalLeft, dirtyIntervalRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var intervalLeft = dirtyIntervalLeft || {};\r\n var intervalRight = dirtyIntervalRight || {};\r\n var leftStartTime = toDate(intervalLeft.start).getTime();\r\n var leftEndTime = toDate(intervalLeft.end).getTime();\r\n var rightStartTime = toDate(intervalRight.start).getTime();\r\n var rightEndTime = toDate(intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\r\n if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {\r\n throw new RangeError('Invalid interval');\r\n }\r\n return leftStartTime < rightEndTime && rightStartTime < leftEndTime;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name closestIndexTo\r\n * @category Common Helpers\r\n * @summary Return an index of the closest date from the array comparing to the given date.\r\n *\r\n * @description\r\n * Return an index of the closest date from the array comparing to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - Now, `closestIndexTo` doesn't throw an exception\r\n * when the second argument is not an array, and returns Invalid Date instead.\r\n *\r\n * @param {Date|Number} dateToCompare - the date to compare with\r\n * @param {Date[]|Number[]} datesArray - the array to search\r\n * @returns {Number} an index of the date closest to the given date\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Which date is closer to 6 September 2015?\r\n * var dateToCompare = new Date(2015, 8, 6)\r\n * var datesArray = [\r\n * new Date(2015, 0, 1),\r\n * new Date(2016, 0, 1),\r\n * new Date(2017, 0, 1)\r\n * ]\r\n * var result = closestIndexTo(dateToCompare, datesArray)\r\n * //=> 1\r\n */\r\nexport default function closestIndexTo(dirtyDateToCompare, dirtyDatesArray) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateToCompare = toDate(dirtyDateToCompare);\r\n if (isNaN(dateToCompare)) {\r\n return NaN;\r\n }\r\n var timeToCompare = dateToCompare.getTime();\r\n var datesArray; // `dirtyDatesArray` is undefined or null\r\n if (dirtyDatesArray == null) {\r\n datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\r\n } else if (typeof dirtyDatesArray.forEach === 'function') {\r\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array\r\n } else {\r\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\r\n }\r\n var result;\r\n var minDistance;\r\n datesArray.forEach(function (dirtyDate, index) {\r\n var currentDate = toDate(dirtyDate);\r\n if (isNaN(currentDate)) {\r\n result = NaN;\r\n minDistance = NaN;\r\n return;\r\n }\r\n var distance = Math.abs(timeToCompare - currentDate.getTime());\r\n if (result == null || distance < minDistance) {\r\n result = index;\r\n minDistance = distance;\r\n }\r\n });\r\n return result;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name closestTo\r\n * @category Common Helpers\r\n * @summary Return a date from the array closest to the given date.\r\n *\r\n * @description\r\n * Return a date from the array closest to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - Now, `closestTo` doesn't throw an exception\r\n * when the second argument is not an array, and returns Invalid Date instead.\r\n *\r\n * @param {Date|Number} dateToCompare - the date to compare with\r\n * @param {Date[]|Number[]} datesArray - the array to search\r\n * @returns {Date} the date from the array closest to the given date\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030?\r\n * var dateToCompare = new Date(2015, 8, 6)\r\n * var result = closestTo(dateToCompare, [\r\n * new Date(2000, 0, 1),\r\n * new Date(2030, 0, 1)\r\n * ])\r\n * //=> Tue Jan 01 2030 00:00:00\r\n */\r\nexport default function closestTo(dirtyDateToCompare, dirtyDatesArray) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateToCompare = toDate(dirtyDateToCompare);\r\n if (isNaN(dateToCompare)) {\r\n return new Date(NaN);\r\n }\r\n var timeToCompare = dateToCompare.getTime();\r\n var datesArray; // `dirtyDatesArray` is undefined or null\r\n if (dirtyDatesArray == null) {\r\n datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\r\n } else if (typeof dirtyDatesArray.forEach === 'function') {\r\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array\r\n } else {\r\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\r\n }\r\n var result;\r\n var minDistance;\r\n datesArray.forEach(function (dirtyDate) {\r\n var currentDate = toDate(dirtyDate);\r\n if (isNaN(currentDate)) {\r\n result = new Date(NaN);\r\n minDistance = NaN;\r\n return;\r\n }\r\n var distance = Math.abs(timeToCompare - currentDate.getTime());\r\n if (result == null || distance < minDistance) {\r\n result = currentDate;\r\n minDistance = distance;\r\n }\r\n });\r\n return result;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name compareAsc\r\n * @category Common Helpers\r\n * @summary Compare the two dates and return -1, 0 or 1.\r\n *\r\n * @description\r\n * Compare the two dates and return 1 if the first date is after the second,\r\n * -1 if the first date is before the second or 0 if dates are equal.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to compare\r\n * @param {Date|Number} dateRight - the second date to compare\r\n * @returns {Number} the result of the comparison\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Compare 11 February 1987 and 10 July 1989:\r\n * var result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\r\n * //=> -1\r\n *\r\n * @example\r\n * // Sort the array of dates:\r\n * var result = [\r\n * new Date(1995, 6, 2),\r\n * new Date(1987, 1, 11),\r\n * new Date(1989, 6, 10)\r\n * ].sort(compareAsc)\r\n * //=> [\r\n * // Wed Feb 11 1987 00:00:00,\r\n * // Mon Jul 10 1989 00:00:00,\r\n * // Sun Jul 02 1995 00:00:00\r\n * // ]\r\n */\r\nexport default function compareAsc(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n var diff = dateLeft.getTime() - dateRight.getTime();\r\n if (diff < 0) {\r\n return -1;\r\n } else if (diff > 0) {\r\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\r\n } else {\r\n return diff;\r\n }\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name compareDesc\r\n * @category Common Helpers\r\n * @summary Compare the two dates reverse chronologically and return -1, 0 or 1.\r\n *\r\n * @description\r\n * Compare the two dates and return -1 if the first date is after the second,\r\n * 1 if the first date is before the second or 0 if dates are equal.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to compare\r\n * @param {Date|Number} dateRight - the second date to compare\r\n * @returns {Number} the result of the comparison\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Compare 11 February 1987 and 10 July 1989 reverse chronologically:\r\n * var result = compareDesc(new Date(1987, 1, 11), new Date(1989, 6, 10))\r\n * //=> 1\r\n *\r\n * @example\r\n * // Sort the array of dates in reverse chronological order:\r\n * var result = [\r\n * new Date(1995, 6, 2),\r\n * new Date(1987, 1, 11),\r\n * new Date(1989, 6, 10)\r\n * ].sort(compareDesc)\r\n * //=> [\r\n * // Sun Jul 02 1995 00:00:00,\r\n * // Mon Jul 10 1989 00:00:00,\r\n * // Wed Feb 11 1987 00:00:00\r\n * // ]\r\n */\r\nexport default function compareDesc(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n var diff = dateLeft.getTime() - dateRight.getTime();\r\n if (diff > 0) {\r\n return -1;\r\n } else if (diff < 0) {\r\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\r\n } else {\r\n return diff;\r\n }\r\n}\r\n","/**\r\n * Maximum allowed time.\r\n * @constant\r\n * @type {number}\r\n * @default\r\n */\r\nexport var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\r\n/**\r\n * Minimum allowed time.\r\n * @constant\r\n * @type {number}\r\n * @default\r\n */\r\nexport var minTime = -maxTime;\r\n","import isValid from '../isValid/index.js';\r\nimport isWeekend from '../isWeekend/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport differenceInCalendarDays from '../differenceInCalendarDays/index.js';\r\nimport addDays from '../addDays/index.js';\r\nimport isSameDay from '../isSameDay/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name differenceInBusinessDays\r\n * @category Day Helpers\r\n * @summary Get the number of business days between the given dates.\r\n *\r\n * @description\r\n * Get the number of business day periods between the given dates.\r\n * Business days being days that arent in the weekend.\r\n * Like `differenceInCalendarDays`, the function removes the times from\r\n * the dates before calculating the difference.\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of business days\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many business days are between\r\n * // 10 January 2014 and 20 July 2014?\r\n * var result = differenceInBusinessDays(\r\n * new Date(2014, 6, 20),\r\n * new Date(2014, 0, 10)\r\n * )\r\n * //=> 136\r\n */\r\nexport default function differenceInBusinessDays(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n if (!isValid(dateLeft) || !isValid(dateRight)) return new Date(NaN);\r\n var calendarDifference = differenceInCalendarDays(dateLeft, dateRight);\r\n var sign = calendarDifference < 0 ? -1 : 1;\r\n var weeks = toInteger(calendarDifference / 7);\r\n var result = weeks * 5;\r\n dateRight = addDays(dateRight, weeks * 7); // the loop below will run at most 6 times to account for the remaining days that don't makeup a full week\r\n while (!isSameDay(dateLeft, dateRight)) {\r\n // sign is used to account for both negative and positive differences\r\n result += isWeekend(dateRight) ? 0 : sign;\r\n dateRight = addDays(dateRight, sign);\r\n }\r\n return result === 0 ? 0 : result;\r\n}\r\n","import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\r\nimport startOfDay from '../startOfDay/index.js';\r\nvar MILLISECONDS_IN_DAY = 86400000;\r\n/**\r\n * @name differenceInCalendarDays\r\n * @category Day Helpers\r\n * @summary Get the number of calendar days between the given dates.\r\n *\r\n * @description\r\n * Get the number of calendar days between the given dates. This means that the times are removed\r\n * from the dates and then the difference in days is calculated.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of calendar days\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many calendar days are between\r\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\r\n * var result = differenceInCalendarDays(\r\n * new Date(2012, 6, 2, 0, 0),\r\n * new Date(2011, 6, 2, 23, 0)\r\n * )\r\n * //=> 366\r\n * // How many calendar days are between\r\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\r\n * var result = differenceInCalendarDays(\r\n * new Date(2011, 6, 3, 0, 1),\r\n * new Date(2011, 6, 2, 23, 59)\r\n * )\r\n * //=> 1\r\n */\r\nexport default function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var startOfDayLeft = startOfDay(dirtyDateLeft);\r\n var startOfDayRight = startOfDay(dirtyDateRight);\r\n var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\r\n var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); // Round the number of days to the nearest integer\r\n // because the number of milliseconds in a day is not constant\r\n // (e.g. it's different in the day of the daylight saving time clock shift)\r\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);\r\n}\r\n","import getISOWeekYear from '../getISOWeekYear/index.js';\r\n/**\r\n * @name differenceInCalendarISOWeekYears\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Get the number of calendar ISO week-numbering years between the given dates.\r\n *\r\n * @description\r\n * Get the number of calendar ISO week-numbering years between the given dates.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `differenceInCalendarISOYears` to `differenceInCalendarISOWeekYears`.\r\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\r\n * This change makes the name consistent with\r\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of calendar ISO week-numbering years\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012?\r\n * var result = differenceInCalendarISOWeekYears(\r\n * new Date(2012, 0, 1),\r\n * new Date(2010, 0, 1)\r\n * )\r\n * //=> 2\r\n */\r\nexport default function differenceInCalendarISOWeekYears(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n return getISOWeekYear(dirtyDateLeft) - getISOWeekYear(dirtyDateRight);\r\n}\r\n","import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\r\nimport startOfISOWeek from '../startOfISOWeek/index.js';\r\nvar MILLISECONDS_IN_WEEK = 604800000;\r\n/**\r\n * @name differenceInCalendarISOWeeks\r\n * @category ISO Week Helpers\r\n * @summary Get the number of calendar ISO weeks between the given dates.\r\n *\r\n * @description\r\n * Get the number of calendar ISO weeks between the given dates.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of calendar ISO weeks\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?\r\n * var result = differenceInCalendarISOWeeks(\r\n * new Date(2014, 6, 21),\r\n * new Date(2014, 6, 6)\r\n * )\r\n * //=> 3\r\n */\r\nexport default function differenceInCalendarISOWeeks(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var startOfISOWeekLeft = startOfISOWeek(dirtyDateLeft);\r\n var startOfISOWeekRight = startOfISOWeek(dirtyDateRight);\r\n var timestampLeft = startOfISOWeekLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfISOWeekLeft);\r\n var timestampRight = startOfISOWeekRight.getTime() - getTimezoneOffsetInMilliseconds(startOfISOWeekRight); // Round the number of days to the nearest integer\r\n // because the number of milliseconds in a week is not constant\r\n // (e.g. it's different in the week of the daylight saving time clock shift)\r\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK);\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name differenceInCalendarMonths\r\n * @category Month Helpers\r\n * @summary Get the number of calendar months between the given dates.\r\n *\r\n * @description\r\n * Get the number of calendar months between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of calendar months\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\r\n * var result = differenceInCalendarMonths(\r\n * new Date(2014, 8, 1),\r\n * new Date(2014, 0, 31)\r\n * )\r\n * //=> 8\r\n */\r\nexport default function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\r\n var monthDiff = dateLeft.getMonth() - dateRight.getMonth();\r\n return yearDiff * 12 + monthDiff;\r\n}\r\n","import getQuarter from '../getQuarter/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name differenceInCalendarQuarters\r\n * @category Quarter Helpers\r\n * @summary Get the number of calendar quarters between the given dates.\r\n *\r\n * @description\r\n * Get the number of calendar quarters between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of calendar quarters\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many calendar quarters are between 31 December 2013 and 2 July 2014?\r\n * var result = differenceInCalendarQuarters(\r\n * new Date(2014, 6, 2),\r\n * new Date(2013, 11, 31)\r\n * )\r\n * //=> 3\r\n */\r\nexport default function differenceInCalendarQuarters(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\r\n var quarterDiff = getQuarter(dateLeft) - getQuarter(dateRight);\r\n return yearDiff * 4 + quarterDiff;\r\n}\r\n","import startOfWeek from '../startOfWeek/index.js';\r\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\r\nvar MILLISECONDS_IN_WEEK = 604800000;\r\n/**\r\n * @name differenceInCalendarWeeks\r\n * @category Week Helpers\r\n * @summary Get the number of calendar weeks between the given dates.\r\n *\r\n * @description\r\n * Get the number of calendar weeks between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {Number} the number of calendar weeks\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n *\r\n * @example\r\n * // How many calendar weeks are between 5 July 2014 and 20 July 2014?\r\n * var result = differenceInCalendarWeeks(\r\n * new Date(2014, 6, 20),\r\n * new Date(2014, 6, 5)\r\n * )\r\n * //=> 3\r\n *\r\n * @example\r\n * // If the week starts on Monday,\r\n * // how many calendar weeks are between 5 July 2014 and 20 July 2014?\r\n * var result = differenceInCalendarWeeks(\r\n * new Date(2014, 6, 20),\r\n * new Date(2014, 6, 5),\r\n * { weekStartsOn: 1 }\r\n * )\r\n * //=> 2\r\n */\r\nexport default function differenceInCalendarWeeks(dirtyDateLeft, dirtyDateRight, dirtyOptions) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var startOfWeekLeft = startOfWeek(dirtyDateLeft, dirtyOptions);\r\n var startOfWeekRight = startOfWeek(dirtyDateRight, dirtyOptions);\r\n var timestampLeft = startOfWeekLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekLeft);\r\n var timestampRight = startOfWeekRight.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekRight); // Round the number of days to the nearest integer\r\n // because the number of milliseconds in a week is not constant\r\n // (e.g. it's different in the week of the daylight saving time clock shift)\r\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK);\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name differenceInCalendarYears\r\n * @category Year Helpers\r\n * @summary Get the number of calendar years between the given dates.\r\n *\r\n * @description\r\n * Get the number of calendar years between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of calendar years\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\r\n * var result = differenceInCalendarYears(\r\n * new Date(2015, 1, 11),\r\n * new Date(2013, 11, 31)\r\n * )\r\n * //=> 2\r\n */\r\nexport default function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n return dateLeft.getFullYear() - dateRight.getFullYear();\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport differenceInCalendarDays from '../differenceInCalendarDays/index.js';\r\nimport compareAsc from '../compareAsc/index.js';\r\n/**\r\n * @name differenceInDays\r\n * @category Day Helpers\r\n * @summary Get the number of full days between the given dates.\r\n *\r\n * @description\r\n * Get the number of full day periods between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of full days\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many full days are between\r\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\r\n * var result = differenceInDays(\r\n * new Date(2012, 6, 2, 0, 0),\r\n * new Date(2011, 6, 2, 23, 0)\r\n * )\r\n * //=> 365\r\n * // How many days are between\r\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\r\n * var result = differenceInDays(\r\n * new Date(2011, 6, 3, 0, 1),\r\n * new Date(2011, 6, 2, 23, 59)\r\n * )\r\n * //=> 0\r\n */\r\nexport default function differenceInDays(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n var sign = compareAsc(dateLeft, dateRight);\r\n var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));\r\n dateLeft.setDate(dateLeft.getDate() - sign * difference); // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\r\n // If so, result must be decreased by 1 in absolute value\r\n var isLastDayNotFull = compareAsc(dateLeft, dateRight) === -sign;\r\n var result = sign * (difference - isLastDayNotFull); // Prevent negative zero\r\n return result === 0 ? 0 : result;\r\n}\r\n","import differenceInMilliseconds from '../differenceInMilliseconds/index.js';\r\nvar MILLISECONDS_IN_HOUR = 3600000;\r\n/**\r\n * @name differenceInHours\r\n * @category Hour Helpers\r\n * @summary Get the number of hours between the given dates.\r\n *\r\n * @description\r\n * Get the number of hours between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of hours\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\r\n * var result = differenceInHours(\r\n * new Date(2014, 6, 2, 19, 0),\r\n * new Date(2014, 6, 2, 6, 50)\r\n * )\r\n * //=> 12\r\n */\r\nexport default function differenceInHours(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_HOUR;\r\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport differenceInCalendarISOWeekYears from '../differenceInCalendarISOWeekYears/index.js';\r\nimport compareAsc from '../compareAsc/index.js';\r\nimport subISOWeekYears from '../subISOWeekYears/index.js';\r\n/**\r\n * @name differenceInISOWeekYears\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Get the number of full ISO week-numbering years between the given dates.\r\n *\r\n * @description\r\n * Get the number of full ISO week-numbering years between the given dates.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `differenceInISOYears` to `differenceInISOWeekYears`.\r\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\r\n * This change makes the name consistent with\r\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of full ISO week-numbering years\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?\r\n * var result = differenceInISOWeekYears(\r\n * new Date(2012, 0, 1),\r\n * new Date(2010, 0, 1)\r\n * )\r\n * //=> 1\r\n */\r\nexport default function differenceInISOWeekYears(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n var sign = compareAsc(dateLeft, dateRight);\r\n var difference = Math.abs(differenceInCalendarISOWeekYears(dateLeft, dateRight));\r\n dateLeft = subISOWeekYears(dateLeft, sign * difference); // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1\r\n // if last calendar ISO year is not full\r\n // If so, result must be decreased by 1 in absolute value\r\n var isLastISOWeekYearNotFull = compareAsc(dateLeft, dateRight) === -sign;\r\n var result = sign * (difference - isLastISOWeekYearNotFull); // Prevent negative zero\r\n return result === 0 ? 0 : result;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name differenceInMilliseconds\r\n * @category Millisecond Helpers\r\n * @summary Get the number of milliseconds between the given dates.\r\n *\r\n * @description\r\n * Get the number of milliseconds between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of milliseconds\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many milliseconds are between\r\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\r\n * var result = differenceInMilliseconds(\r\n * new Date(2014, 6, 2, 12, 30, 21, 700),\r\n * new Date(2014, 6, 2, 12, 30, 20, 600)\r\n * )\r\n * //=> 1100\r\n */\r\nexport default function differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n return dateLeft.getTime() - dateRight.getTime();\r\n}\r\n","import differenceInMilliseconds from '../differenceInMilliseconds/index.js';\r\nvar MILLISECONDS_IN_MINUTE = 60000;\r\n/**\r\n * @name differenceInMinutes\r\n * @category Minute Helpers\r\n * @summary Get the number of minutes between the given dates.\r\n *\r\n * @description\r\n * Get the number of minutes between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of minutes\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\r\n * var result = differenceInMinutes(\r\n * new Date(2014, 6, 2, 12, 20, 0),\r\n * new Date(2014, 6, 2, 12, 7, 59)\r\n * )\r\n * //=> 12\r\n */\r\nexport default function differenceInMinutes(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_MINUTE;\r\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport differenceInCalendarMonths from '../differenceInCalendarMonths/index.js';\r\nimport compareAsc from '../compareAsc/index.js';\r\n/**\r\n * @name differenceInMonths\r\n * @category Month Helpers\r\n * @summary Get the number of full months between the given dates.\r\n *\r\n * @description\r\n * Get the number of full months between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of full months\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many full months are between 31 January 2014 and 1 September 2014?\r\n * var result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\r\n * //=> 7\r\n */\r\nexport default function differenceInMonths(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n var sign = compareAsc(dateLeft, dateRight);\r\n var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));\r\n dateLeft.setMonth(dateLeft.getMonth() - sign * difference); // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\r\n // If so, result must be decreased by 1 in absolute value\r\n var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign;\r\n var result = sign * (difference - isLastMonthNotFull); // Prevent negative zero\r\n return result === 0 ? 0 : result;\r\n}\r\n","import differenceInMonths from '../differenceInMonths/index.js';\r\n/**\r\n * @name differenceInQuarters\r\n * @category Quarter Helpers\r\n * @summary Get the number of full quarters between the given dates.\r\n *\r\n * @description\r\n * Get the number of full quarters between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of full quarters\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many full quarters are between 31 December 2013 and 2 July 2014?\r\n * var result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31))\r\n * //=> 2\r\n */\r\nexport default function differenceInQuarters(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var diff = differenceInMonths(dirtyDateLeft, dirtyDateRight) / 3;\r\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\r\n}\r\n","import differenceInMilliseconds from '../differenceInMilliseconds/index.js';\r\n/**\r\n * @name differenceInSeconds\r\n * @category Second Helpers\r\n * @summary Get the number of seconds between the given dates.\r\n *\r\n * @description\r\n * Get the number of seconds between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of seconds\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many seconds are between\r\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\r\n * var result = differenceInSeconds(\r\n * new Date(2014, 6, 2, 12, 30, 20, 0),\r\n * new Date(2014, 6, 2, 12, 30, 7, 999)\r\n * )\r\n * //=> 12\r\n */\r\nexport default function differenceInSeconds(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / 1000;\r\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\r\n}\r\n","import differenceInDays from '../differenceInDays/index.js';\r\n/**\r\n * @name differenceInWeeks\r\n * @category Week Helpers\r\n * @summary Get the number of full weeks between the given dates.\r\n *\r\n * @description\r\n * Get the number of full weeks between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of full weeks\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many full weeks are between 5 July 2014 and 20 July 2014?\r\n * var result = differenceInWeeks(new Date(2014, 6, 20), new Date(2014, 6, 5))\r\n * //=> 2\r\n */\r\nexport default function differenceInWeeks(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var diff = differenceInDays(dirtyDateLeft, dirtyDateRight) / 7;\r\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport differenceInCalendarYears from '../differenceInCalendarYears/index.js';\r\nimport compareAsc from '../compareAsc/index.js';\r\n/**\r\n * @name differenceInYears\r\n * @category Year Helpers\r\n * @summary Get the number of full years between the given dates.\r\n *\r\n * @description\r\n * Get the number of full years between the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the later date\r\n * @param {Date|Number} dateRight - the earlier date\r\n * @returns {Number} the number of full years\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // How many full years are between 31 December 2013 and 11 February 2015?\r\n * var result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\r\n * //=> 1\r\n */\r\nexport default function differenceInYears(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n var sign = compareAsc(dateLeft, dateRight);\r\n var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight));\r\n dateLeft.setFullYear(dateLeft.getFullYear() - sign * difference); // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\r\n // If so, result must be decreased by 1 in absolute value\r\n var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign;\r\n var result = sign * (difference - isLastYearNotFull); // Prevent negative zero\r\n return result === 0 ? 0 : result;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name eachDayOfInterval\r\n * @category Interval Helpers\r\n * @summary Return the array of dates within the specified time interval.\r\n *\r\n * @description\r\n * Return the array of dates within the specified time interval.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `eachDay` to `eachDayOfInterval`.\r\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\r\n *\r\n * ```\r\n * 2.1.3\r\n * time interval\r\n * part of the time axis limited by two instants\r\n * ```\r\n *\r\n * Also, this function now accepts an object with `start` and `end` properties\r\n * instead of two arguments as an interval.\r\n * This function now throws `RangeError` if the start of the interval is after its end\r\n * or if any date in the interval is `Invalid Date`.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n *\r\n * eachDay(new Date(2014, 0, 10), new Date(2014, 0, 20))\r\n *\r\n * // v2.0.0 onward\r\n *\r\n * eachDayOfInterval(\r\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }\r\n * )\r\n * ```\r\n *\r\n * @param {Interval} interval - the interval. See [Interval]{@link docs/types/Interval}\r\n * @param {Object} [options] - an object with options.\r\n * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1.\r\n * @returns {Date[]} the array with starts of days from the day of the interval start to the day of the interval end\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.step` must be a number greater than 1\r\n * @throws {RangeError} The start of an interval cannot be after its end\r\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\r\n *\r\n * @example\r\n * // Each day between 6 October 2014 and 10 October 2014:\r\n * var result = eachDayOfInterval({\r\n * start: new Date(2014, 9, 6),\r\n * end: new Date(2014, 9, 10)\r\n * })\r\n * //=> [\r\n * // Mon Oct 06 2014 00:00:00,\r\n * // Tue Oct 07 2014 00:00:00,\r\n * // Wed Oct 08 2014 00:00:00,\r\n * // Thu Oct 09 2014 00:00:00,\r\n * // Fri Oct 10 2014 00:00:00\r\n * // ]\r\n */\r\nexport default function eachDayOfInterval(dirtyInterval, options) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var interval = dirtyInterval || {};\r\n var startDate = toDate(interval.start);\r\n var endDate = toDate(interval.end);\r\n var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\r\n if (!(startDate.getTime() <= endTime)) {\r\n throw new RangeError('Invalid interval');\r\n }\r\n var dates = [];\r\n var currentDate = startDate;\r\n currentDate.setHours(0, 0, 0, 0);\r\n var step = options && 'step' in options ? Number(options.step) : 1;\r\n if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1');\r\n while (currentDate.getTime() <= endTime) {\r\n dates.push(toDate(currentDate));\r\n currentDate.setDate(currentDate.getDate() + step);\r\n currentDate.setHours(0, 0, 0, 0);\r\n }\r\n return dates;\r\n}\r\n","import addWeeks from '../addWeeks/index.js';\r\nimport startOfWeek from '../startOfWeek/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name eachWeekOfInterval\r\n * @category Interval Helpers\r\n * @summary Return the array of weeks within the specified time interval.\r\n *\r\n * @description\r\n * Return the array of weeks within the specified time interval.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Interval} interval - the interval. See [Interval]{@link docs/types/Interval}\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {Date[]} the array with starts of weeks from the week of the interval start to the week of the interval end\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.weekStartsOn` must be 0, 1, ..., 6\r\n * @throws {RangeError} The start of an interval cannot be after its end\r\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\r\n *\r\n * @example\r\n * // Each week within interval 6 October 2014 - 23 November 2014:\r\n * var result = eachWeekOfInterval({\r\n * start: new Date(2014, 9, 6),\r\n * end: new Date(2014, 10, 23)\r\n * })\r\n * //=> [\r\n * // Sun Oct 05 2014 00:00:00,\r\n * // Sun Oct 12 2014 00:00:00,\r\n * // Sun Oct 19 2014 00:00:00,\r\n * // Sun Oct 26 2014 00:00:00,\r\n * // Sun Nov 02 2014 00:00:00,\r\n * // Sun Nov 09 2014 00:00:00,\r\n * // Sun Nov 16 2014 00:00:00,\r\n * // Sun Nov 23 2014 00:00:00\r\n * // ]\r\n */\r\nexport default function eachWeekOfInterval(dirtyInterval, options) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var interval = dirtyInterval || {};\r\n var startDate = toDate(interval.start);\r\n var endDate = toDate(interval.end);\r\n var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\r\n if (!(startDate.getTime() <= endTime)) {\r\n throw new RangeError('Invalid interval');\r\n }\r\n var startDateWeek = startOfWeek(startDate, options);\r\n var endDateWeek = startOfWeek(endDate, options); // Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet\r\n startDateWeek.setHours(15);\r\n endDateWeek.setHours(15);\r\n endTime = endDateWeek.getTime();\r\n var weeks = [];\r\n var currentWeek = startDateWeek;\r\n while (currentWeek.getTime() <= endTime) {\r\n currentWeek.setHours(0);\r\n weeks.push(toDate(currentWeek));\r\n currentWeek = addWeeks(currentWeek, 1);\r\n currentWeek.setHours(15);\r\n }\r\n return weeks;\r\n}\r\n","import eachDayOfInterval from '../eachDayOfInterval/index.js';\r\nimport isSunday from '../isSunday/index.js';\r\nimport isWeekend from '../isWeekend/index.js';\r\n/**\r\n * @name eachWeekendOfInterval\r\n * @category Interval Helpers\r\n * @summary List all the Saturdays and Sundays in the given date interval.\r\n *\r\n * @description\r\n * Get all the Saturdays and Sundays in the given date interval.\r\n *\r\n * @param {Interval} interval - the given interval. See [Interval]{@link docs/types/Interval}\r\n * @returns {Date[]} an array containing all the Saturdays and Sundays\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} The start of an interval cannot be after its end\r\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\r\n *\r\n * @example\r\n * // Lists all Saturdays and Sundays in the given date interval\r\n * var result = eachWeekendOfInterval({\r\n * start: new Date(2018, 8, 17),\r\n * end: new Date(2018, 8, 30)\r\n * })\r\n * //=> [\r\n * // Sat Sep 22 2018 00:00:00,\r\n * // Sun Sep 23 2018 00:00:00,\r\n * // Sat Sep 29 2018 00:00:00,\r\n * // Sun Sep 30 2018 00:00:00\r\n * // ]\r\n */\r\nexport default function eachWeekendOfInterval(interval) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var dateInterval = eachDayOfInterval(interval);\r\n var weekends = [];\r\n var index = 0;\r\n while (index++ < dateInterval.length) {\r\n var date = dateInterval[index];\r\n if (isWeekend(date)) {\r\n weekends.push(date);\r\n if (isSunday(date)) index = index + 5;\r\n }\r\n }\r\n return weekends;\r\n}\r\n","import eachWeekendOfInterval from '../eachWeekendOfInterval/index.js';\r\nimport startOfMonth from '../startOfMonth/index.js';\r\nimport endOfMonth from '../endOfMonth/index.js';\r\n/**\r\n * @name eachWeekendOfMonth\r\n * @category Month Helpers\r\n * @summary List all the Saturdays and Sundays in the given month.\r\n *\r\n * @description\r\n * Get all the Saturdays and Sundays in the given month.\r\n *\r\n * @param {Date|Number} date - the given month\r\n * @returns {Date[]} an array containing all the Saturdays and Sundays\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} The passed date is invalid\r\n *\r\n * @example\r\n * // Lists all Saturdays and Sundays in the given month\r\n * var result = eachWeekendOfMonth(new Date(2022, 1, 1))\r\n * //=> [\r\n * // Sat Feb 05 2022 00:00:00,\r\n * // Sun Feb 06 2022 00:00:00,\r\n * // Sat Feb 12 2022 00:00:00,\r\n * // Sun Feb 13 2022 00:00:00,\r\n * // Sat Feb 19 2022 00:00:00,\r\n * // Sun Feb 20 2022 00:00:00,\r\n * // Sat Feb 26 2022 00:00:00,\r\n * // Sun Feb 27 2022 00:00:00\r\n * // ]\r\n */\r\nexport default function eachWeekendOfMonth(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var startDate = startOfMonth(dirtyDate);\r\n if (isNaN(startDate)) throw new RangeError('The passed date is invalid');\r\n var endDate = endOfMonth(dirtyDate);\r\n return eachWeekendOfInterval({\r\n start: startDate,\r\n end: endDate\r\n });\r\n}\r\n","import eachWeekendOfInterval from '../eachWeekendOfInterval/index.js';\r\nimport startOfYear from '../startOfYear/index.js';\r\nimport endOfYear from '../endOfYear/index.js';\r\n/**\r\n * @name eachWeekendOfYear\r\n * @category Year Helpers\r\n * @summary List all the Saturdays and Sundays in the year.\r\n *\r\n * @description\r\n * Get all the Saturdays and Sundays in the year.\r\n *\r\n * @param {Date|Number} date - the given year\r\n * @returns {Date[]} an array containing all the Saturdays and Sundays\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} The passed date is invalid\r\n *\r\n * @example\r\n * // Lists all Saturdays and Sundays in the year\r\n * var result = eachWeekendOfYear(new Date(2020, 1, 1))\r\n * //=> [\r\n * // Sat Jan 03 2020 00:00:00,\r\n * // Sun Jan 04 2020 00:00:00,\r\n * // ...\r\n * // Sun Dec 27 2020 00:00:00\r\n * // ]\r\n * ]\r\n */\r\nexport default function eachWeekendOfYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var startDate = startOfYear(dirtyDate);\r\n if (isNaN(startDate)) throw new RangeError('The passed date is invalid');\r\n var endDate = endOfYear(dirtyDate);\r\n return eachWeekendOfInterval({\r\n start: startDate,\r\n end: endDate\r\n });\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name endOfDay\r\n * @category Day Helpers\r\n * @summary Return the end of a day for the given date.\r\n *\r\n * @description\r\n * Return the end of a day for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of a day\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The end of a day for 2 September 2014 11:55:00:\r\n * var result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Tue Sep 02 2014 23:59:59.999\r\n */\r\nexport default function endOfDay(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n date.setHours(23, 59, 59, 999);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name endOfDecade\r\n * @category Decade Helpers\r\n * @summary Return the end of a decade for the given date.\r\n *\r\n * @description\r\n * Return the end of a decade for the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of a decade\r\n * @param {Object} [options] - an object with options.\r\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\r\n *\r\n * @example\r\n * // The end of a decade for 12 May 1984 00:00:00:\r\n * var result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00))\r\n * //=> Dec 31 1989 23:59:59.999\r\n */\r\nexport default function endOfDecade(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n var decade = 9 + Math.floor(year / 10) * 10;\r\n date.setFullYear(decade, 11, 31);\r\n date.setHours(23, 59, 59, 999);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name endOfHour\r\n * @category Hour Helpers\r\n * @summary Return the end of an hour for the given date.\r\n *\r\n * @description\r\n * Return the end of an hour for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of an hour\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The end of an hour for 2 September 2014 11:55:00:\r\n * var result = endOfHour(new Date(2014, 8, 2, 11, 55))\r\n * //=> Tue Sep 02 2014 11:59:59.999\r\n */\r\nexport default function endOfHour(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n date.setMinutes(59, 59, 999);\r\n return date;\r\n}\r\n","import endOfWeek from '../endOfWeek/index.js';\r\n/**\r\n * @name endOfISOWeek\r\n * @category ISO Week Helpers\r\n * @summary Return the end of an ISO week for the given date.\r\n *\r\n * @description\r\n * Return the end of an ISO week for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of an ISO week\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The end of an ISO week for 2 September 2014 11:55:00:\r\n * var result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Sun Sep 07 2014 23:59:59.999\r\n */\r\nexport default function endOfISOWeek(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return endOfWeek(dirtyDate, {\r\n weekStartsOn: 1\r\n });\r\n}\r\n","import getISOWeekYear from '../getISOWeekYear/index.js';\r\nimport startOfISOWeek from '../startOfISOWeek/index.js';\r\n/**\r\n * @name endOfISOWeekYear\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Return the end of an ISO week-numbering year for the given date.\r\n *\r\n * @description\r\n * Return the end of an ISO week-numbering year,\r\n * which always starts 3 days before the year's first Thursday.\r\n * The result will be in the local timezone.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `endOfISOYear` to `endOfISOWeekYear`.\r\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\r\n * This change makes the name consistent with\r\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of an ISO week-numbering year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The end of an ISO week-numbering year for 2 July 2005:\r\n * var result = endOfISOWeekYear(new Date(2005, 6, 2))\r\n * //=> Sun Jan 01 2006 23:59:59.999\r\n */\r\nexport default function endOfISOWeekYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var year = getISOWeekYear(dirtyDate);\r\n var fourthOfJanuaryOfNextYear = new Date(0);\r\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\r\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\r\n var date = startOfISOWeek(fourthOfJanuaryOfNextYear);\r\n date.setMilliseconds(date.getMilliseconds() - 1);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name endOfMinute\r\n * @category Minute Helpers\r\n * @summary Return the end of a minute for the given date.\r\n *\r\n * @description\r\n * Return the end of a minute for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of a minute\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The end of a minute for 1 December 2014 22:15:45.400:\r\n * var result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\r\n * //=> Mon Dec 01 2014 22:15:59.999\r\n */\r\nexport default function endOfMinute(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n date.setSeconds(59, 999);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name endOfMonth\r\n * @category Month Helpers\r\n * @summary Return the end of a month for the given date.\r\n *\r\n * @description\r\n * Return the end of a month for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of a month\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The end of a month for 2 September 2014 11:55:00:\r\n * var result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Tue Sep 30 2014 23:59:59.999\r\n */\r\nexport default function endOfMonth(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var month = date.getMonth();\r\n date.setFullYear(date.getFullYear(), month + 1, 0);\r\n date.setHours(23, 59, 59, 999);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name endOfQuarter\r\n * @category Quarter Helpers\r\n * @summary Return the end of a year quarter for the given date.\r\n *\r\n * @description\r\n * Return the end of a year quarter for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of a quarter\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The end of a quarter for 2 September 2014 11:55:00:\r\n * var result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Tue Sep 30 2014 23:59:59.999\r\n */\r\nexport default function endOfQuarter(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var currentMonth = date.getMonth();\r\n var month = currentMonth - currentMonth % 3 + 3;\r\n date.setMonth(month, 0);\r\n date.setHours(23, 59, 59, 999);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name endOfSecond\r\n * @category Second Helpers\r\n * @summary Return the end of a second for the given date.\r\n *\r\n * @description\r\n * Return the end of a second for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of a second\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The end of a second for 1 December 2014 22:15:45.400:\r\n * var result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\r\n * //=> Mon Dec 01 2014 22:15:45.999\r\n */\r\nexport default function endOfSecond(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n date.setMilliseconds(999);\r\n return date;\r\n}\r\n","import endOfDay from '../endOfDay/index.js';\r\n/**\r\n * @name endOfToday\r\n * @category Day Helpers\r\n * @summary Return the end of today.\r\n * @pure false\r\n *\r\n * @description\r\n * Return the end of today.\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @returns {Date} the end of today\r\n *\r\n * @example\r\n * // If today is 6 October 2014:\r\n * var result = endOfToday()\r\n * //=> Mon Oct 6 2014 23:59:59.999\r\n */\r\nexport default function endOfToday() {\r\n return endOfDay(Date.now());\r\n}\r\n","/**\r\n * @name endOfTomorrow\r\n * @category Day Helpers\r\n * @summary Return the end of tomorrow.\r\n * @pure false\r\n *\r\n * @description\r\n * Return the end of tomorrow.\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @returns {Date} the end of tomorrow\r\n *\r\n * @example\r\n * // If today is 6 October 2014:\r\n * var result = endOfTomorrow()\r\n * //=> Tue Oct 7 2014 23:59:59.999\r\n */\r\nexport default function endOfTomorrow() {\r\n var now = new Date();\r\n var year = now.getFullYear();\r\n var month = now.getMonth();\r\n var day = now.getDate();\r\n var date = new Date(0);\r\n date.setFullYear(year, month, day + 1);\r\n date.setHours(23, 59, 59, 999);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name endOfWeek\r\n * @category Week Helpers\r\n * @summary Return the end of a week for the given date.\r\n *\r\n * @description\r\n * Return the end of a week for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {Date} the end of a week\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n *\r\n * @example\r\n * // The end of a week for 2 September 2014 11:55:00:\r\n * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Sat Sep 06 2014 23:59:59.999\r\n *\r\n * @example\r\n * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:\r\n * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\r\n * //=> Sun Sep 07 2014 23:59:59.999\r\n */\r\nexport default function endOfWeek(dirtyDate, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\r\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\r\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\r\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\r\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\r\n }\r\n var date = toDate(dirtyDate);\r\n var day = date.getDay();\r\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\r\n date.setDate(date.getDate() + diff);\r\n date.setHours(23, 59, 59, 999);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name endOfYear\r\n * @category Year Helpers\r\n * @summary Return the end of a year for the given date.\r\n *\r\n * @description\r\n * Return the end of a year for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of a year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The end of a year for 2 September 2014 11:55:00:\r\n * var result = endOfYear(new Date(2014, 8, 2, 11, 55, 00))\r\n * //=> Wed Dec 31 2014 23:59:59.999\r\n */\r\nexport default function endOfYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n date.setFullYear(year + 1, 0, 0);\r\n date.setHours(23, 59, 59, 999);\r\n return date;\r\n}\r\n","/**\r\n * @name endOfYesterday\r\n * @category Day Helpers\r\n * @summary Return the end of yesterday.\r\n * @pure false\r\n *\r\n * @description\r\n * Return the end of yesterday.\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @returns {Date} the end of yesterday\r\n *\r\n * @example\r\n * // If today is 6 October 2014:\r\n * var result = endOfYesterday()\r\n * //=> Sun Oct 5 2014 23:59:59.999\r\n */\r\nexport default function endOfYesterday() {\r\n var now = new Date();\r\n var year = now.getFullYear();\r\n var month = now.getMonth();\r\n var day = now.getDate();\r\n var date = new Date(0);\r\n date.setFullYear(year, month, day - 1);\r\n date.setHours(23, 59, 59, 999);\r\n return date;\r\n}\r\n","import isValid from '../isValid/index.js';\r\nimport defaultLocale from '../locale/en-US/index.js';\r\nimport subMilliseconds from '../subMilliseconds/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport formatters from '../_lib/format/formatters/index.js';\r\nimport longFormatters from '../_lib/format/longFormatters/index.js';\r\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\r\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from '../_lib/protectedTokens/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js'; // This RegExp consists of three parts separated by `|`:\r\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\r\n// (one of the certain letters followed by `o`)\r\n// - (\\w)\\1* matches any sequences of the same letter\r\n// - '' matches two quote characters in a row\r\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\r\n// except a single quote symbol, which ends the sequence.\r\n// Two quote characters do not end the sequence.\r\n// If there is no matching single quote\r\n// then the sequence will continue until the end of the string.\r\n// - . matches any single character unmatched by previous parts of the RegExps\r\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\r\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\r\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\r\nvar escapedStringRegExp = /^'(.*?)'?$/;\r\nvar doubleQuoteRegExp = /''/g;\r\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\r\n/**\r\n * @name format\r\n * @category Common Helpers\r\n * @summary Format the date.\r\n *\r\n * @description\r\n * Return the formatted date string in the given format. The result may vary by locale.\r\n *\r\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\r\n * > See: https://git.io/fxCyr\r\n *\r\n * The characters wrapped between two single quotes characters (') are escaped.\r\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\r\n * (see the last example)\r\n *\r\n * Format of the string is based on Unicode Technical Standard #35:\r\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\r\n * with a few additions (see note 7 below the table).\r\n *\r\n * Accepted patterns:\r\n * | Unit | Pattern | Result examples | Notes |\r\n * |---------------------------------|---------|-----------------------------------|-------|\r\n * | Era | G..GGG | AD, BC | |\r\n * | | GGGG | Anno Domini, Before Christ | 2 |\r\n * | | GGGGG | A, B | |\r\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\r\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\r\n * | | yy | 44, 01, 00, 17 | 5 |\r\n * | | yyy | 044, 001, 1900, 2017 | 5 |\r\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\r\n * | | yyyyy | ... | 3,5 |\r\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\r\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\r\n * | | YY | 44, 01, 00, 17 | 5,8 |\r\n * | | YYY | 044, 001, 1900, 2017 | 5 |\r\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\r\n * | | YYYYY | ... | 3,5 |\r\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\r\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\r\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\r\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\r\n * | | RRRRR | ... | 3,5,7 |\r\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\r\n * | | uu | -43, 01, 1900, 2017 | 5 |\r\n * | | uuu | -043, 001, 1900, 2017 | 5 |\r\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\r\n * | | uuuuu | ... | 3,5 |\r\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\r\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\r\n * | | QQ | 01, 02, 03, 04 | |\r\n * | | QQQ | Q1, Q2, Q3, Q4 | |\r\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\r\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\r\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\r\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\r\n * | | qq | 01, 02, 03, 04 | |\r\n * | | qqq | Q1, Q2, Q3, Q4 | |\r\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\r\n * | | qqqqq | 1, 2, 3, 4 | 4 |\r\n * | Month (formatting) | M | 1, 2, ..., 12 | |\r\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\r\n * | | MM | 01, 02, ..., 12 | |\r\n * | | MMM | Jan, Feb, ..., Dec | |\r\n * | | MMMM | January, February, ..., December | 2 |\r\n * | | MMMMM | J, F, ..., D | |\r\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\r\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\r\n * | | LL | 01, 02, ..., 12 | |\r\n * | | LLL | Jan, Feb, ..., Dec | |\r\n * | | LLLL | January, February, ..., December | 2 |\r\n * | | LLLLL | J, F, ..., D | |\r\n * | Local week of year | w | 1, 2, ..., 53 | |\r\n * | | wo | 1st, 2nd, ..., 53th | 7 |\r\n * | | ww | 01, 02, ..., 53 | |\r\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\r\n * | | Io | 1st, 2nd, ..., 53th | 7 |\r\n * | | II | 01, 02, ..., 53 | 7 |\r\n * | Day of month | d | 1, 2, ..., 31 | |\r\n * | | do | 1st, 2nd, ..., 31st | 7 |\r\n * | | dd | 01, 02, ..., 31 | |\r\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\r\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\r\n * | | DD | 01, 02, ..., 365, 366 | 9 |\r\n * | | DDD | 001, 002, ..., 365, 366 | |\r\n * | | DDDD | ... | 3 |\r\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Su | |\r\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\r\n * | | EEEEE | M, T, W, T, F, S, S | |\r\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\r\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\r\n * | | io | 1st, 2nd, ..., 7th | 7 |\r\n * | | ii | 01, 02, ..., 07 | 7 |\r\n * | | iii | Mon, Tue, Wed, ..., Su | 7 |\r\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\r\n * | | iiiii | M, T, W, T, F, S, S | 7 |\r\n * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |\r\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\r\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\r\n * | | ee | 02, 03, ..., 01 | |\r\n * | | eee | Mon, Tue, Wed, ..., Su | |\r\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\r\n * | | eeeee | M, T, W, T, F, S, S | |\r\n * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\r\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\r\n * | | co | 2nd, 3rd, ..., 1st | 7 |\r\n * | | cc | 02, 03, ..., 01 | |\r\n * | | ccc | Mon, Tue, Wed, ..., Su | |\r\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\r\n * | | ccccc | M, T, W, T, F, S, S | |\r\n * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\r\n * | AM, PM | a..aaa | AM, PM | |\r\n * | | aaaa | a.m., p.m. | 2 |\r\n * | | aaaaa | a, p | |\r\n * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |\r\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\r\n * | | bbbbb | a, p, n, mi | |\r\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\r\n * | | BBBB | at night, in the morning, ... | 2 |\r\n * | | BBBBB | at night, in the morning, ... | |\r\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\r\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\r\n * | | hh | 01, 02, ..., 11, 12 | |\r\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\r\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\r\n * | | HH | 00, 01, 02, ..., 23 | |\r\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\r\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\r\n * | | KK | 1, 2, ..., 11, 0 | |\r\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\r\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\r\n * | | kk | 24, 01, 02, ..., 23 | |\r\n * | Minute | m | 0, 1, ..., 59 | |\r\n * | | mo | 0th, 1st, ..., 59th | 7 |\r\n * | | mm | 00, 01, ..., 59 | |\r\n * | Second | s | 0, 1, ..., 59 | |\r\n * | | so | 0th, 1st, ..., 59th | 7 |\r\n * | | ss | 00, 01, ..., 59 | |\r\n * | Fraction of second | S | 0, 1, ..., 9 | |\r\n * | | SS | 00, 01, ..., 99 | |\r\n * | | SSS | 000, 0001, ..., 999 | |\r\n * | | SSSS | ... | 3 |\r\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\r\n * | | XX | -0800, +0530, Z | |\r\n * | | XXX | -08:00, +05:30, Z | |\r\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\r\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\r\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\r\n * | | xx | -0800, +0530, +0000 | |\r\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\r\n * | | xxxx | -0800, +0530, +0000, +123456 | |\r\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\r\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\r\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\r\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\r\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\r\n * | Seconds timestamp | t | 512969520 | 7 |\r\n * | | tt | ... | 3,7 |\r\n * | Milliseconds timestamp | T | 512969520900 | 7 |\r\n * | | TT | ... | 3,7 |\r\n * | Long localized date | P | 05/29/1453 | 7 |\r\n * | | PP | May 29, 1453 | 7 |\r\n * | | PPP | May 29th, 1453 | 7 |\r\n * | | PPPP | Sunday, May 29th, 1453 | 2,7 |\r\n * | Long localized time | p | 12:00 AM | 7 |\r\n * | | pp | 12:00:00 AM | 7 |\r\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\r\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\r\n * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |\r\n * | | PPpp | May 29, 1453, 12:00:00 AM | 7 |\r\n * | | PPPppp | May 29th, 1453 at ... | 7 |\r\n * | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 |\r\n * Notes:\r\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\r\n * are the same as \"stand-alone\" units, but are different in some languages.\r\n * \"Formatting\" units are declined according to the rules of the language\r\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\r\n *\r\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\r\n *\r\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\r\n *\r\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\r\n * the single quote characters (see below).\r\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\r\n * the output will be the same as default pattern for this unit, usually\r\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\r\n * are marked with \"2\" in the last column of the table.\r\n *\r\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\r\n *\r\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\r\n *\r\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\r\n *\r\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\r\n *\r\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\r\n *\r\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\r\n * The output will be padded with zeros to match the length of the pattern.\r\n *\r\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\r\n *\r\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\r\n * These tokens represent the shortest form of the quarter.\r\n *\r\n * 5. The main difference between `y` and `u` patterns are B.C. years:\r\n *\r\n * | Year | `y` | `u` |\r\n * |------|-----|-----|\r\n * | AC 1 | 1 | 1 |\r\n * | BC 1 | 1 | 0 |\r\n * | BC 2 | 2 | -1 |\r\n *\r\n * Also `yy` always returns the last two digits of a year,\r\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\r\n *\r\n * | Year | `yy` | `uu` |\r\n * |------|------|------|\r\n * | 1 | 01 | 01 |\r\n * | 14 | 14 | 14 |\r\n * | 376 | 76 | 376 |\r\n * | 1453 | 53 | 1453 |\r\n *\r\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\r\n * except local week-numbering years are dependent on `options.weekStartsOn`\r\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\r\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\r\n *\r\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\r\n * so right now these tokens fall back to GMT timezones.\r\n *\r\n * 7. These patterns are not in the Unicode Technical Standard #35:\r\n * - `i`: ISO day of week\r\n * - `I`: ISO week of year\r\n * - `R`: ISO week-numbering year\r\n * - `t`: seconds timestamp\r\n * - `T`: milliseconds timestamp\r\n * - `o`: ordinal number modifier\r\n * - `P`: long localized date\r\n * - `p`: long localized time\r\n *\r\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\r\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\r\n *\r\n * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\r\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The second argument is now required for the sake of explicitness.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n * format(new Date(2016, 0, 1))\r\n *\r\n * // v2.0.0 onward\r\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\r\n * ```\r\n *\r\n * - New format string API for `format` function\r\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\r\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\r\n *\r\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @param {String} format - the string of tokens\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\r\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\r\n * see: https://git.io/fxCyr\r\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\r\n * see: https://git.io/fxCyr\r\n * @returns {String} the formatted date string\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} `options.locale` must contain `localize` property\r\n * @throws {RangeError} `options.locale` must contain `formatLong` property\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\r\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr\r\n * @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr\r\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr\r\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr\r\n * @throws {RangeError} format string contains an unescaped latin alphabet character\r\n *\r\n * @example\r\n * // Represent 11 February 2014 in middle-endian format:\r\n * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\r\n * //=> '02/11/2014'\r\n *\r\n * @example\r\n * // Represent 2 July 2014 in Esperanto:\r\n * import { eoLocale } from 'date-fns/locale/eo'\r\n * var result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\r\n * locale: eoLocale\r\n * })\r\n * //=> '2-a de julio 2014'\r\n *\r\n * @example\r\n * // Escape string by single quote characters:\r\n * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\r\n * //=> \"3 o'clock\"\r\n */\r\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var formatStr = String(dirtyFormatStr);\r\n var options = dirtyOptions || {};\r\n var locale = options.locale || defaultLocale;\r\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\r\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\r\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\r\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\r\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\r\n }\r\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\r\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\r\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\r\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\r\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\r\n }\r\n if (!locale.localize) {\r\n throw new RangeError('locale must contain localize property');\r\n }\r\n if (!locale.formatLong) {\r\n throw new RangeError('locale must contain formatLong property');\r\n }\r\n var originalDate = toDate(dirtyDate);\r\n if (!isValid(originalDate)) {\r\n throw new RangeError('Invalid time value');\r\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\r\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\r\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\r\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\r\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\r\n var formatterOptions = {\r\n firstWeekContainsDate: firstWeekContainsDate,\r\n weekStartsOn: weekStartsOn,\r\n locale: locale,\r\n _originalDate: originalDate\r\n };\r\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\r\n var firstCharacter = substring[0];\r\n if (firstCharacter === 'p' || firstCharacter === 'P') {\r\n var longFormatter = longFormatters[firstCharacter];\r\n return longFormatter(substring, locale.formatLong, formatterOptions);\r\n }\r\n return substring;\r\n }).join('').match(formattingTokensRegExp).map(function (substring) {\r\n // Replace two single quote characters with one single quote character\r\n if (substring === \"''\") {\r\n return \"'\";\r\n }\r\n var firstCharacter = substring[0];\r\n if (firstCharacter === \"'\") {\r\n return cleanEscapedString(substring);\r\n }\r\n var formatter = formatters[firstCharacter];\r\n if (formatter) {\r\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\r\n throwProtectedError(substring);\r\n }\r\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\r\n throwProtectedError(substring);\r\n }\r\n return formatter(utcDate, substring, locale.localize, formatterOptions);\r\n }\r\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\r\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\r\n }\r\n return substring;\r\n }).join('');\r\n return result;\r\n}\r\nfunction cleanEscapedString(input) {\r\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\r\n}\r\n","import compareAsc from '../compareAsc/index.js';\r\nimport differenceInMonths from '../differenceInMonths/index.js';\r\nimport differenceInSeconds from '../differenceInSeconds/index.js';\r\nimport defaultLocale from '../locale/en-US/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport cloneObject from '../_lib/cloneObject/index.js';\r\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\r\nvar MINUTES_IN_DAY = 1440;\r\nvar MINUTES_IN_ALMOST_TWO_DAYS = 2520;\r\nvar MINUTES_IN_MONTH = 43200;\r\nvar MINUTES_IN_TWO_MONTHS = 86400;\r\n/**\r\n * @name formatDistance\r\n * @category Common Helpers\r\n * @summary Return the distance between the given dates in words.\r\n *\r\n * @description\r\n * Return the distance between the given dates in words.\r\n *\r\n * | Distance between dates | Result |\r\n * |-------------------------------------------------------------------|---------------------|\r\n * | 0 ... 30 secs | less than a minute |\r\n * | 30 secs ... 1 min 30 secs | 1 minute |\r\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\r\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\r\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\r\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\r\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\r\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\r\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\r\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\r\n * | 1 yr ... 1 yr 3 months | about 1 year |\r\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\r\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\r\n * | N yrs ... N yrs 3 months | about N years |\r\n * | N yrs 3 months ... N yrs 9 months | over N years |\r\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\r\n *\r\n * With `options.includeSeconds == true`:\r\n * | Distance between dates | Result |\r\n * |------------------------|----------------------|\r\n * | 0 secs ... 5 secs | less than 5 seconds |\r\n * | 5 secs ... 10 secs | less than 10 seconds |\r\n * | 10 secs ... 20 secs | less than 20 seconds |\r\n * | 20 secs ... 40 secs | half a minute |\r\n * | 40 secs ... 60 secs | less than a minute |\r\n * | 60 secs ... 90 secs | 1 minute |\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `distanceInWords ` to `formatDistance`\r\n * to make its name consistent with `format` and `formatRelative`.\r\n *\r\n * - The order of arguments is swapped to make the function\r\n * consistent with `differenceIn...` functions.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n *\r\n * distanceInWords(\r\n * new Date(1986, 3, 4, 10, 32, 0),\r\n * new Date(1986, 3, 4, 11, 32, 0),\r\n * { addSuffix: true }\r\n * ) //=> 'in about 1 hour'\r\n *\r\n * // v2.0.0 onward\r\n *\r\n * formatDistance(\r\n * new Date(1986, 3, 4, 11, 32, 0),\r\n * new Date(1986, 3, 4, 10, 32, 0),\r\n * { addSuffix: true }\r\n * ) //=> 'in about 1 hour'\r\n * ```\r\n *\r\n * @param {Date|Number} date - the date\r\n * @param {Date|Number} baseDate - the date to compare with\r\n * @param {Object} [options] - an object with options.\r\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\r\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @returns {String} the distance in words\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\r\n *\r\n * @example\r\n * // What is the distance between 2 July 2014 and 1 January 2015?\r\n * var result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\r\n * //=> '6 months'\r\n *\r\n * @example\r\n * // What is the distance between 1 January 2015 00:00:15\r\n * // and 1 January 2015 00:00:00, including seconds?\r\n * var result = formatDistance(\r\n * new Date(2015, 0, 1, 0, 0, 15),\r\n * new Date(2015, 0, 1, 0, 0, 0),\r\n * { includeSeconds: true }\r\n * )\r\n * //=> 'less than 20 seconds'\r\n *\r\n * @example\r\n * // What is the distance from 1 January 2016\r\n * // to 1 January 2015, with a suffix?\r\n * var result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\r\n * addSuffix: true\r\n * })\r\n * //=> 'about 1 year ago'\r\n *\r\n * @example\r\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\r\n * import { eoLocale } from 'date-fns/locale/eo'\r\n * var result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\r\n * locale: eoLocale\r\n * })\r\n * //=> 'pli ol 1 jaro'\r\n */\r\nexport default function formatDistance(dirtyDate, dirtyBaseDate, dirtyOptions) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale || defaultLocale;\r\n if (!locale.formatDistance) {\r\n throw new RangeError('locale must contain formatDistance property');\r\n }\r\n var comparison = compareAsc(dirtyDate, dirtyBaseDate);\r\n if (isNaN(comparison)) {\r\n throw new RangeError('Invalid time value');\r\n }\r\n var localizeOptions = cloneObject(options);\r\n localizeOptions.addSuffix = Boolean(options.addSuffix);\r\n localizeOptions.comparison = comparison;\r\n var dateLeft;\r\n var dateRight;\r\n if (comparison > 0) {\r\n dateLeft = toDate(dirtyBaseDate);\r\n dateRight = toDate(dirtyDate);\r\n } else {\r\n dateLeft = toDate(dirtyDate);\r\n dateRight = toDate(dirtyBaseDate);\r\n }\r\n var seconds = differenceInSeconds(dateRight, dateLeft);\r\n var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000;\r\n var minutes = Math.round((seconds - offsetInSeconds) / 60);\r\n var months; // 0 up to 2 mins\r\n if (minutes < 2) {\r\n if (options.includeSeconds) {\r\n if (seconds < 5) {\r\n return locale.formatDistance('lessThanXSeconds', 5, localizeOptions);\r\n } else if (seconds < 10) {\r\n return locale.formatDistance('lessThanXSeconds', 10, localizeOptions);\r\n } else if (seconds < 20) {\r\n return locale.formatDistance('lessThanXSeconds', 20, localizeOptions);\r\n } else if (seconds < 40) {\r\n return locale.formatDistance('halfAMinute', null, localizeOptions);\r\n } else if (seconds < 60) {\r\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\r\n } else {\r\n return locale.formatDistance('xMinutes', 1, localizeOptions);\r\n }\r\n } else {\r\n if (minutes === 0) {\r\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\r\n } else {\r\n return locale.formatDistance('xMinutes', minutes, localizeOptions);\r\n }\r\n } // 2 mins up to 0.75 hrs\r\n } else if (minutes < 45) {\r\n return locale.formatDistance('xMinutes', minutes, localizeOptions); // 0.75 hrs up to 1.5 hrs\r\n } else if (minutes < 90) {\r\n return locale.formatDistance('aboutXHours', 1, localizeOptions); // 1.5 hrs up to 24 hrs\r\n } else if (minutes < MINUTES_IN_DAY) {\r\n var hours = Math.round(minutes / 60);\r\n return locale.formatDistance('aboutXHours', hours, localizeOptions); // 1 day up to 1.75 days\r\n } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {\r\n return locale.formatDistance('xDays', 1, localizeOptions); // 1.75 days up to 30 days\r\n } else if (minutes < MINUTES_IN_MONTH) {\r\n var days = Math.round(minutes / MINUTES_IN_DAY);\r\n return locale.formatDistance('xDays', days, localizeOptions); // 1 month up to 2 months\r\n } else if (minutes < MINUTES_IN_TWO_MONTHS) {\r\n months = Math.round(minutes / MINUTES_IN_MONTH);\r\n return locale.formatDistance('aboutXMonths', months, localizeOptions);\r\n }\r\n months = differenceInMonths(dateRight, dateLeft); // 2 months up to 12 months\r\n if (months < 12) {\r\n var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH);\r\n return locale.formatDistance('xMonths', nearestMonth, localizeOptions); // 1 year up to max Date\r\n } else {\r\n var monthsSinceStartOfYear = months % 12;\r\n var years = Math.floor(months / 12); // N years up to 1 years 3 months\r\n if (monthsSinceStartOfYear < 3) {\r\n return locale.formatDistance('aboutXYears', years, localizeOptions); // N years 3 months up to N years 9 months\r\n } else if (monthsSinceStartOfYear < 9) {\r\n return locale.formatDistance('overXYears', years, localizeOptions); // N years 9 months up to N year 12 months\r\n } else {\r\n return locale.formatDistance('almostXYears', years + 1, localizeOptions);\r\n }\r\n }\r\n}\r\n","import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\r\nimport compareAsc from '../compareAsc/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport differenceInSeconds from '../differenceInSeconds/index.js';\r\nimport cloneObject from '../_lib/cloneObject/index.js';\r\nimport defaultLocale from '../locale/en-US/index.js';\r\nvar MINUTES_IN_DAY = 1440;\r\nvar MINUTES_IN_MONTH = 43200;\r\nvar MINUTES_IN_YEAR = 525600;\r\n/**\r\n * @name formatDistanceStrict\r\n * @category Common Helpers\r\n * @summary Return the distance between the given dates in words.\r\n *\r\n * @description\r\n * Return the distance between the given dates in words, using strict units.\r\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\r\n * 'less than' and the like.\r\n *\r\n * | Distance between dates | Result |\r\n * |------------------------|---------------------|\r\n * | 0 ... 59 secs | [0..59] seconds |\r\n * | 1 ... 59 mins | [1..59] minutes |\r\n * | 1 ... 23 hrs | [1..23] hours |\r\n * | 1 ... 29 days | [1..29] days |\r\n * | 1 ... 11 months | [1..11] months |\r\n * | 1 ... N years | [1..N] years |\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `distanceInWordsStrict` to `formatDistanceStrict`\r\n * to make its name consistent with `format` and `formatRelative`.\r\n *\r\n * - The order of arguments is swapped to make the function\r\n * consistent with `differenceIn...` functions.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n *\r\n * distanceInWordsStrict(\r\n * new Date(2015, 0, 2),\r\n * new Date(2014, 6, 2)\r\n * ) //=> '6 months'\r\n *\r\n * // v2.0.0 onward\r\n *\r\n * formatDistanceStrict(\r\n * new Date(2014, 6, 2),\r\n * new Date(2015, 0, 2)\r\n * ) //=> '6 months'\r\n * ```\r\n *\r\n * - `partialMethod` option is renamed to `roundingMethod`.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n *\r\n * distanceInWordsStrict(\r\n * new Date(1986, 3, 4, 10, 32, 0),\r\n * new Date(1986, 3, 4, 10, 33, 1),\r\n * { partialMethod: 'ceil' }\r\n * ) //=> '2 minutes'\r\n *\r\n * // v2.0.0 onward\r\n *\r\n * formatDistanceStrict(\r\n * new Date(1986, 3, 4, 10, 33, 1),\r\n * new Date(1986, 3, 4, 10, 32, 0),\r\n * { roundingMethod: 'ceil' }\r\n * ) //=> '2 minutes'\r\n * ```\r\n *\r\n * - If `roundingMethod` is not specified, it now defaults to `round` instead of `floor`.\r\n *\r\n * - `unit` option now accepts one of the strings:\r\n * 'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y'\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n *\r\n * distanceInWordsStrict(\r\n * new Date(1986, 3, 4, 10, 32, 0),\r\n * new Date(1986, 3, 4, 10, 33, 1),\r\n * { unit: 'm' }\r\n * )\r\n *\r\n * // v2.0.0 onward\r\n *\r\n * formatDistanceStrict(\r\n * new Date(1986, 3, 4, 10, 33, 1),\r\n * new Date(1986, 3, 4, 10, 32, 0),\r\n * { unit: 'minute' }\r\n * )\r\n * ```\r\n *\r\n * @param {Date|Number} date - the date\r\n * @param {Date|Number} baseDate - the date to compare with\r\n * @param {Object} [options] - an object with options.\r\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\r\n * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit\r\n * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @returns {String} the distance in words\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round'\r\n * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\r\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\r\n *\r\n * @example\r\n * // What is the distance between 2 July 2014 and 1 January 2015?\r\n * var result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\r\n * //=> '6 months'\r\n *\r\n * @example\r\n * // What is the distance between 1 January 2015 00:00:15\r\n * // and 1 January 2015 00:00:00?\r\n * var result = formatDistanceStrict(\r\n * new Date(2015, 0, 1, 0, 0, 15),\r\n * new Date(2015, 0, 1, 0, 0, 0)\r\n * )\r\n * //=> '15 seconds'\r\n *\r\n * @example\r\n * // What is the distance from 1 January 2016\r\n * // to 1 January 2015, with a suffix?\r\n * var result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\r\n * addSuffix: true\r\n * })\r\n * //=> '1 year ago'\r\n *\r\n * @example\r\n * // What is the distance from 1 January 2016\r\n * // to 1 January 2015, in minutes?\r\n * var result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\r\n * unit: 'minute'\r\n * })\r\n * //=> '525600 minutes'\r\n *\r\n * @example\r\n * // What is the distance from 1 January 2015\r\n * // to 28 January 2015, in months, rounded up?\r\n * var result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\r\n * unit: 'month',\r\n * roundingMethod: 'ceil'\r\n * })\r\n * //=> '1 month'\r\n *\r\n * @example\r\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\r\n * import { eoLocale } from 'date-fns/locale/eo'\r\n * var result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\r\n * locale: eoLocale\r\n * })\r\n * //=> '1 jaro'\r\n */\r\nexport default function formatDistanceStrict(dirtyDate, dirtyBaseDate, dirtyOptions) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale || defaultLocale;\r\n if (!locale.formatDistance) {\r\n throw new RangeError('locale must contain localize.formatDistance property');\r\n }\r\n var comparison = compareAsc(dirtyDate, dirtyBaseDate);\r\n if (isNaN(comparison)) {\r\n throw new RangeError('Invalid time value');\r\n }\r\n var localizeOptions = cloneObject(options);\r\n localizeOptions.addSuffix = Boolean(options.addSuffix);\r\n localizeOptions.comparison = comparison;\r\n var dateLeft;\r\n var dateRight;\r\n if (comparison > 0) {\r\n dateLeft = toDate(dirtyBaseDate);\r\n dateRight = toDate(dirtyDate);\r\n } else {\r\n dateLeft = toDate(dirtyDate);\r\n dateRight = toDate(dirtyBaseDate);\r\n }\r\n var roundingMethod = options.roundingMethod == null ? 'round' : String(options.roundingMethod);\r\n var roundingMethodFn;\r\n if (roundingMethod === 'floor') {\r\n roundingMethodFn = Math.floor;\r\n } else if (roundingMethod === 'ceil') {\r\n roundingMethodFn = Math.ceil;\r\n } else if (roundingMethod === 'round') {\r\n roundingMethodFn = Math.round;\r\n } else {\r\n throw new RangeError(\"roundingMethod must be 'floor', 'ceil' or 'round'\");\r\n }\r\n var seconds = differenceInSeconds(dateRight, dateLeft);\r\n var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000;\r\n var minutes = roundingMethodFn((seconds - offsetInSeconds) / 60);\r\n var unit;\r\n if (options.unit == null) {\r\n if (minutes < 1) {\r\n unit = 'second';\r\n } else if (minutes < 60) {\r\n unit = 'minute';\r\n } else if (minutes < MINUTES_IN_DAY) {\r\n unit = 'hour';\r\n } else if (minutes < MINUTES_IN_MONTH) {\r\n unit = 'day';\r\n } else if (minutes < MINUTES_IN_YEAR) {\r\n unit = 'month';\r\n } else {\r\n unit = 'year';\r\n }\r\n } else {\r\n unit = String(options.unit);\r\n } // 0 up to 60 seconds\r\n if (unit === 'second') {\r\n return locale.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins\r\n } else if (unit === 'minute') {\r\n return locale.formatDistance('xMinutes', minutes, localizeOptions); // 1 up to 24 hours\r\n } else if (unit === 'hour') {\r\n var hours = roundingMethodFn(minutes / 60);\r\n return locale.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days\r\n } else if (unit === 'day') {\r\n var days = roundingMethodFn(minutes / MINUTES_IN_DAY);\r\n return locale.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months\r\n } else if (unit === 'month') {\r\n var months = roundingMethodFn(minutes / MINUTES_IN_MONTH);\r\n return locale.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date\r\n } else if (unit === 'year') {\r\n var years = roundingMethodFn(minutes / MINUTES_IN_YEAR);\r\n return locale.formatDistance('xYears', years, localizeOptions);\r\n }\r\n throw new RangeError(\"unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\");\r\n}\r\n","import distanceInWords from '../formatDistance/index.js';\r\n/**\r\n * @name formatDistanceToNow\r\n * @category Common Helpers\r\n * @summary Return the distance between the given date and now in words.\r\n * @pure false\r\n *\r\n * @description\r\n * Return the distance between the given date and now in words.\r\n *\r\n * | Distance to now | Result |\r\n * |-------------------------------------------------------------------|---------------------|\r\n * | 0 ... 30 secs | less than a minute |\r\n * | 30 secs ... 1 min 30 secs | 1 minute |\r\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\r\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\r\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\r\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\r\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\r\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\r\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\r\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\r\n * | 1 yr ... 1 yr 3 months | about 1 year |\r\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\r\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\r\n * | N yrs ... N yrs 3 months | about N years |\r\n * | N yrs 3 months ... N yrs 9 months | over N years |\r\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\r\n *\r\n * With `options.includeSeconds == true`:\r\n * | Distance to now | Result |\r\n * |---------------------|----------------------|\r\n * | 0 secs ... 5 secs | less than 5 seconds |\r\n * | 5 secs ... 10 secs | less than 10 seconds |\r\n * | 10 secs ... 20 secs | less than 20 seconds |\r\n * | 20 secs ... 40 secs | half a minute |\r\n * | 40 secs ... 60 secs | less than a minute |\r\n * | 60 secs ... 90 secs | 1 minute |\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `distanceInWordsToNow ` to `formatDistanceToNow`\r\n * to make its name consistent with `format` and `formatRelative`.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n *\r\n * distanceInWordsToNow(new Date(2014, 6, 2), { addSuffix: true })\r\n * //=> 'in 6 months'\r\n *\r\n * // v2.0.0 onward\r\n *\r\n * formatDistanceToNow(new Date(2014, 6, 2), { addSuffix: true })\r\n * //=> 'in 6 months'\r\n * ```\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @param {Object} [options] - the object with options\r\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\r\n * @param {Boolean} [options.addSuffix=false] - result specifies if now is earlier or later than the passed date\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @returns {String} the distance in words\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\r\n *\r\n * @example\r\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\r\n * var result = formatDistanceToNow(\r\n * new Date(2014, 6, 2)\r\n * )\r\n * //=> '6 months'\r\n *\r\n * @example\r\n * // If now is 1 January 2015 00:00:00,\r\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\r\n * var result = formatDistanceToNow(\r\n * new Date(2015, 0, 1, 0, 0, 15),\r\n * {includeSeconds: true}\r\n * )\r\n * //=> 'less than 20 seconds'\r\n *\r\n * @example\r\n * // If today is 1 January 2015,\r\n * // what is the distance to 1 January 2016, with a suffix?\r\n * var result = formatDistanceToNow(\r\n * new Date(2016, 0, 1),\r\n * {addSuffix: true}\r\n * )\r\n * //=> 'in about 1 year'\r\n *\r\n * @example\r\n * // If today is 1 January 2015,\r\n * // what is the distance to 1 August 2016 in Esperanto?\r\n * var eoLocale = require('date-fns/locale/eo')\r\n * var result = formatDistanceToNow(\r\n * new Date(2016, 7, 1),\r\n * {locale: eoLocale}\r\n * )\r\n * //=> 'pli ol 1 jaro'\r\n */\r\nexport default function formatDistanceToNow(dirtyDate, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return distanceInWords(dirtyDate, Date.now(), dirtyOptions);\r\n}\r\n","import differenceInCalendarDays from '../differenceInCalendarDays/index.js';\r\nimport format from '../format/index.js';\r\nimport defaultLocale from '../locale/en-US/index.js';\r\nimport subMilliseconds from '../subMilliseconds/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\r\n/**\r\n * @name formatRelative\r\n * @category Common Helpers\r\n * @summary Represent the date in words relative to the given base date.\r\n *\r\n * @description\r\n * Represent the date in words relative to the given base date.\r\n *\r\n * | Distance to the base date | Result |\r\n * |---------------------------|---------------------------|\r\n * | Previous 6 days | last Sunday at 04:30 AM |\r\n * | Last day | yesterday at 04:30 AM |\r\n * | Same day | today at 04:30 AM |\r\n * | Next day | tomorrow at 04:30 AM |\r\n * | Next 6 days | Sunday at 04:30 AM |\r\n * | Other | 12/31/2017 |\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to format\r\n * @param {Date|Number} baseDate - the date to compare with\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {String} the date in words\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n * @throws {RangeError} `options.locale` must contain `localize` property\r\n * @throws {RangeError} `options.locale` must contain `formatLong` property\r\n * @throws {RangeError} `options.locale` must contain `formatRelative` property\r\n */\r\nexport default function formatRelative(dirtyDate, dirtyBaseDate, dirtyOptions) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var baseDate = toDate(dirtyBaseDate);\r\n var options = dirtyOptions || {};\r\n var locale = options.locale || defaultLocale;\r\n if (!locale.localize) {\r\n throw new RangeError('locale must contain localize property');\r\n }\r\n if (!locale.formatLong) {\r\n throw new RangeError('locale must contain formatLong property');\r\n }\r\n if (!locale.formatRelative) {\r\n throw new RangeError('locale must contain formatRelative property');\r\n }\r\n var diff = differenceInCalendarDays(date, baseDate);\r\n if (isNaN(diff)) {\r\n throw new RangeError('Invalid time value');\r\n }\r\n var token;\r\n if (diff < -6) {\r\n token = 'other';\r\n } else if (diff < -1) {\r\n token = 'lastWeek';\r\n } else if (diff < 0) {\r\n token = 'yesterday';\r\n } else if (diff < 1) {\r\n token = 'today';\r\n } else if (diff < 2) {\r\n token = 'tomorrow';\r\n } else if (diff < 7) {\r\n token = 'nextWeek';\r\n } else {\r\n token = 'other';\r\n }\r\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\r\n var utcBaseDate = subMilliseconds(baseDate, getTimezoneOffsetInMilliseconds(baseDate));\r\n var formatStr = locale.formatRelative(token, utcDate, utcBaseDate, options);\r\n return format(date, formatStr, options);\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name fromUnixTime\r\n * @category Timestamp Helpers\r\n * @summary Create a date from a Unix timestamp.\r\n *\r\n * @description\r\n * Create a date from a Unix timestamp.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Number} unixTime - the given Unix timestamp\r\n * @returns {Date} the date\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Create the date 29 February 2012 11:45:05:\r\n * var result = fromUnixTime(1330515905)\r\n * //=> Wed Feb 29 2012 11:45:05\r\n */\r\nexport default function fromUnixTime(dirtyUnixTime) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var unixTime = toInteger(dirtyUnixTime);\r\n return toDate(unixTime * 1000);\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getDate\r\n * @category Day Helpers\r\n * @summary Get the day of the month of the given date.\r\n *\r\n * @description\r\n * Get the day of the month of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the day of month\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which day of the month is 29 February 2012?\r\n * var result = getDate(new Date(2012, 1, 29))\r\n * //=> 29\r\n */\r\nexport default function getDate(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var dayOfMonth = date.getDate();\r\n return dayOfMonth;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getDay\r\n * @category Weekday Helpers\r\n * @summary Get the day of the week of the given date.\r\n *\r\n * @description\r\n * Get the day of the week of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the day of week\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which day of the week is 29 February 2012?\r\n * var result = getDay(new Date(2012, 1, 29))\r\n * //=> 3\r\n */\r\nexport default function getDay(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var day = date.getDay();\r\n return day;\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport startOfYear from '../startOfYear/index.js';\r\nimport differenceInCalendarDays from '../differenceInCalendarDays/index.js';\r\n/**\r\n * @name getDayOfYear\r\n * @category Day Helpers\r\n * @summary Get the day of the year of the given date.\r\n *\r\n * @description\r\n * Get the day of the year of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the day of year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which day of the year is 2 July 2014?\r\n * var result = getDayOfYear(new Date(2014, 6, 2))\r\n * //=> 183\r\n */\r\nexport default function getDayOfYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var diff = differenceInCalendarDays(date, startOfYear(date));\r\n var dayOfYear = diff + 1;\r\n return dayOfYear;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getDaysInMonth\r\n * @category Month Helpers\r\n * @summary Get the number of days in a month of the given date.\r\n *\r\n * @description\r\n * Get the number of days in a month of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the number of days in a month\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // How many days are in February 2000?\r\n * var result = getDaysInMonth(new Date(2000, 1))\r\n * //=> 29\r\n */\r\nexport default function getDaysInMonth(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n var monthIndex = date.getMonth();\r\n var lastDayOfMonth = new Date(0);\r\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\r\n lastDayOfMonth.setHours(0, 0, 0, 0);\r\n return lastDayOfMonth.getDate();\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport isLeapYear from '../isLeapYear/index.js';\r\n/**\r\n * @name getDaysInYear\r\n * @category Year Helpers\r\n * @summary Get the number of days in a year of the given date.\r\n *\r\n * @description\r\n * Get the number of days in a year of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the number of days in a year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // How many days are in 2012?\r\n * var result = getDaysInYear(new Date(2012, 0, 1))\r\n * //=> 366\r\n */\r\nexport default function getDaysInYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n if (isNaN(date)) {\r\n return NaN;\r\n }\r\n return isLeapYear(date) ? 366 : 365;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getDecade\r\n * @category Decade Helpers\r\n * @summary Get the decade of the given date.\r\n *\r\n * @description\r\n * Get the decade of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the year of decade\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which decade belongs 27 November 1942?\r\n * var result = getDecade(new Date(1942, 10, 27))\r\n * //=> 1940\r\n */\r\nexport default function getDecade(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n var decade = Math.floor(year / 10) * 10;\r\n return decade;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getHours\r\n * @category Hour Helpers\r\n * @summary Get the hours of the given date.\r\n *\r\n * @description\r\n * Get the hours of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the hours\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Get the hours of 29 February 2012 11:45:00:\r\n * var result = getHours(new Date(2012, 1, 29, 11, 45))\r\n * //=> 11\r\n */\r\nexport default function getHours(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var hours = date.getHours();\r\n return hours;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getISODay\r\n * @category Weekday Helpers\r\n * @summary Get the day of the ISO week of the given date.\r\n *\r\n * @description\r\n * Get the day of the ISO week of the given date,\r\n * which is 7 for Sunday, 1 for Monday etc.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the day of ISO week\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which day of the ISO week is 26 February 2012?\r\n * var result = getISODay(new Date(2012, 1, 26))\r\n * //=> 7\r\n */\r\nexport default function getISODay(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var day = date.getDay();\r\n if (day === 0) {\r\n day = 7;\r\n }\r\n return day;\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport startOfISOWeek from '../startOfISOWeek/index.js';\r\nimport startOfISOWeekYear from '../startOfISOWeekYear/index.js';\r\nvar MILLISECONDS_IN_WEEK = 604800000;\r\n/**\r\n * @name getISOWeek\r\n * @category ISO Week Helpers\r\n * @summary Get the ISO week of the given date.\r\n *\r\n * @description\r\n * Get the ISO week of the given date.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the ISO week\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which week of the ISO-week numbering year is 2 January 2005?\r\n * var result = getISOWeek(new Date(2005, 0, 2))\r\n * //=> 53\r\n */\r\nexport default function getISOWeek(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var diff = startOfISOWeek(date).getTime() - startOfISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\r\n // because the number of milliseconds in a week is not constant\r\n // (e.g. it's different in the week of the daylight saving time clock shift)\r\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport startOfISOWeek from '../startOfISOWeek/index.js';\r\n/**\r\n * @name getISOWeekYear\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Get the ISO week-numbering year of the given date.\r\n *\r\n * @description\r\n * Get the ISO week-numbering year of the given date,\r\n * which always starts 3 days before the year's first Thursday.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `getISOYear` to `getISOWeekYear`.\r\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\r\n * This change makes the name consistent with\r\n * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the ISO week-numbering year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which ISO-week numbering year is 2 January 2005?\r\n * var result = getISOWeekYear(new Date(2005, 0, 2))\r\n * //=> 2004\r\n */\r\nexport default function getISOWeekYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n var fourthOfJanuaryOfNextYear = new Date(0);\r\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\r\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\r\n var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\r\n var fourthOfJanuaryOfThisYear = new Date(0);\r\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\r\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\r\n var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\r\n if (date.getTime() >= startOfNextYear.getTime()) {\r\n return year + 1;\r\n } else if (date.getTime() >= startOfThisYear.getTime()) {\r\n return year;\r\n } else {\r\n return year - 1;\r\n }\r\n}\r\n","import startOfISOWeekYear from '../startOfISOWeekYear/index.js';\r\nimport addWeeks from '../addWeeks/index.js';\r\nvar MILLISECONDS_IN_WEEK = 604800000;\r\n/**\r\n * @name getISOWeeksInYear\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Get the number of weeks in an ISO week-numbering year of the given date.\r\n *\r\n * @description\r\n * Get the number of weeks in an ISO week-numbering year of the given date.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the number of ISO weeks in a year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // How many weeks are in ISO week-numbering year 2015?\r\n * var result = getISOWeeksInYear(new Date(2015, 1, 11))\r\n * //=> 53\r\n */\r\nexport default function getISOWeeksInYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var thisYear = startOfISOWeekYear(dirtyDate);\r\n var nextYear = startOfISOWeekYear(addWeeks(thisYear, 60));\r\n var diff = nextYear.valueOf() - thisYear.valueOf(); // Round the number of weeks to the nearest integer\r\n // because the number of milliseconds in a week is not constant\r\n // (e.g. it's different in the week of the daylight saving time clock shift)\r\n return Math.round(diff / MILLISECONDS_IN_WEEK);\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getMilliseconds\r\n * @category Millisecond Helpers\r\n * @summary Get the milliseconds of the given date.\r\n *\r\n * @description\r\n * Get the milliseconds of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the milliseconds\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Get the milliseconds of 29 February 2012 11:45:05.123:\r\n * var result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))\r\n * //=> 123\r\n */\r\nexport default function getMilliseconds(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var milliseconds = date.getMilliseconds();\r\n return milliseconds;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getMinutes\r\n * @category Minute Helpers\r\n * @summary Get the minutes of the given date.\r\n *\r\n * @description\r\n * Get the minutes of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the minutes\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Get the minutes of 29 February 2012 11:45:05:\r\n * var result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))\r\n * //=> 45\r\n */\r\nexport default function getMinutes(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var minutes = date.getMinutes();\r\n return minutes;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getMonth\r\n * @category Month Helpers\r\n * @summary Get the month of the given date.\r\n *\r\n * @description\r\n * Get the month of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the month\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which month is 29 February 2012?\r\n * var result = getMonth(new Date(2012, 1, 29))\r\n * //=> 1\r\n */\r\nexport default function getMonth(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var month = date.getMonth();\r\n return month;\r\n}\r\n","import toDate from '../toDate/index.js';\r\nvar MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000;\r\n/**\r\n * @name getOverlappingDaysInIntervals\r\n * @category Interval Helpers\r\n * @summary Get the number of days that overlap in two time intervals\r\n *\r\n * @description\r\n * Get the number of days that overlap in two time intervals\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `getOverlappingDaysInRanges` to `getOverlappingDaysInIntervals`.\r\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\r\n *\r\n * ```\r\n * 2.1.3\r\n * time interval\r\n * part of the time axis limited by two instants\r\n * ```\r\n *\r\n * Also, this function now accepts an object with `start` and `end` properties\r\n * instead of two arguments as an interval.\r\n * This function now throws `RangeError` if the start of the interval is after its end\r\n * or if any date in the interval is `Invalid Date`.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n *\r\n * getOverlappingDaysInRanges(\r\n * new Date(2014, 0, 10), new Date(2014, 0, 20),\r\n * new Date(2014, 0, 17), new Date(2014, 0, 21)\r\n * )\r\n *\r\n * // v2.0.0 onward\r\n *\r\n * getOverlappingDaysInIntervals(\r\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\r\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\r\n * )\r\n * ```\r\n *\r\n * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link docs/Interval}\r\n * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link docs/Interval}\r\n * @returns {Number} the number of days that overlap in two time intervals\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} The start of an interval cannot be after its end\r\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\r\n *\r\n * @example\r\n * // For overlapping time intervals adds 1 for each started overlapping day:\r\n * getOverlappingDaysInIntervals(\r\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\r\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\r\n * )\r\n * //=> 3\r\n *\r\n * @example\r\n * // For non-overlapping time intervals returns 0:\r\n * getOverlappingDaysInIntervals(\r\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\r\n * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }\r\n * )\r\n * //=> 0\r\n */\r\nexport default function getOverlappingDaysInIntervals(dirtyIntervalLeft, dirtyIntervalRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var intervalLeft = dirtyIntervalLeft || {};\r\n var intervalRight = dirtyIntervalRight || {};\r\n var leftStartTime = toDate(intervalLeft.start).getTime();\r\n var leftEndTime = toDate(intervalLeft.end).getTime();\r\n var rightStartTime = toDate(intervalRight.start).getTime();\r\n var rightEndTime = toDate(intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\r\n if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {\r\n throw new RangeError('Invalid interval');\r\n }\r\n var isOverlapping = leftStartTime < rightEndTime && rightStartTime < leftEndTime;\r\n if (!isOverlapping) {\r\n return 0;\r\n }\r\n var overlapStartDate = rightStartTime < leftStartTime ? leftStartTime : rightStartTime;\r\n var overlapEndDate = rightEndTime > leftEndTime ? leftEndTime : rightEndTime;\r\n var differenceInMs = overlapEndDate - overlapStartDate;\r\n return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY);\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getQuarter\r\n * @category Quarter Helpers\r\n * @summary Get the year quarter of the given date.\r\n *\r\n * @description\r\n * Get the year quarter of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the quarter\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which quarter is 2 July 2014?\r\n * var result = getQuarter(new Date(2014, 6, 2))\r\n * //=> 3\r\n */\r\nexport default function getQuarter(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var quarter = Math.floor(date.getMonth() / 3) + 1;\r\n return quarter;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getSeconds\r\n * @category Second Helpers\r\n * @summary Get the seconds of the given date.\r\n *\r\n * @description\r\n * Get the seconds of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the seconds\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Get the seconds of 29 February 2012 11:45:05.123:\r\n * var result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123))\r\n * //=> 5\r\n */\r\nexport default function getSeconds(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var seconds = date.getSeconds();\r\n return seconds;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getTime\r\n * @category Timestamp Helpers\r\n * @summary Get the milliseconds timestamp of the given date.\r\n *\r\n * @description\r\n * Get the milliseconds timestamp of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the timestamp\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Get the timestamp of 29 February 2012 11:45:05.123:\r\n * var result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123))\r\n * //=> 1330515905123\r\n */\r\nexport default function getTime(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var timestamp = date.getTime();\r\n return timestamp;\r\n}\r\n","import getTime from '../getTime/index.js';\r\n/**\r\n * @name getUnixTime\r\n * @category Timestamp Helpers\r\n * @summary Get the seconds timestamp of the given date.\r\n *\r\n * @description\r\n * Get the seconds timestamp of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the timestamp\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Get the timestamp of 29 February 2012 11:45:05 CET:\r\n * var result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5))\r\n * //=> 1330512305\r\n */\r\nexport default function getUnixTime(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return Math.floor(getTime(dirtyDate) / 1000);\r\n}\r\n","import startOfWeek from '../startOfWeek/index.js';\r\nimport startOfWeekYear from '../startOfWeekYear/index.js';\r\nimport toDate from '../toDate/index.js';\r\nvar MILLISECONDS_IN_WEEK = 604800000;\r\n/**\r\n * @name getWeek\r\n * @category Week Helpers\r\n * @summary Get the local week index of the given date.\r\n *\r\n * @description\r\n * Get the local week index of the given date.\r\n * The exact calculation depends on the values of\r\n * `options.weekStartsOn` (which is the index of the first day of the week)\r\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\r\n * the first week of the week-numbering year)\r\n *\r\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\r\n * @returns {Number} the week\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\r\n *\r\n * @example\r\n * // Which week of the local week numbering year is 2 January 2005 with default options?\r\n * var result = getISOWeek(new Date(2005, 0, 2))\r\n * //=> 2\r\n *\r\n * // Which week of the local week numbering year is 2 January 2005,\r\n * // if Monday is the first day of the week,\r\n * // and the first week of the year always contains 4 January?\r\n * var result = getISOWeek(new Date(2005, 0, 2), {\r\n * weekStartsOn: 1,\r\n * firstWeekContainsDate: 4\r\n * })\r\n * //=> 53\r\n */\r\nexport default function getWeek(dirtyDate, options) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var diff = startOfWeek(date, options).getTime() - startOfWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\r\n // because the number of milliseconds in a week is not constant\r\n // (e.g. it's different in the week of the daylight saving time clock shift)\r\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\r\n}\r\n","import getDate from '../getDate/index.js';\r\nimport getDay from '../getDay/index.js';\r\nimport startOfMonth from '../startOfMonth/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name getWeekOfMonth\r\n * @category Week Helpers\r\n * @summary Get the week of the month of the given date.\r\n *\r\n * @description\r\n * Get the week of the month of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {Number} the week of month\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n *\r\n * @example\r\n * // Which week of the month is 9 November 2017?\r\n * var result = getWeekOfMonth(new Date(2017, 10, 9))\r\n * //=> 2\r\n */\r\nexport default function getWeekOfMonth(date, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\r\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\r\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\r\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\r\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\r\n }\r\n var currentDayOfMonth = getDate(date);\r\n if (isNaN(currentDayOfMonth)) {\r\n return currentDayOfMonth;\r\n }\r\n var startWeekDay = getDay(startOfMonth(date));\r\n var lastDayOfFirstWeek = 0;\r\n if (startWeekDay >= weekStartsOn) {\r\n lastDayOfFirstWeek = weekStartsOn + 7 - startWeekDay;\r\n } else {\r\n lastDayOfFirstWeek = weekStartsOn - startWeekDay;\r\n }\r\n var weekNumber = 1;\r\n if (currentDayOfMonth > lastDayOfFirstWeek) {\r\n var remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek;\r\n weekNumber = weekNumber + Math.ceil(remainingDaysAfterFirstWeek / 7);\r\n }\r\n return weekNumber;\r\n}\r\n","import startOfWeek from '../startOfWeek/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name getWeekYear\r\n * @category Week-Numbering Year Helpers\r\n * @summary Get the local week-numbering year of the given date.\r\n *\r\n * @description\r\n * Get the local week-numbering year of the given date.\r\n * The exact calculation depends on the values of\r\n * `options.weekStartsOn` (which is the index of the first day of the week)\r\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\r\n * the first week of the week-numbering year)\r\n *\r\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\r\n * @returns {Number} the local week-numbering year\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\r\n *\r\n * @example\r\n * // Which week numbering year is 26 December 2004 with the default settings?\r\n * var result = getWeekYear(new Date(2004, 11, 26))\r\n * //=> 2005\r\n *\r\n * @example\r\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\r\n * var result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\r\n * //=> 2004\r\n *\r\n * @example\r\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\r\n * var result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\r\n * //=> 2004\r\n */\r\nexport default function getWeekYear(dirtyDate, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\r\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\r\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\r\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\r\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\r\n }\r\n var firstWeekOfNextYear = new Date(0);\r\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\r\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\r\n var startOfNextYear = startOfWeek(firstWeekOfNextYear, dirtyOptions);\r\n var firstWeekOfThisYear = new Date(0);\r\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\r\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\r\n var startOfThisYear = startOfWeek(firstWeekOfThisYear, dirtyOptions);\r\n if (date.getTime() >= startOfNextYear.getTime()) {\r\n return year + 1;\r\n } else if (date.getTime() >= startOfThisYear.getTime()) {\r\n return year;\r\n } else {\r\n return year - 1;\r\n }\r\n}\r\n","import differenceInCalendarWeeks from '../differenceInCalendarWeeks/index.js';\r\nimport lastDayOfMonth from '../lastDayOfMonth/index.js';\r\nimport startOfMonth from '../startOfMonth/index.js';\r\n/**\r\n * @name getWeeksInMonth\r\n * @category Week Helpers\r\n * @summary Get the number of calendar weeks a month spans.\r\n *\r\n * @description\r\n * Get the number of calendar weeks the month in the given date spans.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {Number} the number of calendar weeks\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n *\r\n * @example\r\n * // How many calendar weeks does February 2015 span?\r\n * var result = getWeeksInMonth(new Date(2015, 1, 8))\r\n * //=> 4\r\n *\r\n * @example\r\n * // If the week starts on Monday,\r\n * // how many calendar weeks does July 2017 span?\r\n * var result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 })\r\n * //=> 6\r\n */\r\nexport default function getWeeksInMonth(date, options) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return differenceInCalendarWeeks(lastDayOfMonth(date), startOfMonth(date), options) + 1;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name getYear\r\n * @category Year Helpers\r\n * @summary Get the year of the given date.\r\n *\r\n * @description\r\n * Get the year of the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the given date\r\n * @returns {Number} the year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which year is 2 July 2014?\r\n * var result = getYear(new Date(2014, 6, 2))\r\n * //=> 2014\r\n */\r\nexport default function getYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n return year;\r\n}\r\n","// This file is generated automatically by `scripts/build/indices.js`. Please, don't change it.\r\nexport { default as addBusinessDays } from './addBusinessDays/index.js';\r\nexport { default as addDays } from './addDays/index.js';\r\nexport { default as addHours } from './addHours/index.js';\r\nexport { default as addISOWeekYears } from './addISOWeekYears/index.js';\r\nexport { default as addMilliseconds } from './addMilliseconds/index.js';\r\nexport { default as addMinutes } from './addMinutes/index.js';\r\nexport { default as addMonths } from './addMonths/index.js';\r\nexport { default as addQuarters } from './addQuarters/index.js';\r\nexport { default as addSeconds } from './addSeconds/index.js';\r\nexport { default as addWeeks } from './addWeeks/index.js';\r\nexport { default as addYears } from './addYears/index.js';\r\nexport { default as areIntervalsOverlapping } from './areIntervalsOverlapping/index.js';\r\nexport { default as closestIndexTo } from './closestIndexTo/index.js';\r\nexport { default as closestTo } from './closestTo/index.js';\r\nexport { default as compareAsc } from './compareAsc/index.js';\r\nexport { default as compareDesc } from './compareDesc/index.js';\r\nexport { default as differenceInBusinessDays } from './differenceInBusinessDays/index.js';\r\nexport { default as differenceInCalendarDays } from './differenceInCalendarDays/index.js';\r\nexport { default as differenceInCalendarISOWeekYears } from './differenceInCalendarISOWeekYears/index.js';\r\nexport { default as differenceInCalendarISOWeeks } from './differenceInCalendarISOWeeks/index.js';\r\nexport { default as differenceInCalendarMonths } from './differenceInCalendarMonths/index.js';\r\nexport { default as differenceInCalendarQuarters } from './differenceInCalendarQuarters/index.js';\r\nexport { default as differenceInCalendarWeeks } from './differenceInCalendarWeeks/index.js';\r\nexport { default as differenceInCalendarYears } from './differenceInCalendarYears/index.js';\r\nexport { default as differenceInDays } from './differenceInDays/index.js';\r\nexport { default as differenceInHours } from './differenceInHours/index.js';\r\nexport { default as differenceInISOWeekYears } from './differenceInISOWeekYears/index.js';\r\nexport { default as differenceInMilliseconds } from './differenceInMilliseconds/index.js';\r\nexport { default as differenceInMinutes } from './differenceInMinutes/index.js';\r\nexport { default as differenceInMonths } from './differenceInMonths/index.js';\r\nexport { default as differenceInQuarters } from './differenceInQuarters/index.js';\r\nexport { default as differenceInSeconds } from './differenceInSeconds/index.js';\r\nexport { default as differenceInWeeks } from './differenceInWeeks/index.js';\r\nexport { default as differenceInYears } from './differenceInYears/index.js';\r\nexport { default as eachDayOfInterval } from './eachDayOfInterval/index.js';\r\nexport { default as eachWeekOfInterval } from './eachWeekOfInterval/index.js';\r\nexport { default as eachWeekendOfInterval } from './eachWeekendOfInterval/index.js';\r\nexport { default as eachWeekendOfMonth } from './eachWeekendOfMonth/index.js';\r\nexport { default as eachWeekendOfYear } from './eachWeekendOfYear/index.js';\r\nexport { default as endOfDay } from './endOfDay/index.js';\r\nexport { default as endOfDecade } from './endOfDecade/index.js';\r\nexport { default as endOfHour } from './endOfHour/index.js';\r\nexport { default as endOfISOWeek } from './endOfISOWeek/index.js';\r\nexport { default as endOfISOWeekYear } from './endOfISOWeekYear/index.js';\r\nexport { default as endOfMinute } from './endOfMinute/index.js';\r\nexport { default as endOfMonth } from './endOfMonth/index.js';\r\nexport { default as endOfQuarter } from './endOfQuarter/index.js';\r\nexport { default as endOfSecond } from './endOfSecond/index.js';\r\nexport { default as endOfToday } from './endOfToday/index.js';\r\nexport { default as endOfTomorrow } from './endOfTomorrow/index.js';\r\nexport { default as endOfWeek } from './endOfWeek/index.js';\r\nexport { default as endOfYear } from './endOfYear/index.js';\r\nexport { default as endOfYesterday } from './endOfYesterday/index.js';\r\nexport { default as format } from './format/index.js';\r\nexport { default as formatDistance } from './formatDistance/index.js';\r\nexport { default as formatDistanceStrict } from './formatDistanceStrict/index.js';\r\nexport { default as formatDistanceToNow } from './formatDistanceToNow/index.js';\r\nexport { default as formatRelative } from './formatRelative/index.js';\r\nexport { default as fromUnixTime } from './fromUnixTime/index.js';\r\nexport { default as getDate } from './getDate/index.js';\r\nexport { default as getDay } from './getDay/index.js';\r\nexport { default as getDayOfYear } from './getDayOfYear/index.js';\r\nexport { default as getDaysInMonth } from './getDaysInMonth/index.js';\r\nexport { default as getDaysInYear } from './getDaysInYear/index.js';\r\nexport { default as getDecade } from './getDecade/index.js';\r\nexport { default as getHours } from './getHours/index.js';\r\nexport { default as getISODay } from './getISODay/index.js';\r\nexport { default as getISOWeek } from './getISOWeek/index.js';\r\nexport { default as getISOWeekYear } from './getISOWeekYear/index.js';\r\nexport { default as getISOWeeksInYear } from './getISOWeeksInYear/index.js';\r\nexport { default as getMilliseconds } from './getMilliseconds/index.js';\r\nexport { default as getMinutes } from './getMinutes/index.js';\r\nexport { default as getMonth } from './getMonth/index.js';\r\nexport { default as getOverlappingDaysInIntervals } from './getOverlappingDaysInIntervals/index.js';\r\nexport { default as getQuarter } from './getQuarter/index.js';\r\nexport { default as getSeconds } from './getSeconds/index.js';\r\nexport { default as getTime } from './getTime/index.js';\r\nexport { default as getUnixTime } from './getUnixTime/index.js';\r\nexport { default as getWeek } from './getWeek/index.js';\r\nexport { default as getWeekOfMonth } from './getWeekOfMonth/index.js';\r\nexport { default as getWeekYear } from './getWeekYear/index.js';\r\nexport { default as getWeeksInMonth } from './getWeeksInMonth/index.js';\r\nexport { default as getYear } from './getYear/index.js';\r\nexport { default as isAfter } from './isAfter/index.js';\r\nexport { default as isBefore } from './isBefore/index.js';\r\nexport { default as isDate } from './isDate/index.js';\r\nexport { default as isEqual } from './isEqual/index.js';\r\nexport { default as isFirstDayOfMonth } from './isFirstDayOfMonth/index.js';\r\nexport { default as isFriday } from './isFriday/index.js';\r\nexport { default as isFuture } from './isFuture/index.js';\r\nexport { default as isLastDayOfMonth } from './isLastDayOfMonth/index.js';\r\nexport { default as isLeapYear } from './isLeapYear/index.js';\r\nexport { default as isMonday } from './isMonday/index.js';\r\nexport { default as isPast } from './isPast/index.js';\r\nexport { default as isSameDay } from './isSameDay/index.js';\r\nexport { default as isSameHour } from './isSameHour/index.js';\r\nexport { default as isSameISOWeek } from './isSameISOWeek/index.js';\r\nexport { default as isSameISOWeekYear } from './isSameISOWeekYear/index.js';\r\nexport { default as isSameMinute } from './isSameMinute/index.js';\r\nexport { default as isSameMonth } from './isSameMonth/index.js';\r\nexport { default as isSameQuarter } from './isSameQuarter/index.js';\r\nexport { default as isSameSecond } from './isSameSecond/index.js';\r\nexport { default as isSameWeek } from './isSameWeek/index.js';\r\nexport { default as isSameYear } from './isSameYear/index.js';\r\nexport { default as isSaturday } from './isSaturday/index.js';\r\nexport { default as isSunday } from './isSunday/index.js';\r\nexport { default as isThisHour } from './isThisHour/index.js';\r\nexport { default as isThisISOWeek } from './isThisISOWeek/index.js';\r\nexport { default as isThisMinute } from './isThisMinute/index.js';\r\nexport { default as isThisMonth } from './isThisMonth/index.js';\r\nexport { default as isThisQuarter } from './isThisQuarter/index.js';\r\nexport { default as isThisSecond } from './isThisSecond/index.js';\r\nexport { default as isThisWeek } from './isThisWeek/index.js';\r\nexport { default as isThisYear } from './isThisYear/index.js';\r\nexport { default as isThursday } from './isThursday/index.js';\r\nexport { default as isToday } from './isToday/index.js';\r\nexport { default as isTomorrow } from './isTomorrow/index.js';\r\nexport { default as isTuesday } from './isTuesday/index.js';\r\nexport { default as isValid } from './isValid/index.js';\r\nexport { default as isWednesday } from './isWednesday/index.js';\r\nexport { default as isWeekend } from './isWeekend/index.js';\r\nexport { default as isWithinInterval } from './isWithinInterval/index.js';\r\nexport { default as isYesterday } from './isYesterday/index.js';\r\nexport { default as lastDayOfDecade } from './lastDayOfDecade/index.js';\r\nexport { default as lastDayOfISOWeek } from './lastDayOfISOWeek/index.js';\r\nexport { default as lastDayOfISOWeekYear } from './lastDayOfISOWeekYear/index.js';\r\nexport { default as lastDayOfMonth } from './lastDayOfMonth/index.js';\r\nexport { default as lastDayOfQuarter } from './lastDayOfQuarter/index.js';\r\nexport { default as lastDayOfWeek } from './lastDayOfWeek/index.js';\r\nexport { default as lastDayOfYear } from './lastDayOfYear/index.js';\r\nexport { default as lightFormat } from './lightFormat/index.js';\r\nexport { default as max } from './max/index.js';\r\nexport { default as min } from './min/index.js';\r\nexport { default as parse } from './parse/index.js';\r\nexport { default as parseISO } from './parseISO/index.js';\r\nexport { default as roundToNearestMinutes } from './roundToNearestMinutes/index.js';\r\nexport { default as setDate } from './setDate/index.js';\r\nexport { default as setDay } from './setDay/index.js';\r\nexport { default as setDayOfYear } from './setDayOfYear/index.js';\r\nexport { default as setHours } from './setHours/index.js';\r\nexport { default as setISODay } from './setISODay/index.js';\r\nexport { default as setISOWeek } from './setISOWeek/index.js';\r\nexport { default as setISOWeekYear } from './setISOWeekYear/index.js';\r\nexport { default as setMilliseconds } from './setMilliseconds/index.js';\r\nexport { default as setMinutes } from './setMinutes/index.js';\r\nexport { default as setMonth } from './setMonth/index.js';\r\nexport { default as setQuarter } from './setQuarter/index.js';\r\nexport { default as setSeconds } from './setSeconds/index.js';\r\nexport { default as setWeek } from './setWeek/index.js';\r\nexport { default as setWeekYear } from './setWeekYear/index.js';\r\nexport { default as setYear } from './setYear/index.js';\r\nexport { default as startOfDay } from './startOfDay/index.js';\r\nexport { default as startOfDecade } from './startOfDecade/index.js';\r\nexport { default as startOfHour } from './startOfHour/index.js';\r\nexport { default as startOfISOWeek } from './startOfISOWeek/index.js';\r\nexport { default as startOfISOWeekYear } from './startOfISOWeekYear/index.js';\r\nexport { default as startOfMinute } from './startOfMinute/index.js';\r\nexport { default as startOfMonth } from './startOfMonth/index.js';\r\nexport { default as startOfQuarter } from './startOfQuarter/index.js';\r\nexport { default as startOfSecond } from './startOfSecond/index.js';\r\nexport { default as startOfToday } from './startOfToday/index.js';\r\nexport { default as startOfTomorrow } from './startOfTomorrow/index.js';\r\nexport { default as startOfWeek } from './startOfWeek/index.js';\r\nexport { default as startOfWeekYear } from './startOfWeekYear/index.js';\r\nexport { default as startOfYear } from './startOfYear/index.js';\r\nexport { default as startOfYesterday } from './startOfYesterday/index.js';\r\nexport { default as subDays } from './subDays/index.js';\r\nexport { default as subHours } from './subHours/index.js';\r\nexport { default as subISOWeekYears } from './subISOWeekYears/index.js';\r\nexport { default as subMilliseconds } from './subMilliseconds/index.js';\r\nexport { default as subMinutes } from './subMinutes/index.js';\r\nexport { default as subMonths } from './subMonths/index.js';\r\nexport { default as subQuarters } from './subQuarters/index.js';\r\nexport { default as subSeconds } from './subSeconds/index.js';\r\nexport { default as subWeeks } from './subWeeks/index.js';\r\nexport { default as subYears } from './subYears/index.js';\r\nexport { default as toDate } from './toDate/index.js';\r\nexport * from './constants/index.js';\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isAfter\r\n * @category Common Helpers\r\n * @summary Is the first date after the second one?\r\n *\r\n * @description\r\n * Is the first date after the second one?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date that should be after the other one to return true\r\n * @param {Date|Number} dateToCompare - the date to compare with\r\n * @returns {Boolean} the first date is after the second date\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Is 10 July 1989 after 11 February 1987?\r\n * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\r\n * //=> true\r\n */\r\nexport default function isAfter(dirtyDate, dirtyDateToCompare) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var dateToCompare = toDate(dirtyDateToCompare);\r\n return date.getTime() > dateToCompare.getTime();\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isBefore\r\n * @category Common Helpers\r\n * @summary Is the first date before the second one?\r\n *\r\n * @description\r\n * Is the first date before the second one?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date that should be before the other one to return true\r\n * @param {Date|Number} dateToCompare - the date to compare with\r\n * @returns {Boolean} the first date is before the second date\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Is 10 July 1989 before 11 February 1987?\r\n * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\r\n * //=> false\r\n */\r\nexport default function isBefore(dirtyDate, dirtyDateToCompare) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var dateToCompare = toDate(dirtyDateToCompare);\r\n return date.getTime() < dateToCompare.getTime();\r\n}\r\n","/**\r\n * @name isDate\r\n * @category Common Helpers\r\n * @summary Is the given value a date?\r\n *\r\n * @description\r\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {*} value - the value to check\r\n * @returns {boolean} true if the given value is a date\r\n * @throws {TypeError} 1 arguments required\r\n *\r\n * @example\r\n * // For a valid date:\r\n * var result = isDate(new Date())\r\n * //=> true\r\n *\r\n * @example\r\n * // For an invalid date:\r\n * var result = isDate(new Date(NaN))\r\n * //=> true\r\n *\r\n * @example\r\n * // For some value:\r\n * var result = isDate('2014-02-31')\r\n * //=> false\r\n *\r\n * @example\r\n * // For an object:\r\n * var result = isDate({})\r\n * //=> false\r\n */\r\nexport default function isDate(value) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isEqual\r\n * @category Common Helpers\r\n * @summary Are the given dates equal?\r\n *\r\n * @description\r\n * Are the given dates equal?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to compare\r\n * @param {Date|Number} dateRight - the second date to compare\r\n * @returns {Boolean} the dates are equal\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\r\n * var result = isEqual(\r\n * new Date(2014, 6, 2, 6, 30, 45, 0),\r\n * new Date(2014, 6, 2, 6, 30, 45, 500)\r\n * )\r\n * //=> false\r\n */\r\nexport default function isEqual(dirtyLeftDate, dirtyRightDate) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyLeftDate);\r\n var dateRight = toDate(dirtyRightDate);\r\n return dateLeft.getTime() === dateRight.getTime();\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isFirstDayOfMonth\r\n * @category Month Helpers\r\n * @summary Is the given date the first day of a month?\r\n *\r\n * @description\r\n * Is the given date the first day of a month?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is the first day of a month\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Is 1 September 2014 the first day of a month?\r\n * var result = isFirstDayOfMonth(new Date(2014, 8, 1))\r\n * //=> true\r\n */\r\nexport default function isFirstDayOfMonth(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return toDate(dirtyDate).getDate() === 1;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isFriday\r\n * @category Weekday Helpers\r\n * @summary Is the given date Friday?\r\n *\r\n * @description\r\n * Is the given date Friday?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is Friday\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Is 26 September 2014 Friday?\r\n * var result = isFriday(new Date(2014, 8, 26))\r\n * //=> true\r\n */\r\nexport default function isFriday(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return toDate(dirtyDate).getDay() === 5;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isFuture\r\n * @category Common Helpers\r\n * @summary Is the given date in the future?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date in the future?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is in the future\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If today is 6 October 2014, is 31 December 2014 in the future?\r\n * var result = isFuture(new Date(2014, 11, 31))\r\n * //=> true\r\n */\r\nexport default function isFuture(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return toDate(dirtyDate).getTime() > Date.now();\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport endOfDay from '../endOfDay/index.js';\r\nimport endOfMonth from '../endOfMonth/index.js';\r\n/**\r\n * @name isLastDayOfMonth\r\n * @category Month Helpers\r\n * @summary Is the given date the last day of a month?\r\n *\r\n * @description\r\n * Is the given date the last day of a month?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is the last day of a month\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Is 28 February 2014 the last day of a month?\r\n * var result = isLastDayOfMonth(new Date(2014, 1, 28))\r\n * //=> true\r\n */\r\nexport default function isLastDayOfMonth(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n return endOfDay(date).getTime() === endOfMonth(date).getTime();\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isLeapYear\r\n * @category Year Helpers\r\n * @summary Is the given date in the leap year?\r\n *\r\n * @description\r\n * Is the given date in the leap year?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is in the leap year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Is 1 September 2012 in the leap year?\r\n * var result = isLeapYear(new Date(2012, 8, 1))\r\n * //=> true\r\n */\r\nexport default function isLeapYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isMonday\r\n * @category Weekday Helpers\r\n * @summary Is the given date Monday?\r\n *\r\n * @description\r\n * Is the given date Monday?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is Monday\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Is 22 September 2014 Monday?\r\n * var result = isMonday(new Date(2014, 8, 22))\r\n * //=> true\r\n */\r\nexport default function isMonday(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return toDate(dirtyDate).getDay() === 1;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isPast\r\n * @category Common Helpers\r\n * @summary Is the given date in the past?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date in the past?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is in the past\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If today is 6 October 2014, is 2 July 2014 in the past?\r\n * var result = isPast(new Date(2014, 6, 2))\r\n * //=> true\r\n */\r\nexport default function isPast(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return toDate(dirtyDate).getTime() < Date.now();\r\n}\r\n","import startOfDay from '../startOfDay/index.js';\r\n/**\r\n * @name isSameDay\r\n * @category Day Helpers\r\n * @summary Are the given dates in the same day?\r\n *\r\n * @description\r\n * Are the given dates in the same day?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to check\r\n * @param {Date|Number} dateRight - the second date to check\r\n * @returns {Boolean} the dates are in the same day\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\r\n * var result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\r\n * //=> true\r\n */\r\nexport default function isSameDay(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeftStartOfDay = startOfDay(dirtyDateLeft);\r\n var dateRightStartOfDay = startOfDay(dirtyDateRight);\r\n return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();\r\n}\r\n","import startOfHour from '../startOfHour/index.js';\r\n/**\r\n * @name isSameHour\r\n * @category Hour Helpers\r\n * @summary Are the given dates in the same hour?\r\n *\r\n * @description\r\n * Are the given dates in the same hour?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to check\r\n * @param {Date|Number} dateRight - the second date to check\r\n * @returns {Boolean} the dates are in the same hour\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour?\r\n * var result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30))\r\n * //=> true\r\n */\r\nexport default function isSameHour(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeftStartOfHour = startOfHour(dirtyDateLeft);\r\n var dateRightStartOfHour = startOfHour(dirtyDateRight);\r\n return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime();\r\n}\r\n","import isSameWeek from '../isSameWeek/index.js';\r\n/**\r\n * @name isSameISOWeek\r\n * @category ISO Week Helpers\r\n * @summary Are the given dates in the same ISO week?\r\n *\r\n * @description\r\n * Are the given dates in the same ISO week?\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to check\r\n * @param {Date|Number} dateRight - the second date to check\r\n * @returns {Boolean} the dates are in the same ISO week\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Are 1 September 2014 and 7 September 2014 in the same ISO week?\r\n * var result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7))\r\n * //=> true\r\n */\r\nexport default function isSameISOWeek(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameWeek(dirtyDateLeft, dirtyDateRight, {\r\n weekStartsOn: 1\r\n });\r\n}\r\n","import startOfISOWeekYear from '../startOfISOWeekYear/index.js';\r\n/**\r\n * @name isSameISOWeekYear\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Are the given dates in the same ISO week-numbering year?\r\n *\r\n * @description\r\n * Are the given dates in the same ISO week-numbering year?\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `isSameISOYear` to `isSameISOWeekYear`.\r\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\r\n * This change makes the name consistent with\r\n * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.\r\n *\r\n * @param {Date|Number} dateLeft - the first date to check\r\n * @param {Date|Number} dateRight - the second date to check\r\n * @returns {Boolean} the dates are in the same ISO week-numbering year\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year?\r\n * var result = isSameISOWeekYear(new Date(2003, 11, 29), new Date(2005, 0, 2))\r\n * //=> true\r\n */\r\nexport default function isSameISOWeekYear(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeftStartOfYear = startOfISOWeekYear(dirtyDateLeft);\r\n var dateRightStartOfYear = startOfISOWeekYear(dirtyDateRight);\r\n return dateLeftStartOfYear.getTime() === dateRightStartOfYear.getTime();\r\n}\r\n","import startOfMinute from '../startOfMinute/index.js';\r\n/**\r\n * @name isSameMinute\r\n * @category Minute Helpers\r\n * @summary Are the given dates in the same minute?\r\n *\r\n * @description\r\n * Are the given dates in the same minute?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to check\r\n * @param {Date|Number} dateRight - the second date to check\r\n * @returns {Boolean} the dates are in the same minute\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15\r\n * // in the same minute?\r\n * var result = isSameMinute(\r\n * new Date(2014, 8, 4, 6, 30),\r\n * new Date(2014, 8, 4, 6, 30, 15)\r\n * )\r\n * //=> true\r\n */\r\nexport default function isSameMinute(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeftStartOfMinute = startOfMinute(dirtyDateLeft);\r\n var dateRightStartOfMinute = startOfMinute(dirtyDateRight);\r\n return dateLeftStartOfMinute.getTime() === dateRightStartOfMinute.getTime();\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isSameMonth\r\n * @category Month Helpers\r\n * @summary Are the given dates in the same month?\r\n *\r\n * @description\r\n * Are the given dates in the same month?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to check\r\n * @param {Date|Number} dateRight - the second date to check\r\n * @returns {Boolean} the dates are in the same month\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Are 2 September 2014 and 25 September 2014 in the same month?\r\n * var result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))\r\n * //=> true\r\n */\r\nexport default function isSameMonth(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth();\r\n}\r\n","import startOfQuarter from '../startOfQuarter/index.js';\r\n/**\r\n * @name isSameQuarter\r\n * @category Quarter Helpers\r\n * @summary Are the given dates in the same year quarter?\r\n *\r\n * @description\r\n * Are the given dates in the same year quarter?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to check\r\n * @param {Date|Number} dateRight - the second date to check\r\n * @returns {Boolean} the dates are in the same quarter\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Are 1 January 2014 and 8 March 2014 in the same quarter?\r\n * var result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8))\r\n * //=> true\r\n */\r\nexport default function isSameQuarter(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeftStartOfQuarter = startOfQuarter(dirtyDateLeft);\r\n var dateRightStartOfQuarter = startOfQuarter(dirtyDateRight);\r\n return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime();\r\n}\r\n","import startOfSecond from '../startOfSecond/index.js';\r\n/**\r\n * @name isSameSecond\r\n * @category Second Helpers\r\n * @summary Are the given dates in the same second?\r\n *\r\n * @description\r\n * Are the given dates in the same second?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to check\r\n * @param {Date|Number} dateRight - the second date to check\r\n * @returns {Boolean} the dates are in the same second\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500\r\n * // in the same second?\r\n * var result = isSameSecond(\r\n * new Date(2014, 8, 4, 6, 30, 15),\r\n * new Date(2014, 8, 4, 6, 30, 15, 500)\r\n * )\r\n * //=> true\r\n */\r\nexport default function isSameSecond(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeftStartOfSecond = startOfSecond(dirtyDateLeft);\r\n var dateRightStartOfSecond = startOfSecond(dirtyDateRight);\r\n return dateLeftStartOfSecond.getTime() === dateRightStartOfSecond.getTime();\r\n}\r\n","import startOfWeek from '../startOfWeek/index.js';\r\n/**\r\n * @name isSameWeek\r\n * @category Week Helpers\r\n * @summary Are the given dates in the same week?\r\n *\r\n * @description\r\n * Are the given dates in the same week?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to check\r\n * @param {Date|Number} dateRight - the second date to check\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {Boolean} the dates are in the same week\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n *\r\n * @example\r\n * // Are 31 August 2014 and 4 September 2014 in the same week?\r\n * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\r\n * //=> true\r\n *\r\n * @example\r\n * // If week starts with Monday,\r\n * // are 31 August 2014 and 4 September 2014 in the same week?\r\n * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\r\n * weekStartsOn: 1\r\n * })\r\n * //=> false\r\n */\r\nexport default function isSameWeek(dirtyDateLeft, dirtyDateRight, dirtyOptions) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeftStartOfWeek = startOfWeek(dirtyDateLeft, dirtyOptions);\r\n var dateRightStartOfWeek = startOfWeek(dirtyDateRight, dirtyOptions);\r\n return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime();\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isSameYear\r\n * @category Year Helpers\r\n * @summary Are the given dates in the same year?\r\n *\r\n * @description\r\n * Are the given dates in the same year?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} dateLeft - the first date to check\r\n * @param {Date|Number} dateRight - the second date to check\r\n * @returns {Boolean} the dates are in the same year\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Are 2 September 2014 and 25 September 2014 in the same year?\r\n * var result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\r\n * //=> true\r\n */\r\nexport default function isSameYear(dirtyDateLeft, dirtyDateRight) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateLeft = toDate(dirtyDateLeft);\r\n var dateRight = toDate(dirtyDateRight);\r\n return dateLeft.getFullYear() === dateRight.getFullYear();\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isSaturday\r\n * @category Weekday Helpers\r\n * @summary Is the given date Saturday?\r\n *\r\n * @description\r\n * Is the given date Saturday?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is Saturday\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Is 27 September 2014 Saturday?\r\n * var result = isSaturday(new Date(2014, 8, 27))\r\n * //=> true\r\n */\r\nexport default function isSaturday(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return toDate(dirtyDate).getDay() === 6;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isSunday\r\n * @category Weekday Helpers\r\n * @summary Is the given date Sunday?\r\n *\r\n * @description\r\n * Is the given date Sunday?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is Sunday\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Is 21 September 2014 Sunday?\r\n * var result = isSunday(new Date(2014, 8, 21))\r\n * //=> true\r\n */\r\nexport default function isSunday(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return toDate(dirtyDate).getDay() === 0;\r\n}\r\n","import isSameHour from '../isSameHour/index.js';\r\n/**\r\n * @name isThisHour\r\n * @category Hour Helpers\r\n * @summary Is the given date in the same hour as the current date?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date in the same hour as the current date?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is in this hour\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If now is 25 September 2014 18:30:15.500,\r\n * // is 25 September 2014 18:00:00 in this hour?\r\n * var result = isThisHour(new Date(2014, 8, 25, 18))\r\n * //=> true\r\n */\r\nexport default function isThisHour(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameHour(Date.now(), dirtyDate);\r\n}\r\n","import isSameISOWeek from '../isSameISOWeek/index.js';\r\n/**\r\n * @name isThisISOWeek\r\n * @category ISO Week Helpers\r\n * @summary Is the given date in the same ISO week as the current date?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date in the same ISO week as the current date?\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is in this ISO week\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If today is 25 September 2014, is 22 September 2014 in this ISO week?\r\n * var result = isThisISOWeek(new Date(2014, 8, 22))\r\n * //=> true\r\n */\r\nexport default function isThisISOWeek(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameISOWeek(dirtyDate, Date.now());\r\n}\r\n","import isSameMinute from '../isSameMinute/index.js';\r\n/**\r\n * @name isThisMinute\r\n * @category Minute Helpers\r\n * @summary Is the given date in the same minute as the current date?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date in the same minute as the current date?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is in this minute\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If now is 25 September 2014 18:30:15.500,\r\n * // is 25 September 2014 18:30:00 in this minute?\r\n * var result = isThisMinute(new Date(2014, 8, 25, 18, 30))\r\n * //=> true\r\n */\r\nexport default function isThisMinute(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameMinute(Date.now(), dirtyDate);\r\n}\r\n","import isSameMonth from '../isSameMonth/index.js';\r\n/**\r\n * @name isThisMonth\r\n * @category Month Helpers\r\n * @summary Is the given date in the same month as the current date?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date in the same month as the current date?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is in this month\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If today is 25 September 2014, is 15 September 2014 in this month?\r\n * var result = isThisMonth(new Date(2014, 8, 15))\r\n * //=> true\r\n */\r\nexport default function isThisMonth(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameMonth(Date.now(), dirtyDate);\r\n}\r\n","import isSameQuarter from '../isSameQuarter/index.js';\r\n/**\r\n * @name isThisQuarter\r\n * @category Quarter Helpers\r\n * @summary Is the given date in the same quarter as the current date?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date in the same quarter as the current date?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is in this quarter\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If today is 25 September 2014, is 2 July 2014 in this quarter?\r\n * var result = isThisQuarter(new Date(2014, 6, 2))\r\n * //=> true\r\n */\r\nexport default function isThisQuarter(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameQuarter(Date.now(), dirtyDate);\r\n}\r\n","import isSameSecond from '../isSameSecond/index.js';\r\n/**\r\n * @name isThisSecond\r\n * @category Second Helpers\r\n * @summary Is the given date in the same second as the current date?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date in the same second as the current date?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is in this second\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If now is 25 September 2014 18:30:15.500,\r\n * // is 25 September 2014 18:30:15.000 in this second?\r\n * var result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15))\r\n * //=> true\r\n */\r\nexport default function isThisSecond(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameSecond(Date.now(), dirtyDate);\r\n}\r\n","import isSameWeek from '../isSameWeek/index.js';\r\n/**\r\n * @name isThisWeek\r\n * @category Week Helpers\r\n * @summary Is the given date in the same week as the current date?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date in the same week as the current date?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @param {Object} [options] - the object with options\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {Boolean} the date is in this week\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n *\r\n * @example\r\n * // If today is 25 September 2014, is 21 September 2014 in this week?\r\n * var result = isThisWeek(new Date(2014, 8, 21))\r\n * //=> true\r\n *\r\n * @example\r\n * // If today is 25 September 2014 and week starts with Monday\r\n * // is 21 September 2014 in this week?\r\n * var result = isThisWeek(new Date(2014, 8, 21), { weekStartsOn: 1 })\r\n * //=> false\r\n */\r\nexport default function isThisWeek(dirtyDate, options) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameWeek(dirtyDate, Date.now(), options);\r\n}\r\n","import isSameYear from '../isSameYear/index.js';\r\n/**\r\n * @name isThisYear\r\n * @category Year Helpers\r\n * @summary Is the given date in the same year as the current date?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date in the same year as the current date?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is in this year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If today is 25 September 2014, is 2 July 2014 in this year?\r\n * var result = isThisYear(new Date(2014, 6, 2))\r\n * //=> true\r\n */\r\nexport default function isThisYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameYear(dirtyDate, Date.now());\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isThursday\r\n * @category Weekday Helpers\r\n * @summary Is the given date Thursday?\r\n *\r\n * @description\r\n * Is the given date Thursday?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is Thursday\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Is 25 September 2014 Thursday?\r\n * var result = isThursday(new Date(2014, 8, 25))\r\n * //=> true\r\n */\r\nexport default function isThursday(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return toDate(dirtyDate).getDay() === 4;\r\n}\r\n","import isSameDay from '../isSameDay/index.js';\r\n/**\r\n * @name isToday\r\n * @category Day Helpers\r\n * @summary Is the given date today?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date today?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is today\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If today is 6 October 2014, is 6 October 14:00:00 today?\r\n * var result = isToday(new Date(2014, 9, 6, 14, 0))\r\n * //=> true\r\n */\r\nexport default function isToday(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameDay(dirtyDate, Date.now());\r\n}\r\n","import addDays from '../addDays/index.js';\r\nimport isSameDay from '../isSameDay/index.js';\r\n/**\r\n * @name isTomorrow\r\n * @category Day Helpers\r\n * @summary Is the given date tomorrow?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date tomorrow?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is tomorrow\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow?\r\n * var result = isTomorrow(new Date(2014, 9, 7, 14, 0))\r\n * //=> true\r\n */\r\nexport default function isTomorrow(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameDay(dirtyDate, addDays(Date.now(), 1));\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isTuesday\r\n * @category Weekday Helpers\r\n * @summary Is the given date Tuesday?\r\n *\r\n * @description\r\n * Is the given date Tuesday?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is Tuesday\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Is 23 September 2014 Tuesday?\r\n * var result = isTuesday(new Date(2014, 8, 23))\r\n * //=> true\r\n */\r\nexport default function isTuesday(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return toDate(dirtyDate).getDay() === 2;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isValid\r\n * @category Common Helpers\r\n * @summary Is the given date valid?\r\n *\r\n * @description\r\n * Returns false if argument is Invalid Date and true otherwise.\r\n * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\r\n * Invalid Date is a Date, whose time value is NaN.\r\n *\r\n * Time value of Date: http://es5.github.io/#x15.9.1.1\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - Now `isValid` doesn't throw an exception\r\n * if the first argument is not an instance of Date.\r\n * Instead, argument is converted beforehand using `toDate`.\r\n *\r\n * Examples:\r\n *\r\n * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |\r\n * |---------------------------|---------------|---------------|\r\n * | `new Date()` | `true` | `true` |\r\n * | `new Date('2016-01-01')` | `true` | `true` |\r\n * | `new Date('')` | `false` | `false` |\r\n * | `new Date(1488370835081)` | `true` | `true` |\r\n * | `new Date(NaN)` | `false` | `false` |\r\n * | `'2016-01-01'` | `TypeError` | `true` |\r\n * | `''` | `TypeError` | `false` |\r\n * | `1488370835081` | `TypeError` | `true` |\r\n * | `NaN` | `TypeError` | `false` |\r\n *\r\n * We introduce this change to make *date-fns* consistent with ECMAScript behavior\r\n * that try to coerce arguments to the expected type\r\n * (which is also the case with other *date-fns* functions).\r\n *\r\n * @param {*} date - the date to check\r\n * @returns {Boolean} the date is valid\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // For the valid date:\r\n * var result = isValid(new Date(2014, 1, 31))\r\n * //=> true\r\n *\r\n * @example\r\n * // For the value, convertable into a date:\r\n * var result = isValid(1393804800000)\r\n * //=> true\r\n *\r\n * @example\r\n * // For the invalid date:\r\n * var result = isValid(new Date(''))\r\n * //=> false\r\n */\r\nexport default function isValid(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n return !isNaN(date);\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isWednesday\r\n * @category Weekday Helpers\r\n * @summary Is the given date Wednesday?\r\n *\r\n * @description\r\n * Is the given date Wednesday?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is Wednesday\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Is 24 September 2014 Wednesday?\r\n * var result = isWednesday(new Date(2014, 8, 24))\r\n * //=> true\r\n */\r\nexport default function isWednesday(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return toDate(dirtyDate).getDay() === 3;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isWeekend\r\n * @category Weekday Helpers\r\n * @summary Does the given date fall on a weekend?\r\n *\r\n * @description\r\n * Does the given date fall on a weekend?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date falls on a weekend\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Does 5 October 2014 fall on a weekend?\r\n * var result = isWeekend(new Date(2014, 9, 5))\r\n * //=> true\r\n */\r\nexport default function isWeekend(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var day = date.getDay();\r\n return day === 0 || day === 6;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name isWithinInterval\r\n * @category Interval Helpers\r\n * @summary Is the given date within the interval?\r\n *\r\n * @description\r\n * Is the given date within the interval?\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `isWithinRange` to `isWithinInterval`.\r\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\r\n *\r\n * ```\r\n * 2.1.3\r\n * time interval\r\n * part of the time axis limited by two instants\r\n * ```\r\n *\r\n * Also, this function now accepts an object with `start` and `end` properties\r\n * instead of two arguments as an interval.\r\n * This function now throws `RangeError` if the start of the interval is after its end\r\n * or if any date in the interval is `Invalid Date`.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n *\r\n * isWithinRange(\r\n * new Date(2014, 0, 3),\r\n * new Date(2014, 0, 1), new Date(2014, 0, 7)\r\n * )\r\n *\r\n * // v2.0.0 onward\r\n *\r\n * isWithinInterval(\r\n * new Date(2014, 0, 3),\r\n * { start: new Date(2014, 0, 1), end: new Date(2014, 0, 7) }\r\n * )\r\n * ```\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @param {Interval} interval - the interval to check\r\n * @returns {Boolean} the date is within the interval\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} The start of an interval cannot be after its end\r\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\r\n *\r\n * @example\r\n * // For the date within the interval:\r\n * isWithinInterval(new Date(2014, 0, 3), {\r\n * start: new Date(2014, 0, 1),\r\n * end: new Date(2014, 0, 7)\r\n * })\r\n * //=> true\r\n *\r\n * @example\r\n * // For the date outside of the interval:\r\n * isWithinInterval(new Date(2014, 0, 10), {\r\n * start: new Date(2014, 0, 1),\r\n * end: new Date(2014, 0, 7)\r\n * })\r\n * //=> false\r\n */\r\nexport default function isWithinInterval(dirtyDate, dirtyInterval) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var interval = dirtyInterval || {};\r\n var time = toDate(dirtyDate).getTime();\r\n var startTime = toDate(interval.start).getTime();\r\n var endTime = toDate(interval.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\r\n if (!(startTime <= endTime)) {\r\n throw new RangeError('Invalid interval');\r\n }\r\n return time >= startTime && time <= endTime;\r\n}\r\n","import isSameDay from '../isSameDay/index.js';\r\nimport subDays from '../subDays/index.js';\r\n/**\r\n * @name isYesterday\r\n * @category Day Helpers\r\n * @summary Is the given date yesterday?\r\n * @pure false\r\n *\r\n * @description\r\n * Is the given date yesterday?\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to check\r\n * @returns {Boolean} the date is yesterday\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // If today is 6 October 2014, is 5 October 14:00:00 yesterday?\r\n * var result = isYesterday(new Date(2014, 9, 5, 14, 0))\r\n * //=> true\r\n */\r\nexport default function isYesterday(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return isSameDay(dirtyDate, subDays(Date.now(), 1));\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name lastDayOfDecade\r\n * @category Decade Helpers\r\n * @summary Return the last day of a decade for the given date.\r\n *\r\n * @description\r\n * Return the last day of a decade for the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the last day of a decade\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The last day of a decade for 21 December 2012 21:12:00:\r\n * var result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00))\r\n * //=> Wed Dec 31 2019 00:00:00\r\n */\r\nexport default function lastDayOfDecade(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n var decade = 9 + Math.floor(year / 10) * 10;\r\n date.setFullYear(decade + 1, 0, 0);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import lastDayOfWeek from '../lastDayOfWeek/index.js';\r\n/**\r\n * @name lastDayOfISOWeek\r\n * @category ISO Week Helpers\r\n * @summary Return the last day of an ISO week for the given date.\r\n *\r\n * @description\r\n * Return the last day of an ISO week for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the last day of an ISO week\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The last day of an ISO week for 2 September 2014 11:55:00:\r\n * var result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Sun Sep 07 2014 00:00:00\r\n */\r\nexport default function lastDayOfISOWeek(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return lastDayOfWeek(dirtyDate, {\r\n weekStartsOn: 1\r\n });\r\n}\r\n","import getISOWeekYear from '../getISOWeekYear/index.js';\r\nimport startOfISOWeek from '../startOfISOWeek/index.js';\r\n/**\r\n * @name lastDayOfISOWeekYear\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Return the last day of an ISO week-numbering year for the given date.\r\n *\r\n * @description\r\n * Return the last day of an ISO week-numbering year,\r\n * which always starts 3 days before the year's first Thursday.\r\n * The result will be in the local timezone.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `lastDayOfISOYear` to `lastDayOfISOWeekYear`.\r\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\r\n * This change makes the name consistent with\r\n * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the end of an ISO week-numbering year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The last day of an ISO week-numbering year for 2 July 2005:\r\n * var result = lastDayOfISOWeekYear(new Date(2005, 6, 2))\r\n * //=> Sun Jan 01 2006 00:00:00\r\n */\r\nexport default function lastDayOfISOWeekYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var year = getISOWeekYear(dirtyDate);\r\n var fourthOfJanuary = new Date(0);\r\n fourthOfJanuary.setFullYear(year + 1, 0, 4);\r\n fourthOfJanuary.setHours(0, 0, 0, 0);\r\n var date = startOfISOWeek(fourthOfJanuary);\r\n date.setDate(date.getDate() - 1);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name lastDayOfMonth\r\n * @category Month Helpers\r\n * @summary Return the last day of a month for the given date.\r\n *\r\n * @description\r\n * Return the last day of a month for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the last day of a month\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The last day of a month for 2 September 2014 11:55:00:\r\n * var result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Tue Sep 30 2014 00:00:00\r\n */\r\nexport default function lastDayOfMonth(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var month = date.getMonth();\r\n date.setFullYear(date.getFullYear(), month + 1, 0);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name lastDayOfQuarter\r\n * @category Quarter Helpers\r\n * @summary Return the last day of a year quarter for the given date.\r\n *\r\n * @description\r\n * Return the last day of a year quarter for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @param {Object} [options] - an object with options.\r\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\r\n * @returns {Date} the last day of a quarter\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\r\n *\r\n * @example\r\n * // The last day of a quarter for 2 September 2014 11:55:00:\r\n * var result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Tue Sep 30 2014 00:00:00\r\n */\r\nexport default function lastDayOfQuarter(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var currentMonth = date.getMonth();\r\n var month = currentMonth - currentMonth % 3 + 3;\r\n date.setMonth(month, 0);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name lastDayOfWeek\r\n * @category Week Helpers\r\n * @summary Return the last day of a week for the given date.\r\n *\r\n * @description\r\n * Return the last day of a week for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {Date} the last day of a week\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n *\r\n * @example\r\n * // The last day of a week for 2 September 2014 11:55:00:\r\n * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Sat Sep 06 2014 00:00:00\r\n *\r\n * @example\r\n * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00:\r\n * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\r\n * //=> Sun Sep 07 2014 00:00:00\r\n */\r\nexport default function lastDayOfWeek(dirtyDate, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\r\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\r\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\r\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\r\n throw new RangeError('weekStartsOn must be between 0 and 6');\r\n }\r\n var date = toDate(dirtyDate);\r\n var day = date.getDay();\r\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\r\n date.setHours(0, 0, 0, 0);\r\n date.setDate(date.getDate() + diff);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name lastDayOfYear\r\n * @category Year Helpers\r\n * @summary Return the last day of a year for the given date.\r\n *\r\n * @description\r\n * Return the last day of a year for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the last day of a year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The last day of a year for 2 September 2014 11:55:00:\r\n * var result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00))\r\n * //=> Wed Dec 31 2014 00:00:00\r\n */\r\nexport default function lastDayOfYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n date.setFullYear(year + 1, 0, 0);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport formatters from '../_lib/format/lightFormatters/index.js';\r\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\r\nimport isValid from '../isValid/index.js';\r\nimport subMilliseconds from '../subMilliseconds/index.js'; // This RegExp consists of three parts separated by `|`:\r\n// - (\\w)\\1* matches any sequences of the same letter\r\n// - '' matches two quote characters in a row\r\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\r\n// except a single quote symbol, which ends the sequence.\r\n// Two quote characters do not end the sequence.\r\n// If there is no matching single quote\r\n// then the sequence will continue until the end of the string.\r\n// - . matches any single character unmatched by previous parts of the RegExps\r\nvar formattingTokensRegExp = /(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\r\nvar escapedStringRegExp = /^'(.*?)'?$/;\r\nvar doubleQuoteRegExp = /''/g;\r\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\r\n/**\r\n * @name lightFormat\r\n * @category Common Helpers\r\n * @summary Format the date.\r\n *\r\n * @description\r\n * Return the formatted date string in the given format. Unlike `format`,\r\n * `lightFormat` doesn't use locales and outputs date using the most popular tokens.\r\n *\r\n * > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries.\r\n * > See: https://git.io/fxCyr\r\n *\r\n * The characters wrapped between two single quotes characters (') are escaped.\r\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\r\n *\r\n * Format of the string is based on Unicode Technical Standard #35:\r\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\r\n *\r\n * Accepted patterns:\r\n * | Unit | Pattern | Result examples |\r\n * |---------------------------------|---------|-----------------------------------|\r\n * | AM, PM | a..aaa | AM, PM |\r\n * | | aaaa | a.m., p.m. |\r\n * | | aaaaa | a, p |\r\n * | Calendar year | y | 44, 1, 1900, 2017 |\r\n * | | yy | 44, 01, 00, 17 |\r\n * | | yyy | 044, 001, 000, 017 |\r\n * | | yyyy | 0044, 0001, 1900, 2017 |\r\n * | Month (formatting) | M | 1, 2, ..., 12 |\r\n * | | MM | 01, 02, ..., 12 |\r\n * | Day of month | d | 1, 2, ..., 31 |\r\n * | | dd | 01, 02, ..., 31 |\r\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 |\r\n * | | hh | 01, 02, ..., 11, 12 |\r\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 |\r\n * | | HH | 00, 01, 02, ..., 23 |\r\n * | Minute | m | 0, 1, ..., 59 |\r\n * | | mm | 00, 01, ..., 59 |\r\n * | Second | s | 0, 1, ..., 59 |\r\n * | | ss | 00, 01, ..., 59 |\r\n * | Fraction of second | S | 0, 1, ..., 9 |\r\n * | | SS | 00, 01, ..., 99 |\r\n * | | SSS | 000, 0001, ..., 999 |\r\n * | | SSSS | ... |\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @param {String} format - the string of tokens\r\n * @returns {String} the formatted date string\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} format string contains an unescaped latin alphabet character\r\n *\r\n * @example\r\n * var result = format(new Date(2014, 1, 11), 'yyyy-MM-dd')\r\n * //=> '1987-02-11'\r\n */\r\nexport default function lightFormat(dirtyDate, dirtyFormatStr) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var formatStr = String(dirtyFormatStr);\r\n var originalDate = toDate(dirtyDate);\r\n if (!isValid(originalDate)) {\r\n throw new RangeError('Invalid time value');\r\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\r\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\r\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\r\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\r\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\r\n var result = formatStr.match(formattingTokensRegExp).map(function (substring) {\r\n // Replace two single quote characters with one single quote character\r\n if (substring === \"''\") {\r\n return \"'\";\r\n }\r\n var firstCharacter = substring[0];\r\n if (firstCharacter === \"'\") {\r\n return cleanEscapedString(substring);\r\n }\r\n var formatter = formatters[firstCharacter];\r\n if (formatter) {\r\n return formatter(utcDate, substring, null, {});\r\n }\r\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\r\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\r\n }\r\n return substring;\r\n }).join('');\r\n return result;\r\n}\r\nfunction cleanEscapedString(input) {\r\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\r\n}\r\n","export default function buildFormatLongFn(args) {\r\n return function (dirtyOptions) {\r\n var options = dirtyOptions || {};\r\n var width = options.width ? String(options.width) : args.defaultWidth;\r\n var format = args.formats[width] || args.formats[args.defaultWidth];\r\n return format;\r\n };\r\n}\r\n","export default function buildLocalizeFn(args) {\r\n return function (dirtyIndex, dirtyOptions) {\r\n var options = dirtyOptions || {};\r\n var context = options.context ? String(options.context) : 'standalone';\r\n var valuesArray;\r\n if (context === 'formatting' && args.formattingValues) {\r\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\r\n var width = options.width ? String(options.width) : defaultWidth;\r\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\r\n } else {\r\n var _defaultWidth = args.defaultWidth;\r\n var _width = options.width ? String(options.width) : args.defaultWidth;\r\n valuesArray = args.values[_width] || args.values[_defaultWidth];\r\n }\r\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;\r\n return valuesArray[index];\r\n };\r\n}\r\n","export default function buildMatchFn(args) {\r\n return function (dirtyString, dirtyOptions) {\r\n var string = String(dirtyString);\r\n var options = dirtyOptions || {};\r\n var width = options.width;\r\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\r\n var matchResult = string.match(matchPattern);\r\n if (!matchResult) {\r\n return null;\r\n }\r\n var matchedString = matchResult[0];\r\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\r\n var value;\r\n if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {\r\n value = parsePatterns.findIndex(function (pattern) {\r\n return pattern.test(string);\r\n });\r\n } else {\r\n value = findKey(parsePatterns, function (pattern) {\r\n return pattern.test(string);\r\n });\r\n }\r\n value = args.valueCallback ? args.valueCallback(value) : value;\r\n value = options.valueCallback ? options.valueCallback(value) : value;\r\n return {\r\n value: value,\r\n rest: string.slice(matchedString.length)\r\n };\r\n };\r\n}\r\nfunction findKey(object, predicate) {\r\n for (var key in object) {\r\n if (object.hasOwnProperty(key) && predicate(object[key])) {\r\n return key;\r\n }\r\n }\r\n}\r\n","export default function buildMatchPatternFn(args) {\r\n return function (dirtyString, dirtyOptions) {\r\n var string = String(dirtyString);\r\n var options = dirtyOptions || {};\r\n var matchResult = string.match(args.matchPattern);\r\n if (!matchResult) {\r\n return null;\r\n }\r\n var matchedString = matchResult[0];\r\n var parseResult = string.match(args.parsePattern);\r\n if (!parseResult) {\r\n return null;\r\n }\r\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\r\n value = options.valueCallback ? options.valueCallback(value) : value;\r\n return {\r\n value: value,\r\n rest: string.slice(matchedString.length)\r\n };\r\n };\r\n}\r\n","var formatDistanceLocale = {\r\n lessThanXSeconds: {\r\n one: 'less than a second',\r\n other: 'less than {{count}} seconds'\r\n },\r\n xSeconds: {\r\n one: '1 second',\r\n other: '{{count}} seconds'\r\n },\r\n halfAMinute: 'half a minute',\r\n lessThanXMinutes: {\r\n one: 'less than a minute',\r\n other: 'less than {{count}} minutes'\r\n },\r\n xMinutes: {\r\n one: '1 minute',\r\n other: '{{count}} minutes'\r\n },\r\n aboutXHours: {\r\n one: 'about 1 hour',\r\n other: 'about {{count}} hours'\r\n },\r\n xHours: {\r\n one: '1 hour',\r\n other: '{{count}} hours'\r\n },\r\n xDays: {\r\n one: '1 day',\r\n other: '{{count}} days'\r\n },\r\n aboutXMonths: {\r\n one: 'about 1 month',\r\n other: 'about {{count}} months'\r\n },\r\n xMonths: {\r\n one: '1 month',\r\n other: '{{count}} months'\r\n },\r\n aboutXYears: {\r\n one: 'about 1 year',\r\n other: 'about {{count}} years'\r\n },\r\n xYears: {\r\n one: '1 year',\r\n other: '{{count}} years'\r\n },\r\n overXYears: {\r\n one: 'over 1 year',\r\n other: 'over {{count}} years'\r\n },\r\n almostXYears: {\r\n one: 'almost 1 year',\r\n other: 'almost {{count}} years'\r\n }\r\n};\r\nexport default function formatDistance(token, count, options) {\r\n options = options || {};\r\n var result;\r\n if (typeof formatDistanceLocale[token] === 'string') {\r\n result = formatDistanceLocale[token];\r\n } else if (count === 1) {\r\n result = formatDistanceLocale[token].one;\r\n } else {\r\n result = formatDistanceLocale[token].other.replace('{{count}}', count);\r\n }\r\n if (options.addSuffix) {\r\n if (options.comparison > 0) {\r\n return 'in ' + result;\r\n } else {\r\n return result + ' ago';\r\n }\r\n }\r\n return result;\r\n}\r\n","import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index.js';\r\nvar dateFormats = {\r\n full: 'EEEE, MMMM do, y',\r\n long: 'MMMM do, y',\r\n medium: 'MMM d, y',\r\n short: 'MM/dd/yyyy'\r\n};\r\nvar timeFormats = {\r\n full: 'h:mm:ss a zzzz',\r\n long: 'h:mm:ss a z',\r\n medium: 'h:mm:ss a',\r\n short: 'h:mm a'\r\n};\r\nvar dateTimeFormats = {\r\n full: \"{{date}} 'at' {{time}}\",\r\n long: \"{{date}} 'at' {{time}}\",\r\n medium: '{{date}}, {{time}}',\r\n short: '{{date}}, {{time}}'\r\n};\r\nvar formatLong = {\r\n date: buildFormatLongFn({\r\n formats: dateFormats,\r\n defaultWidth: 'full'\r\n }),\r\n time: buildFormatLongFn({\r\n formats: timeFormats,\r\n defaultWidth: 'full'\r\n }),\r\n dateTime: buildFormatLongFn({\r\n formats: dateTimeFormats,\r\n defaultWidth: 'full'\r\n })\r\n};\r\nexport default formatLong;\r\n","var formatRelativeLocale = {\r\n lastWeek: \"'last' eeee 'at' p\",\r\n yesterday: \"'yesterday at' p\",\r\n today: \"'today at' p\",\r\n tomorrow: \"'tomorrow at' p\",\r\n nextWeek: \"eeee 'at' p\",\r\n other: 'P'\r\n};\r\nexport default function formatRelative(token, _date, _baseDate, _options) {\r\n return formatRelativeLocale[token];\r\n}\r\n","import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index.js';\r\nvar eraValues = {\r\n narrow: ['B', 'A'],\r\n abbreviated: ['BC', 'AD'],\r\n wide: ['Before Christ', 'Anno Domini']\r\n};\r\nvar quarterValues = {\r\n narrow: ['1', '2', '3', '4'],\r\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\r\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] // Note: in English, the names of days of the week and months are capitalized.\r\n // If you are making a new locale based on this one, check if the same is true for the language you're working on.\r\n // Generally, formatted dates should look like they are in the middle of a sentence,\r\n // e.g. in Spanish language the weekdays and months should be in the lowercase.\r\n};\r\nvar monthValues = {\r\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\r\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\r\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\r\n};\r\nvar dayValues = {\r\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\r\n short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\r\n abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\r\n wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\r\n};\r\nvar dayPeriodValues = {\r\n narrow: {\r\n am: 'a',\r\n pm: 'p',\r\n midnight: 'mi',\r\n noon: 'n',\r\n morning: 'morning',\r\n afternoon: 'afternoon',\r\n evening: 'evening',\r\n night: 'night'\r\n },\r\n abbreviated: {\r\n am: 'AM',\r\n pm: 'PM',\r\n midnight: 'midnight',\r\n noon: 'noon',\r\n morning: 'morning',\r\n afternoon: 'afternoon',\r\n evening: 'evening',\r\n night: 'night'\r\n },\r\n wide: {\r\n am: 'a.m.',\r\n pm: 'p.m.',\r\n midnight: 'midnight',\r\n noon: 'noon',\r\n morning: 'morning',\r\n afternoon: 'afternoon',\r\n evening: 'evening',\r\n night: 'night'\r\n }\r\n};\r\nvar formattingDayPeriodValues = {\r\n narrow: {\r\n am: 'a',\r\n pm: 'p',\r\n midnight: 'mi',\r\n noon: 'n',\r\n morning: 'in the morning',\r\n afternoon: 'in the afternoon',\r\n evening: 'in the evening',\r\n night: 'at night'\r\n },\r\n abbreviated: {\r\n am: 'AM',\r\n pm: 'PM',\r\n midnight: 'midnight',\r\n noon: 'noon',\r\n morning: 'in the morning',\r\n afternoon: 'in the afternoon',\r\n evening: 'in the evening',\r\n night: 'at night'\r\n },\r\n wide: {\r\n am: 'a.m.',\r\n pm: 'p.m.',\r\n midnight: 'midnight',\r\n noon: 'noon',\r\n morning: 'in the morning',\r\n afternoon: 'in the afternoon',\r\n evening: 'in the evening',\r\n night: 'at night'\r\n }\r\n};\r\nfunction ordinalNumber(dirtyNumber, _dirtyOptions) {\r\n var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,\r\n // if they are different for different grammatical genders,\r\n // use `options.unit`:\r\n //\r\n // var options = dirtyOptions || {}\r\n // var unit = String(options.unit)\r\n //\r\n // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\r\n // 'day', 'hour', 'minute', 'second'\r\n var rem100 = number % 100;\r\n if (rem100 > 20 || rem100 < 10) {\r\n switch (rem100 % 10) {\r\n case 1:\r\n return number + 'st';\r\n case 2:\r\n return number + 'nd';\r\n case 3:\r\n return number + 'rd';\r\n }\r\n }\r\n return number + 'th';\r\n}\r\nvar localize = {\r\n ordinalNumber: ordinalNumber,\r\n era: buildLocalizeFn({\r\n values: eraValues,\r\n defaultWidth: 'wide'\r\n }),\r\n quarter: buildLocalizeFn({\r\n values: quarterValues,\r\n defaultWidth: 'wide',\r\n argumentCallback: function (quarter) {\r\n return Number(quarter) - 1;\r\n }\r\n }),\r\n month: buildLocalizeFn({\r\n values: monthValues,\r\n defaultWidth: 'wide'\r\n }),\r\n day: buildLocalizeFn({\r\n values: dayValues,\r\n defaultWidth: 'wide'\r\n }),\r\n dayPeriod: buildLocalizeFn({\r\n values: dayPeriodValues,\r\n defaultWidth: 'wide',\r\n formattingValues: formattingDayPeriodValues,\r\n defaultFormattingWidth: 'wide'\r\n })\r\n};\r\nexport default localize;\r\n","import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index.js';\r\nimport buildMatchFn from '../../../_lib/buildMatchFn/index.js';\r\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\r\nvar parseOrdinalNumberPattern = /\\d+/i;\r\nvar matchEraPatterns = {\r\n narrow: /^(b|a)/i,\r\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\r\n wide: /^(before christ|before common era|anno domini|common era)/i\r\n};\r\nvar parseEraPatterns = {\r\n any: [/^b/i, /^(a|c)/i]\r\n};\r\nvar matchQuarterPatterns = {\r\n narrow: /^[1234]/i,\r\n abbreviated: /^q[1234]/i,\r\n wide: /^[1234](th|st|nd|rd)? quarter/i\r\n};\r\nvar parseQuarterPatterns = {\r\n any: [/1/i, /2/i, /3/i, /4/i]\r\n};\r\nvar matchMonthPatterns = {\r\n narrow: /^[jfmasond]/i,\r\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\r\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\r\n};\r\nvar parseMonthPatterns = {\r\n narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],\r\n any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]\r\n};\r\nvar matchDayPatterns = {\r\n narrow: /^[smtwf]/i,\r\n short: /^(su|mo|tu|we|th|fr|sa)/i,\r\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\r\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\r\n};\r\nvar parseDayPatterns = {\r\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\r\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\r\n};\r\nvar matchDayPeriodPatterns = {\r\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\r\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\r\n};\r\nvar parseDayPeriodPatterns = {\r\n any: {\r\n am: /^a/i,\r\n pm: /^p/i,\r\n midnight: /^mi/i,\r\n noon: /^no/i,\r\n morning: /morning/i,\r\n afternoon: /afternoon/i,\r\n evening: /evening/i,\r\n night: /night/i\r\n }\r\n};\r\nvar match = {\r\n ordinalNumber: buildMatchPatternFn({\r\n matchPattern: matchOrdinalNumberPattern,\r\n parsePattern: parseOrdinalNumberPattern,\r\n valueCallback: function (value) {\r\n return parseInt(value, 10);\r\n }\r\n }),\r\n era: buildMatchFn({\r\n matchPatterns: matchEraPatterns,\r\n defaultMatchWidth: 'wide',\r\n parsePatterns: parseEraPatterns,\r\n defaultParseWidth: 'any'\r\n }),\r\n quarter: buildMatchFn({\r\n matchPatterns: matchQuarterPatterns,\r\n defaultMatchWidth: 'wide',\r\n parsePatterns: parseQuarterPatterns,\r\n defaultParseWidth: 'any',\r\n valueCallback: function (index) {\r\n return index + 1;\r\n }\r\n }),\r\n month: buildMatchFn({\r\n matchPatterns: matchMonthPatterns,\r\n defaultMatchWidth: 'wide',\r\n parsePatterns: parseMonthPatterns,\r\n defaultParseWidth: 'any'\r\n }),\r\n day: buildMatchFn({\r\n matchPatterns: matchDayPatterns,\r\n defaultMatchWidth: 'wide',\r\n parsePatterns: parseDayPatterns,\r\n defaultParseWidth: 'any'\r\n }),\r\n dayPeriod: buildMatchFn({\r\n matchPatterns: matchDayPeriodPatterns,\r\n defaultMatchWidth: 'any',\r\n parsePatterns: parseDayPeriodPatterns,\r\n defaultParseWidth: 'any'\r\n })\r\n};\r\nexport default match;\r\n","import formatDistance from './_lib/formatDistance/index.js';\r\nimport formatLong from './_lib/formatLong/index.js';\r\nimport formatRelative from './_lib/formatRelative/index.js';\r\nimport localize from './_lib/localize/index.js';\r\nimport match from './_lib/match/index.js';\r\n/**\r\n * @type {Locale}\r\n * @category Locales\r\n * @summary English locale (United States).\r\n * @language English\r\n * @iso-639-2 eng\r\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\r\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\r\n */\r\nvar locale = {\r\n formatDistance: formatDistance,\r\n formatLong: formatLong,\r\n formatRelative: formatRelative,\r\n localize: localize,\r\n match: match,\r\n options: {\r\n weekStartsOn: 0\r\n /* Sunday */\r\n ,\r\n firstWeekContainsDate: 1\r\n }\r\n};\r\nexport default locale;\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name max\r\n * @category Common Helpers\r\n * @summary Return the latest of the given dates.\r\n *\r\n * @description\r\n * Return the latest of the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - `max` function now accepts an array of dates rather than spread arguments.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n * var date1 = new Date(1989, 6, 10)\r\n * var date2 = new Date(1987, 1, 11)\r\n * var maxDate = max(date1, date2)\r\n *\r\n * // v2.0.0 onward:\r\n * var dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)]\r\n * var maxDate = max(dates)\r\n * ```\r\n *\r\n * @param {Date[]|Number[]} datesArray - the dates to compare\r\n * @returns {Date} the latest of the dates\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which of these dates is the latest?\r\n * var result = max([\r\n * new Date(1989, 6, 10),\r\n * new Date(1987, 1, 11),\r\n * new Date(1995, 6, 2),\r\n * new Date(1990, 0, 1)\r\n * ])\r\n * //=> Sun Jul 02 1995 00:00:00\r\n */\r\nexport default function max(dirtyDatesArray) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var datesArray; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\r\n if (dirtyDatesArray && typeof dirtyDatesArray.forEach === 'function') {\r\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array.\r\n } else if (typeof dirtyDatesArray === 'object' && dirtyDatesArray !== null) {\r\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\r\n } else {\r\n // `dirtyDatesArray` is non-iterable, return Invalid Date\r\n return new Date(NaN);\r\n }\r\n var result;\r\n datesArray.forEach(function (dirtyDate) {\r\n var currentDate = toDate(dirtyDate);\r\n if (result === undefined || result < currentDate || isNaN(currentDate)) {\r\n result = currentDate;\r\n }\r\n });\r\n return result || new Date(NaN);\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name min\r\n * @category Common Helpers\r\n * @summary Return the earliest of the given dates.\r\n *\r\n * @description\r\n * Return the earliest of the given dates.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - `min` function now accepts an array of dates rather than spread arguments.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n * var date1 = new Date(1989, 6, 10)\r\n * var date2 = new Date(1987, 1, 11)\r\n * var minDate = min(date1, date2)\r\n *\r\n * // v2.0.0 onward:\r\n * var dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)]\r\n * var minDate = min(dates)\r\n * ```\r\n *\r\n * @param {Date[]|Number[]} datesArray - the dates to compare\r\n * @returns {Date} the earliest of the dates\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Which of these dates is the earliest?\r\n * var result = min([\r\n * new Date(1989, 6, 10),\r\n * new Date(1987, 1, 11),\r\n * new Date(1995, 6, 2),\r\n * new Date(1990, 0, 1)\r\n * ])\r\n * //=> Wed Feb 11 1987 00:00:00\r\n */\r\nexport default function min(dirtyDatesArray) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var datesArray; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\r\n if (dirtyDatesArray && typeof dirtyDatesArray.forEach === 'function') {\r\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array.\r\n } else if (typeof dirtyDatesArray === 'object' && dirtyDatesArray !== null) {\r\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\r\n } else {\r\n // `dirtyDatesArray` is non-iterable, return Invalid Date\r\n return new Date(NaN);\r\n }\r\n var result;\r\n datesArray.forEach(function (dirtyDate) {\r\n var currentDate = toDate(dirtyDate);\r\n if (result === undefined || result > currentDate || isNaN(currentDate)) {\r\n result = currentDate;\r\n }\r\n });\r\n return result || new Date(NaN);\r\n}\r\n","import getUTCWeekYear from '../../../_lib/getUTCWeekYear/index.js';\r\nimport setUTCDay from '../../../_lib/setUTCDay/index.js';\r\nimport setUTCISODay from '../../../_lib/setUTCISODay/index.js';\r\nimport setUTCISOWeek from '../../../_lib/setUTCISOWeek/index.js';\r\nimport setUTCWeek from '../../../_lib/setUTCWeek/index.js';\r\nimport startOfUTCISOWeek from '../../../_lib/startOfUTCISOWeek/index.js';\r\nimport startOfUTCWeek from '../../../_lib/startOfUTCWeek/index.js';\r\nvar MILLISECONDS_IN_HOUR = 3600000;\r\nvar MILLISECONDS_IN_MINUTE = 60000;\r\nvar MILLISECONDS_IN_SECOND = 1000;\r\nvar numericPatterns = {\r\n month: /^(1[0-2]|0?\\d)/,\r\n // 0 to 12\r\n date: /^(3[0-1]|[0-2]?\\d)/,\r\n // 0 to 31\r\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\r\n // 0 to 366\r\n week: /^(5[0-3]|[0-4]?\\d)/,\r\n // 0 to 53\r\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\r\n // 0 to 23\r\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\r\n // 0 to 24\r\n hour11h: /^(1[0-1]|0?\\d)/,\r\n // 0 to 11\r\n hour12h: /^(1[0-2]|0?\\d)/,\r\n // 0 to 12\r\n minute: /^[0-5]?\\d/,\r\n // 0 to 59\r\n second: /^[0-5]?\\d/,\r\n // 0 to 59\r\n singleDigit: /^\\d/,\r\n // 0 to 9\r\n twoDigits: /^\\d{1,2}/,\r\n // 0 to 99\r\n threeDigits: /^\\d{1,3}/,\r\n // 0 to 999\r\n fourDigits: /^\\d{1,4}/,\r\n // 0 to 9999\r\n anyDigitsSigned: /^-?\\d+/,\r\n singleDigitSigned: /^-?\\d/,\r\n // 0 to 9, -0 to -9\r\n twoDigitsSigned: /^-?\\d{1,2}/,\r\n // 0 to 99, -0 to -99\r\n threeDigitsSigned: /^-?\\d{1,3}/,\r\n // 0 to 999, -0 to -999\r\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\r\n};\r\nvar timezonePatterns = {\r\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\r\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\r\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\r\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\r\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/\r\n};\r\nfunction parseNumericPattern(pattern, string, valueCallback) {\r\n var matchResult = string.match(pattern);\r\n if (!matchResult) {\r\n return null;\r\n }\r\n var value = parseInt(matchResult[0], 10);\r\n return {\r\n value: valueCallback ? valueCallback(value) : value,\r\n rest: string.slice(matchResult[0].length)\r\n };\r\n}\r\nfunction parseTimezonePattern(pattern, string) {\r\n var matchResult = string.match(pattern);\r\n if (!matchResult) {\r\n return null;\r\n } // Input is 'Z'\r\n if (matchResult[0] === 'Z') {\r\n return {\r\n value: 0,\r\n rest: string.slice(1)\r\n };\r\n }\r\n var sign = matchResult[1] === '+' ? 1 : -1;\r\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\r\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\r\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\r\n return {\r\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\r\n rest: string.slice(matchResult[0].length)\r\n };\r\n}\r\nfunction parseAnyDigitsSigned(string, valueCallback) {\r\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\r\n}\r\nfunction parseNDigits(n, string, valueCallback) {\r\n switch (n) {\r\n case 1:\r\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\r\n case 2:\r\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\r\n case 3:\r\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\r\n case 4:\r\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\r\n default:\r\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\r\n }\r\n}\r\nfunction parseNDigitsSigned(n, string, valueCallback) {\r\n switch (n) {\r\n case 1:\r\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\r\n case 2:\r\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\r\n case 3:\r\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\r\n case 4:\r\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\r\n default:\r\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\r\n }\r\n}\r\nfunction dayPeriodEnumToHours(enumValue) {\r\n switch (enumValue) {\r\n case 'morning':\r\n return 4;\r\n case 'evening':\r\n return 17;\r\n case 'pm':\r\n case 'noon':\r\n case 'afternoon':\r\n return 12;\r\n case 'am':\r\n case 'midnight':\r\n case 'night':\r\n default:\r\n return 0;\r\n }\r\n}\r\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\r\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\r\n // 1 -> 1 AC\r\n // 0 -> 1 BC\r\n // -1 -> 2 BC\r\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\r\n var result;\r\n if (absCurrentYear <= 50) {\r\n result = twoDigitYear || 100;\r\n } else {\r\n var rangeEnd = absCurrentYear + 50;\r\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\r\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\r\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\r\n }\r\n return isCommonEra ? result : 1 - result;\r\n}\r\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\r\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\r\nfunction isLeapYearIndex(year) {\r\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\r\n}\r\n/*\r\n * | | Unit | | Unit |\r\n * |-----|--------------------------------|-----|--------------------------------|\r\n * | a | AM, PM | A* | Milliseconds in day |\r\n * | b | AM, PM, noon, midnight | B | Flexible day period |\r\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\r\n * | d | Day of month | D | Day of year |\r\n * | e | Local day of week | E | Day of week |\r\n * | f | | F* | Day of week in month |\r\n * | g* | Modified Julian day | G | Era |\r\n * | h | Hour [1-12] | H | Hour [0-23] |\r\n * | i! | ISO day of week | I! | ISO week of year |\r\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\r\n * | k | Hour [1-24] | K | Hour [0-11] |\r\n * | l* | (deprecated) | L | Stand-alone month |\r\n * | m | Minute | M | Month |\r\n * | n | | N | |\r\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\r\n * | p | | P | |\r\n * | q | Stand-alone quarter | Q | Quarter |\r\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\r\n * | s | Second | S | Fraction of second |\r\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\r\n * | u | Extended year | U* | Cyclic year |\r\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\r\n * | w | Local week of year | W* | Week of month |\r\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\r\n * | y | Year (abs) | Y | Local week-numbering year |\r\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\r\n *\r\n * Letters marked by * are not implemented but reserved by Unicode standard.\r\n *\r\n * Letters marked by ! are non-standard, but implemented by date-fns:\r\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\r\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\r\n * i.e. 7 for Sunday, 1 for Monday, etc.\r\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\r\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\r\n * `R` is supposed to be used in conjunction with `I` and `i`\r\n * for universal ISO week-numbering date, whereas\r\n * `Y` is supposed to be used in conjunction with `w` and `e`\r\n * for week-numbering date specific to the locale.\r\n */\r\nvar parsers = {\r\n // Era\r\n G: {\r\n priority: 140,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n // AD, BC\r\n case 'G':\r\n case 'GG':\r\n case 'GGG':\r\n return match.era(string, {\r\n width: 'abbreviated'\r\n }) || match.era(string, {\r\n width: 'narrow'\r\n });\r\n // A, B\r\n case 'GGGGG':\r\n return match.era(string, {\r\n width: 'narrow'\r\n });\r\n // Anno Domini, Before Christ\r\n case 'GGGG':\r\n default:\r\n return match.era(string, {\r\n width: 'wide'\r\n }) || match.era(string, {\r\n width: 'abbreviated'\r\n }) || match.era(string, {\r\n width: 'narrow'\r\n });\r\n }\r\n },\r\n set: function (date, flags, value, _options) {\r\n flags.era = value;\r\n date.setUTCFullYear(value, 0, 1);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['R', 'u', 't', 'T']\r\n },\r\n // Year\r\n y: {\r\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\r\n // | Year | y | yy | yyy | yyyy | yyyyy |\r\n // |----------|-------|----|-------|-------|-------|\r\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\r\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\r\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\r\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\r\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\r\n priority: 130,\r\n parse: function (string, token, match, _options) {\r\n var valueCallback = function (year) {\r\n return {\r\n year: year,\r\n isTwoDigitYear: token === 'yy'\r\n };\r\n };\r\n switch (token) {\r\n case 'y':\r\n return parseNDigits(4, string, valueCallback);\r\n case 'yo':\r\n return match.ordinalNumber(string, {\r\n unit: 'year',\r\n valueCallback: valueCallback\r\n });\r\n default:\r\n return parseNDigits(token.length, string, valueCallback);\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value.isTwoDigitYear || value.year > 0;\r\n },\r\n set: function (date, flags, value, _options) {\r\n var currentYear = date.getUTCFullYear();\r\n if (value.isTwoDigitYear) {\r\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\r\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n }\r\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\r\n date.setUTCFullYear(year, 0, 1);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\r\n },\r\n // Local week-numbering year\r\n Y: {\r\n priority: 130,\r\n parse: function (string, token, match, _options) {\r\n var valueCallback = function (year) {\r\n return {\r\n year: year,\r\n isTwoDigitYear: token === 'YY'\r\n };\r\n };\r\n switch (token) {\r\n case 'Y':\r\n return parseNDigits(4, string, valueCallback);\r\n case 'Yo':\r\n return match.ordinalNumber(string, {\r\n unit: 'year',\r\n valueCallback: valueCallback\r\n });\r\n default:\r\n return parseNDigits(token.length, string, valueCallback);\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value.isTwoDigitYear || value.year > 0;\r\n },\r\n set: function (date, flags, value, options) {\r\n var currentYear = getUTCWeekYear(date, options);\r\n if (value.isTwoDigitYear) {\r\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\r\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return startOfUTCWeek(date, options);\r\n }\r\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\r\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return startOfUTCWeek(date, options);\r\n },\r\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\r\n },\r\n // ISO week-numbering year\r\n R: {\r\n priority: 130,\r\n parse: function (string, token, _match, _options) {\r\n if (token === 'R') {\r\n return parseNDigitsSigned(4, string);\r\n }\r\n return parseNDigitsSigned(token.length, string);\r\n },\r\n set: function (_date, _flags, value, _options) {\r\n var firstWeekOfYear = new Date(0);\r\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\r\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\r\n return startOfUTCISOWeek(firstWeekOfYear);\r\n },\r\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\r\n },\r\n // Extended year\r\n u: {\r\n priority: 130,\r\n parse: function (string, token, _match, _options) {\r\n if (token === 'u') {\r\n return parseNDigitsSigned(4, string);\r\n }\r\n return parseNDigitsSigned(token.length, string);\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCFullYear(value, 0, 1);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\r\n },\r\n // Quarter\r\n Q: {\r\n priority: 120,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n // 1, 2, 3, 4\r\n case 'Q':\r\n case 'QQ':\r\n // 01, 02, 03, 04\r\n return parseNDigits(token.length, string);\r\n // 1st, 2nd, 3rd, 4th\r\n case 'Qo':\r\n return match.ordinalNumber(string, {\r\n unit: 'quarter'\r\n });\r\n // Q1, Q2, Q3, Q4\r\n case 'QQQ':\r\n return match.quarter(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.quarter(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\r\n case 'QQQQQ':\r\n return match.quarter(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // 1st quarter, 2nd quarter, ...\r\n case 'QQQQ':\r\n default:\r\n return match.quarter(string, {\r\n width: 'wide',\r\n context: 'formatting'\r\n }) || match.quarter(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.quarter(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 1 && value <= 4;\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCMonth((value - 1) * 3, 1);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\r\n },\r\n // Stand-alone quarter\r\n q: {\r\n priority: 120,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n // 1, 2, 3, 4\r\n case 'q':\r\n case 'qq':\r\n // 01, 02, 03, 04\r\n return parseNDigits(token.length, string);\r\n // 1st, 2nd, 3rd, 4th\r\n case 'qo':\r\n return match.ordinalNumber(string, {\r\n unit: 'quarter'\r\n });\r\n // Q1, Q2, Q3, Q4\r\n case 'qqq':\r\n return match.quarter(string, {\r\n width: 'abbreviated',\r\n context: 'standalone'\r\n }) || match.quarter(string, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\r\n case 'qqqqq':\r\n return match.quarter(string, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n // 1st quarter, 2nd quarter, ...\r\n case 'qqqq':\r\n default:\r\n return match.quarter(string, {\r\n width: 'wide',\r\n context: 'standalone'\r\n }) || match.quarter(string, {\r\n width: 'abbreviated',\r\n context: 'standalone'\r\n }) || match.quarter(string, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 1 && value <= 4;\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCMonth((value - 1) * 3, 1);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\r\n },\r\n // Month\r\n M: {\r\n priority: 110,\r\n parse: function (string, token, match, _options) {\r\n var valueCallback = function (value) {\r\n return value - 1;\r\n };\r\n switch (token) {\r\n // 1, 2, ..., 12\r\n case 'M':\r\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\r\n // 01, 02, ..., 12\r\n case 'MM':\r\n return parseNDigits(2, string, valueCallback);\r\n // 1st, 2nd, ..., 12th\r\n case 'Mo':\r\n return match.ordinalNumber(string, {\r\n unit: 'month',\r\n valueCallback: valueCallback\r\n });\r\n // Jan, Feb, ..., Dec\r\n case 'MMM':\r\n return match.month(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.month(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // J, F, ..., D\r\n case 'MMMMM':\r\n return match.month(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // January, February, ..., December\r\n case 'MMMM':\r\n default:\r\n return match.month(string, {\r\n width: 'wide',\r\n context: 'formatting'\r\n }) || match.month(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.month(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 0 && value <= 11;\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCMonth(value, 1);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\r\n },\r\n // Stand-alone month\r\n L: {\r\n priority: 110,\r\n parse: function (string, token, match, _options) {\r\n var valueCallback = function (value) {\r\n return value - 1;\r\n };\r\n switch (token) {\r\n // 1, 2, ..., 12\r\n case 'L':\r\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\r\n // 01, 02, ..., 12\r\n case 'LL':\r\n return parseNDigits(2, string, valueCallback);\r\n // 1st, 2nd, ..., 12th\r\n case 'Lo':\r\n return match.ordinalNumber(string, {\r\n unit: 'month',\r\n valueCallback: valueCallback\r\n });\r\n // Jan, Feb, ..., Dec\r\n case 'LLL':\r\n return match.month(string, {\r\n width: 'abbreviated',\r\n context: 'standalone'\r\n }) || match.month(string, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n // J, F, ..., D\r\n case 'LLLLL':\r\n return match.month(string, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n // January, February, ..., December\r\n case 'LLLL':\r\n default:\r\n return match.month(string, {\r\n width: 'wide',\r\n context: 'standalone'\r\n }) || match.month(string, {\r\n width: 'abbreviated',\r\n context: 'standalone'\r\n }) || match.month(string, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 0 && value <= 11;\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCMonth(value, 1);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\r\n },\r\n // Local week of year\r\n w: {\r\n priority: 100,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'w':\r\n return parseNumericPattern(numericPatterns.week, string);\r\n case 'wo':\r\n return match.ordinalNumber(string, {\r\n unit: 'week'\r\n });\r\n default:\r\n return parseNDigits(token.length, string);\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 1 && value <= 53;\r\n },\r\n set: function (date, _flags, value, options) {\r\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\r\n },\r\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\r\n },\r\n // ISO week of year\r\n I: {\r\n priority: 100,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'I':\r\n return parseNumericPattern(numericPatterns.week, string);\r\n case 'Io':\r\n return match.ordinalNumber(string, {\r\n unit: 'week'\r\n });\r\n default:\r\n return parseNDigits(token.length, string);\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 1 && value <= 53;\r\n },\r\n set: function (date, _flags, value, options) {\r\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\r\n },\r\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\r\n },\r\n // Day of the month\r\n d: {\r\n priority: 90,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'd':\r\n return parseNumericPattern(numericPatterns.date, string);\r\n case 'do':\r\n return match.ordinalNumber(string, {\r\n unit: 'date'\r\n });\r\n default:\r\n return parseNDigits(token.length, string);\r\n }\r\n },\r\n validate: function (date, value, _options) {\r\n var year = date.getUTCFullYear();\r\n var isLeapYear = isLeapYearIndex(year);\r\n var month = date.getUTCMonth();\r\n if (isLeapYear) {\r\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\r\n } else {\r\n return value >= 1 && value <= DAYS_IN_MONTH[month];\r\n }\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCDate(value);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\r\n },\r\n // Day of year\r\n D: {\r\n priority: 90,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'D':\r\n case 'DD':\r\n return parseNumericPattern(numericPatterns.dayOfYear, string);\r\n case 'Do':\r\n return match.ordinalNumber(string, {\r\n unit: 'date'\r\n });\r\n default:\r\n return parseNDigits(token.length, string);\r\n }\r\n },\r\n validate: function (date, value, _options) {\r\n var year = date.getUTCFullYear();\r\n var isLeapYear = isLeapYearIndex(year);\r\n if (isLeapYear) {\r\n return value >= 1 && value <= 366;\r\n } else {\r\n return value >= 1 && value <= 365;\r\n }\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCMonth(0, value);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\r\n },\r\n // Day of week\r\n E: {\r\n priority: 90,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n // Tue\r\n case 'E':\r\n case 'EE':\r\n case 'EEE':\r\n return match.day(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'short',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // T\r\n case 'EEEEE':\r\n return match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // Tu\r\n case 'EEEEEE':\r\n return match.day(string, {\r\n width: 'short',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // Tuesday\r\n case 'EEEE':\r\n default:\r\n return match.day(string, {\r\n width: 'wide',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'short',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 0 && value <= 6;\r\n },\r\n set: function (date, _flags, value, options) {\r\n date = setUTCDay(date, value, options);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\r\n },\r\n // Local day of week\r\n e: {\r\n priority: 90,\r\n parse: function (string, token, match, options) {\r\n var valueCallback = function (value) {\r\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\r\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\r\n };\r\n switch (token) {\r\n // 3\r\n case 'e':\r\n case 'ee':\r\n // 03\r\n return parseNDigits(token.length, string, valueCallback);\r\n // 3rd\r\n case 'eo':\r\n return match.ordinalNumber(string, {\r\n unit: 'day',\r\n valueCallback: valueCallback\r\n });\r\n // Tue\r\n case 'eee':\r\n return match.day(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'short',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // T\r\n case 'eeeee':\r\n return match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // Tu\r\n case 'eeeeee':\r\n return match.day(string, {\r\n width: 'short',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n // Tuesday\r\n case 'eeee':\r\n default:\r\n return match.day(string, {\r\n width: 'wide',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'short',\r\n context: 'formatting'\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 0 && value <= 6;\r\n },\r\n set: function (date, _flags, value, options) {\r\n date = setUTCDay(date, value, options);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\r\n },\r\n // Stand-alone local day of week\r\n c: {\r\n priority: 90,\r\n parse: function (string, token, match, options) {\r\n var valueCallback = function (value) {\r\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\r\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\r\n };\r\n switch (token) {\r\n // 3\r\n case 'c':\r\n case 'cc':\r\n // 03\r\n return parseNDigits(token.length, string, valueCallback);\r\n // 3rd\r\n case 'co':\r\n return match.ordinalNumber(string, {\r\n unit: 'day',\r\n valueCallback: valueCallback\r\n });\r\n // Tue\r\n case 'ccc':\r\n return match.day(string, {\r\n width: 'abbreviated',\r\n context: 'standalone'\r\n }) || match.day(string, {\r\n width: 'short',\r\n context: 'standalone'\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n // T\r\n case 'ccccc':\r\n return match.day(string, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n // Tu\r\n case 'cccccc':\r\n return match.day(string, {\r\n width: 'short',\r\n context: 'standalone'\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n // Tuesday\r\n case 'cccc':\r\n default:\r\n return match.day(string, {\r\n width: 'wide',\r\n context: 'standalone'\r\n }) || match.day(string, {\r\n width: 'abbreviated',\r\n context: 'standalone'\r\n }) || match.day(string, {\r\n width: 'short',\r\n context: 'standalone'\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'standalone'\r\n });\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 0 && value <= 6;\r\n },\r\n set: function (date, _flags, value, options) {\r\n date = setUTCDay(date, value, options);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\r\n },\r\n // ISO day of week\r\n i: {\r\n priority: 90,\r\n parse: function (string, token, match, _options) {\r\n var valueCallback = function (value) {\r\n if (value === 0) {\r\n return 7;\r\n }\r\n return value;\r\n };\r\n switch (token) {\r\n // 2\r\n case 'i':\r\n case 'ii':\r\n // 02\r\n return parseNDigits(token.length, string);\r\n // 2nd\r\n case 'io':\r\n return match.ordinalNumber(string, {\r\n unit: 'day'\r\n });\r\n // Tue\r\n case 'iii':\r\n return match.day(string, {\r\n width: 'abbreviated',\r\n context: 'formatting',\r\n valueCallback: valueCallback\r\n }) || match.day(string, {\r\n width: 'short',\r\n context: 'formatting',\r\n valueCallback: valueCallback\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting',\r\n valueCallback: valueCallback\r\n });\r\n // T\r\n case 'iiiii':\r\n return match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting',\r\n valueCallback: valueCallback\r\n });\r\n // Tu\r\n case 'iiiiii':\r\n return match.day(string, {\r\n width: 'short',\r\n context: 'formatting',\r\n valueCallback: valueCallback\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting',\r\n valueCallback: valueCallback\r\n });\r\n // Tuesday\r\n case 'iiii':\r\n default:\r\n return match.day(string, {\r\n width: 'wide',\r\n context: 'formatting',\r\n valueCallback: valueCallback\r\n }) || match.day(string, {\r\n width: 'abbreviated',\r\n context: 'formatting',\r\n valueCallback: valueCallback\r\n }) || match.day(string, {\r\n width: 'short',\r\n context: 'formatting',\r\n valueCallback: valueCallback\r\n }) || match.day(string, {\r\n width: 'narrow',\r\n context: 'formatting',\r\n valueCallback: valueCallback\r\n });\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 1 && value <= 7;\r\n },\r\n set: function (date, _flags, value, options) {\r\n date = setUTCISODay(date, value, options);\r\n date.setUTCHours(0, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\r\n },\r\n // AM or PM\r\n a: {\r\n priority: 80,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'a':\r\n case 'aa':\r\n case 'aaa':\r\n return match.dayPeriod(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.dayPeriod(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n case 'aaaaa':\r\n return match.dayPeriod(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n case 'aaaa':\r\n default:\r\n return match.dayPeriod(string, {\r\n width: 'wide',\r\n context: 'formatting'\r\n }) || match.dayPeriod(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.dayPeriod(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']\r\n },\r\n // AM, PM, midnight\r\n b: {\r\n priority: 80,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'b':\r\n case 'bb':\r\n case 'bbb':\r\n return match.dayPeriod(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.dayPeriod(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n case 'bbbbb':\r\n return match.dayPeriod(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n case 'bbbb':\r\n default:\r\n return match.dayPeriod(string, {\r\n width: 'wide',\r\n context: 'formatting'\r\n }) || match.dayPeriod(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.dayPeriod(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']\r\n },\r\n // in the morning, in the afternoon, in the evening, at night\r\n B: {\r\n priority: 80,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'B':\r\n case 'BB':\r\n case 'BBB':\r\n return match.dayPeriod(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.dayPeriod(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n case 'BBBBB':\r\n return match.dayPeriod(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n case 'BBBB':\r\n default:\r\n return match.dayPeriod(string, {\r\n width: 'wide',\r\n context: 'formatting'\r\n }) || match.dayPeriod(string, {\r\n width: 'abbreviated',\r\n context: 'formatting'\r\n }) || match.dayPeriod(string, {\r\n width: 'narrow',\r\n context: 'formatting'\r\n });\r\n }\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['a', 'b', 't', 'T']\r\n },\r\n // Hour [1-12]\r\n h: {\r\n priority: 70,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'h':\r\n return parseNumericPattern(numericPatterns.hour12h, string);\r\n case 'ho':\r\n return match.ordinalNumber(string, {\r\n unit: 'hour'\r\n });\r\n default:\r\n return parseNDigits(token.length, string);\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 1 && value <= 12;\r\n },\r\n set: function (date, _flags, value, _options) {\r\n var isPM = date.getUTCHours() >= 12;\r\n if (isPM && value < 12) {\r\n date.setUTCHours(value + 12, 0, 0, 0);\r\n } else if (!isPM && value === 12) {\r\n date.setUTCHours(0, 0, 0, 0);\r\n } else {\r\n date.setUTCHours(value, 0, 0, 0);\r\n }\r\n return date;\r\n },\r\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\r\n },\r\n // Hour [0-23]\r\n H: {\r\n priority: 70,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'H':\r\n return parseNumericPattern(numericPatterns.hour23h, string);\r\n case 'Ho':\r\n return match.ordinalNumber(string, {\r\n unit: 'hour'\r\n });\r\n default:\r\n return parseNDigits(token.length, string);\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 0 && value <= 23;\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCHours(value, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\r\n },\r\n // Hour [0-11]\r\n K: {\r\n priority: 70,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'K':\r\n return parseNumericPattern(numericPatterns.hour11h, string);\r\n case 'Ko':\r\n return match.ordinalNumber(string, {\r\n unit: 'hour'\r\n });\r\n default:\r\n return parseNDigits(token.length, string);\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 0 && value <= 11;\r\n },\r\n set: function (date, _flags, value, _options) {\r\n var isPM = date.getUTCHours() >= 12;\r\n if (isPM && value < 12) {\r\n date.setUTCHours(value + 12, 0, 0, 0);\r\n } else {\r\n date.setUTCHours(value, 0, 0, 0);\r\n }\r\n return date;\r\n },\r\n incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']\r\n },\r\n // Hour [1-24]\r\n k: {\r\n priority: 70,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'k':\r\n return parseNumericPattern(numericPatterns.hour24h, string);\r\n case 'ko':\r\n return match.ordinalNumber(string, {\r\n unit: 'hour'\r\n });\r\n default:\r\n return parseNDigits(token.length, string);\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 1 && value <= 24;\r\n },\r\n set: function (date, _flags, value, _options) {\r\n var hours = value <= 24 ? value % 24 : value;\r\n date.setUTCHours(hours, 0, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\r\n },\r\n // Minute\r\n m: {\r\n priority: 60,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 'm':\r\n return parseNumericPattern(numericPatterns.minute, string);\r\n case 'mo':\r\n return match.ordinalNumber(string, {\r\n unit: 'minute'\r\n });\r\n default:\r\n return parseNDigits(token.length, string);\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 0 && value <= 59;\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCMinutes(value, 0, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['t', 'T']\r\n },\r\n // Second\r\n s: {\r\n priority: 50,\r\n parse: function (string, token, match, _options) {\r\n switch (token) {\r\n case 's':\r\n return parseNumericPattern(numericPatterns.second, string);\r\n case 'so':\r\n return match.ordinalNumber(string, {\r\n unit: 'second'\r\n });\r\n default:\r\n return parseNDigits(token.length, string);\r\n }\r\n },\r\n validate: function (_date, value, _options) {\r\n return value >= 0 && value <= 59;\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCSeconds(value, 0);\r\n return date;\r\n },\r\n incompatibleTokens: ['t', 'T']\r\n },\r\n // Fraction of second\r\n S: {\r\n priority: 30,\r\n parse: function (string, token, _match, _options) {\r\n var valueCallback = function (value) {\r\n return Math.floor(value * Math.pow(10, -token.length + 3));\r\n };\r\n return parseNDigits(token.length, string, valueCallback);\r\n },\r\n set: function (date, _flags, value, _options) {\r\n date.setUTCMilliseconds(value);\r\n return date;\r\n },\r\n incompatibleTokens: ['t', 'T']\r\n },\r\n // Timezone (ISO-8601. +00:00 is `'Z'`)\r\n X: {\r\n priority: 10,\r\n parse: function (string, token, _match, _options) {\r\n switch (token) {\r\n case 'X':\r\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\r\n case 'XX':\r\n return parseTimezonePattern(timezonePatterns.basic, string);\r\n case 'XXXX':\r\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\r\n case 'XXXXX':\r\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\r\n case 'XXX':\r\n default:\r\n return parseTimezonePattern(timezonePatterns.extended, string);\r\n }\r\n },\r\n set: function (date, flags, value, _options) {\r\n if (flags.timestampIsSet) {\r\n return date;\r\n }\r\n return new Date(date.getTime() - value);\r\n },\r\n incompatibleTokens: ['t', 'T', 'x']\r\n },\r\n // Timezone (ISO-8601)\r\n x: {\r\n priority: 10,\r\n parse: function (string, token, _match, _options) {\r\n switch (token) {\r\n case 'x':\r\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\r\n case 'xx':\r\n return parseTimezonePattern(timezonePatterns.basic, string);\r\n case 'xxxx':\r\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\r\n case 'xxxxx':\r\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\r\n case 'xxx':\r\n default:\r\n return parseTimezonePattern(timezonePatterns.extended, string);\r\n }\r\n },\r\n set: function (date, flags, value, _options) {\r\n if (flags.timestampIsSet) {\r\n return date;\r\n }\r\n return new Date(date.getTime() - value);\r\n },\r\n incompatibleTokens: ['t', 'T', 'X']\r\n },\r\n // Seconds timestamp\r\n t: {\r\n priority: 40,\r\n parse: function (string, _token, _match, _options) {\r\n return parseAnyDigitsSigned(string);\r\n },\r\n set: function (_date, _flags, value, _options) {\r\n return [new Date(value * 1000), {\r\n timestampIsSet: true\r\n }];\r\n },\r\n incompatibleTokens: '*'\r\n },\r\n // Milliseconds timestamp\r\n T: {\r\n priority: 20,\r\n parse: function (string, _token, _match, _options) {\r\n return parseAnyDigitsSigned(string);\r\n },\r\n set: function (_date, _flags, value, _options) {\r\n return [new Date(value), {\r\n timestampIsSet: true\r\n }];\r\n },\r\n incompatibleTokens: '*'\r\n }\r\n};\r\nexport default parsers;\r\n","import defaultLocale from '../locale/en-US/index.js';\r\nimport subMilliseconds from '../subMilliseconds/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport assign from '../_lib/assign/index.js';\r\nimport longFormatters from '../_lib/format/longFormatters/index.js';\r\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\r\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from '../_lib/protectedTokens/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\nimport parsers from './_lib/parsers/index.js';\r\nvar TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`:\r\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\r\n// (one of the certain letters followed by `o`)\r\n// - (\\w)\\1* matches any sequences of the same letter\r\n// - '' matches two quote characters in a row\r\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\r\n// except a single quote symbol, which ends the sequence.\r\n// Two quote characters do not end the sequence.\r\n// If there is no matching single quote\r\n// then the sequence will continue until the end of the string.\r\n// - . matches any single character unmatched by previous parts of the RegExps\r\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\r\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\r\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\r\nvar escapedStringRegExp = /^'(.*?)'?$/;\r\nvar doubleQuoteRegExp = /''/g;\r\nvar notWhitespaceRegExp = /\\S/;\r\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\r\n/**\r\n * @name parse\r\n * @category Common Helpers\r\n * @summary Parse the date.\r\n *\r\n * @description\r\n * Return the date parsed from string using the given format string.\r\n *\r\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\r\n * > See: https://git.io/fxCyr\r\n *\r\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\r\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\r\n *\r\n * Format of the format string is based on Unicode Technical Standard #35:\r\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\r\n * with a few additions (see note 5 below the table).\r\n *\r\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\r\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\r\n *\r\n * ```javascript\r\n * parse('23 AM', 'HH a', new Date())\r\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\r\n * ```\r\n *\r\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\r\n *\r\n * Accepted format string patterns:\r\n * | Unit |Prior| Pattern | Result examples | Notes |\r\n * |---------------------------------|-----|---------|-----------------------------------|-------|\r\n * | Era | 140 | G..GGG | AD, BC | |\r\n * | | | GGGG | Anno Domini, Before Christ | 2 |\r\n * | | | GGGGG | A, B | |\r\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\r\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\r\n * | | | yy | 44, 01, 00, 17 | 4 |\r\n * | | | yyy | 044, 001, 123, 999 | 4 |\r\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\r\n * | | | yyyyy | ... | 2,4 |\r\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\r\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\r\n * | | | YY | 44, 01, 00, 17 | 4,6 |\r\n * | | | YYY | 044, 001, 123, 999 | 4 |\r\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\r\n * | | | YYYYY | ... | 2,4 |\r\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\r\n * | | | RR | -43, 01, 00, 17 | 4,5 |\r\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\r\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\r\n * | | | RRRRR | ... | 2,4,5 |\r\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\r\n * | | | uu | -43, 01, 99, -99 | 4 |\r\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\r\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\r\n * | | | uuuuu | ... | 2,4 |\r\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\r\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\r\n * | | | QQ | 01, 02, 03, 04 | |\r\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\r\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\r\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\r\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\r\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\r\n * | | | qq | 01, 02, 03, 04 | |\r\n * | | | qqq | Q1, Q2, Q3, Q4 | |\r\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\r\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\r\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\r\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\r\n * | | | MM | 01, 02, ..., 12 | |\r\n * | | | MMM | Jan, Feb, ..., Dec | |\r\n * | | | MMMM | January, February, ..., December | 2 |\r\n * | | | MMMMM | J, F, ..., D | |\r\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\r\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\r\n * | | | LL | 01, 02, ..., 12 | |\r\n * | | | LLL | Jan, Feb, ..., Dec | |\r\n * | | | LLLL | January, February, ..., December | 2 |\r\n * | | | LLLLL | J, F, ..., D | |\r\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\r\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\r\n * | | | ww | 01, 02, ..., 53 | |\r\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\r\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\r\n * | | | II | 01, 02, ..., 53 | 5 |\r\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\r\n * | | | do | 1st, 2nd, ..., 31st | 5 |\r\n * | | | dd | 01, 02, ..., 31 | |\r\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\r\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\r\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\r\n * | | | DDD | 001, 002, ..., 365, 366 | |\r\n * | | | DDDD | ... | 2 |\r\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | |\r\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\r\n * | | | EEEEE | M, T, W, T, F, S, S | |\r\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\r\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\r\n * | | | io | 1st, 2nd, ..., 7th | 5 |\r\n * | | | ii | 01, 02, ..., 07 | 5 |\r\n * | | | iii | Mon, Tue, Wed, ..., Su | 5 |\r\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\r\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\r\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 |\r\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\r\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\r\n * | | | ee | 02, 03, ..., 01 | |\r\n * | | | eee | Mon, Tue, Wed, ..., Su | |\r\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\r\n * | | | eeeee | M, T, W, T, F, S, S | |\r\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\r\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\r\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\r\n * | | | cc | 02, 03, ..., 01 | |\r\n * | | | ccc | Mon, Tue, Wed, ..., Su | |\r\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\r\n * | | | ccccc | M, T, W, T, F, S, S | |\r\n * | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\r\n * | AM, PM | 80 | a..aaa | AM, PM | |\r\n * | | | aaaa | a.m., p.m. | 2 |\r\n * | | | aaaaa | a, p | |\r\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\r\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\r\n * | | | bbbbb | a, p, n, mi | |\r\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\r\n * | | | BBBB | at night, in the morning, ... | 2 |\r\n * | | | BBBBB | at night, in the morning, ... | |\r\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\r\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\r\n * | | | hh | 01, 02, ..., 11, 12 | |\r\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\r\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\r\n * | | | HH | 00, 01, 02, ..., 23 | |\r\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\r\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\r\n * | | | KK | 1, 2, ..., 11, 0 | |\r\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\r\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\r\n * | | | kk | 24, 01, 02, ..., 23 | |\r\n * | Minute | 60 | m | 0, 1, ..., 59 | |\r\n * | | | mo | 0th, 1st, ..., 59th | 5 |\r\n * | | | mm | 00, 01, ..., 59 | |\r\n * | Second | 50 | s | 0, 1, ..., 59 | |\r\n * | | | so | 0th, 1st, ..., 59th | 5 |\r\n * | | | ss | 00, 01, ..., 59 | |\r\n * | Seconds timestamp | 40 | t | 512969520 | |\r\n * | | | tt | ... | 2 |\r\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\r\n * | | | SS | 00, 01, ..., 99 | |\r\n * | | | SSS | 000, 0001, ..., 999 | |\r\n * | | | SSSS | ... | 2 |\r\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\r\n * | | | TT | ... | 2 |\r\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\r\n * | | | XX | -0800, +0530, Z | |\r\n * | | | XXX | -08:00, +05:30, Z | |\r\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\r\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\r\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\r\n * | | | xx | -0800, +0530, +0000 | |\r\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\r\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\r\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\r\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\r\n * | | | PP | May 29, 1453 | |\r\n * | | | PPP | May 29th, 1453 | |\r\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\r\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\r\n * | | | pp | 12:00:00 AM | |\r\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\r\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\r\n * | | | PPPpp | May 29th, 1453 at ... | |\r\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\r\n * Notes:\r\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\r\n * are the same as \"stand-alone\" units, but are different in some languages.\r\n * \"Formatting\" units are declined according to the rules of the language\r\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\r\n * In `format` function, they will produce different result:\r\n *\r\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\r\n *\r\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\r\n *\r\n * `parse` will try to match both formatting and stand-alone units interchangably.\r\n *\r\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\r\n * the single quote characters (see below).\r\n * If the sequence is longer than listed in table:\r\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\r\n * as wide as the sequence\r\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\r\n * These variations are marked with \"2\" in the last column of the table.\r\n *\r\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\r\n * These tokens represent the shortest form of the quarter.\r\n *\r\n * 4. The main difference between `y` and `u` patterns are B.C. years:\r\n *\r\n * | Year | `y` | `u` |\r\n * |------|-----|-----|\r\n * | AC 1 | 1 | 1 |\r\n * | BC 1 | 1 | 0 |\r\n * | BC 2 | 2 | -1 |\r\n *\r\n * Also `yy` will try to guess the century of two digit year by proximity with `backupDate`:\r\n *\r\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\r\n *\r\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\r\n *\r\n * while `uu` will just assign the year as is:\r\n *\r\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\r\n *\r\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\r\n *\r\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\r\n * except local week-numbering years are dependent on `options.weekStartsOn`\r\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}\r\n * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).\r\n *\r\n * 5. These patterns are not in the Unicode Technical Standard #35:\r\n * - `i`: ISO day of week\r\n * - `I`: ISO week of year\r\n * - `R`: ISO week-numbering year\r\n * - `o`: ordinal number modifier\r\n * - `P`: long localized date\r\n * - `p`: long localized time\r\n *\r\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\r\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\r\n *\r\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\r\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\r\n *\r\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\r\n * on the given locale.\r\n *\r\n * using `en-US` locale: `P` => `MM/dd/yyyy`\r\n * using `en-US` locale: `p` => `hh:mm a`\r\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\r\n * using `pt-BR` locale: `p` => `HH:mm`\r\n *\r\n * Values will be assigned to the date in the descending order of its unit's priority.\r\n * Units of an equal priority overwrite each other in the order of appearance.\r\n *\r\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\r\n * the values will be taken from 3rd argument `backupDate` which works as a context of parsing.\r\n *\r\n * `backupDate` must be passed for correct work of the function.\r\n * If you're not sure which `backupDate` to supply, create a new instance of Date:\r\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\r\n * In this case parsing will be done in the context of the current date.\r\n * If `backupDate` is `Invalid Date` or a value not convertible to valid `Date`,\r\n * then `Invalid Date` will be returned.\r\n *\r\n * The result may vary by locale.\r\n *\r\n * If `formatString` matches with `dateString` but does not provides tokens, `backupDate` will be returned.\r\n *\r\n * If parsing failed, `Invalid Date` will be returned.\r\n * Invalid Date is a Date, whose time value is NaN.\r\n * Time value of Date: http://es5.github.io/#x15.9.1.1\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - Old `parse` was renamed to `toDate`.\r\n * Now `parse` is a new function which parses a string using a provided format.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n * parse('2016-01-01')\r\n *\r\n * // v2.0.0 onward\r\n * toDate('2016-01-01')\r\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\r\n * ```\r\n *\r\n * @param {String} dateString - the string to parse\r\n * @param {String} formatString - the string of tokens\r\n * @param {Date|Number} backupDate - defines values missing from the parsed dateString\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\r\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\r\n * see: https://git.io/fxCyr\r\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\r\n * see: https://git.io/fxCyr\r\n * @returns {Date} the parsed date\r\n * @throws {TypeError} 3 arguments required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\r\n * @throws {RangeError} `options.locale` must contain `match` property\r\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr\r\n * @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr\r\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr\r\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr\r\n * @throws {RangeError} format string contains an unescaped latin alphabet character\r\n *\r\n * @example\r\n * // Parse 11 February 2014 from middle-endian format:\r\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\r\n * //=> Tue Feb 11 2014 00:00:00\r\n *\r\n * @example\r\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\r\n * import eo from 'date-fns/locale/eo'\r\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\r\n * locale: eo\r\n * })\r\n * //=> Sun Feb 28 2010 00:00:00\r\n */\r\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyBackupDate, dirtyOptions) {\r\n if (arguments.length < 3) {\r\n throw new TypeError('3 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var dateString = String(dirtyDateString);\r\n var formatString = String(dirtyFormatString);\r\n var options = dirtyOptions || {};\r\n var locale = options.locale || defaultLocale;\r\n if (!locale.match) {\r\n throw new RangeError('locale must contain match property');\r\n }\r\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\r\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\r\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\r\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\r\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\r\n }\r\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\r\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\r\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\r\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\r\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\r\n }\r\n if (formatString === '') {\r\n if (dateString === '') {\r\n return toDate(dirtyBackupDate);\r\n } else {\r\n return new Date(NaN);\r\n }\r\n }\r\n var subFnOptions = {\r\n firstWeekContainsDate: firstWeekContainsDate,\r\n weekStartsOn: weekStartsOn,\r\n locale: locale // If timezone isn't specified, it will be set to the system timezone\r\n };\r\n var setters = [{\r\n priority: TIMEZONE_UNIT_PRIORITY,\r\n set: dateToSystemTimezone,\r\n index: 0\r\n }];\r\n var i;\r\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\r\n var firstCharacter = substring[0];\r\n if (firstCharacter === 'p' || firstCharacter === 'P') {\r\n var longFormatter = longFormatters[firstCharacter];\r\n return longFormatter(substring, locale.formatLong, subFnOptions);\r\n }\r\n return substring;\r\n }).join('').match(formattingTokensRegExp);\r\n var usedTokens = [];\r\n for (i = 0; i < tokens.length; i++) {\r\n var token = tokens[i];\r\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\r\n throwProtectedError(token);\r\n }\r\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\r\n throwProtectedError(token);\r\n }\r\n var firstCharacter = token[0];\r\n var parser = parsers[firstCharacter];\r\n if (parser) {\r\n var incompatibleTokens = parser.incompatibleTokens;\r\n if (Array.isArray(incompatibleTokens)) {\r\n var incompatibleToken = void 0;\r\n for (var _i = 0; _i < usedTokens.length; _i++) {\r\n var usedToken = usedTokens[_i].token;\r\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\r\n incompatibleToken = usedTokens[_i];\r\n break;\r\n }\r\n }\r\n if (incompatibleToken) {\r\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\r\n }\r\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\r\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\r\n }\r\n usedTokens.push({\r\n token: firstCharacter,\r\n fullToken: token\r\n });\r\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\r\n if (!parseResult) {\r\n return new Date(NaN);\r\n }\r\n setters.push({\r\n priority: parser.priority,\r\n set: parser.set,\r\n validate: parser.validate,\r\n value: parseResult.value,\r\n index: setters.length\r\n });\r\n dateString = parseResult.rest;\r\n } else {\r\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\r\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\r\n } // Replace two single quote characters with one single quote character\r\n if (token === \"''\") {\r\n token = \"'\";\r\n } else if (firstCharacter === \"'\") {\r\n token = cleanEscapedString(token);\r\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\r\n if (dateString.indexOf(token) === 0) {\r\n dateString = dateString.slice(token.length);\r\n } else {\r\n return new Date(NaN);\r\n }\r\n }\r\n } // Check if the remaining input contains something other than whitespace\r\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\r\n return new Date(NaN);\r\n }\r\n var uniquePrioritySetters = setters.map(function (setter) {\r\n return setter.priority;\r\n }).sort(function (a, b) {\r\n return b - a;\r\n }).filter(function (priority, index, array) {\r\n return array.indexOf(priority) === index;\r\n }).map(function (priority) {\r\n return setters.filter(function (setter) {\r\n return setter.priority === priority;\r\n }).reverse();\r\n }).map(function (setterArray) {\r\n return setterArray[0];\r\n });\r\n var date = toDate(dirtyBackupDate);\r\n if (isNaN(date)) {\r\n return new Date(NaN);\r\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\r\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\r\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\r\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\r\n var flags = {};\r\n for (i = 0; i < uniquePrioritySetters.length; i++) {\r\n var setter = uniquePrioritySetters[i];\r\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\r\n return new Date(NaN);\r\n }\r\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\r\n if (result[0]) {\r\n utcDate = result[0];\r\n assign(flags, result[1]); // Result is date\r\n } else {\r\n utcDate = result;\r\n }\r\n }\r\n return utcDate;\r\n}\r\nfunction dateToSystemTimezone(date, flags) {\r\n if (flags.timestampIsSet) {\r\n return date;\r\n }\r\n var convertedDate = new Date(0);\r\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\r\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\r\n return convertedDate;\r\n}\r\nfunction cleanEscapedString(input) {\r\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\r\nvar MILLISECONDS_IN_HOUR = 3600000;\r\nvar MILLISECONDS_IN_MINUTE = 60000;\r\nvar DEFAULT_ADDITIONAL_DIGITS = 2;\r\nvar patterns = {\r\n dateTimeDelimiter: /[T ]/,\r\n timeZoneDelimiter: /[Z ]/i,\r\n timezone: /([Z+-].*)$/\r\n};\r\nvar dateRegex = /^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/;\r\nvar timeRegex = /^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/;\r\nvar timezoneRegex = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\r\n/**\r\n * @name parseISO\r\n * @category Common Helpers\r\n * @summary Parse ISO string\r\n *\r\n * @description\r\n * Parse the given string in ISO 8601 format and return an instance of Date.\r\n *\r\n * Function accepts complete ISO 8601 formats as well as partial implementations.\r\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\r\n *\r\n * If the argument isn't a string, the function cannot parse the string or\r\n * the values are invalid, it returns Invalid Date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The previous `parse` implementation was renamed to `parseISO`.\r\n *\r\n * ```javascript\r\n * // Before v2.0.0\r\n * parse('2016-01-01')\r\n *\r\n * // v2.0.0 onward\r\n * parseISO('2016-01-01')\r\n * ```\r\n *\r\n * - `parseISO` now validates separate date and time values in ISO-8601 strings\r\n * and returns `Invalid Date` if the date is invalid.\r\n *\r\n * ```javascript\r\n * parseISO('2018-13-32')\r\n * //=> Invalid Date\r\n * ```\r\n *\r\n * - `parseISO` now doesn't fall back to `new Date` constructor\r\n * if it fails to parse a string argument. Instead, it returns `Invalid Date`.\r\n *\r\n * @param {String} argument - the value to convert\r\n * @param {Object} [options] - an object with options.\r\n * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format\r\n * @returns {Date} the parsed date in the local time zone\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\r\n *\r\n * @example\r\n * // Convert string '2014-02-11T11:30:30' to date:\r\n * var result = parseISO('2014-02-11T11:30:30')\r\n * //=> Tue Feb 11 2014 11:30:30\r\n *\r\n * @example\r\n * // Convert string '+02014101' to date,\r\n * // if the additional number of digits in the extended year format is 1:\r\n * var result = parseISO('+02014101', { additionalDigits: 1 })\r\n * //=> Fri Apr 11 2014 00:00:00\r\n */\r\nexport default function parseISO(argument, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : toInteger(options.additionalDigits);\r\n if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {\r\n throw new RangeError('additionalDigits must be 0, 1 or 2');\r\n }\r\n if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {\r\n return new Date(NaN);\r\n }\r\n var dateStrings = splitDateString(argument);\r\n var date;\r\n if (dateStrings.date) {\r\n var parseYearResult = parseYear(dateStrings.date, additionalDigits);\r\n date = parseDate(parseYearResult.restDateString, parseYearResult.year);\r\n }\r\n if (isNaN(date) || !date) {\r\n return new Date(NaN);\r\n }\r\n var timestamp = date.getTime();\r\n var time = 0;\r\n var offset;\r\n if (dateStrings.time) {\r\n time = parseTime(dateStrings.time);\r\n if (isNaN(time) || time === null) {\r\n return new Date(NaN);\r\n }\r\n }\r\n if (dateStrings.timezone) {\r\n offset = parseTimezone(dateStrings.timezone);\r\n if (isNaN(offset)) {\r\n return new Date(NaN);\r\n }\r\n } else {\r\n var fullTime = timestamp + time;\r\n var fullTimeDate = new Date(fullTime);\r\n offset = getTimezoneOffsetInMilliseconds(fullTimeDate); // Adjust time when it's coming from DST\r\n var fullTimeDateNextDay = new Date(fullTime);\r\n fullTimeDateNextDay.setDate(fullTimeDate.getDate() + 1);\r\n var offsetDiff = getTimezoneOffsetInMilliseconds(fullTimeDateNextDay) - offset;\r\n if (offsetDiff > 0) {\r\n offset += offsetDiff;\r\n }\r\n }\r\n return new Date(timestamp + time + offset);\r\n}\r\nfunction splitDateString(dateString) {\r\n var dateStrings = {};\r\n var array = dateString.split(patterns.dateTimeDelimiter);\r\n var timeString;\r\n if (/:/.test(array[0])) {\r\n dateStrings.date = null;\r\n timeString = array[0];\r\n } else {\r\n dateStrings.date = array[0];\r\n timeString = array[1];\r\n if (patterns.timeZoneDelimiter.test(dateStrings.date)) {\r\n dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];\r\n timeString = dateString.substr(dateStrings.date.length, dateString.length);\r\n }\r\n }\r\n if (timeString) {\r\n var token = patterns.timezone.exec(timeString);\r\n if (token) {\r\n dateStrings.time = timeString.replace(token[1], '');\r\n dateStrings.timezone = token[1];\r\n } else {\r\n dateStrings.time = timeString;\r\n }\r\n }\r\n return dateStrings;\r\n}\r\nfunction parseYear(dateString, additionalDigits) {\r\n var regex = new RegExp('^(?:(\\\\d{4}|[+-]\\\\d{' + (4 + additionalDigits) + '})|(\\\\d{2}|[+-]\\\\d{' + (2 + additionalDigits) + '})$)');\r\n var captures = dateString.match(regex); // Invalid ISO-formatted year\r\n if (!captures) return {\r\n year: null\r\n };\r\n var year = captures[1] && parseInt(captures[1]);\r\n var century = captures[2] && parseInt(captures[2]);\r\n return {\r\n year: century == null ? year : century * 100,\r\n restDateString: dateString.slice((captures[1] || captures[2]).length)\r\n };\r\n}\r\nfunction parseDate(dateString, year) {\r\n // Invalid ISO-formatted year\r\n if (year === null) return null;\r\n var captures = dateString.match(dateRegex); // Invalid ISO-formatted string\r\n if (!captures) return null;\r\n var isWeekDate = !!captures[4];\r\n var dayOfYear = parseDateUnit(captures[1]);\r\n var month = parseDateUnit(captures[2]) - 1;\r\n var day = parseDateUnit(captures[3]);\r\n var week = parseDateUnit(captures[4]);\r\n var dayOfWeek = parseDateUnit(captures[5]) - 1;\r\n if (isWeekDate) {\r\n if (!validateWeekDate(year, week, dayOfWeek)) {\r\n return new Date(NaN);\r\n }\r\n return dayOfISOWeekYear(year, week, dayOfWeek);\r\n } else {\r\n var date = new Date(0);\r\n if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {\r\n return new Date(NaN);\r\n }\r\n date.setUTCFullYear(year, month, Math.max(dayOfYear, day));\r\n return date;\r\n }\r\n}\r\nfunction parseDateUnit(value) {\r\n return value ? parseInt(value) : 1;\r\n}\r\nfunction parseTime(timeString) {\r\n var captures = timeString.match(timeRegex);\r\n if (!captures) return null; // Invalid ISO-formatted time\r\n var hours = parseTimeUnit(captures[1]);\r\n var minutes = parseTimeUnit(captures[2]);\r\n var seconds = parseTimeUnit(captures[3]);\r\n if (!validateTime(hours, minutes, seconds)) {\r\n return NaN;\r\n }\r\n return hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1000;\r\n}\r\nfunction parseTimeUnit(value) {\r\n return value && parseFloat(value.replace(',', '.')) || 0;\r\n}\r\nfunction parseTimezone(timezoneString) {\r\n if (timezoneString === 'Z') return 0;\r\n var captures = timezoneString.match(timezoneRegex);\r\n if (!captures) return 0;\r\n var sign = captures[1] === '+' ? -1 : 1;\r\n var hours = parseInt(captures[2]);\r\n var minutes = captures[3] && parseInt(captures[3]) || 0;\r\n if (!validateTimezone(hours, minutes)) {\r\n return NaN;\r\n }\r\n return sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE);\r\n}\r\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\r\n var date = new Date(0);\r\n date.setUTCFullYear(isoWeekYear, 0, 4);\r\n var fourthOfJanuaryDay = date.getUTCDay() || 7;\r\n var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;\r\n date.setUTCDate(date.getUTCDate() + diff);\r\n return date;\r\n} // Validation functions\r\n// February is null to handle the leap year (using ||)\r\nvar daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\r\nfunction isLeapYearIndex(year) {\r\n return year % 400 === 0 || year % 4 === 0 && year % 100;\r\n}\r\nfunction validateDate(year, month, date) {\r\n return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));\r\n}\r\nfunction validateDayOfYearDate(year, dayOfYear) {\r\n return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);\r\n}\r\nfunction validateWeekDate(_year, week, day) {\r\n return week >= 1 && week <= 53 && day >= 0 && day <= 6;\r\n}\r\nfunction validateTime(hours, minutes, seconds) {\r\n if (hours === 24) {\r\n return minutes === 0 && seconds === 0;\r\n }\r\n return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;\r\n}\r\nfunction validateTimezone(_hours, minutes) {\r\n return minutes >= 0 && minutes <= 59;\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name roundToNearestMinutes\r\n * @category Minute Helpers\r\n * @summary Rounds the given date to the nearest minute\r\n *\r\n * @description\r\n * Rounds the given date to the nearest minute\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to round\r\n * @param {Object} [options] - an object with options.\r\n * @param {Number} [options.nearestTo=1] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\r\n * @returns {Date} the new date rounded to the closest minute\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.nearestTo` must be between 1 and 30\r\n *\r\n * @example\r\n * // Round 10 July 2014 12:12:34 to nearest minute:\r\n * var result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34))\r\n * //=> Thu Jul 10 2014 12:13:00\r\n */\r\nexport default function roundToNearestMinutes(dirtyDate, options) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only none provided present');\r\n }\r\n var nearestTo = options && 'nearestTo' in options ? toInteger(options.nearestTo) : 1;\r\n if (nearestTo < 1 || nearestTo > 30) {\r\n throw new RangeError('`options.nearestTo` must be between 1 and 30');\r\n }\r\n var date = toDate(dirtyDate);\r\n var seconds = date.getSeconds(); // relevant if nearestTo is 1, which is the default case\r\n var minutes = date.getMinutes() + seconds / 60;\r\n var roundedMinutes = Math.floor(minutes / nearestTo) * nearestTo;\r\n var remainderMinutes = minutes % nearestTo;\r\n var addedMinutes = Math.round(remainderMinutes / nearestTo) * nearestTo;\r\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), roundedMinutes + addedMinutes);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name setDate\r\n * @category Day Helpers\r\n * @summary Set the day of the month to the given date.\r\n *\r\n * @description\r\n * Set the day of the month to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} dayOfMonth - the day of the month of the new date\r\n * @returns {Date} the new date with the day of the month set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set the 30th day of the month to 1 September 2014:\r\n * var result = setDate(new Date(2014, 8, 1), 30)\r\n * //=> Tue Sep 30 2014 00:00:00\r\n */\r\nexport default function setDate(dirtyDate, dirtyDayOfMonth) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var dayOfMonth = toInteger(dirtyDayOfMonth);\r\n date.setDate(dayOfMonth);\r\n return date;\r\n}\r\n","import addDays from '../addDays/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name setDay\r\n * @category Weekday Helpers\r\n * @summary Set the day of the week to the given date.\r\n *\r\n * @description\r\n * Set the day of the week to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} day - the day of the week of the new date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {Date} the new date with the day of the week set\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n *\r\n * @example\r\n * // Set Sunday to 1 September 2014:\r\n * var result = setDay(new Date(2014, 8, 1), 0)\r\n * //=> Sun Aug 31 2014 00:00:00\r\n *\r\n * @example\r\n * // If week starts with Monday, set Sunday to 1 September 2014:\r\n * var result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\r\n * //=> Sun Sep 07 2014 00:00:00\r\n */\r\nexport default function setDay(dirtyDate, dirtyDay, dirtyOptions) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\r\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\r\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\r\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\r\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\r\n }\r\n var date = toDate(dirtyDate, options);\r\n var day = toInteger(dirtyDay);\r\n var currentDay = date.getDay();\r\n var remainder = day % 7;\r\n var dayIndex = (remainder + 7) % 7;\r\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\r\n return addDays(date, diff, options);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name setDayOfYear\r\n * @category Day Helpers\r\n * @summary Set the day of the year to the given date.\r\n *\r\n * @description\r\n * Set the day of the year to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} dayOfYear - the day of the year of the new date\r\n * @returns {Date} the new date with the day of the year set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set the 2nd day of the year to 2 July 2014:\r\n * var result = setDayOfYear(new Date(2014, 6, 2), 2)\r\n * //=> Thu Jan 02 2014 00:00:00\r\n */\r\nexport default function setDayOfYear(dirtyDate, dirtyDayOfYear) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var dayOfYear = toInteger(dirtyDayOfYear);\r\n date.setMonth(0);\r\n date.setDate(dayOfYear);\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name setHours\r\n * @category Hour Helpers\r\n * @summary Set the hours to the given date.\r\n *\r\n * @description\r\n * Set the hours to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} hours - the hours of the new date\r\n * @returns {Date} the new date with the hours set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set 4 hours to 1 September 2014 11:30:00:\r\n * var result = setHours(new Date(2014, 8, 1, 11, 30), 4)\r\n * //=> Mon Sep 01 2014 04:30:00\r\n */\r\nexport default function setHours(dirtyDate, dirtyHours) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var hours = toInteger(dirtyHours);\r\n date.setHours(hours);\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport addDays from '../addDays/index.js';\r\nimport getISODay from '../getISODay/index.js';\r\n/**\r\n * @name setISODay\r\n * @category Weekday Helpers\r\n * @summary Set the day of the ISO week to the given date.\r\n *\r\n * @description\r\n * Set the day of the ISO week to the given date.\r\n * ISO week starts with Monday.\r\n * 7 is the index of Sunday, 1 is the index of Monday etc.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} day - the day of the ISO week of the new date\r\n * @returns {Date} the new date with the day of the ISO week set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set Sunday to 1 September 2014:\r\n * var result = setISODay(new Date(2014, 8, 1), 7)\r\n * //=> Sun Sep 07 2014 00:00:00\r\n */\r\nexport default function setISODay(dirtyDate, dirtyDay) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var day = toInteger(dirtyDay);\r\n var currentDay = getISODay(date);\r\n var diff = day - currentDay;\r\n return addDays(date, diff);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport getISOWeek from '../getISOWeek/index.js';\r\n/**\r\n * @name setISOWeek\r\n * @category ISO Week Helpers\r\n * @summary Set the ISO week to the given date.\r\n *\r\n * @description\r\n * Set the ISO week to the given date, saving the weekday number.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} isoWeek - the ISO week of the new date\r\n * @returns {Date} the new date with the ISO week set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set the 53rd ISO week to 7 August 2004:\r\n * var result = setISOWeek(new Date(2004, 7, 7), 53)\r\n * //=> Sat Jan 01 2005 00:00:00\r\n */\r\nexport default function setISOWeek(dirtyDate, dirtyISOWeek) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var isoWeek = toInteger(dirtyISOWeek);\r\n var diff = getISOWeek(date) - isoWeek;\r\n date.setDate(date.getDate() - diff * 7);\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport startOfISOWeekYear from '../startOfISOWeekYear/index.js';\r\nimport differenceInCalendarDays from '../differenceInCalendarDays/index.js';\r\n/**\r\n * @name setISOWeekYear\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Set the ISO week-numbering year to the given date.\r\n *\r\n * @description\r\n * Set the ISO week-numbering year to the given date,\r\n * saving the week number and the weekday number.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `setISOYear` to `setISOWeekYear`.\r\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\r\n * This change makes the name consistent with\r\n * locale-dependent week-numbering year helpers, e.g., `setWeekYear`.\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} isoWeekYear - the ISO week-numbering year of the new date\r\n * @returns {Date} the new date with the ISO week-numbering year set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set ISO week-numbering year 2007 to 29 December 2008:\r\n * var result = setISOWeekYear(new Date(2008, 11, 29), 2007)\r\n * //=> Mon Jan 01 2007 00:00:00\r\n */\r\nexport default function setISOWeekYear(dirtyDate, dirtyISOWeekYear) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var isoWeekYear = toInteger(dirtyISOWeekYear);\r\n var diff = differenceInCalendarDays(date, startOfISOWeekYear(date));\r\n var fourthOfJanuary = new Date(0);\r\n fourthOfJanuary.setFullYear(isoWeekYear, 0, 4);\r\n fourthOfJanuary.setHours(0, 0, 0, 0);\r\n date = startOfISOWeekYear(fourthOfJanuary);\r\n date.setDate(date.getDate() + diff);\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name setMilliseconds\r\n * @category Millisecond Helpers\r\n * @summary Set the milliseconds to the given date.\r\n *\r\n * @description\r\n * Set the milliseconds to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} milliseconds - the milliseconds of the new date\r\n * @returns {Date} the new date with the milliseconds set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set 300 milliseconds to 1 September 2014 11:30:40.500:\r\n * var result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)\r\n * //=> Mon Sep 01 2014 11:30:40.300\r\n */\r\nexport default function setMilliseconds(dirtyDate, dirtyMilliseconds) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var milliseconds = toInteger(dirtyMilliseconds);\r\n date.setMilliseconds(milliseconds);\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name setMinutes\r\n * @category Minute Helpers\r\n * @summary Set the minutes to the given date.\r\n *\r\n * @description\r\n * Set the minutes to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} minutes - the minutes of the new date\r\n * @returns {Date} the new date with the minutes set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set 45 minutes to 1 September 2014 11:30:40:\r\n * var result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\r\n * //=> Mon Sep 01 2014 11:45:40\r\n */\r\nexport default function setMinutes(dirtyDate, dirtyMinutes) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var minutes = toInteger(dirtyMinutes);\r\n date.setMinutes(minutes);\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport getDaysInMonth from '../getDaysInMonth/index.js';\r\n/**\r\n * @name setMonth\r\n * @category Month Helpers\r\n * @summary Set the month to the given date.\r\n *\r\n * @description\r\n * Set the month to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} month - the month of the new date\r\n * @returns {Date} the new date with the month set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set February to 1 September 2014:\r\n * var result = setMonth(new Date(2014, 8, 1), 1)\r\n * //=> Sat Feb 01 2014 00:00:00\r\n */\r\nexport default function setMonth(dirtyDate, dirtyMonth) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var month = toInteger(dirtyMonth);\r\n var year = date.getFullYear();\r\n var day = date.getDate();\r\n var dateWithDesiredMonth = new Date(0);\r\n dateWithDesiredMonth.setFullYear(year, month, 15);\r\n dateWithDesiredMonth.setHours(0, 0, 0, 0);\r\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth); // Set the last day of the new month\r\n // if the original date was the last day of the longer month\r\n date.setMonth(month, Math.min(day, daysInMonth));\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport setMonth from '../setMonth/index.js';\r\n/**\r\n * @name setQuarter\r\n * @category Quarter Helpers\r\n * @summary Set the year quarter to the given date.\r\n *\r\n * @description\r\n * Set the year quarter to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} quarter - the quarter of the new date\r\n * @returns {Date} the new date with the quarter set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set the 2nd quarter to 2 July 2014:\r\n * var result = setQuarter(new Date(2014, 6, 2), 2)\r\n * //=> Wed Apr 02 2014 00:00:00\r\n */\r\nexport default function setQuarter(dirtyDate, dirtyQuarter) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var quarter = toInteger(dirtyQuarter);\r\n var oldQuarter = Math.floor(date.getMonth() / 3) + 1;\r\n var diff = quarter - oldQuarter;\r\n return setMonth(date, date.getMonth() + diff * 3);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name setSeconds\r\n * @category Second Helpers\r\n * @summary Set the seconds to the given date.\r\n *\r\n * @description\r\n * Set the seconds to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} seconds - the seconds of the new date\r\n * @returns {Date} the new date with the seconds set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set 45 seconds to 1 September 2014 11:30:40:\r\n * var result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)\r\n * //=> Mon Sep 01 2014 11:30:45\r\n */\r\nexport default function setSeconds(dirtyDate, dirtySeconds) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var seconds = toInteger(dirtySeconds);\r\n date.setSeconds(seconds);\r\n return date;\r\n}\r\n","import getWeek from '../getWeek/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name setWeek\r\n * @category Week Helpers\r\n * @summary Set the local week to the given date.\r\n *\r\n * @description\r\n * Set the local week to the given date, saving the weekday number.\r\n * The exact calculation depends on the values of\r\n * `options.weekStartsOn` (which is the index of the first day of the week)\r\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\r\n * the first week of the week-numbering year)\r\n *\r\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} week - the week of the new date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\r\n * @returns {Date} the new date with the local week set\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\r\n *\r\n * @example\r\n * // Set the 1st week to 2 January 2005 with default options:\r\n * var result = setWeek(new Date(2005, 0, 2), 1)\r\n * //=> Sun Dec 26 2004 00:00:00\r\n *\r\n * @example\r\n * // Set the 1st week to 2 January 2005,\r\n * // if Monday is the first day of the week,\r\n * // and the first week of the year always contains 4 January:\r\n * var result = setWeek(new Date(2005, 0, 2), 1, {\r\n * weekStartsOn: 1,\r\n * firstWeekContainsDate: 4\r\n * })\r\n * //=> Sun Jan 4 2004 00:00:00\r\n */\r\nexport default function setWeek(dirtyDate, dirtyWeek, dirtyOptions) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var week = toInteger(dirtyWeek);\r\n var diff = getWeek(date, dirtyOptions) - week;\r\n date.setDate(date.getDate() - diff * 7);\r\n return date;\r\n}\r\n","import differenceInCalendarDays from '../differenceInCalendarDays/index.js';\r\nimport startOfWeekYear from '../startOfWeekYear/index.js';\r\nimport toDate from '../toDate/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name setWeekYear\r\n * @category Week-Numbering Year Helpers\r\n * @summary Set the local week-numbering year to the given date.\r\n *\r\n * @description\r\n * Set the local week-numbering year to the given date,\r\n * saving the week number and the weekday number.\r\n * The exact calculation depends on the values of\r\n * `options.weekStartsOn` (which is the index of the first day of the week)\r\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\r\n * the first week of the week-numbering year)\r\n *\r\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} weekYear - the local week-numbering year of the new date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\r\n * @returns {Date} the new date with the local week-numbering year set\r\n * @throws {TypeError} 2 arguments required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\r\n *\r\n * @example\r\n * // Set the local week-numbering year 2004 to 2 January 2010 with default options:\r\n * var result = setWeekYear(new Date(2010, 0, 2), 2004)\r\n * //=> Sat Jan 03 2004 00:00:00\r\n *\r\n * @example\r\n * // Set the local week-numbering year 2004 to 2 January 2010,\r\n * // if Monday is the first day of week\r\n * // and 4 January is always in the first week of the year:\r\n * var result = setWeekYear(new Date(2010, 0, 2), 2004, {\r\n * weekStartsOn: 1,\r\n * firstWeekContainsDate: 4\r\n * })\r\n * //=> Sat Jan 01 2005 00:00:00\r\n */\r\nexport default function setWeekYear(dirtyDate, dirtyWeekYear, dirtyOptions) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\r\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\r\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\r\n var date = toDate(dirtyDate);\r\n var weekYear = toInteger(dirtyWeekYear);\r\n var diff = differenceInCalendarDays(date, startOfWeekYear(date, dirtyOptions));\r\n var firstWeek = new Date(0);\r\n firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate);\r\n firstWeek.setHours(0, 0, 0, 0);\r\n date = startOfWeekYear(firstWeek, dirtyOptions);\r\n date.setDate(date.getDate() + diff);\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport toDate from '../toDate/index.js';\r\n/**\r\n * @name setYear\r\n * @category Year Helpers\r\n * @summary Set the year to the given date.\r\n *\r\n * @description\r\n * Set the year to the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} year - the year of the new date\r\n * @returns {Date} the new date with the year set\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Set year 2013 to 1 September 2014:\r\n * var result = setYear(new Date(2014, 8, 1), 2013)\r\n * //=> Sun Sep 01 2013 00:00:00\r\n */\r\nexport default function setYear(dirtyDate, dirtyYear) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = toInteger(dirtyYear); // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\r\n if (isNaN(date)) {\r\n return new Date(NaN);\r\n }\r\n date.setFullYear(year);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name startOfDay\r\n * @category Day Helpers\r\n * @summary Return the start of a day for the given date.\r\n *\r\n * @description\r\n * Return the start of a day for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the start of a day\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The start of a day for 2 September 2014 11:55:00:\r\n * var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Tue Sep 02 2014 00:00:00\r\n */\r\nexport default function startOfDay(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name startOfDecade\r\n * @category Decade Helpers\r\n * @summary Return the start of a decade for the given date.\r\n *\r\n * @description\r\n * Return the start of a decade for the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the start of a decade\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The start of a decade for 21 October 2015 00:00:00:\r\n * var result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00))\r\n * //=> Jan 01 2010 00:00:00\r\n */\r\nexport default function startOfDecade(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var year = date.getFullYear();\r\n var decade = Math.floor(year / 10) * 10;\r\n date.setFullYear(decade, 0, 1);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name startOfHour\r\n * @category Hour Helpers\r\n * @summary Return the start of an hour for the given date.\r\n *\r\n * @description\r\n * Return the start of an hour for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the start of an hour\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The start of an hour for 2 September 2014 11:55:00:\r\n * var result = startOfHour(new Date(2014, 8, 2, 11, 55))\r\n * //=> Tue Sep 02 2014 11:00:00\r\n */\r\nexport default function startOfHour(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n date.setMinutes(0, 0, 0);\r\n return date;\r\n}\r\n","import startOfWeek from '../startOfWeek/index.js';\r\n/**\r\n * @name startOfISOWeek\r\n * @category ISO Week Helpers\r\n * @summary Return the start of an ISO week for the given date.\r\n *\r\n * @description\r\n * Return the start of an ISO week for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the start of an ISO week\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The start of an ISO week for 2 September 2014 11:55:00:\r\n * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Mon Sep 01 2014 00:00:00\r\n */\r\nexport default function startOfISOWeek(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n return startOfWeek(dirtyDate, {\r\n weekStartsOn: 1\r\n });\r\n}\r\n","import getISOWeekYear from '../getISOWeekYear/index.js';\r\nimport startOfISOWeek from '../startOfISOWeek/index.js';\r\n/**\r\n * @name startOfISOWeekYear\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Return the start of an ISO week-numbering year for the given date.\r\n *\r\n * @description\r\n * Return the start of an ISO week-numbering year,\r\n * which always starts 3 days before the year's first Thursday.\r\n * The result will be in the local timezone.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the start of an ISO week-numbering year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The start of an ISO week-numbering year for 2 July 2005:\r\n * var result = startOfISOWeekYear(new Date(2005, 6, 2))\r\n * //=> Mon Jan 03 2005 00:00:00\r\n */\r\nexport default function startOfISOWeekYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var year = getISOWeekYear(dirtyDate);\r\n var fourthOfJanuary = new Date(0);\r\n fourthOfJanuary.setFullYear(year, 0, 4);\r\n fourthOfJanuary.setHours(0, 0, 0, 0);\r\n var date = startOfISOWeek(fourthOfJanuary);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name startOfMinute\r\n * @category Minute Helpers\r\n * @summary Return the start of a minute for the given date.\r\n *\r\n * @description\r\n * Return the start of a minute for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the start of a minute\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The start of a minute for 1 December 2014 22:15:45.400:\r\n * var result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\r\n * //=> Mon Dec 01 2014 22:15:00\r\n */\r\nexport default function startOfMinute(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n date.setSeconds(0, 0);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name startOfMonth\r\n * @category Month Helpers\r\n * @summary Return the start of a month for the given date.\r\n *\r\n * @description\r\n * Return the start of a month for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the start of a month\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The start of a month for 2 September 2014 11:55:00:\r\n * var result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Mon Sep 01 2014 00:00:00\r\n */\r\nexport default function startOfMonth(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n date.setDate(1);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name startOfQuarter\r\n * @category Quarter Helpers\r\n * @summary Return the start of a year quarter for the given date.\r\n *\r\n * @description\r\n * Return the start of a year quarter for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the start of a quarter\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The start of a quarter for 2 September 2014 11:55:00:\r\n * var result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Tue Jul 01 2014 00:00:00\r\n */\r\nexport default function startOfQuarter(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n var currentMonth = date.getMonth();\r\n var month = currentMonth - currentMonth % 3;\r\n date.setMonth(month, 1);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name startOfSecond\r\n * @category Second Helpers\r\n * @summary Return the start of a second for the given date.\r\n *\r\n * @description\r\n * Return the start of a second for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the start of a second\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The start of a second for 1 December 2014 22:15:45.400:\r\n * var result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\r\n * //=> Mon Dec 01 2014 22:15:45.000\r\n */\r\nexport default function startOfSecond(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var date = toDate(dirtyDate);\r\n date.setMilliseconds(0);\r\n return date;\r\n}\r\n","import startOfDay from '../startOfDay/index.js';\r\n/**\r\n * @name startOfToday\r\n * @category Day Helpers\r\n * @summary Return the start of today.\r\n * @pure false\r\n *\r\n * @description\r\n * Return the start of today.\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @returns {Date} the start of today\r\n *\r\n * @example\r\n * // If today is 6 October 2014:\r\n * var result = startOfToday()\r\n * //=> Mon Oct 6 2014 00:00:00\r\n */\r\nexport default function startOfToday() {\r\n return startOfDay(Date.now());\r\n}\r\n","/**\r\n * @name startOfTomorrow\r\n * @category Day Helpers\r\n * @summary Return the start of tomorrow.\r\n * @pure false\r\n *\r\n * @description\r\n * Return the start of tomorrow.\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @returns {Date} the start of tomorrow\r\n *\r\n * @example\r\n * // If today is 6 October 2014:\r\n * var result = startOfTomorrow()\r\n * //=> Tue Oct 7 2014 00:00:00\r\n */\r\nexport default function startOfTomorrow() {\r\n var now = new Date();\r\n var year = now.getFullYear();\r\n var month = now.getMonth();\r\n var day = now.getDate();\r\n var date = new Date(0);\r\n date.setFullYear(year, month, day + 1);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name startOfWeek\r\n * @category Week Helpers\r\n * @summary Return the start of a week for the given date.\r\n *\r\n * @description\r\n * Return the start of a week for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @returns {Date} the start of a week\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n *\r\n * @example\r\n * // The start of a week for 2 September 2014 11:55:00:\r\n * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\r\n * //=> Sun Aug 31 2014 00:00:00\r\n *\r\n * @example\r\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\r\n * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\r\n * //=> Mon Sep 01 2014 00:00:00\r\n */\r\nexport default function startOfWeek(dirtyDate, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\r\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\r\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\r\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\r\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\r\n }\r\n var date = toDate(dirtyDate);\r\n var day = date.getDay();\r\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\r\n date.setDate(date.getDate() - diff);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import getWeekYear from '../getWeekYear/index.js';\r\nimport startOfWeek from '../startOfWeek/index.js';\r\nimport toInteger from '../_lib/toInteger/index.js';\r\n/**\r\n * @name startOfWeekYear\r\n * @category Week-Numbering Year Helpers\r\n * @summary Return the start of a local week-numbering year for the given date.\r\n *\r\n * @description\r\n * Return the start of a local week-numbering year.\r\n * The exact calculation depends on the values of\r\n * `options.weekStartsOn` (which is the index of the first day of the week)\r\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\r\n * the first week of the week-numbering year)\r\n *\r\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @param {Object} [options] - an object with options.\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\r\n * @returns {Date} the start of a week-numbering year\r\n * @throws {TypeError} 1 argument required\r\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\r\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\r\n *\r\n * @example\r\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\r\n * var result = startOfWeekYear(new Date(2005, 6, 2))\r\n * //=> Sun Dec 26 2004 00:00:00\r\n *\r\n * @example\r\n * // The start of a week-numbering year for 2 July 2005\r\n * // if Monday is the first day of week\r\n * // and 4 January is always in the first week of the year:\r\n * var result = startOfWeekYear(new Date(2005, 6, 2), {\r\n * weekStartsOn: 1,\r\n * firstWeekContainsDate: 4\r\n * })\r\n * //=> Mon Jan 03 2005 00:00:00\r\n */\r\nexport default function startOfWeekYear(dirtyDate, dirtyOptions) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var options = dirtyOptions || {};\r\n var locale = options.locale;\r\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\r\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\r\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\r\n var year = getWeekYear(dirtyDate, dirtyOptions);\r\n var firstWeek = new Date(0);\r\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\r\n firstWeek.setHours(0, 0, 0, 0);\r\n var date = startOfWeek(firstWeek, dirtyOptions);\r\n return date;\r\n}\r\n","import toDate from '../toDate/index.js';\r\n/**\r\n * @name startOfYear\r\n * @category Year Helpers\r\n * @summary Return the start of a year for the given date.\r\n *\r\n * @description\r\n * Return the start of a year for the given date.\r\n * The result will be in the local timezone.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the original date\r\n * @returns {Date} the start of a year\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // The start of a year for 2 September 2014 11:55:00:\r\n * var result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\r\n * //=> Wed Jan 01 2014 00:00:00\r\n */\r\nexport default function startOfYear(dirtyDate) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var cleanDate = toDate(dirtyDate);\r\n var date = new Date(0);\r\n date.setFullYear(cleanDate.getFullYear(), 0, 1);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","/**\r\n * @name startOfYesterday\r\n * @category Day Helpers\r\n * @summary Return the start of yesterday.\r\n * @pure false\r\n *\r\n * @description\r\n * Return the start of yesterday.\r\n *\r\n * > ⚠️ Please note that this function is not present in the FP submodule as\r\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @returns {Date} the start of yesterday\r\n *\r\n * @example\r\n * // If today is 6 October 2014:\r\n * var result = startOfYesterday()\r\n * //=> Sun Oct 5 2014 00:00:00\r\n */\r\nexport default function startOfYesterday() {\r\n var now = new Date();\r\n var year = now.getFullYear();\r\n var month = now.getMonth();\r\n var day = now.getDate();\r\n var date = new Date(0);\r\n date.setFullYear(year, month, day - 1);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addDays from '../addDays/index.js';\r\n/**\r\n * @name subDays\r\n * @category Day Helpers\r\n * @summary Subtract the specified number of days from the given date.\r\n *\r\n * @description\r\n * Subtract the specified number of days from the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of days to be subtracted\r\n * @returns {Date} the new date with the days subtracted\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Subtract 10 days from 1 September 2014:\r\n * var result = subDays(new Date(2014, 8, 1), 10)\r\n * //=> Fri Aug 22 2014 00:00:00\r\n */\r\nexport default function subDays(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addDays(dirtyDate, -amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addHours from '../addHours/index.js';\r\n/**\r\n * @name subHours\r\n * @category Hour Helpers\r\n * @summary Subtract the specified number of hours from the given date.\r\n *\r\n * @description\r\n * Subtract the specified number of hours from the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of hours to be subtracted\r\n * @returns {Date} the new date with the hours subtracted\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Subtract 2 hours from 11 July 2014 01:00:00:\r\n * var result = subHours(new Date(2014, 6, 11, 1, 0), 2)\r\n * //=> Thu Jul 10 2014 23:00:00\r\n */\r\nexport default function subHours(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addHours(dirtyDate, -amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addISOWeekYears from '../addISOWeekYears/index.js';\r\n/**\r\n * @name subISOWeekYears\r\n * @category ISO Week-Numbering Year Helpers\r\n * @summary Subtract the specified number of ISO week-numbering years from the given date.\r\n *\r\n * @description\r\n * Subtract the specified number of ISO week-numbering years from the given date.\r\n *\r\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * - The function was renamed from `subISOYears` to `subISOWeekYears`.\r\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\r\n * This change makes the name consistent with\r\n * locale-dependent week-numbering year helpers, e.g., `setWeekYear`.\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of ISO week-numbering years to be subtracted\r\n * @returns {Date} the new date with the ISO week-numbering years subtracted\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Subtract 5 ISO week-numbering years from 1 September 2014:\r\n * var result = subISOWeekYears(new Date(2014, 8, 1), 5)\r\n * //=> Mon Aug 31 2009 00:00:00\r\n */\r\nexport default function subISOWeekYears(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addISOWeekYears(dirtyDate, -amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addMilliseconds from '../addMilliseconds/index.js';\r\n/**\r\n * @name subMilliseconds\r\n * @category Millisecond Helpers\r\n * @summary Subtract the specified number of milliseconds from the given date.\r\n *\r\n * @description\r\n * Subtract the specified number of milliseconds from the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of milliseconds to be subtracted\r\n * @returns {Date} the new date with the milliseconds subtracted\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\r\n * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\r\n * //=> Thu Jul 10 2014 12:45:29.250\r\n */\r\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addMilliseconds(dirtyDate, -amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addMinutes from '../addMinutes/index.js';\r\n/**\r\n * @name subMinutes\r\n * @category Minute Helpers\r\n * @summary Subtract the specified number of minutes from the given date.\r\n *\r\n * @description\r\n * Subtract the specified number of minutes from the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of minutes to be subtracted\r\n * @returns {Date} the new date with the minutes subtracted\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\r\n * var result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\r\n * //=> Thu Jul 10 2014 11:30:00\r\n */\r\nexport default function subMinutes(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addMinutes(dirtyDate, -amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addMonths from '../addMonths/index.js';\r\n/**\r\n * @name subMonths\r\n * @category Month Helpers\r\n * @summary Subtract the specified number of months from the given date.\r\n *\r\n * @description\r\n * Subtract the specified number of months from the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of months to be subtracted\r\n * @returns {Date} the new date with the months subtracted\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Subtract 5 months from 1 February 2015:\r\n * var result = subMonths(new Date(2015, 1, 1), 5)\r\n * //=> Mon Sep 01 2014 00:00:00\r\n */\r\nexport default function subMonths(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addMonths(dirtyDate, -amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addQuarters from '../addQuarters/index.js';\r\n/**\r\n * @name subQuarters\r\n * @category Quarter Helpers\r\n * @summary Subtract the specified number of year quarters from the given date.\r\n *\r\n * @description\r\n * Subtract the specified number of year quarters from the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of quarters to be subtracted\r\n * @returns {Date} the new date with the quarters subtracted\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Subtract 3 quarters from 1 September 2014:\r\n * var result = subQuarters(new Date(2014, 8, 1), 3)\r\n * //=> Sun Dec 01 2013 00:00:00\r\n */\r\nexport default function subQuarters(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addQuarters(dirtyDate, -amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addSeconds from '../addSeconds/index.js';\r\n/**\r\n * @name subSeconds\r\n * @category Second Helpers\r\n * @summary Subtract the specified number of seconds from the given date.\r\n *\r\n * @description\r\n * Subtract the specified number of seconds from the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of seconds to be subtracted\r\n * @returns {Date} the new date with the seconds subtracted\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Subtract 30 seconds from 10 July 2014 12:45:00:\r\n * var result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\r\n * //=> Thu Jul 10 2014 12:44:30\r\n */\r\nexport default function subSeconds(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addSeconds(dirtyDate, -amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addWeeks from '../addWeeks/index.js';\r\n/**\r\n * @name subWeeks\r\n * @category Week Helpers\r\n * @summary Subtract the specified number of weeks from the given date.\r\n *\r\n * @description\r\n * Subtract the specified number of weeks from the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of weeks to be subtracted\r\n * @returns {Date} the new date with the weeks subtracted\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Subtract 4 weeks from 1 September 2014:\r\n * var result = subWeeks(new Date(2014, 8, 1), 4)\r\n * //=> Mon Aug 04 2014 00:00:00\r\n */\r\nexport default function subWeeks(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addWeeks(dirtyDate, -amount);\r\n}\r\n","import toInteger from '../_lib/toInteger/index.js';\r\nimport addYears from '../addYears/index.js';\r\n/**\r\n * @name subYears\r\n * @category Year Helpers\r\n * @summary Subtract the specified number of years from the given date.\r\n *\r\n * @description\r\n * Subtract the specified number of years from the given date.\r\n *\r\n * ### v2.0.0 breaking changes:\r\n *\r\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\r\n *\r\n * @param {Date|Number} date - the date to be changed\r\n * @param {Number} amount - the amount of years to be subtracted\r\n * @returns {Date} the new date with the years subtracted\r\n * @throws {TypeError} 2 arguments required\r\n *\r\n * @example\r\n * // Subtract 5 years from 1 September 2014:\r\n * var result = subYears(new Date(2014, 8, 1), 5)\r\n * //=> Tue Sep 01 2009 00:00:00\r\n */\r\nexport default function subYears(dirtyDate, dirtyAmount) {\r\n if (arguments.length < 2) {\r\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\r\n }\r\n var amount = toInteger(dirtyAmount);\r\n return addYears(dirtyDate, -amount);\r\n}\r\n","/**\r\n * @name toDate\r\n * @category Common Helpers\r\n * @summary Convert the given argument to an instance of Date.\r\n *\r\n * @description\r\n * Convert the given argument to an instance of Date.\r\n *\r\n * If the argument is an instance of Date, the function returns its clone.\r\n *\r\n * If the argument is a number, it is treated as a timestamp.\r\n *\r\n * If the argument is none of the above, the function returns Invalid Date.\r\n *\r\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\r\n *\r\n * @param {Date|Number} argument - the value to convert\r\n * @returns {Date} the parsed date in the local time zone\r\n * @throws {TypeError} 1 argument required\r\n *\r\n * @example\r\n * // Clone the date:\r\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\r\n * //=> Tue Feb 11 2014 11:30:30\r\n *\r\n * @example\r\n * // Convert the timestamp to date:\r\n * const result = toDate(1392098430000)\r\n * //=> Tue Feb 11 2014 11:30:30\r\n */\r\nexport default function toDate(argument) {\r\n if (arguments.length < 1) {\r\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\r\n }\r\n var argStr = Object.prototype.toString.call(argument); // Clone the date\r\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\r\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\r\n return new Date(argument.getTime());\r\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\r\n return new Date(argument);\r\n } else {\r\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\r\n // eslint-disable-next-line no-console\r\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule\"); // eslint-disable-next-line no-console\r\n console.warn(new Error().stack);\r\n }\r\n return new Date(NaN);\r\n }\r\n}\r\n","\"use strict\";\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\nexports.__esModule = true;\r\nexports.default = addClass;\r\nvar _hasClass = _interopRequireDefault(require(\"./hasClass\"));\r\nfunction addClass(element, className) {\r\n if (element.classList) element.classList.add(className);else if (!(0, _hasClass.default)(element, className)) if (typeof element.className === 'string') element.className = element.className + ' ' + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + ' ' + className);\r\n}\r\nmodule.exports = exports[\"default\"];\r\n","\"use strict\";\r\nexports.__esModule = true;\r\nexports.default = hasClass;\r\nfunction hasClass(element, className) {\r\n if (element.classList) return !!className && element.classList.contains(className);else return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\r\n}\r\nmodule.exports = exports[\"default\"];\r\n","'use strict';\r\nfunction replaceClassName(origClass, classToRemove) {\r\n return origClass.replace(new RegExp('(^|\\\\s)' + classToRemove + '(?:\\\\s|$)', 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\r\n}\r\nmodule.exports = function removeClass(element, className) {\r\n if (element.classList) element.classList.remove(className);else if (typeof element.className === 'string') element.className = replaceClassName(element.className, className);else element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\r\n};\r\n","var getNative = require('./_getNative'),\r\n root = require('./_root');\r\n/* Built-in method references that are verified to be native. */\r\nvar DataView = getNative(root, 'DataView');\r\nmodule.exports = DataView;\r\n","var getNative = require('./_getNative'),\r\n root = require('./_root');\r\n/* Built-in method references that are verified to be native. */\r\nvar Map = getNative(root, 'Map');\r\nmodule.exports = Map;\r\n","var getNative = require('./_getNative'),\r\n root = require('./_root');\r\n/* Built-in method references that are verified to be native. */\r\nvar Promise = getNative(root, 'Promise');\r\nmodule.exports = Promise;\r\n","var getNative = require('./_getNative'),\r\n root = require('./_root');\r\n/* Built-in method references that are verified to be native. */\r\nvar Set = getNative(root, 'Set');\r\nmodule.exports = Set;\r\n","var root = require('./_root');\r\n/** Built-in value references. */\r\nvar Symbol = root.Symbol;\r\nmodule.exports = Symbol;\r\n","var getNative = require('./_getNative'),\r\n root = require('./_root');\r\n/* Built-in method references that are verified to be native. */\r\nvar WeakMap = getNative(root, 'WeakMap');\r\nmodule.exports = WeakMap;\r\n","var Symbol = require('./_Symbol'),\r\n getRawTag = require('./_getRawTag'),\r\n objectToString = require('./_objectToString');\r\n/** `Object#toString` result references. */\r\nvar nullTag = '[object Null]',\r\n undefinedTag = '[object Undefined]';\r\n/** Built-in value references. */\r\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\r\n/**\r\n * The base implementation of `getTag` without fallbacks for buggy environments.\r\n *\r\n * @private\r\n * @param {*} value The value to query.\r\n * @returns {string} Returns the `toStringTag`.\r\n */\r\nfunction baseGetTag(value) {\r\n if (value == null) {\r\n return value === undefined ? undefinedTag : nullTag;\r\n }\r\n return (symToStringTag && symToStringTag in Object(value))\r\n ? getRawTag(value)\r\n : objectToString(value);\r\n}\r\nmodule.exports = baseGetTag;\r\n","var baseGetTag = require('./_baseGetTag'),\r\n isObjectLike = require('./isObjectLike');\r\n/** `Object#toString` result references. */\r\nvar argsTag = '[object Arguments]';\r\n/**\r\n * The base implementation of `_.isArguments`.\r\n *\r\n * @private\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\r\n */\r\nfunction baseIsArguments(value) {\r\n return isObjectLike(value) && baseGetTag(value) == argsTag;\r\n}\r\nmodule.exports = baseIsArguments;\r\n","var isFunction = require('./isFunction'),\r\n isMasked = require('./_isMasked'),\r\n isObject = require('./isObject'),\r\n toSource = require('./_toSource');\r\n/**\r\n * Used to match `RegExp`\r\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\r\n */\r\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\r\n/** Used to detect host constructors (Safari). */\r\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\r\n/** Used for built-in method references. */\r\nvar funcProto = Function.prototype,\r\n objectProto = Object.prototype;\r\n/** Used to resolve the decompiled source of functions. */\r\nvar funcToString = funcProto.toString;\r\n/** Used to check objects for own properties. */\r\nvar hasOwnProperty = objectProto.hasOwnProperty;\r\n/** Used to detect if a method is native. */\r\nvar reIsNative = RegExp('^' +\r\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\r\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\r\n);\r\n/**\r\n * The base implementation of `_.isNative` without bad shim checks.\r\n *\r\n * @private\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is a native function,\r\n * else `false`.\r\n */\r\nfunction baseIsNative(value) {\r\n if (!isObject(value) || isMasked(value)) {\r\n return false;\r\n }\r\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\r\n return pattern.test(toSource(value));\r\n}\r\nmodule.exports = baseIsNative;\r\n","var baseGetTag = require('./_baseGetTag'),\r\n isLength = require('./isLength'),\r\n isObjectLike = require('./isObjectLike');\r\n/** `Object#toString` result references. */\r\nvar argsTag = '[object Arguments]',\r\n arrayTag = '[object Array]',\r\n boolTag = '[object Boolean]',\r\n dateTag = '[object Date]',\r\n errorTag = '[object Error]',\r\n funcTag = '[object Function]',\r\n mapTag = '[object Map]',\r\n numberTag = '[object Number]',\r\n objectTag = '[object Object]',\r\n regexpTag = '[object RegExp]',\r\n setTag = '[object Set]',\r\n stringTag = '[object String]',\r\n weakMapTag = '[object WeakMap]';\r\nvar arrayBufferTag = '[object ArrayBuffer]',\r\n dataViewTag = '[object DataView]',\r\n float32Tag = '[object Float32Array]',\r\n float64Tag = '[object Float64Array]',\r\n int8Tag = '[object Int8Array]',\r\n int16Tag = '[object Int16Array]',\r\n int32Tag = '[object Int32Array]',\r\n uint8Tag = '[object Uint8Array]',\r\n uint8ClampedTag = '[object Uint8ClampedArray]',\r\n uint16Tag = '[object Uint16Array]',\r\n uint32Tag = '[object Uint32Array]';\r\n/** Used to identify `toStringTag` values of typed arrays. */\r\nvar typedArrayTags = {};\r\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\r\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\r\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\r\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\r\ntypedArrayTags[uint32Tag] = true;\r\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\r\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\r\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\r\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\r\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\r\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\r\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\r\ntypedArrayTags[weakMapTag] = false;\r\n/**\r\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\r\n *\r\n * @private\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\r\n */\r\nfunction baseIsTypedArray(value) {\r\n return isObjectLike(value) &&\r\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\r\n}\r\nmodule.exports = baseIsTypedArray;\r\n","var isPrototype = require('./_isPrototype'),\r\n nativeKeys = require('./_nativeKeys');\r\n/** Used for built-in method references. */\r\nvar objectProto = Object.prototype;\r\n/** Used to check objects for own properties. */\r\nvar hasOwnProperty = objectProto.hasOwnProperty;\r\n/**\r\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\r\n *\r\n * @private\r\n * @param {Object} object The object to query.\r\n * @returns {Array} Returns the array of property names.\r\n */\r\nfunction baseKeys(object) {\r\n if (!isPrototype(object)) {\r\n return nativeKeys(object);\r\n }\r\n var result = [];\r\n for (var key in Object(object)) {\r\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\r\n result.push(key);\r\n }\r\n }\r\n return result;\r\n}\r\nmodule.exports = baseKeys;\r\n","/**\r\n * The base implementation of `_.unary` without support for storing metadata.\r\n *\r\n * @private\r\n * @param {Function} func The function to cap arguments for.\r\n * @returns {Function} Returns the new capped function.\r\n */\r\nfunction baseUnary(func) {\r\n return function(value) {\r\n return func(value);\r\n };\r\n}\r\nmodule.exports = baseUnary;\r\n","var root = require('./_root');\r\n/** Used to detect overreaching core-js shims. */\r\nvar coreJsData = root['__core-js_shared__'];\r\nmodule.exports = coreJsData;\r\n","/** Detect free variable `global` from Node.js. */\r\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\r\nmodule.exports = freeGlobal;\r\n","var baseIsNative = require('./_baseIsNative'),\r\n getValue = require('./_getValue');\r\n/**\r\n * Gets the native function at `key` of `object`.\r\n *\r\n * @private\r\n * @param {Object} object The object to query.\r\n * @param {string} key The key of the method to get.\r\n * @returns {*} Returns the function if it's native, else `undefined`.\r\n */\r\nfunction getNative(object, key) {\r\n var value = getValue(object, key);\r\n return baseIsNative(value) ? value : undefined;\r\n}\r\nmodule.exports = getNative;\r\n","var Symbol = require('./_Symbol');\r\n/** Used for built-in method references. */\r\nvar objectProto = Object.prototype;\r\n/** Used to check objects for own properties. */\r\nvar hasOwnProperty = objectProto.hasOwnProperty;\r\n/**\r\n * Used to resolve the\r\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\r\n * of values.\r\n */\r\nvar nativeObjectToString = objectProto.toString;\r\n/** Built-in value references. */\r\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\r\n/**\r\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\r\n *\r\n * @private\r\n * @param {*} value The value to query.\r\n * @returns {string} Returns the raw `toStringTag`.\r\n */\r\nfunction getRawTag(value) {\r\n var isOwn = hasOwnProperty.call(value, symToStringTag),\r\n tag = value[symToStringTag];\r\n try {\r\n value[symToStringTag] = undefined;\r\n var unmasked = true;\r\n } catch (e) {}\r\n var result = nativeObjectToString.call(value);\r\n if (unmasked) {\r\n if (isOwn) {\r\n value[symToStringTag] = tag;\r\n } else {\r\n delete value[symToStringTag];\r\n }\r\n }\r\n return result;\r\n}\r\nmodule.exports = getRawTag;\r\n","var DataView = require('./_DataView'),\r\n Map = require('./_Map'),\r\n Promise = require('./_Promise'),\r\n Set = require('./_Set'),\r\n WeakMap = require('./_WeakMap'),\r\n baseGetTag = require('./_baseGetTag'),\r\n toSource = require('./_toSource');\r\n/** `Object#toString` result references. */\r\nvar mapTag = '[object Map]',\r\n objectTag = '[object Object]',\r\n promiseTag = '[object Promise]',\r\n setTag = '[object Set]',\r\n weakMapTag = '[object WeakMap]';\r\nvar dataViewTag = '[object DataView]';\r\n/** Used to detect maps, sets, and weakmaps. */\r\nvar dataViewCtorString = toSource(DataView),\r\n mapCtorString = toSource(Map),\r\n promiseCtorString = toSource(Promise),\r\n setCtorString = toSource(Set),\r\n weakMapCtorString = toSource(WeakMap);\r\n/**\r\n * Gets the `toStringTag` of `value`.\r\n *\r\n * @private\r\n * @param {*} value The value to query.\r\n * @returns {string} Returns the `toStringTag`.\r\n */\r\nvar getTag = baseGetTag;\r\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\r\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\r\n (Map && getTag(new Map) != mapTag) ||\r\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\r\n (Set && getTag(new Set) != setTag) ||\r\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\r\n getTag = function(value) {\r\n var result = baseGetTag(value),\r\n Ctor = result == objectTag ? value.constructor : undefined,\r\n ctorString = Ctor ? toSource(Ctor) : '';\r\n if (ctorString) {\r\n switch (ctorString) {\r\n case dataViewCtorString: return dataViewTag;\r\n case mapCtorString: return mapTag;\r\n case promiseCtorString: return promiseTag;\r\n case setCtorString: return setTag;\r\n case weakMapCtorString: return weakMapTag;\r\n }\r\n }\r\n return result;\r\n };\r\n}\r\nmodule.exports = getTag;\r\n","/**\r\n * Gets the value at `key` of `object`.\r\n *\r\n * @private\r\n * @param {Object} [object] The object to query.\r\n * @param {string} key The key of the property to get.\r\n * @returns {*} Returns the property value.\r\n */\r\nfunction getValue(object, key) {\r\n return object == null ? undefined : object[key];\r\n}\r\nmodule.exports = getValue;\r\n","var coreJsData = require('./_coreJsData');\r\n/** Used to detect methods masquerading as native. */\r\nvar maskSrcKey = (function() {\r\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\r\n return uid ? ('Symbol(src)_1.' + uid) : '';\r\n}());\r\n/**\r\n * Checks if `func` has its source masked.\r\n *\r\n * @private\r\n * @param {Function} func The function to check.\r\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\r\n */\r\nfunction isMasked(func) {\r\n return !!maskSrcKey && (maskSrcKey in func);\r\n}\r\nmodule.exports = isMasked;\r\n","/** Used for built-in method references. */\r\nvar objectProto = Object.prototype;\r\n/**\r\n * Checks if `value` is likely a prototype object.\r\n *\r\n * @private\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\r\n */\r\nfunction isPrototype(value) {\r\n var Ctor = value && value.constructor,\r\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\r\n return value === proto;\r\n}\r\nmodule.exports = isPrototype;\r\n","var overArg = require('./_overArg');\r\n/* Built-in method references for those with the same name as other `lodash` methods. */\r\nvar nativeKeys = overArg(Object.keys, Object);\r\nmodule.exports = nativeKeys;\r\n","var freeGlobal = require('./_freeGlobal');\r\n/** Detect free variable `exports`. */\r\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\r\n/** Detect free variable `module`. */\r\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\r\n/** Detect the popular CommonJS extension `module.exports`. */\r\nvar moduleExports = freeModule && freeModule.exports === freeExports;\r\n/** Detect free variable `process` from Node.js. */\r\nvar freeProcess = moduleExports && freeGlobal.process;\r\n/** Used to access faster Node.js helpers. */\r\nvar nodeUtil = (function() {\r\n try {\r\n // Use `util.types` for Node.js 10+.\r\n var types = freeModule && freeModule.require && freeModule.require('util').types;\r\n if (types) {\r\n return types;\r\n }\r\n // Legacy `process.binding('util')` for Node.js < 10.\r\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\r\n } catch (e) {}\r\n}());\r\nmodule.exports = nodeUtil;\r\n","/** Used for built-in method references. */\r\nvar objectProto = Object.prototype;\r\n/**\r\n * Used to resolve the\r\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\r\n * of values.\r\n */\r\nvar nativeObjectToString = objectProto.toString;\r\n/**\r\n * Converts `value` to a string using `Object.prototype.toString`.\r\n *\r\n * @private\r\n * @param {*} value The value to convert.\r\n * @returns {string} Returns the converted string.\r\n */\r\nfunction objectToString(value) {\r\n return nativeObjectToString.call(value);\r\n}\r\nmodule.exports = objectToString;\r\n","/**\r\n * Creates a unary function that invokes `func` with its argument transformed.\r\n *\r\n * @private\r\n * @param {Function} func The function to wrap.\r\n * @param {Function} transform The argument transform.\r\n * @returns {Function} Returns the new function.\r\n */\r\nfunction overArg(func, transform) {\r\n return function(arg) {\r\n return func(transform(arg));\r\n };\r\n}\r\nmodule.exports = overArg;\r\n","var freeGlobal = require('./_freeGlobal');\r\n/** Detect free variable `self`. */\r\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\r\n/** Used as a reference to the global object. */\r\nvar root = freeGlobal || freeSelf || Function('return this')();\r\nmodule.exports = root;\r\n","/** Used for built-in method references. */\r\nvar funcProto = Function.prototype;\r\n/** Used to resolve the decompiled source of functions. */\r\nvar funcToString = funcProto.toString;\r\n/**\r\n * Converts `func` to its source code.\r\n *\r\n * @private\r\n * @param {Function} func The function to convert.\r\n * @returns {string} Returns the source code.\r\n */\r\nfunction toSource(func) {\r\n if (func != null) {\r\n try {\r\n return funcToString.call(func);\r\n } catch (e) {}\r\n try {\r\n return (func + '');\r\n } catch (e) {}\r\n }\r\n return '';\r\n}\r\nmodule.exports = toSource;\r\n","var baseIsArguments = require('./_baseIsArguments'),\r\n isObjectLike = require('./isObjectLike');\r\n/** Used for built-in method references. */\r\nvar objectProto = Object.prototype;\r\n/** Used to check objects for own properties. */\r\nvar hasOwnProperty = objectProto.hasOwnProperty;\r\n/** Built-in value references. */\r\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\r\n/**\r\n * Checks if `value` is likely an `arguments` object.\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 0.1.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\r\n * else `false`.\r\n * @example\r\n *\r\n * _.isArguments(function() { return arguments; }());\r\n * // => true\r\n *\r\n * _.isArguments([1, 2, 3]);\r\n * // => false\r\n */\r\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\r\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\r\n !propertyIsEnumerable.call(value, 'callee');\r\n};\r\nmodule.exports = isArguments;\r\n","/**\r\n * Checks if `value` is classified as an `Array` object.\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 0.1.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\r\n * @example\r\n *\r\n * _.isArray([1, 2, 3]);\r\n * // => true\r\n *\r\n * _.isArray(document.body.children);\r\n * // => false\r\n *\r\n * _.isArray('abc');\r\n * // => false\r\n *\r\n * _.isArray(_.noop);\r\n * // => false\r\n */\r\nvar isArray = Array.isArray;\r\nmodule.exports = isArray;\r\n","var isFunction = require('./isFunction'),\r\n isLength = require('./isLength');\r\n/**\r\n * Checks if `value` is array-like. A value is considered array-like if it's\r\n * not a function and has a `value.length` that's an integer greater than or\r\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 4.0.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\r\n * @example\r\n *\r\n * _.isArrayLike([1, 2, 3]);\r\n * // => true\r\n *\r\n * _.isArrayLike(document.body.children);\r\n * // => true\r\n *\r\n * _.isArrayLike('abc');\r\n * // => true\r\n *\r\n * _.isArrayLike(_.noop);\r\n * // => false\r\n */\r\nfunction isArrayLike(value) {\r\n return value != null && isLength(value.length) && !isFunction(value);\r\n}\r\nmodule.exports = isArrayLike;\r\n","var root = require('./_root'),\r\n stubFalse = require('./stubFalse');\r\n/** Detect free variable `exports`. */\r\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\r\n/** Detect free variable `module`. */\r\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\r\n/** Detect the popular CommonJS extension `module.exports`. */\r\nvar moduleExports = freeModule && freeModule.exports === freeExports;\r\n/** Built-in value references. */\r\nvar Buffer = moduleExports ? root.Buffer : undefined;\r\n/* Built-in method references for those with the same name as other `lodash` methods. */\r\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\r\n/**\r\n * Checks if `value` is a buffer.\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 4.3.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\r\n * @example\r\n *\r\n * _.isBuffer(new Buffer(2));\r\n * // => true\r\n *\r\n * _.isBuffer(new Uint8Array(2));\r\n * // => false\r\n */\r\nvar isBuffer = nativeIsBuffer || stubFalse;\r\nmodule.exports = isBuffer;\r\n","var baseKeys = require('./_baseKeys'),\r\n getTag = require('./_getTag'),\r\n isArguments = require('./isArguments'),\r\n isArray = require('./isArray'),\r\n isArrayLike = require('./isArrayLike'),\r\n isBuffer = require('./isBuffer'),\r\n isPrototype = require('./_isPrototype'),\r\n isTypedArray = require('./isTypedArray');\r\n/** `Object#toString` result references. */\r\nvar mapTag = '[object Map]',\r\n setTag = '[object Set]';\r\n/** Used for built-in method references. */\r\nvar objectProto = Object.prototype;\r\n/** Used to check objects for own properties. */\r\nvar hasOwnProperty = objectProto.hasOwnProperty;\r\n/**\r\n * Checks if `value` is an empty object, collection, map, or set.\r\n *\r\n * Objects are considered empty if they have no own enumerable string keyed\r\n * properties.\r\n *\r\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\r\n * jQuery-like collections are considered empty if they have a `length` of `0`.\r\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 0.1.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\r\n * @example\r\n *\r\n * _.isEmpty(null);\r\n * // => true\r\n *\r\n * _.isEmpty(true);\r\n * // => true\r\n *\r\n * _.isEmpty(1);\r\n * // => true\r\n *\r\n * _.isEmpty([1, 2, 3]);\r\n * // => false\r\n *\r\n * _.isEmpty({ 'a': 1 });\r\n * // => false\r\n */\r\nfunction isEmpty(value) {\r\n if (value == null) {\r\n return true;\r\n }\r\n if (isArrayLike(value) &&\r\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\r\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\r\n return !value.length;\r\n }\r\n var tag = getTag(value);\r\n if (tag == mapTag || tag == setTag) {\r\n return !value.size;\r\n }\r\n if (isPrototype(value)) {\r\n return !baseKeys(value).length;\r\n }\r\n for (var key in value) {\r\n if (hasOwnProperty.call(value, key)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nmodule.exports = isEmpty;\r\n","var baseGetTag = require('./_baseGetTag'),\r\n isObject = require('./isObject');\r\n/** `Object#toString` result references. */\r\nvar asyncTag = '[object AsyncFunction]',\r\n funcTag = '[object Function]',\r\n genTag = '[object GeneratorFunction]',\r\n proxyTag = '[object Proxy]';\r\n/**\r\n * Checks if `value` is classified as a `Function` object.\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 0.1.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\r\n * @example\r\n *\r\n * _.isFunction(_);\r\n * // => true\r\n *\r\n * _.isFunction(/abc/);\r\n * // => false\r\n */\r\nfunction isFunction(value) {\r\n if (!isObject(value)) {\r\n return false;\r\n }\r\n // The use of `Object#toString` avoids issues with the `typeof` operator\r\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\r\n var tag = baseGetTag(value);\r\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\r\n}\r\nmodule.exports = isFunction;\r\n","/** Used as references for various `Number` constants. */\r\nvar MAX_SAFE_INTEGER = 9007199254740991;\r\n/**\r\n * Checks if `value` is a valid array-like length.\r\n *\r\n * **Note:** This method is loosely based on\r\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 4.0.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\r\n * @example\r\n *\r\n * _.isLength(3);\r\n * // => true\r\n *\r\n * _.isLength(Number.MIN_VALUE);\r\n * // => false\r\n *\r\n * _.isLength(Infinity);\r\n * // => false\r\n *\r\n * _.isLength('3');\r\n * // => false\r\n */\r\nfunction isLength(value) {\r\n return typeof value == 'number' &&\r\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\r\n}\r\nmodule.exports = isLength;\r\n","/**\r\n * Checks if `value` is the\r\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\r\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 0.1.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\r\n * @example\r\n *\r\n * _.isObject({});\r\n * // => true\r\n *\r\n * _.isObject([1, 2, 3]);\r\n * // => true\r\n *\r\n * _.isObject(_.noop);\r\n * // => true\r\n *\r\n * _.isObject(null);\r\n * // => false\r\n */\r\nfunction isObject(value) {\r\n var type = typeof value;\r\n return value != null && (type == 'object' || type == 'function');\r\n}\r\nmodule.exports = isObject;\r\n","/**\r\n * Checks if `value` is object-like. A value is object-like if it's not `null`\r\n * and has a `typeof` result of \"object\".\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 4.0.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\r\n * @example\r\n *\r\n * _.isObjectLike({});\r\n * // => true\r\n *\r\n * _.isObjectLike([1, 2, 3]);\r\n * // => true\r\n *\r\n * _.isObjectLike(_.noop);\r\n * // => false\r\n *\r\n * _.isObjectLike(null);\r\n * // => false\r\n */\r\nfunction isObjectLike(value) {\r\n return value != null && typeof value == 'object';\r\n}\r\nmodule.exports = isObjectLike;\r\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\r\n baseUnary = require('./_baseUnary'),\r\n nodeUtil = require('./_nodeUtil');\r\n/* Node.js helper references. */\r\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\r\n/**\r\n * Checks if `value` is classified as a typed array.\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 3.0.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\r\n * @example\r\n *\r\n * _.isTypedArray(new Uint8Array);\r\n * // => true\r\n *\r\n * _.isTypedArray([]);\r\n * // => false\r\n */\r\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\r\nmodule.exports = isTypedArray;\r\n","/**\r\n * This method returns `false`.\r\n *\r\n * @static\r\n * @memberOf _\r\n * @since 4.13.0\r\n * @category Util\r\n * @returns {boolean} Returns `false`.\r\n * @example\r\n *\r\n * _.times(2, _.stubFalse);\r\n * // => [false, false]\r\n */\r\nfunction stubFalse() {\r\n return false;\r\n}\r\nmodule.exports = stubFalse;\r\n","/*\r\nobject-assign\r\n(c) Sindre Sorhus\r\n@license MIT\r\n*/\r\n'use strict';\r\n/* eslint-disable no-unused-vars */\r\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\r\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\r\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\r\nfunction toObject(val) {\r\n\tif (val === null || val === undefined) {\r\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\r\n\t}\r\n\treturn Object(val);\r\n}\r\nfunction shouldUseNative() {\r\n\ttry {\r\n\t\tif (!Object.assign) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// Detect buggy property enumeration order in older V8 versions.\r\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\r\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\r\n\t\ttest1[5] = 'de';\r\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\r\n\t\tvar test2 = {};\r\n\t\tfor (var i = 0; i < 10; i++) {\r\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\r\n\t\t}\r\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\r\n\t\t\treturn test2[n];\r\n\t\t});\r\n\t\tif (order2.join('') !== '0123456789') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\r\n\t\tvar test3 = {};\r\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\r\n\t\t\ttest3[letter] = letter;\r\n\t\t});\r\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\r\n\t\t\t\t'abcdefghijklmnopqrst') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t} catch (err) {\r\n\t\t// We don't expect any of the above to throw, but better to be safe.\r\n\t\treturn false;\r\n\t}\r\n}\r\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\r\n\tvar from;\r\n\tvar to = toObject(target);\r\n\tvar symbols;\r\n\tfor (var s = 1; s < arguments.length; s++) {\r\n\t\tfrom = Object(arguments[s]);\r\n\t\tfor (var key in from) {\r\n\t\t\tif (hasOwnProperty.call(from, key)) {\r\n\t\t\t\tto[key] = from[key];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (getOwnPropertySymbols) {\r\n\t\t\tsymbols = getOwnPropertySymbols(from);\r\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\r\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\r\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn to;\r\n};\r\n","import * as React from 'react';\r\nimport { CSSTransition } from 'primereact/csstransition';\r\nimport { useMountEffect } from 'primereact/hooks';\r\nimport { UniqueComponentId, ObjectUtils, classNames, IconUtils } from 'primereact/utils';\r\nfunction _extends() {\r\n _extends = Object.assign || function (target) {\r\n for (var i = 1; i < arguments.length; i++) {\r\n var source = arguments[i];\r\n for (var key in source) {\r\n if (Object.prototype.hasOwnProperty.call(source, key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n };\r\n return _extends.apply(this, arguments);\r\n}\r\nfunction _defineProperty(obj, key, value) {\r\n if (key in obj) {\r\n Object.defineProperty(obj, key, {\r\n value: value,\r\n enumerable: true,\r\n configurable: true,\r\n writable: true\r\n });\r\n } else {\r\n obj[key] = value;\r\n }\r\n return obj;\r\n}\r\nfunction _arrayLikeToArray(arr, len) {\r\n if (len == null || len > arr.length) len = arr.length;\r\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\r\n arr2[i] = arr[i];\r\n }\r\n return arr2;\r\n}\r\nfunction _arrayWithoutHoles(arr) {\r\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\r\n}\r\nfunction _iterableToArray(iter) {\r\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\r\n}\r\nfunction _unsupportedIterableToArray(o, minLen) {\r\n if (!o) return;\r\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\r\n var n = Object.prototype.toString.call(o).slice(8, -1);\r\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\r\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\r\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\r\n}\r\nfunction _nonIterableSpread() {\r\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\r\n}\r\nfunction _toConsumableArray(arr) {\r\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\r\n}\r\nfunction _arrayWithHoles(arr) {\r\n if (Array.isArray(arr)) return arr;\r\n}\r\nfunction _iterableToArrayLimit(arr, i) {\r\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\r\n if (_i == null) return;\r\n var _arr = [];\r\n var _n = true;\r\n var _d = false;\r\n var _s, _e;\r\n try {\r\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\r\n _arr.push(_s.value);\r\n if (i && _arr.length === i) break;\r\n }\r\n } catch (err) {\r\n _d = true;\r\n _e = err;\r\n } finally {\r\n try {\r\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\r\n } finally {\r\n if (_d) throw _e;\r\n }\r\n }\r\n return _arr;\r\n}\r\nfunction _nonIterableRest() {\r\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\r\n}\r\nfunction _slicedToArray(arr, i) {\r\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\r\n}\r\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\r\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\r\nvar AccordionTab = function AccordionTab() {};\r\nvar Accordion = /*#__PURE__*/React.forwardRef(function (props, ref) {\r\n var _React$useState = React.useState(props.id),\r\n _React$useState2 = _slicedToArray(_React$useState, 2),\r\n idState = _React$useState2[0],\r\n setIdState = _React$useState2[1];\r\n var _React$useState3 = React.useState(props.activeIndex),\r\n _React$useState4 = _slicedToArray(_React$useState3, 2),\r\n activeIndexState = _React$useState4[0],\r\n setActiveIndexState = _React$useState4[1];\r\n var activeIndex = props.onTabChange ? props.activeIndex : activeIndexState;\r\n var shouldUseTab = function shouldUseTab(tab) {\r\n return tab && tab.props.__TYPE === 'AccordionTab';\r\n };\r\n var onTabHeaderClick = function onTabHeaderClick(event, tab, index) {\r\n if (!tab.props.disabled) {\r\n var selected = isSelected(index);\r\n var newActiveIndex = null;\r\n if (props.multiple) {\r\n var indexes = activeIndex || [];\r\n newActiveIndex = selected ? indexes.filter(function (i) {\r\n return i !== index;\r\n }) : [].concat(_toConsumableArray(indexes), [index]);\r\n } else {\r\n newActiveIndex = selected ? null : index;\r\n }\r\n var callback = selected ? props.onTabClose : props.onTabOpen;\r\n callback && callback({\r\n originalEvent: event,\r\n index: index\r\n });\r\n if (props.onTabChange) {\r\n props.onTabChange({\r\n originalEvent: event,\r\n index: newActiveIndex\r\n });\r\n } else {\r\n setActiveIndexState(newActiveIndex);\r\n }\r\n }\r\n event.preventDefault();\r\n };\r\n var isSelected = function isSelected(index) {\r\n return props.multiple ? activeIndex && activeIndex.some(function (i) {\r\n return i === index;\r\n }) : activeIndex === index;\r\n };\r\n useMountEffect(function () {\r\n if (!idState) {\r\n setIdState(UniqueComponentId());\r\n }\r\n });\r\n var createTabHeader = function createTabHeader(tab, selected, index) {\r\n var style = _objectSpread(_objectSpread({}, tab.props.style || {}), tab.props.headerStyle || {});\r\n var className = classNames('p-accordion-header', {\r\n 'p-highlight': selected,\r\n 'p-disabled': tab.props.disabled\r\n }, tab.props.headerClassName, tab.props.className);\r\n var headerId = idState + '_header_' + index;\r\n var ariaControls = idState + '_content_' + index;\r\n var tabIndex = tab.props.disabled ? -1 : null;\r\n var header = tab.props.headerTemplate ? ObjectUtils.getJSXElement(tab.props.headerTemplate, tab.props) : /*#__PURE__*/React.createElement(\"span\", {\r\n className: \"p-accordion-header-text\"\r\n }, tab.props.header);\r\n var icon = IconUtils.getJSXIcon(selected ? props.collapseIcon : props.expandIcon, {\r\n className: 'p-accordion-toggle-icon'\r\n }, {\r\n props: props,\r\n selected: selected\r\n });\r\n return /*#__PURE__*/React.createElement(\"div\", {\r\n className: className,\r\n style: style\r\n }, /*#__PURE__*/React.createElement(\"a\", {\r\n href: '#' + ariaControls,\r\n id: headerId,\r\n className: \"p-accordion-header-link\",\r\n \"aria-controls\": ariaControls,\r\n role: \"tab\",\r\n \"aria-expanded\": selected,\r\n onClick: function onClick(e) {\r\n return onTabHeaderClick(e, tab, index);\r\n },\r\n tabIndex: tabIndex\r\n }, icon, header));\r\n };\r\n var createTabContent = function createTabContent(tab, selected, index) {\r\n var style = _objectSpread(_objectSpread({}, tab.props.style || {}), tab.props.contentStyle || {});\r\n var className = classNames('p-toggleable-content', tab.props.contentClassName, tab.props.className);\r\n var contentId = idState + '_content_' + index;\r\n var ariaLabelledby = idState + '_header_' + index;\r\n var contentRef = /*#__PURE__*/React.createRef();\r\n return /*#__PURE__*/React.createElement(CSSTransition, {\r\n nodeRef: contentRef,\r\n classNames: \"p-toggleable-content\",\r\n timeout: {\r\n enter: 1000,\r\n exit: 450\r\n },\r\n \"in\": selected,\r\n unmountOnExit: true,\r\n options: props.transitionOptions\r\n }, /*#__PURE__*/React.createElement(\"div\", {\r\n ref: contentRef,\r\n id: contentId,\r\n className: className,\r\n style: style,\r\n role: \"region\",\r\n \"aria-labelledby\": ariaLabelledby\r\n }, /*#__PURE__*/React.createElement(\"div\", {\r\n className: \"p-accordion-content\"\r\n }, tab.props.children)));\r\n };\r\n var createTab = function createTab(tab, index) {\r\n if (shouldUseTab(tab)) {\r\n var key = idState + '_' + index;\r\n var selected = isSelected(index);\r\n var _otherProps = ObjectUtils.findDiffKeys(tab.props, AccordionTab.defaultProps);\r\n var tabHeader = createTabHeader(tab, selected, index);\r\n var tabContent = createTabContent(tab, selected, index);\r\n var tabClassName = classNames('p-accordion-tab', {\r\n 'p-accordion-tab-active': selected\r\n });\r\n return /*#__PURE__*/React.createElement(\"div\", _extends({\r\n key: key,\r\n className: tabClassName\r\n }, _otherProps), tabHeader, tabContent);\r\n }\r\n return null;\r\n };\r\n var createTabs = function createTabs() {\r\n return React.Children.map(props.children, createTab);\r\n };\r\n var otherProps = ObjectUtils.findDiffKeys(props, Accordion.defaultProps);\r\n var className = classNames('p-accordion p-component', props.className);\r\n var tabs = createTabs();\r\n return /*#__PURE__*/React.createElement(\"div\", _extends({\r\n id: idState,\r\n className: className,\r\n style: props.style\r\n }, otherProps), tabs);\r\n});\r\nAccordionTab.displayName = 'AccordionTab';\r\nAccordionTab.defaultProps = {\r\n __TYPE: 'AccordionTab',\r\n header: null,\r\n disabled: false,\r\n style: null,\r\n className: null,\r\n headerStyle: null,\r\n headerClassName: null,\r\n headerTemplate: null,\r\n contentStyle: null,\r\n contentClassName: null\r\n};\r\nAccordion.displayName = 'Accordion';\r\nAccordion.defaultProps = {\r\n __TYPE: 'Accordion',\r\n id: null,\r\n activeIndex: null,\r\n className: null,\r\n style: null,\r\n multiple: false,\r\n expandIcon: 'pi pi-chevron-right',\r\n collapseIcon: 'pi pi-chevron-down',\r\n transitionOptions: null,\r\n onTabOpen: null,\r\n onTabClose: null,\r\n onTabChange: null\r\n};\r\nexport { Accordion, AccordionTab };\r\n","import { ObjectUtils } from 'primereact/utils';\r\nfunction _defineProperties(target, props) {\r\n for (var i = 0; i < props.length; i++) {\r\n var descriptor = props[i];\r\n descriptor.enumerable = descriptor.enumerable || false;\r\n descriptor.configurable = true;\r\n if (\"value\" in descriptor) descriptor.writable = true;\r\n Object.defineProperty(target, descriptor.key, descriptor);\r\n }\r\n}\r\nfunction _createClass(Constructor, protoProps, staticProps) {\r\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\r\n if (staticProps) _defineProperties(Constructor, staticProps);\r\n return Constructor;\r\n}\r\nfunction _classCallCheck(instance, Constructor) {\r\n if (!(instance instanceof Constructor)) {\r\n throw new TypeError(\"Cannot call a class as a function\");\r\n }\r\n}\r\nfunction _defineProperty(obj, key, value) {\r\n if (key in obj) {\r\n Object.defineProperty(obj, key, {\r\n value: value,\r\n enumerable: true,\r\n configurable: true,\r\n writable: true\r\n });\r\n } else {\r\n obj[key] = value;\r\n }\r\n return obj;\r\n}\r\nvar FilterMatchMode = Object.freeze({\r\n STARTS_WITH: 'startsWith',\r\n CONTAINS: 'contains',\r\n NOT_CONTAINS: 'notContains',\r\n ENDS_WITH: 'endsWith',\r\n EQUALS: 'equals',\r\n NOT_EQUALS: 'notEquals',\r\n IN: 'in',\r\n LESS_THAN: 'lt',\r\n LESS_THAN_OR_EQUAL_TO: 'lte',\r\n GREATER_THAN: 'gt',\r\n GREATER_THAN_OR_EQUAL_TO: 'gte',\r\n BETWEEN: 'between',\r\n DATE_IS: 'dateIs',\r\n DATE_IS_NOT: 'dateIsNot',\r\n DATE_BEFORE: 'dateBefore',\r\n DATE_AFTER: 'dateAfter',\r\n CUSTOM: 'custom'\r\n});\r\nvar PrimeReact = /*#__PURE__*/_createClass(function PrimeReact() {\r\n _classCallCheck(this, PrimeReact);\r\n});\r\n_defineProperty(PrimeReact, \"ripple\", false);\r\n_defineProperty(PrimeReact, \"inputStyle\", 'outlined');\r\n_defineProperty(PrimeReact, \"locale\", 'en');\r\n_defineProperty(PrimeReact, \"appendTo\", null);\r\n_defineProperty(PrimeReact, \"cssTransition\", true);\r\n_defineProperty(PrimeReact, \"autoZIndex\", true);\r\n_defineProperty(PrimeReact, \"nonce\", null);\r\n_defineProperty(PrimeReact, \"zIndex\", {\r\n modal: 1100,\r\n overlay: 1000,\r\n menu: 1000,\r\n tooltip: 1100,\r\n toast: 1200\r\n});\r\n_defineProperty(PrimeReact, \"filterMatchModeOptions\", {\r\n text: [FilterMatchMode.STARTS_WITH, FilterMatchMode.CONTAINS, FilterMatchMode.NOT_CONTAINS, FilterMatchMode.ENDS_WITH, FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS],\r\n numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],\r\n date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER]\r\n});\r\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\r\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\r\nvar locales = {\r\n 'en': {\r\n startsWith: 'Starts with',\r\n contains: 'Contains',\r\n notContains: 'Not contains',\r\n endsWith: 'Ends with',\r\n equals: 'Equals',\r\n notEquals: 'Not equals',\r\n noFilter: 'No Filter',\r\n lt: 'Less than',\r\n lte: 'Less than or equal to',\r\n gt: 'Greater than',\r\n gte: 'Greater than or equal to',\r\n dateIs: 'Date is',\r\n dateIsNot: 'Date is not',\r\n dateBefore: 'Date is before',\r\n dateAfter: 'Date is after',\r\n custom: 'Custom',\r\n clear: 'Clear',\r\n apply: 'Apply',\r\n matchAll: 'Match All',\r\n matchAny: 'Match Any',\r\n addRule: 'Add Rule',\r\n removeRule: 'Remove Rule',\r\n accept: 'Yes',\r\n reject: 'No',\r\n choose: 'Choose',\r\n upload: 'Upload',\r\n cancel: 'Cancel',\r\n dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\r\n dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\r\n dayNamesMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\r\n monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\r\n monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\r\n today: 'Today',\r\n weekHeader: 'Wk',\r\n firstDayOfWeek: 0,\r\n dateFormat: 'mm/dd/yy',\r\n weak: 'Weak',\r\n medium: 'Medium',\r\n strong: 'Strong',\r\n passwordPrompt: 'Enter a password',\r\n emptyFilterMessage: 'No available options',\r\n emptyMessage: 'No results found',\r\n aria: {\r\n trueLabel: 'True',\r\n falseLabel: 'False',\r\n nullLabel: 'Not Selected',\r\n pageLabel: 'Page',\r\n firstPageLabel: 'First Page',\r\n lastPageLabel: 'Last Page',\r\n nextPageLabel: 'Next Page',\r\n previousPageLabel: 'Previous Page'\r\n }\r\n }\r\n};\r\nfunction locale(locale) {\r\n locale && (PrimeReact.locale = locale);\r\n return {\r\n locale: PrimeReact.locale,\r\n options: locales[PrimeReact.locale]\r\n };\r\n}\r\nfunction addLocale(locale, options) {\r\n locales[locale] = _objectSpread(_objectSpread({}, locales['en']), options);\r\n}\r\nfunction updateLocaleOption(key, value, locale) {\r\n localeOptions(locale)[key] = value;\r\n}\r\nfunction updateLocaleOptions(options, locale) {\r\n var _locale = locale || PrimeReact.locale;\r\n locales[_locale] = _objectSpread(_objectSpread({}, locales[_locale]), options);\r\n}\r\nfunction localeOption(key, locale) {\r\n var _locale = locale || PrimeReact.locale;\r\n try {\r\n return localeOptions(_locale)[key];\r\n } catch (error) {\r\n throw new Error(\"The \".concat(key, \" option is not found in the current locale('\").concat(_locale, \"').\"));\r\n }\r\n}\r\nfunction ariaLabel(key) {\r\n var _locale = PrimeReact.locale;\r\n try {\r\n return localeOptions(_locale)['aria'][key];\r\n } catch (error) {\r\n throw new Error(\"The \".concat(key, \" option is not found in the current locale('\").concat(_locale, \"').\"));\r\n }\r\n}\r\nfunction localeOptions(locale) {\r\n var _locale = locale || PrimeReact.locale;\r\n return locales[_locale];\r\n}\r\nvar PrimeIcons = Object.freeze({\r\n ALIGN_CENTER: 'pi pi-align-center',\r\n ALIGN_JUSTIFY: 'pi pi-align-justify',\r\n ALIGN_LEFT: 'pi pi-align-left',\r\n ALIGN_RIGHT: 'pi pi-align-right',\r\n AMAZON: 'pi pi-amazon',\r\n ANDROID: 'pi pi-android',\r\n ANGLE_DOUBLE_DOWN: 'pi pi-angle-double-down',\r\n ANGLE_DOUBLE_LEFT: 'pi pi-angle-double-left',\r\n ANGLE_DOUBLE_RIGHT: 'pi pi-angle-double-right',\r\n ANGLE_DOUBLE_UP: 'pi pi-angle-double-up',\r\n ANGLE_DOWN: 'pi pi-angle-down',\r\n ANGLE_LEFT: 'pi pi-angle-left',\r\n ANGLE_RIGHT: 'pi pi-angle-right',\r\n ANGLE_UP: 'pi pi-angle-up',\r\n APPLE: 'pi pi-apple',\r\n ARROW_CIRCLE_DOWN: 'pi pi-arrow-circle-down',\r\n ARROW_CIRCLE_LEFT: 'pi pi-arrow-circle-left',\r\n ARROW_CIRCLE_RIGHT: 'pi pi-arrow-circle-right',\r\n ARROW_CIRCLE_UP: 'pi pi-arrow-circle-up',\r\n ARROW_DOWN: 'pi pi-arrow-down',\r\n ARROW_DOWN_LEFT: 'pi pi-arrow-down-left',\r\n ARROW_DOWN_RIGHT: 'pi pi-arrow-down-right',\r\n ARROW_LEFT: 'pi pi-arrow-left',\r\n ARROW_RIGHT: 'pi pi-arrow-right',\r\n ARROW_UP: 'pi pi-arrow-up',\r\n ARROW_UP_LEFT: 'pi pi-arrow-up-left',\r\n ARROW_UP_RIGHT: 'pi pi-arrow-up-right',\r\n ARROWS_H: 'pi pi-arrows-h',\r\n ARROWS_V: 'pi pi-arrows-v',\r\n AT: 'pi pi-at',\r\n BACKWARD: 'pi pi-backward',\r\n BAN: 'pi pi-ban',\r\n BARS: 'pi pi-bars',\r\n BELL: 'pi pi-bell',\r\n BOLT: 'pi pi-bolt',\r\n BOOK: 'pi pi-book',\r\n BOOKMARK: 'pi pi-bookmark',\r\n BOOKMARK_FILL: 'pi pi-bookmark-fill',\r\n BOX: 'pi pi-box',\r\n BRIEFCASE: 'pi pi-briefcase',\r\n BUILDING: 'pi pi-building',\r\n CALENDAR: 'pi pi-calendar',\r\n CALENDAR_MINUS: 'pi pi-calendar-minus',\r\n CALENDAR_PLUS: 'pi pi-calendar-plus',\r\n CALENDAR_TIMES: 'pi pi-calendar-times',\r\n CAMERA: 'pi pi-camera',\r\n CAR: 'pi pi-car',\r\n CARET_DOWN: 'pi pi-caret-down',\r\n CARET_LEFT: 'pi pi-caret-left',\r\n CARET_RIGHT: 'pi pi-caret-right',\r\n CARET_UP: 'pi pi-caret-up',\r\n CHART_BAR: 'pi pi-chart-bar',\r\n CHART_LINE: 'pi pi-chart-line',\r\n CHART_PIE: 'pi pi-chart-pie',\r\n CHECK: 'pi pi-check',\r\n CHECK_CIRCLE: 'pi pi-check-circle',\r\n CHECK_SQUARE: 'pi pi-check-square',\r\n CHEVRON_CIRCLE_DOWN: 'pi pi-chevron-circle-down',\r\n CHEVRON_CIRCLE_LEFT: 'pi pi-chevron-circle-left',\r\n CHEVRON_CIRCLE_RIGHT: 'pi pi-chevron-circle-right',\r\n CHEVRON_CIRCLE_UP: 'pi pi-chevron-circle-up',\r\n CHEVRON_DOWN: 'pi pi-chevron-down',\r\n CHEVRON_LEFT: 'pi pi-chevron-left',\r\n CHEVRON_RIGHT: 'pi pi-chevron-right',\r\n CHEVRON_UP: 'pi pi-chevron-up',\r\n CIRCLE: 'pi pi-circle',\r\n CIRCLE_FILL: 'pi pi-circle-fill',\r\n CLOCK: 'pi pi-clock',\r\n CLONE: 'pi pi-clone',\r\n CLOUD: 'pi pi-cloud',\r\n CLOUD_DOWNLOAD: 'pi pi-cloud-download',\r\n CLOUD_UPLOAD: 'pi pi-cloud-upload',\r\n CODE: 'pi pi-code',\r\n COG: 'pi pi-cog',\r\n COMMENT: 'pi pi-comment',\r\n COMMENTS: 'pi pi-comments',\r\n COMPASS: 'pi pi-compass',\r\n COPY: 'pi pi-copy',\r\n CREDIT_CARD: 'pi pi-credit-card',\r\n DATABASE: 'pi pi-database',\r\n DESKTOP: 'pi pi-desktop',\r\n DIRECTIONS: 'pi pi-directions',\r\n DIRECTIONS_ALT: 'pi pi-directions-alt',\r\n DISCORD: 'pi pi-discord',\r\n DOLLAR: 'pi pi-dollar',\r\n DOWNLOAD: 'pi pi-download',\r\n EJECT: 'pi pi-eject',\r\n ELLIPSIS_H: 'pi pi-ellipsis-h',\r\n ELLIPSIS_V: 'pi pi-ellipsis-v',\r\n ENVELOPE: 'pi pi-envelope',\r\n EURO: 'pi pi-euro',\r\n EXCLAMATION_CIRCLE: 'pi pi-exclamation-circle',\r\n EXCLAMATION_TRIANGLE: 'pi pi-exclamation-triangle',\r\n EXTERNAL_LINK: 'pi pi-external-link',\r\n EYE: 'pi pi-eye',\r\n EYE_SLASH: 'pi pi-eye-slash',\r\n FACEBOOK: 'pi pi-facebook',\r\n FAST_BACKWARD: 'pi pi-fast-backward',\r\n FAST_FORWARD: 'pi pi-fast-forward',\r\n FILE: 'pi pi-file',\r\n FILE_EXCEL: 'pi pi-file-excel',\r\n FILE_PDF: 'pi pi-file-pdf',\r\n FILTER: 'pi pi-filter',\r\n FILTER_FILL: 'pi pi-filter-fill',\r\n FILTER_SLASH: 'pi pi-filter-slash',\r\n FLAG: 'pi pi-flag',\r\n FLAG_FILL: 'pi pi-flag-fill',\r\n FOLDER: 'pi pi-folder',\r\n FOLDER_OPEN: 'pi pi-folder-open',\r\n FORWARD: 'pi pi-forward',\r\n GITHUB: 'pi pi-github',\r\n GLOBE: 'pi pi-globe',\r\n GOOGLE: 'pi pi-google',\r\n HASHTAG: 'pi pi-hashtag',\r\n HEART: 'pi pi-heart',\r\n HEART_FILL: 'pi pi-heart-fill',\r\n HISTORY: 'pi pi-history',\r\n HOME: 'pi pi-home',\r\n ID_CARD: 'pi pi-id-card',\r\n IMAGE: 'pi pi-image',\r\n IMAGES: 'pi pi-images',\r\n INBOX: 'pi pi-inbox',\r\n INFO: 'pi pi-info',\r\n INFO_CIRCLE: 'pi pi-info-circle',\r\n INSTAGRAM: 'pi pi-instagram',\r\n KEY: 'pi pi-key',\r\n LINK: 'pi pi-link',\r\n LINKEDIN: 'pi pi-linkedin',\r\n LIST: 'pi pi-list',\r\n LOCK: 'pi pi-lock',\r\n LOCK_OPEN: 'pi pi-lock-open',\r\n MAP: 'pi pi-map',\r\n MAP_MARKER: 'pi pi-map-marker',\r\n MICROSOFT: 'pi pi-microsoft',\r\n MINUS: 'pi pi-minus',\r\n MINUS_CIRCLE: 'pi pi-minus-circle',\r\n MOBILE: 'pi pi-mobile',\r\n MONEY_BILL: 'pi pi-money-bill',\r\n MOON: 'pi pi-moon',\r\n PALETTE: 'pi pi-palette',\r\n PAPERCLIP: 'pi pi-paperclip',\r\n PAUSE: 'pi pi-pause',\r\n PAYPAL: 'pi pi-paypal',\r\n PENCIL: 'pi pi-pencil',\r\n PERCENTAGE: 'pi pi-percentage',\r\n PHONE: 'pi pi-phone',\r\n PLAY: 'pi pi-play',\r\n PLUS: 'pi pi-plus',\r\n PLUS_CIRCLE: 'pi pi-plus-circle',\r\n POUND: 'pi pi-pound',\r\n POWER_OFF: 'pi pi-power-off',\r\n PRIME: 'pi pi-prime',\r\n PRINT: 'pi pi-print',\r\n QRCODE: 'pi pi-qrcode',\r\n QUESTION: 'pi pi-question',\r\n QUESTION_CIRCLE: 'pi pi-question-circle',\r\n REDDIT: 'pi pi-reddit',\r\n REFRESH: 'pi pi-refresh',\r\n REPLAY: 'pi pi-replay',\r\n REPLY: 'pi pi-reply',\r\n SAVE: 'pi pi-save',\r\n SEARCH: 'pi pi-search',\r\n SEARCH_MINUS: 'pi pi-search-minus',\r\n SEARCH_PLUS: 'pi pi-search-plus',\r\n SEND: 'pi pi-send',\r\n SERVER: 'pi pi-server',\r\n SHARE_ALT: 'pi pi-share-alt',\r\n SHIELD: 'pi pi-shield',\r\n SHOPPING_BAG: 'pi pi-shopping-bag',\r\n SHOPPING_CART: 'pi pi-shopping-cart',\r\n SIGN_IN: 'pi pi-sign-in',\r\n SIGN_OUT: 'pi pi-sign-out',\r\n SITEMAP: 'pi pi-sitemap',\r\n SLACK: 'pi pi-slack',\r\n SLIDERS_H: 'pi pi-sliders-h',\r\n SLIDERS_V: 'pi pi-sliders-v',\r\n SORT: 'pi pi-sort',\r\n SORT_ALPHA_DOWN: 'pi pi-sort-alpha-down',\r\n SORT_ALPHA_ALT_DOWN: 'pi pi-sort-alpha-alt-down',\r\n SORT_ALPHA_UP: 'pi pi-sort-alpha-up',\r\n SORT_ALPHA_ALT_UP: 'pi pi-sort-alpha-alt-up',\r\n SORT_ALT: 'pi pi-sort-alt',\r\n SORT_ALT_SLASH: 'pi pi-sort-slash',\r\n SORT_AMOUNT_DOWN: 'pi pi-sort-amount-down',\r\n SORT_AMOUNT_DOWN_ALT: 'pi pi-sort-amount-down-alt',\r\n SORT_AMOUNT_UP: 'pi pi-sort-amount-up',\r\n SORT_AMOUNT_UP_ALT: 'pi pi-sort-amount-up-alt',\r\n SORT_DOWN: 'pi pi-sort-down',\r\n SORT_NUMERIC_DOWN: 'pi pi-sort-numeric-down',\r\n SORT_NUMERIC_ALT_DOWN: 'pi pi-sort-numeric-alt-down',\r\n SORT_NUMERIC_UP: 'pi pi-sort-numeric-up',\r\n SORT_NUMERIC_ALT_UP: 'pi pi-sort-numeric-alt-up',\r\n SORT_UP: 'pi pi-sort-up',\r\n SPINNER: 'pi pi-spinner',\r\n STAR: 'pi pi-star',\r\n STAR_FILL: 'pi pi-star-fill',\r\n STEP_BACKWARD: 'pi pi-step-backward',\r\n STEP_BACKWARD_ALT: 'pi pi-step-backward-alt',\r\n STEP_FORWARD: 'pi pi-step-forward',\r\n STEP_FORWARD_ALT: 'pi pi-step-forward-alt',\r\n STOP: 'pi pi-stop',\r\n STOP_CIRCLE: 'pi pi-stop-circle',\r\n SUN: 'pi pi-sun',\r\n SYNC: 'pi pi-sync',\r\n TABLE: 'pi pi-table',\r\n TABLET: 'pi pi-tablet',\r\n TAG: 'pi pi-tag',\r\n TAGS: 'pi pi-tags',\r\n TELEGRAM: 'pi pi-telegram',\r\n TH_LARGE: 'pi pi-th-large',\r\n THUMBS_DOWN: 'pi pi-thumbs-down',\r\n THUMBS_UP: 'pi pi-thumbs-up',\r\n TICKET: 'pi pi-ticket',\r\n TIMES: 'pi pi-times',\r\n TIMES_CIRCLE: 'pi pi-times-circle',\r\n TRASH: 'pi pi-trash',\r\n TWITTER: 'pi pi-twitter',\r\n UNDO: 'pi pi-undo',\r\n UNLOCK: 'pi pi-unlock',\r\n UPLOAD: 'pi pi-upload',\r\n USER: 'pi pi-user',\r\n USER_EDIT: 'pi pi-user-edit',\r\n USER_MINUS: 'pi pi-user-minus',\r\n USER_PLUS: 'pi pi-user-plus',\r\n USERS: 'pi pi-users',\r\n VIDEO: 'pi pi-video',\r\n VIMEO: 'pi pi-vimeo',\r\n VOLUME_DOWN: 'pi pi-volume-down',\r\n VOLUME_OFF: 'pi pi-volume-off',\r\n VOLUME_UP: 'pi pi-volume-up',\r\n WALLET: 'pi pi-wallet',\r\n WHATSAPP: 'pi pi-whatsapp',\r\n WIFI: 'pi pi-wifi',\r\n WINDOW_MAXIMIZE: 'pi pi-window-maximize',\r\n WINDOW_MINIMIZE: 'pi pi-window-minimize',\r\n YOUTUBE: 'pi pi-youtube'\r\n});\r\nvar MessageSeverity = Object.freeze({\r\n SUCCESS: 'success',\r\n INFO: 'info',\r\n WARN: 'warn',\r\n ERROR: 'error'\r\n});\r\nvar FilterOperator = Object.freeze({\r\n AND: 'and',\r\n OR: 'or'\r\n});\r\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\r\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\r\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\r\nvar FilterService = {\r\n filter: function filter(value, fields, filterValue, filterMatchMode, filterLocale) {\r\n var filteredItems = [];\r\n if (value) {\r\n var _iterator = _createForOfIteratorHelper(value),\r\n _step;\r\n try {\r\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\r\n var item = _step.value;\r\n var _iterator2 = _createForOfIteratorHelper(fields),\r\n _step2;\r\n try {\r\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\r\n var field = _step2.value;\r\n var fieldValue = ObjectUtils.resolveFieldData(item, field);\r\n if (this.filters[filterMatchMode](fieldValue, filterValue, filterLocale)) {\r\n filteredItems.push(item);\r\n break;\r\n }\r\n }\r\n } catch (err) {\r\n _iterator2.e(err);\r\n } finally {\r\n _iterator2.f();\r\n }\r\n }\r\n } catch (err) {\r\n _iterator.e(err);\r\n } finally {\r\n _iterator.f();\r\n }\r\n }\r\n return filteredItems;\r\n },\r\n filters: {\r\n startsWith: function startsWith(value, filter, filterLocale) {\r\n if (filter === undefined || filter === null || filter.trim() === '') {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n var filterValue = ObjectUtils.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\r\n var stringValue = ObjectUtils.removeAccents(value.toString()).toLocaleLowerCase(filterLocale);\r\n return stringValue.slice(0, filterValue.length) === filterValue;\r\n },\r\n contains: function contains(value, filter, filterLocale) {\r\n if (filter === undefined || filter === null || typeof filter === 'string' && filter.trim() === '') {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n var filterValue = ObjectUtils.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\r\n var stringValue = ObjectUtils.removeAccents(value.toString()).toLocaleLowerCase(filterLocale);\r\n return stringValue.indexOf(filterValue) !== -1;\r\n },\r\n notContains: function notContains(value, filter, filterLocale) {\r\n if (filter === undefined || filter === null || typeof filter === 'string' && filter.trim() === '') {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n var filterValue = ObjectUtils.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\r\n var stringValue = ObjectUtils.removeAccents(value.toString()).toLocaleLowerCase(filterLocale);\r\n return stringValue.indexOf(filterValue) === -1;\r\n },\r\n endsWith: function endsWith(value, filter, filterLocale) {\r\n if (filter === undefined || filter === null || filter.trim() === '') {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n var filterValue = ObjectUtils.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\r\n var stringValue = ObjectUtils.removeAccents(value.toString()).toLocaleLowerCase(filterLocale);\r\n return stringValue.indexOf(filterValue, stringValue.length - filterValue.length) !== -1;\r\n },\r\n equals: function equals(value, filter, filterLocale) {\r\n if (filter === undefined || filter === null || typeof filter === 'string' && filter.trim() === '') {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n if (value.getTime && filter.getTime) return value.getTime() === filter.getTime();else return ObjectUtils.removeAccents(value.toString()).toLocaleLowerCase(filterLocale) === ObjectUtils.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\r\n },\r\n notEquals: function notEquals(value, filter, filterLocale) {\r\n if (filter === undefined || filter === null || typeof filter === 'string' && filter.trim() === '') {\r\n return false;\r\n }\r\n if (value === undefined || value === null) {\r\n return true;\r\n }\r\n if (value.getTime && filter.getTime) return value.getTime() !== filter.getTime();else return ObjectUtils.removeAccents(value.toString()).toLocaleLowerCase(filterLocale) !== ObjectUtils.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\r\n },\r\n \"in\": function _in(value, filter) {\r\n if (filter === undefined || filter === null || filter.length === 0) {\r\n return true;\r\n }\r\n for (var i = 0; i < filter.length; i++) {\r\n if (ObjectUtils.equals(value, filter[i])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n between: function between(value, filter) {\r\n if (filter == null || filter[0] == null || filter[1] == null) {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n if (value.getTime) return filter[0].getTime() <= value.getTime() && value.getTime() <= filter[1].getTime();else return filter[0] <= value && value <= filter[1];\r\n },\r\n lt: function lt(value, filter) {\r\n if (filter === undefined || filter === null) {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n if (value.getTime && filter.getTime) return value.getTime() < filter.getTime();else return value < filter;\r\n },\r\n lte: function lte(value, filter) {\r\n if (filter === undefined || filter === null) {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n if (value.getTime && filter.getTime) return value.getTime() <= filter.getTime();else return value <= filter;\r\n },\r\n gt: function gt(value, filter) {\r\n if (filter === undefined || filter === null) {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n if (value.getTime && filter.getTime) return value.getTime() > filter.getTime();else return value > filter;\r\n },\r\n gte: function gte(value, filter) {\r\n if (filter === undefined || filter === null) {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n if (value.getTime && filter.getTime) return value.getTime() >= filter.getTime();else return value >= filter;\r\n },\r\n dateIs: function dateIs(value, filter) {\r\n if (filter === undefined || filter === null) {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n return value.toDateString() === filter.toDateString();\r\n },\r\n dateIsNot: function dateIsNot(value, filter) {\r\n if (filter === undefined || filter === null) {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n return value.toDateString() !== filter.toDateString();\r\n },\r\n dateBefore: function dateBefore(value, filter) {\r\n if (filter === undefined || filter === null) {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n return value.getTime() < filter.getTime();\r\n },\r\n dateAfter: function dateAfter(value, filter) {\r\n if (filter === undefined || filter === null) {\r\n return true;\r\n }\r\n if (value === undefined || value === null) {\r\n return false;\r\n }\r\n return value.getTime() > filter.getTime();\r\n }\r\n },\r\n register: function register(rule, fn) {\r\n this.filters[rule] = fn;\r\n }\r\n};\r\nexport { FilterMatchMode, FilterOperator, FilterService, MessageSeverity, PrimeIcons, addLocale, ariaLabel, PrimeReact as default, locale, localeOption, localeOptions, updateLocaleOption, updateLocaleOptions };\r\n","import * as React from 'react';\r\nimport { CSSTransition as CSSTransition$1 } from 'react-transition-group';\r\nimport PrimeReact from 'primereact/api';\r\nimport { useUpdateEffect } from 'primereact/hooks';\r\nimport { ObjectUtils } from 'primereact/utils';\r\nfunction _defineProperty(obj, key, value) {\r\n if (key in obj) {\r\n Object.defineProperty(obj, key, {\r\n value: value,\r\n enumerable: true,\r\n configurable: true,\r\n writable: true\r\n });\r\n } else {\r\n obj[key] = value;\r\n }\r\n return obj;\r\n}\r\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\r\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\r\nvar CSSTransition = /*#__PURE__*/React.forwardRef(function (props, ref) {\r\n var disabled = props.disabled || props.options && props.options.disabled || !PrimeReact.cssTransition;\r\n var onEnter = function onEnter(node, isAppearing) {\r\n props.onEnter && props.onEnter(node, isAppearing); // component\r\n props.options && props.options.onEnter && props.options.onEnter(node, isAppearing); // user option\r\n };\r\n var onEntering = function onEntering(node, isAppearing) {\r\n props.onEntering && props.onEntering(node, isAppearing); // component\r\n props.options && props.options.onEntering && props.options.onEntering(node, isAppearing); // user option\r\n };\r\n var onEntered = function onEntered(node, isAppearing) {\r\n props.onEntered && props.onEntered(node, isAppearing); // component\r\n props.options && props.options.onEntered && props.options.onEntered(node, isAppearing); // user option\r\n };\r\n var onExit = function onExit(node) {\r\n props.onExit && props.onExit(node); // component\r\n props.options && props.options.onExit && props.options.onExit(node); // user option\r\n };\r\n var onExiting = function onExiting(node) {\r\n props.onExiting && props.onExiting(node); // component\r\n props.options && props.options.onExiting && props.options.onExiting(node); // user option\r\n };\r\n var onExited = function onExited(node) {\r\n props.onExited && props.onExited(node); // component\r\n props.options && props.options.onExited && props.options.onExited(node); // user option\r\n };\r\n useUpdateEffect(function () {\r\n if (disabled) {\r\n // no animation\r\n var node = ObjectUtils.getRefElement(props.nodeRef);\r\n if (props[\"in\"]) {\r\n onEnter(node, true);\r\n onEntering(node, true);\r\n onEntered(node, true);\r\n } else {\r\n onExit(node);\r\n onExiting(node);\r\n onExited(node);\r\n }\r\n }\r\n }, [props[\"in\"]]);\r\n if (disabled) {\r\n return props[\"in\"] ? props.children : null;\r\n } else {\r\n var immutableProps = {\r\n nodeRef: props.nodeRef,\r\n \"in\": props[\"in\"],\r\n onEnter: onEnter,\r\n onEntering: onEntering,\r\n onEntered: onEntered,\r\n onExit: onExit,\r\n onExiting: onExiting,\r\n onExited: onExited\r\n };\r\n var mutableProps = {\r\n classNames: props.classNames,\r\n timeout: props.timeout,\r\n unmountOnExit: props.unmountOnExit\r\n };\r\n var mergedProps = _objectSpread(_objectSpread(_objectSpread({}, mutableProps), props.options || {}), immutableProps);\r\n return /*#__PURE__*/React.createElement(CSSTransition$1, mergedProps, props.children);\r\n }\r\n});\r\nCSSTransition.displayName = 'CSSTransition';\r\nCSSTransition.defaultProps = {\r\n __TYPE: 'CSSTransition'\r\n};\r\nexport { CSSTransition };\r\n","import * as React from 'react';\r\nimport { DomHandler, ObjectUtils } from 'primereact/utils';\r\nvar usePrevious = function usePrevious(newValue) {\r\n var ref = React.useRef(undefined);\r\n React.useEffect(function () {\r\n ref.current = newValue;\r\n });\r\n return ref.current;\r\n};\r\n/* eslint-disable */\r\nvar useMountEffect = function useMountEffect(fn) {\r\n return React.useEffect(fn, []);\r\n};\r\n/* eslint-enable */\r\n/* eslint-disable */\r\nvar useUpdateEffect = function useUpdateEffect(fn, deps) {\r\n var mounted = React.useRef(false);\r\n return React.useEffect(function () {\r\n if (!mounted.current) {\r\n mounted.current = true;\r\n return;\r\n }\r\n return fn && fn();\r\n }, deps);\r\n};\r\n/* eslint-enable */\r\n/* eslint-disable */\r\nvar useUnmountEffect = function useUnmountEffect(fn) {\r\n return React.useEffect(function () {\r\n return fn;\r\n }, []);\r\n};\r\n/* eslint-enable */\r\n/* eslint-disable */\r\nvar useEventListener = function useEventListener(_ref) {\r\n var _ref$target = _ref.target,\r\n target = _ref$target === void 0 ? 'document' : _ref$target,\r\n type = _ref.type,\r\n listener = _ref.listener,\r\n options = _ref.options,\r\n _ref$when = _ref.when,\r\n when = _ref$when === void 0 ? true : _ref$when;\r\n var targetRef = React.useRef(null);\r\n var listenerRef = React.useRef(null);\r\n var prevOptions = usePrevious(options);\r\n var bind = function bind() {\r\n var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\r\n if (ObjectUtils.isNotEmpty(bindOptions.target)) {\r\n unbind();\r\n (bindOptions.when || when) && (targetRef.current = DomHandler.getTargetElement(bindOptions.target));\r\n }\r\n if (!listenerRef.current && targetRef.current) {\r\n listenerRef.current = function (event) {\r\n return listener && listener(event);\r\n };\r\n targetRef.current.addEventListener(type, listenerRef.current, options);\r\n }\r\n };\r\n var unbind = function unbind() {\r\n if (listenerRef.current) {\r\n targetRef.current.removeEventListener(type, listenerRef.current, options);\r\n listenerRef.current = null;\r\n }\r\n };\r\n React.useEffect(function () {\r\n if (when) {\r\n targetRef.current = DomHandler.getTargetElement(target);\r\n } else {\r\n unbind();\r\n targetRef.current = null;\r\n }\r\n }, [target, when]);\r\n React.useEffect(function () {\r\n if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {\r\n unbind();\r\n when && bind();\r\n }\r\n }, [listener, options]);\r\n useUnmountEffect(function () {\r\n unbind();\r\n });\r\n return [bind, unbind];\r\n};\r\n/* eslint-enable */\r\nfunction _arrayWithHoles(arr) {\r\n if (Array.isArray(arr)) return arr;\r\n}\r\nfunction _iterableToArrayLimit(arr, i) {\r\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\r\n if (_i == null) return;\r\n var _arr = [];\r\n var _n = true;\r\n var _d = false;\r\n var _s, _e;\r\n try {\r\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\r\n _arr.push(_s.value);\r\n if (i && _arr.length === i) break;\r\n }\r\n } catch (err) {\r\n _d = true;\r\n _e = err;\r\n } finally {\r\n try {\r\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\r\n } finally {\r\n if (_d) throw _e;\r\n }\r\n }\r\n return _arr;\r\n}\r\nfunction _arrayLikeToArray(arr, len) {\r\n if (len == null || len > arr.length) len = arr.length;\r\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\r\n arr2[i] = arr[i];\r\n }\r\n return arr2;\r\n}\r\nfunction _unsupportedIterableToArray(o, minLen) {\r\n if (!o) return;\r\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\r\n var n = Object.prototype.toString.call(o).slice(8, -1);\r\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\r\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\r\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\r\n}\r\nfunction _nonIterableRest() {\r\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\r\n}\r\nfunction _slicedToArray(arr, i) {\r\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\r\n}\r\n/* eslint-disable */\r\nvar useOverlayScrollListener = function useOverlayScrollListener(_ref) {\r\n var target = _ref.target,\r\n listener = _ref.listener,\r\n options = _ref.options,\r\n _ref$when = _ref.when,\r\n when = _ref$when === void 0 ? true : _ref$when;\r\n var targetRef = React.useRef(null);\r\n var listenerRef = React.useRef(null);\r\n var scrollableParents = React.useRef([]);\r\n var prevOptions = usePrevious(options);\r\n var bind = function bind() {\r\n var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\r\n if (ObjectUtils.isNotEmpty(bindOptions.target)) {\r\n unbind();\r\n (bindOptions.when || when) && (targetRef.current = DomHandler.getTargetElement(bindOptions.target));\r\n }\r\n if (!listenerRef.current && targetRef.current) {\r\n var nodes = scrollableParents.current = DomHandler.getScrollableParents(targetRef.current);\r\n listenerRef.current = function (event) {\r\n return listener && listener(event);\r\n };\r\n nodes.forEach(function (node) {\r\n return node.addEventListener('scroll', listenerRef.current, options);\r\n });\r\n }\r\n };\r\n var unbind = function unbind() {\r\n if (listenerRef.current) {\r\n var nodes = scrollableParents.current;\r\n nodes.forEach(function (node) {\r\n return node.removeEventListener('scroll', listenerRef.current, options);\r\n });\r\n listenerRef.current = null;\r\n }\r\n };\r\n React.useEffect(function () {\r\n if (when) {\r\n targetRef.current = DomHandler.getTargetElement(target);\r\n } else {\r\n unbind();\r\n targetRef.current = null;\r\n }\r\n }, [target, when]);\r\n React.useEffect(function () {\r\n if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {\r\n unbind();\r\n when && bind();\r\n }\r\n }, [listener, options]);\r\n useUnmountEffect(function () {\r\n unbind();\r\n });\r\n return [bind, unbind];\r\n};\r\n/* eslint-enable */\r\nvar useResizeListener = function useResizeListener(_ref) {\r\n var listener = _ref.listener;\r\n return useEventListener({\r\n target: 'window',\r\n type: 'resize',\r\n listener: listener\r\n });\r\n};\r\nvar useOverlayListener = function useOverlayListener(_ref) {\r\n var target = _ref.target,\r\n overlay = _ref.overlay,\r\n _listener = _ref.listener,\r\n _ref$when = _ref.when,\r\n when = _ref$when === void 0 ? true : _ref$when;\r\n var targetRef = React.useRef(null);\r\n var overlayRef = React.useRef(null);\r\n /**\r\n * The parameters of the 'listener' method in the following event handlers;\r\n * @param {Event} event A click event of the document.\r\n * @param {string} options.type The custom type to detect event.\r\n * @param {boolean} options.valid It is controlled by PrimeReact. It is determined whether it is valid or not according to some custom validation.\r\n */\r\n var _useEventListener = useEventListener({\r\n type: 'click',\r\n listener: function listener(event) {\r\n _listener && _listener(event, {\r\n type: 'outside',\r\n valid: event.which !== 3 && isOutsideClicked(event)\r\n });\r\n }\r\n }),\r\n _useEventListener2 = _slicedToArray(_useEventListener, 2),\r\n bindDocumentClickListener = _useEventListener2[0],\r\n unbindDocumentClickListener = _useEventListener2[1];\r\n var _useResizeListener = useResizeListener({\r\n listener: function listener(event) {\r\n _listener && _listener(event, {\r\n type: 'resize',\r\n valid: !DomHandler.isTouchDevice()\r\n });\r\n }\r\n }),\r\n _useResizeListener2 = _slicedToArray(_useResizeListener, 2),\r\n bindWindowResizeListener = _useResizeListener2[0],\r\n unbindWindowResizeListener = _useResizeListener2[1];\r\n var _useOverlayScrollList = useOverlayScrollListener({\r\n target: targetRef,\r\n listener: function listener(event) {\r\n _listener && _listener(event, {\r\n type: 'scroll',\r\n valid: true\r\n });\r\n }\r\n }),\r\n _useOverlayScrollList2 = _slicedToArray(_useOverlayScrollList, 2),\r\n bindOverlayScrollListener = _useOverlayScrollList2[0],\r\n unbindOverlayScrollListener = _useOverlayScrollList2[1];\r\n var isOutsideClicked = function isOutsideClicked(event) {\r\n return targetRef.current && !(targetRef.current.isSameNode(event.target) || targetRef.current.contains(event.target) || overlayRef.current && overlayRef.current.contains(event.target));\r\n };\r\n var bind = function bind() {\r\n bindDocumentClickListener();\r\n bindWindowResizeListener();\r\n bindOverlayScrollListener();\r\n };\r\n var unbind = function unbind() {\r\n unbindDocumentClickListener();\r\n unbindWindowResizeListener();\r\n unbindOverlayScrollListener();\r\n };\r\n React.useEffect(function () {\r\n if (when) {\r\n targetRef.current = DomHandler.getTargetElement(target);\r\n overlayRef.current = DomHandler.getTargetElement(overlay);\r\n } else {\r\n unbind();\r\n targetRef.current = overlayRef.current = null;\r\n }\r\n }, [target, overlay, when]);\r\n React.useEffect(function () {\r\n unbind(); // when && bind();\r\n }, [when]);\r\n useUnmountEffect(function () {\r\n unbind();\r\n });\r\n return [bind, unbind];\r\n};\r\n/* eslint-enable */\r\n/* eslint-disable */\r\nvar useInterval = function useInterval(fn) {\r\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\r\n var when = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\r\n var timeout = React.useRef(null);\r\n var savedCallback = React.useRef(null);\r\n var clear = React.useCallback(function () {\r\n return clearInterval(timeout.current);\r\n }, [timeout.current]);\r\n React.useEffect(function () {\r\n savedCallback.current = fn;\r\n });\r\n React.useEffect(function () {\r\n function callback() {\r\n savedCallback.current();\r\n }\r\n if (when) {\r\n timeout.current = setInterval(callback, delay);\r\n return clear;\r\n } else {\r\n clear();\r\n }\r\n }, [delay, when]);\r\n useUnmountEffect(function () {\r\n clear();\r\n });\r\n return [clear];\r\n};\r\n/* eslint-enable */\r\n/**\r\n * Hook to wrap around useState that stores the value in the browser local/session storage.\r\n *\r\n * @param {any} initialValue the initial value to store\r\n * @param {string} key the key to store the value in local/session storage\r\n * @param {string} storage either 'local' or 'session' for what type of storage\r\n * @returns a stateful value, and a function to update it.\r\n */\r\nvar useStorage = function useStorage(initialValue, key) {\r\n var storage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'local';\r\n // Since the local storage API isn't available in server-rendering environments, \r\n // we check that typeof window !== 'undefined' to make SSR and SSG work properly.\r\n var storageAvailable = typeof window !== 'undefined';\r\n var _React$useState = React.useState(function () {\r\n if (!storageAvailable) {\r\n return initialValue;\r\n }\r\n try {\r\n var item = storage === 'local' ? window.localStorage.getItem(key) : window.sessionStorage.getItem(key);\r\n return item ? JSON.parse(item) : initialValue;\r\n } catch (error) {\r\n // If error also return initialValue\r\n return initialValue;\r\n }\r\n }),\r\n _React$useState2 = _slicedToArray(_React$useState, 2),\r\n storedValue = _React$useState2[0],\r\n setStoredValue = _React$useState2[1];\r\n var setValue = function setValue(value) {\r\n try {\r\n // Allow value to be a function so we have same API as useState\r\n var valueToStore = value instanceof Function ? value(storedValue) : value;\r\n setStoredValue(valueToStore);\r\n if (storageAvailable) {\r\n var serializedValue = JSON.stringify(valueToStore);\r\n storage === 'local' ? window.localStorage.setItem(key, serializedValue) : window.sessionStorage.setItem(key, serializedValue);\r\n }\r\n } catch (error) {\r\n throw new Error(\"PrimeReact useStorage: Failed to serialize the value at key: \".concat(key));\r\n }\r\n };\r\n return [storedValue, setValue];\r\n};\r\n/* eslint-enable */\r\n/* eslint-disable */\r\nvar useTimeout = function useTimeout(fn) {\r\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\r\n var when = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\r\n var timeout = React.useRef(null);\r\n var savedCallback = React.useRef(null);\r\n var clear = React.useCallback(function () {\r\n return clearTimeout(timeout.current);\r\n }, [timeout.current]);\r\n React.useEffect(function () {\r\n savedCallback.current = fn;\r\n });\r\n React.useEffect(function () {\r\n function callback() {\r\n savedCallback.current();\r\n }\r\n if (when) {\r\n timeout.current = setTimeout(callback, delay);\r\n return clear;\r\n } else {\r\n clear();\r\n }\r\n }, [delay, when]);\r\n useUnmountEffect(function () {\r\n clear();\r\n });\r\n return [clear];\r\n};\r\n/* eslint-enable */\r\nexport { useEventListener, useInterval, useMountEffect, useOverlayListener, useOverlayScrollListener, usePrevious, useResizeListener, useStorage, useTimeout, useUnmountEffect, useUpdateEffect };\r\n","import * as React from 'react';\r\nfunction _arrayWithHoles(arr) {\r\n if (Array.isArray(arr)) return arr;\r\n}\r\nfunction _iterableToArrayLimit(arr, i) {\r\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\r\n if (_i == null) return;\r\n var _arr = [];\r\n var _n = true;\r\n var _d = false;\r\n var _s, _e;\r\n try {\r\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\r\n _arr.push(_s.value);\r\n if (i && _arr.length === i) break;\r\n }\r\n } catch (err) {\r\n _d = true;\r\n _e = err;\r\n } finally {\r\n try {\r\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\r\n } finally {\r\n if (_d) throw _e;\r\n }\r\n }\r\n return _arr;\r\n}\r\nfunction _arrayLikeToArray$1(arr, len) {\r\n if (len == null || len > arr.length) len = arr.length;\r\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\r\n arr2[i] = arr[i];\r\n }\r\n return arr2;\r\n}\r\nfunction _unsupportedIterableToArray$1(o, minLen) {\r\n if (!o) return;\r\n if (typeof o === \"string\") return _arrayLikeToArray$1(o, minLen);\r\n var n = Object.prototype.toString.call(o).slice(8, -1);\r\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\r\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\r\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);\r\n}\r\nfunction _nonIterableRest() {\r\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\r\n}\r\nfunction _slicedToArray(arr, i) {\r\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();\r\n}\r\nfunction _typeof(obj) {\r\n \"@babel/helpers - typeof\";\r\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\r\n _typeof = function _typeof(obj) {\r\n return typeof obj;\r\n };\r\n } else {\r\n _typeof = function _typeof(obj) {\r\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\r\n };\r\n }\r\n return _typeof(obj);\r\n}\r\nfunction classNames() {\r\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\r\n args[_key] = arguments[_key];\r\n }\r\n if (args) {\r\n var classes = [];\r\n for (var i = 0; i < args.length; i++) {\r\n var className = args[i];\r\n if (!className) continue;\r\n var type = _typeof(className);\r\n if (type === 'string' || type === 'number') {\r\n classes.push(className);\r\n } else if (type === 'object') {\r\n var _classes = Array.isArray(className) ? className : Object.entries(className).map(function (_ref) {\r\n var _ref2 = _slicedToArray(_ref, 2),\r\n key = _ref2[0],\r\n value = _ref2[1];\r\n return !!value ? key : null;\r\n });\r\n classes = _classes.length ? classes.concat(_classes.filter(function (c) {\r\n return !!c;\r\n })) : classes;\r\n }\r\n }\r\n return classes.join(' ');\r\n }\r\n return undefined;\r\n}\r\nfunction _classCallCheck(instance, Constructor) {\r\n if (!(instance instanceof Constructor)) {\r\n throw new TypeError(\"Cannot call a class as a function\");\r\n }\r\n}\r\nfunction _defineProperties(target, props) {\r\n for (var i = 0; i < props.length; i++) {\r\n var descriptor = props[i];\r\n descriptor.enumerable = descriptor.enumerable || false;\r\n descriptor.configurable = true;\r\n if (\"value\" in descriptor) descriptor.writable = true;\r\n Object.defineProperty(target, descriptor.key, descriptor);\r\n }\r\n}\r\nfunction _createClass(Constructor, protoProps, staticProps) {\r\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\r\n if (staticProps) _defineProperties(Constructor, staticProps);\r\n return Constructor;\r\n}\r\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\r\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\r\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\r\nvar DomHandler = /*#__PURE__*/function () {\r\n function DomHandler() {\r\n _classCallCheck(this, DomHandler);\r\n }\r\n _createClass(DomHandler, null, [{\r\n key: \"innerWidth\",\r\n value: function innerWidth(el) {\r\n if (el) {\r\n var width = el.offsetWidth;\r\n var style = getComputedStyle(el);\r\n width += parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\r\n return width;\r\n }\r\n return 0;\r\n }\r\n }, {\r\n key: \"width\",\r\n value: function width(el) {\r\n if (el) {\r\n var width = el.offsetWidth;\r\n var style = getComputedStyle(el);\r\n width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\r\n return width;\r\n }\r\n return 0;\r\n }\r\n }, {\r\n key: \"getBrowserLanguage\",\r\n value: function getBrowserLanguage() {\r\n return navigator.userLanguage || navigator.languages && navigator.languages.length && navigator.languages[0] || navigator.language || navigator.browserLanguage || navigator.systemLanguage || 'en';\r\n }\r\n }, {\r\n key: \"getWindowScrollTop\",\r\n value: function getWindowScrollTop() {\r\n var doc = document.documentElement;\r\n return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);\r\n }\r\n }, {\r\n key: \"getWindowScrollLeft\",\r\n value: function getWindowScrollLeft() {\r\n var doc = document.documentElement;\r\n return (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);\r\n }\r\n }, {\r\n key: \"getOuterWidth\",\r\n value: function getOuterWidth(el, margin) {\r\n if (el) {\r\n var width = el.offsetWidth || el.getBoundingClientRect().width;\r\n if (margin) {\r\n var style = getComputedStyle(el);\r\n width += parseFloat(style.marginLeft) + parseFloat(style.marginRight);\r\n }\r\n return width;\r\n }\r\n return 0;\r\n }\r\n }, {\r\n key: \"getOuterHeight\",\r\n value: function getOuterHeight(el, margin) {\r\n if (el) {\r\n var height = el.offsetHeight || el.getBoundingClientRect().height;\r\n if (margin) {\r\n var style = getComputedStyle(el);\r\n height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);\r\n }\r\n return height;\r\n }\r\n return 0;\r\n }\r\n }, {\r\n key: \"getClientHeight\",\r\n value: function getClientHeight(el, margin) {\r\n if (el) {\r\n var height = el.clientHeight;\r\n if (margin) {\r\n var style = getComputedStyle(el);\r\n height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);\r\n }\r\n return height;\r\n }\r\n return 0;\r\n }\r\n }, {\r\n key: \"getClientWidth\",\r\n value: function getClientWidth(el, margin) {\r\n if (el) {\r\n var width = el.clientWidth;\r\n if (margin) {\r\n var style = getComputedStyle(el);\r\n width += parseFloat(style.marginLeft) + parseFloat(style.marginRight);\r\n }\r\n return width;\r\n }\r\n return 0;\r\n }\r\n }, {\r\n key: \"getViewport\",\r\n value: function getViewport() {\r\n var win = window,\r\n d = document,\r\n e = d.documentElement,\r\n g = d.getElementsByTagName('body')[0],\r\n w = win.innerWidth || e.clientWidth || g.clientWidth,\r\n h = win.innerHeight || e.clientHeight || g.clientHeight;\r\n return {\r\n width: w,\r\n height: h\r\n };\r\n }\r\n }, {\r\n key: \"getOffset\",\r\n value: function getOffset(el) {\r\n if (el) {\r\n var rect = el.getBoundingClientRect();\r\n return {\r\n top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),\r\n left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0)\r\n };\r\n }\r\n return {\r\n top: 'auto',\r\n left: 'auto'\r\n };\r\n }\r\n }, {\r\n key: \"index\",\r\n value: function index(element) {\r\n if (element) {\r\n var children = element.parentNode.childNodes;\r\n var num = 0;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i] === element) return num;\r\n if (children[i].nodeType === 1) num++;\r\n }\r\n }\r\n return -1;\r\n }\r\n }, {\r\n key: \"addMultipleClasses\",\r\n value: function addMultipleClasses(element, className) {\r\n if (element && className) {\r\n if (element.classList) {\r\n var styles = className.split(' ');\r\n for (var i = 0; i < styles.length; i++) {\r\n element.classList.add(styles[i]);\r\n }\r\n } else {\r\n var _styles = className.split(' ');\r\n for (var _i = 0; _i < _styles.length; _i++) {\r\n element.className += ' ' + _styles[_i];\r\n }\r\n }\r\n }\r\n }\r\n }, {\r\n key: \"removeMultipleClasses\",\r\n value: function removeMultipleClasses(element, className) {\r\n if (element && className) {\r\n if (element.classList) {\r\n var styles = className.split(' ');\r\n for (var i = 0; i < styles.length; i++) {\r\n element.classList.remove(styles[i]);\r\n }\r\n } else {\r\n var _styles2 = className.split(' ');\r\n for (var _i2 = 0; _i2 < _styles2.length; _i2++) {\r\n element.className = element.className.replace(new RegExp('(^|\\\\b)' + _styles2[_i2].split(' ').join('|') + '(\\\\b|$)', 'gi'), ' ');\r\n }\r\n }\r\n }\r\n }\r\n }, {\r\n key: \"addClass\",\r\n value: function addClass(element, className) {\r\n if (element && className) {\r\n if (element.classList) element.classList.add(className);else element.className += ' ' + className;\r\n }\r\n }\r\n }, {\r\n key: \"removeClass\",\r\n value: function removeClass(element, className) {\r\n if (element && className) {\r\n if (element.classList) element.classList.remove(className);else element.className = element.className.replace(new RegExp('(^|\\\\b)' + className.split(' ').join('|') + '(\\\\b|$)', 'gi'), ' ');\r\n }\r\n }\r\n }, {\r\n key: \"hasClass\",\r\n value: function hasClass(element, className) {\r\n if (element) {\r\n if (element.classList) return element.classList.contains(className);else return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);\r\n }\r\n }\r\n }, {\r\n key: \"find\",\r\n value: function find(element, selector) {\r\n return element ? Array.from(element.querySelectorAll(selector)) : [];\r\n }\r\n }, {\r\n key: \"findSingle\",\r\n value: function findSingle(element, selector) {\r\n if (element) {\r\n return element.querySelector(selector);\r\n }\r\n return null;\r\n }\r\n }, {\r\n key: \"getHeight\",\r\n value: function getHeight(el) {\r\n if (el) {\r\n var height = el.offsetHeight;\r\n var style = getComputedStyle(el);\r\n height -= parseFloat(style.paddingTop) + parseFloat(style.paddingBottom) + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\r\n return height;\r\n }\r\n return 0;\r\n }\r\n }, {\r\n key: \"getWidth\",\r\n value: function getWidth(el) {\r\n if (el) {\r\n var width = el.offsetWidth;\r\n var style = getComputedStyle(el);\r\n width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);\r\n return width;\r\n }\r\n return 0;\r\n }\r\n }, {\r\n key: \"alignOverlay\",\r\n value: function alignOverlay(overlay, target, appendTo) {\r\n var calculateMinWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\r\n if (overlay && target) {\r\n if (appendTo === 'self') {\r\n this.relativePosition(overlay, target);\r\n } else {\r\n calculateMinWidth && (overlay.style.minWidth = DomHandler.getOuterWidth(target) + 'px');\r\n this.absolutePosition(overlay, target);\r\n }\r\n }\r\n }\r\n }, {\r\n key: \"absolutePosition\",\r\n value: function absolutePosition(element, target) {\r\n if (element) {\r\n var elementDimensions = element.offsetParent ? {\r\n width: element.offsetWidth,\r\n height: element.offsetHeight\r\n } : this.getHiddenElementDimensions(element);\r\n var elementOuterHeight = elementDimensions.height;\r\n var elementOuterWidth = elementDimensions.width;\r\n var targetOuterHeight = target.offsetHeight;\r\n var targetOuterWidth = target.offsetWidth;\r\n var targetOffset = target.getBoundingClientRect();\r\n var windowScrollTop = this.getWindowScrollTop();\r\n var windowScrollLeft = this.getWindowScrollLeft();\r\n var viewport = this.getViewport();\r\n var top, left;\r\n if (targetOffset.top + targetOuterHeight + elementOuterHeight > viewport.height) {\r\n top = targetOffset.top + windowScrollTop - elementOuterHeight;\r\n if (top < 0) {\r\n top = windowScrollTop;\r\n }\r\n element.style.transformOrigin = 'bottom';\r\n } else {\r\n top = targetOuterHeight + targetOffset.top + windowScrollTop;\r\n element.style.transformOrigin = 'top';\r\n }\r\n if (targetOffset.left + targetOuterWidth + elementOuterWidth > viewport.width) left = Math.max(0, targetOffset.left + windowScrollLeft + targetOuterWidth - elementOuterWidth);else left = targetOffset.left + windowScrollLeft;\r\n element.style.top = top + 'px';\r\n element.style.left = left + 'px';\r\n }\r\n }\r\n }, {\r\n key: \"relativePosition\",\r\n value: function relativePosition(element, target) {\r\n if (element) {\r\n var elementDimensions = element.offsetParent ? {\r\n width: element.offsetWidth,\r\n height: element.offsetHeight\r\n } : this.getHiddenElementDimensions(element);\r\n var targetHeight = target.offsetHeight;\r\n var targetOffset = target.getBoundingClientRect();\r\n var viewport = this.getViewport();\r\n var top, left;\r\n if (targetOffset.top + targetHeight + elementDimensions.height > viewport.height) {\r\n top = -1 * elementDimensions.height;\r\n if (targetOffset.top + top < 0) {\r\n top = -1 * targetOffset.top;\r\n }\r\n element.style.transformOrigin = 'bottom';\r\n } else {\r\n top = targetHeight;\r\n element.style.transformOrigin = 'top';\r\n }\r\n if (elementDimensions.width > viewport.width) {\r\n // element wider then viewport and cannot fit on screen (align at left side of viewport)\r\n left = targetOffset.left * -1;\r\n } else if (targetOffset.left + elementDimensions.width > viewport.width) {\r\n // element wider then viewport but can be fit on screen (align at right side of viewport)\r\n left = (targetOffset.left + elementDimensions.width - viewport.width) * -1;\r\n } else {\r\n // element fits on screen (align with target)\r\n left = 0;\r\n }\r\n element.style.top = top + 'px';\r\n element.style.left = left + 'px';\r\n }\r\n }\r\n }, {\r\n key: \"flipfitCollision\",\r\n value: function flipfitCollision(element, target) {\r\n var _this = this;\r\n var my = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'left top';\r\n var at = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'left bottom';\r\n var callback = arguments.length > 4 ? arguments[4] : undefined;\r\n if (element && target) {\r\n var targetOffset = target.getBoundingClientRect();\r\n var viewport = this.getViewport();\r\n var myArr = my.split(' ');\r\n var atArr = at.split(' ');\r\n var getPositionValue = function getPositionValue(arr, isOffset) {\r\n return isOffset ? +arr.substring(arr.search(/(\\+|-)/g)) || 0 : arr.substring(0, arr.search(/(\\+|-)/g)) || arr;\r\n };\r\n var position = {\r\n my: {\r\n x: getPositionValue(myArr[0]),\r\n y: getPositionValue(myArr[1] || myArr[0]),\r\n offsetX: getPositionValue(myArr[0], true),\r\n offsetY: getPositionValue(myArr[1] || myArr[0], true)\r\n },\r\n at: {\r\n x: getPositionValue(atArr[0]),\r\n y: getPositionValue(atArr[1] || atArr[0]),\r\n offsetX: getPositionValue(atArr[0], true),\r\n offsetY: getPositionValue(atArr[1] || atArr[0], true)\r\n }\r\n };\r\n var myOffset = {\r\n left: function left() {\r\n var totalOffset = position.my.offsetX + position.at.offsetX;\r\n return totalOffset + targetOffset.left + (position.my.x === 'left' ? 0 : -1 * (position.my.x === 'center' ? _this.getOuterWidth(element) / 2 : _this.getOuterWidth(element)));\r\n },\r\n top: function top() {\r\n var totalOffset = position.my.offsetY + position.at.offsetY;\r\n return totalOffset + targetOffset.top + (position.my.y === 'top' ? 0 : -1 * (position.my.y === 'center' ? _this.getOuterHeight(element) / 2 : _this.getOuterHeight(element)));\r\n }\r\n };\r\n var alignWithAt = {\r\n count: {\r\n x: 0,\r\n y: 0\r\n },\r\n left: function left() {\r\n var left = myOffset.left();\r\n var scrollLeft = DomHandler.getWindowScrollLeft();\r\n element.style.left = left + scrollLeft + 'px';\r\n if (this.count.x === 2) {\r\n element.style.left = scrollLeft + 'px';\r\n this.count.x = 0;\r\n } else if (left < 0) {\r\n this.count.x++;\r\n position.my.x = 'left';\r\n position.at.x = 'right';\r\n position.my.offsetX *= -1;\r\n position.at.offsetX *= -1;\r\n this.right();\r\n }\r\n },\r\n right: function right() {\r\n var left = myOffset.left() + DomHandler.getOuterWidth(target);\r\n var scrollLeft = DomHandler.getWindowScrollLeft();\r\n element.style.left = left + scrollLeft + 'px';\r\n if (this.count.x === 2) {\r\n element.style.left = viewport.width - DomHandler.getOuterWidth(element) + scrollLeft + 'px';\r\n this.count.x = 0;\r\n } else if (left + DomHandler.getOuterWidth(element) > viewport.width) {\r\n this.count.x++;\r\n position.my.x = 'right';\r\n position.at.x = 'left';\r\n position.my.offsetX *= -1;\r\n position.at.offsetX *= -1;\r\n this.left();\r\n }\r\n },\r\n top: function top() {\r\n var top = myOffset.top();\r\n var scrollTop = DomHandler.getWindowScrollTop();\r\n element.style.top = top + scrollTop + 'px';\r\n if (this.count.y === 2) {\r\n element.style.left = scrollTop + 'px';\r\n this.count.y = 0;\r\n } else if (top < 0) {\r\n this.count.y++;\r\n position.my.y = 'top';\r\n position.at.y = 'bottom';\r\n position.my.offsetY *= -1;\r\n position.at.offsetY *= -1;\r\n this.bottom();\r\n }\r\n },\r\n bottom: function bottom() {\r\n var top = myOffset.top() + DomHandler.getOuterHeight(target);\r\n var scrollTop = DomHandler.getWindowScrollTop();\r\n element.style.top = top + scrollTop + 'px';\r\n if (this.count.y === 2) {\r\n element.style.left = viewport.height - DomHandler.getOuterHeight(element) + scrollTop + 'px';\r\n this.count.y = 0;\r\n } else if (top + DomHandler.getOuterHeight(target) > viewport.height) {\r\n this.count.y++;\r\n position.my.y = 'bottom';\r\n position.at.y = 'top';\r\n position.my.offsetY *= -1;\r\n position.at.offsetY *= -1;\r\n this.top();\r\n }\r\n },\r\n center: function center(axis) {\r\n if (axis === 'y') {\r\n var top = myOffset.top() + DomHandler.getOuterHeight(target) / 2;\r\n element.style.top = top + DomHandler.getWindowScrollTop() + 'px';\r\n if (top < 0) {\r\n this.bottom();\r\n } else if (top + DomHandler.getOuterHeight(target) > viewport.height) {\r\n this.top();\r\n }\r\n } else {\r\n var left = myOffset.left() + DomHandler.getOuterWidth(target) / 2;\r\n element.style.left = left + DomHandler.getWindowScrollLeft() + 'px';\r\n if (left < 0) {\r\n this.left();\r\n } else if (left + DomHandler.getOuterWidth(element) > viewport.width) {\r\n this.right();\r\n }\r\n }\r\n }\r\n };\r\n alignWithAt[position.at.x]('x');\r\n alignWithAt[position.at.y]('y');\r\n if (this.isFunction(callback)) {\r\n callback(position);\r\n }\r\n }\r\n }\r\n }, {\r\n key: \"findCollisionPosition\",\r\n value: function findCollisionPosition(position) {\r\n if (position) {\r\n var isAxisY = position === 'top' || position === 'bottom';\r\n var myXPosition = position === 'left' ? 'right' : 'left';\r\n var myYPosition = position === 'top' ? 'bottom' : 'top';\r\n if (isAxisY) {\r\n return {\r\n axis: 'y',\r\n my: \"center \".concat(myYPosition),\r\n at: \"center \".concat(position)\r\n };\r\n }\r\n return {\r\n axis: 'x',\r\n my: \"\".concat(myXPosition, \" center\"),\r\n at: \"\".concat(position, \" center\")\r\n };\r\n }\r\n }\r\n }, {\r\n key: \"getParents\",\r\n value: function getParents(element) {\r\n var parents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\r\n return element['parentNode'] === null ? parents : this.getParents(element.parentNode, parents.concat([element.parentNode]));\r\n }\r\n }, {\r\n key: \"getScrollableParents\",\r\n value: function getScrollableParents(element) {\r\n var scrollableParents = [];\r\n if (element) {\r\n var parents = this.getParents(element);\r\n var overflowRegex = /(auto|scroll)/;\r\n var overflowCheck = function overflowCheck(node) {\r\n var styleDeclaration = node ? getComputedStyle(node) : null;\r\n return styleDeclaration && (overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowY')));\r\n };\r\n var _iterator = _createForOfIteratorHelper(parents),\r\n _step;\r\n try {\r\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\r\n var parent = _step.value;\r\n var scrollSelectors = parent.nodeType === 1 && parent.dataset['scrollselectors'];\r\n if (scrollSelectors) {\r\n var selectors = scrollSelectors.split(',');\r\n var _iterator2 = _createForOfIteratorHelper(selectors),\r\n _step2;\r\n try {\r\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\r\n var selector = _step2.value;\r\n var el = this.findSingle(parent, selector);\r\n if (el && overflowCheck(el)) {\r\n scrollableParents.push(el);\r\n }\r\n }\r\n } catch (err) {\r\n _iterator2.e(err);\r\n } finally {\r\n _iterator2.f();\r\n }\r\n }\r\n if (parent.nodeType !== 9 && overflowCheck(parent)) {\r\n scrollableParents.push(parent);\r\n }\r\n }\r\n } catch (err) {\r\n _iterator.e(err);\r\n } finally {\r\n _iterator.f();\r\n }\r\n }\r\n return scrollableParents;\r\n }\r\n }, {\r\n key: \"getHiddenElementOuterHeight\",\r\n value: function getHiddenElementOuterHeight(element) {\r\n if (element) {\r\n element.style.visibility = 'hidden';\r\n element.style.display = 'block';\r\n var elementHeight = element.offsetHeight;\r\n element.style.display = 'none';\r\n element.style.visibility = 'visible';\r\n return elementHeight;\r\n }\r\n return 0;\r\n }\r\n }, {\r\n key: \"getHiddenElementOuterWidth\",\r\n value: function getHiddenElementOuterWidth(element) {\r\n if (element) {\r\n element.style.visibility = 'hidden';\r\n element.style.display = 'block';\r\n var elementWidth = element.offsetWidth;\r\n element.style.display = 'none';\r\n element.style.visibility = 'visible';\r\n return elementWidth;\r\n }\r\n return 0;\r\n }\r\n }, {\r\n key: \"getHiddenElementDimensions\",\r\n value: function getHiddenElementDimensions(element) {\r\n var dimensions = {};\r\n if (element) {\r\n element.style.visibility = 'hidden';\r\n element.style.display = 'block';\r\n dimensions.width = element.offsetWidth;\r\n dimensions.height = element.offsetHeight;\r\n element.style.display = 'none';\r\n element.style.visibility = 'visible';\r\n }\r\n return dimensions;\r\n }\r\n }, {\r\n key: \"fadeIn\",\r\n value: function fadeIn(element, duration) {\r\n if (element) {\r\n element.style.opacity = 0;\r\n var last = +new Date();\r\n var opacity = 0;\r\n var tick = function tick() {\r\n opacity = +element.style.opacity + (new Date().getTime() - last) / duration;\r\n element.style.opacity = opacity;\r\n last = +new Date();\r\n if (+opacity < 1) {\r\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 16);\r\n }\r\n };\r\n tick();\r\n }\r\n }\r\n }, {\r\n key: \"fadeOut\",\r\n value: function fadeOut(element, duration) {\r\n if (element) {\r\n var opacity = 1,\r\n interval = 50,\r\n gap = interval / duration;\r\n var fading = setInterval(function () {\r\n opacity -= gap;\r\n if (opacity <= 0) {\r\n opacity = 0;\r\n clearInterval(fading);\r\n }\r\n element.style.opacity = opacity;\r\n }, interval);\r\n }\r\n }\r\n }, {\r\n key: \"getUserAgent\",\r\n value: function getUserAgent() {\r\n return navigator.userAgent;\r\n }\r\n }, {\r\n key: \"isIOS\",\r\n value: function isIOS() {\r\n return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window['MSStream'];\r\n }\r\n }, {\r\n key: \"isAndroid\",\r\n value: function isAndroid() {\r\n return /(android)/i.test(navigator.userAgent);\r\n }\r\n }, {\r\n key: \"isTouchDevice\",\r\n value: function isTouchDevice() {\r\n return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;\r\n }\r\n }, {\r\n key: \"isFunction\",\r\n value: function isFunction(obj) {\r\n return !!(obj && obj.constructor && obj.call && obj.apply);\r\n }\r\n }, {\r\n key: \"appendChild\",\r\n value: function appendChild(element, target) {\r\n if (this.isElement(target)) target.appendChild(element);else if (target.el && target.el.nativeElement) target.el.nativeElement.appendChild(element);else throw new Error('Cannot append ' + target + ' to ' + element);\r\n }\r\n }, {\r\n key: \"removeChild\",\r\n value: function removeChild(element, target) {\r\n if (this.isElement(target)) target.removeChild(element);else if (target.el && target.el.nativeElement) target.el.nativeElement.removeChild(element);else throw new Error('Cannot remove ' + element + ' from ' + target);\r\n }\r\n }, {\r\n key: \"isElement\",\r\n value: function isElement(obj) {\r\n return (typeof HTMLElement === \"undefined\" ? \"undefined\" : _typeof(HTMLElement)) === \"object\" ? obj instanceof HTMLElement : obj && _typeof(obj) === \"object\" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === \"string\";\r\n }\r\n }, {\r\n key: \"scrollInView\",\r\n value: function scrollInView(container, item) {\r\n var borderTopValue = getComputedStyle(container).getPropertyValue('borderTopWidth');\r\n var borderTop = borderTopValue ? parseFloat(borderTopValue) : 0;\r\n var paddingTopValue = getComputedStyle(container).getPropertyValue('paddingTop');\r\n var paddingTop = paddingTopValue ? parseFloat(paddingTopValue) : 0;\r\n var containerRect = container.getBoundingClientRect();\r\n var itemRect = item.getBoundingClientRect();\r\n var offset = itemRect.top + document.body.scrollTop - (containerRect.top + document.body.scrollTop) - borderTop - paddingTop;\r\n var scroll = container.scrollTop;\r\n var elementHeight = container.clientHeight;\r\n var itemHeight = this.getOuterHeight(item);\r\n if (offset < 0) {\r\n container.scrollTop = scroll + offset;\r\n } else if (offset + itemHeight > elementHeight) {\r\n container.scrollTop = scroll + offset - elementHeight + itemHeight;\r\n }\r\n }\r\n }, {\r\n key: \"clearSelection\",\r\n value: function clearSelection() {\r\n if (window.getSelection) {\r\n if (window.getSelection().empty) {\r\n window.getSelection().empty();\r\n } else if (window.getSelection().removeAllRanges && window.getSelection().rangeCount > 0 && window.getSelection().getRangeAt(0).getClientRects().length > 0) {\r\n window.getSelection().removeAllRanges();\r\n }\r\n } else if (document['selection'] && document['selection'].empty) {\r\n try {\r\n document['selection'].empty();\r\n } catch (error) {//ignore IE bug\r\n }\r\n }\r\n }\r\n }, {\r\n key: \"calculateScrollbarWidth\",\r\n value: function calculateScrollbarWidth(el) {\r\n if (el) {\r\n var style = getComputedStyle(el);\r\n return el.offsetWidth - el.clientWidth - parseFloat(style.borderLeftWidth) - parseFloat(style.borderRightWidth);\r\n } else {\r\n if (this.calculatedScrollbarWidth != null) return this.calculatedScrollbarWidth;\r\n var scrollDiv = document.createElement(\"div\");\r\n scrollDiv.className = \"p-scrollbar-measure\";\r\n document.body.appendChild(scrollDiv);\r\n var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;\r\n document.body.removeChild(scrollDiv);\r\n this.calculatedScrollbarWidth = scrollbarWidth;\r\n return scrollbarWidth;\r\n }\r\n }\r\n }, {\r\n key: \"getBrowser\",\r\n value: function getBrowser() {\r\n if (!this.browser) {\r\n var matched = this.resolveUserAgent();\r\n this.browser = {};\r\n if (matched.browser) {\r\n this.browser[matched.browser] = true;\r\n this.browser['version'] = matched.version;\r\n }\r\n if (this.browser['chrome']) {\r\n this.browser['webkit'] = true;\r\n } else if (this.browser['webkit']) {\r\n this.browser['safari'] = true;\r\n }\r\n }\r\n return this.browser;\r\n }\r\n }, {\r\n key: \"resolveUserAgent\",\r\n value: function resolveUserAgent() {\r\n var ua = navigator.userAgent.toLowerCase();\r\n var match = /(chrome)[ ]([\\w.]+)/.exec(ua) || /(webkit)[ ]([\\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ ]([\\w.]+)/.exec(ua) || /(msie) ([\\w.]+)/.exec(ua) || ua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec(ua) || [];\r\n return {\r\n browser: match[1] || \"\",\r\n version: match[2] || \"0\"\r\n };\r\n }\r\n }, {\r\n key: \"isVisible\",\r\n value: function isVisible(element) {\r\n return element && element.offsetParent != null;\r\n }\r\n }, {\r\n key: \"isExist\",\r\n value: function isExist(element) {\r\n return element !== null && typeof element !== 'undefined' && element.nodeName && element.parentNode;\r\n }\r\n }, {\r\n key: \"hasDOM\",\r\n value: function hasDOM() {\r\n return !!(typeof window !== 'undefined' && window.document && window.document.createElement);\r\n }\r\n }, {\r\n key: \"getFocusableElements\",\r\n value: function getFocusableElements(element) {\r\n var selector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\r\n var focusableElements = DomHandler.find(element, \"button:not([tabindex = \\\"-1\\\"]):not([disabled]):not([style*=\\\"display:none\\\"]):not([hidden])\".concat(selector, \",\\n [href][clientHeight][clientWidth]:not([tabindex = \\\"-1\\\"]):not([disabled]):not([style*=\\\"display:none\\\"]):not([hidden])\").concat(selector, \",\\n input:not([tabindex = \\\"-1\\\"]):not([disabled]):not([style*=\\\"display:none\\\"]):not([hidden])\").concat(selector, \",\\n select:not([tabindex = \\\"-1\\\"]):not([disabled]):not([style*=\\\"display:none\\\"]):not([hidden])\").concat(selector, \",\\n textarea:not([tabindex = \\\"-1\\\"]):not([disabled]):not([style*=\\\"display:none\\\"]):not([hidden])\").concat(selector, \",\\n [tabIndex]:not([tabIndex = \\\"-1\\\"]):not([disabled]):not([style*=\\\"display:none\\\"]):not([hidden])\").concat(selector, \",\\n [contenteditable]:not([tabIndex = \\\"-1\\\"]):not([disabled]):not([style*=\\\"display:none\\\"]):not([hidden])\").concat(selector));\r\n var visibleFocusableElements = [];\r\n var _iterator3 = _createForOfIteratorHelper(focusableElements),\r\n _step3;\r\n try {\r\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\r\n var focusableElement = _step3.value;\r\n if (getComputedStyle(focusableElement).display !== \"none\" && getComputedStyle(focusableElement).visibility !== \"hidden\") visibleFocusableElements.push(focusableElement);\r\n }\r\n } catch (err) {\r\n _iterator3.e(err);\r\n } finally {\r\n _iterator3.f();\r\n }\r\n return visibleFocusableElements;\r\n }\r\n }, {\r\n key: \"getFirstFocusableElement\",\r\n value: function getFirstFocusableElement(element, selector) {\r\n var focusableElements = DomHandler.getFocusableElements(element, selector);\r\n return focusableElements.length > 0 ? focusableElements[0] : null;\r\n }\r\n }, {\r\n key: \"getLastFocusableElement\",\r\n value: function getLastFocusableElement(element, selector) {\r\n var focusableElements = DomHandler.getFocusableElements(element, selector);\r\n return focusableElements.length > 0 ? focusableElements[focusableElements.length - 1] : null;\r\n }\r\n }, {\r\n key: \"getCursorOffset\",\r\n value: function getCursorOffset(el, prevText, nextText, currentText) {\r\n if (el) {\r\n var style = getComputedStyle(el);\r\n var ghostDiv = document.createElement('div');\r\n ghostDiv.style.position = 'absolute';\r\n ghostDiv.style.top = '0px';\r\n ghostDiv.style.left = '0px';\r\n ghostDiv.style.visibility = 'hidden';\r\n ghostDiv.style.pointerEvents = 'none';\r\n ghostDiv.style.overflow = style.overflow;\r\n ghostDiv.style.width = style.width;\r\n ghostDiv.style.height = style.height;\r\n ghostDiv.style.padding = style.padding;\r\n ghostDiv.style.border = style.border;\r\n ghostDiv.style.overflowWrap = style.overflowWrap;\r\n ghostDiv.style.whiteSpace = style.whiteSpace;\r\n ghostDiv.style.lineHeight = style.lineHeight;\r\n ghostDiv.innerHTML = prevText.replace(/\\r\\n|\\r|\\n/g, ' ');\r\n var ghostSpan = document.createElement('span');\r\n ghostSpan.textContent = currentText;\r\n ghostDiv.appendChild(ghostSpan);\r\n var text = document.createTextNode(nextText);\r\n ghostDiv.appendChild(text);\r\n document.body.appendChild(ghostDiv);\r\n var offsetLeft = ghostSpan.offsetLeft,\r\n offsetTop = ghostSpan.offsetTop,\r\n clientHeight = ghostSpan.clientHeight;\r\n document.body.removeChild(ghostDiv);\r\n return {\r\n left: Math.abs(offsetLeft - el.scrollLeft),\r\n top: Math.abs(offsetTop - el.scrollTop) + clientHeight\r\n };\r\n }\r\n return {\r\n top: 'auto',\r\n left: 'auto'\r\n };\r\n }\r\n }, {\r\n key: \"invokeElementMethod\",\r\n value: function invokeElementMethod(element, methodName, args) {\r\n element[methodName].apply(element, args);\r\n }\r\n }, {\r\n key: \"isClickable\",\r\n value: function isClickable(element) {\r\n var targetNode = element.nodeName;\r\n var parentNode = element.parentElement && element.parentElement.nodeName;\r\n return targetNode === 'INPUT' || targetNode === 'TEXTAREA' || targetNode === 'BUTTON' || targetNode === 'A' || parentNode === 'INPUT' || parentNode === 'TEXTAREA' || parentNode === 'BUTTON' || parentNode === 'A' || this.hasClass(element, 'p-button') || this.hasClass(element.parentElement, 'p-button') || this.hasClass(element.parentElement, 'p-checkbox') || this.hasClass(element.parentElement, 'p-radiobutton');\r\n }\r\n }, {\r\n key: \"applyStyle\",\r\n value: function applyStyle(element, style) {\r\n if (typeof style === 'string') {\r\n element.style.cssText = this.style;\r\n } else {\r\n for (var prop in this.style) {\r\n element.style[prop] = style[prop];\r\n }\r\n }\r\n }\r\n }, {\r\n key: \"exportCSV\",\r\n value: function exportCSV(csv, filename) {\r\n var blob = new Blob([csv], {\r\n type: 'application/csv;charset=utf-8;'\r\n });\r\n if (window.navigator.msSaveOrOpenBlob) {\r\n navigator.msSaveOrOpenBlob(blob, filename + '.csv');\r\n } else {\r\n var isDownloaded = DomHandler.saveAs({\r\n name: filename + '.csv',\r\n src: URL.createObjectURL(blob)\r\n });\r\n if (!isDownloaded) {\r\n csv = 'data:text/csv;charset=utf-8,' + csv;\r\n window.open(encodeURI(csv));\r\n }\r\n }\r\n }\r\n }, {\r\n key: \"saveAs\",\r\n value: function saveAs(file) {\r\n if (file) {\r\n var link = document.createElement('a');\r\n if (link.download !== undefined) {\r\n var name = file.name,\r\n src = file.src;\r\n link.setAttribute('href', src);\r\n link.setAttribute('download', name);\r\n link.style.display = 'none';\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n }, {\r\n key: \"createInlineStyle\",\r\n value: function createInlineStyle(nonce) {\r\n var styleElement = document.createElement('style');\r\n try {\r\n if (!nonce) {\r\n nonce = process.env.REACT_APP_CSS_NONCE;\r\n }\r\n } catch (error) {// NOOP\r\n }\r\n nonce && styleElement.setAttribute('nonce', nonce);\r\n document.head.appendChild(styleElement);\r\n return styleElement;\r\n }\r\n }, {\r\n key: \"removeInlineStyle\",\r\n value: function removeInlineStyle(styleElement) {\r\n if (this.isExist(styleElement)) {\r\n try {\r\n document.head.removeChild(styleElement);\r\n } catch (error) {// style element may have already been removed in a fast refresh\r\n }\r\n styleElement = null;\r\n }\r\n return styleElement;\r\n }\r\n }, {\r\n key: \"getTargetElement\",\r\n value: function getTargetElement(target) {\r\n if (!target) return null;\r\n if (target === 'document') {\r\n return document;\r\n } else if (target === 'window') {\r\n return window;\r\n } else if (_typeof(target) === 'object' && target.hasOwnProperty('current')) {\r\n return this.isExist(target.current) ? target.current : null;\r\n } else {\r\n var isFunction = function isFunction(obj) {\r\n return !!(obj && obj.constructor && obj.call && obj.apply);\r\n };\r\n var element = isFunction(target) ? target() : target;\r\n return element && element.nodeType === 9 || this.isExist(element) ? element : null;\r\n }\r\n }\r\n }]);\r\n return DomHandler;\r\n}();\r\nvar ConnectedOverlayScrollHandler = /*#__PURE__*/function () {\r\n function ConnectedOverlayScrollHandler(element) {\r\n var listener = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\r\n _classCallCheck(this, ConnectedOverlayScrollHandler);\r\n this.element = element;\r\n this.listener = listener;\r\n }\r\n _createClass(ConnectedOverlayScrollHandler, [{\r\n key: \"bindScrollListener\",\r\n value: function bindScrollListener() {\r\n this.scrollableParents = DomHandler.getScrollableParents(this.element);\r\n for (var i = 0; i < this.scrollableParents.length; i++) {\r\n this.scrollableParents[i].addEventListener('scroll', this.listener);\r\n }\r\n }\r\n }, {\r\n key: \"unbindScrollListener\",\r\n value: function unbindScrollListener() {\r\n if (this.scrollableParents) {\r\n for (var i = 0; i < this.scrollableParents.length; i++) {\r\n this.scrollableParents[i].removeEventListener('scroll', this.listener);\r\n }\r\n }\r\n }\r\n }, {\r\n key: \"destroy\",\r\n value: function destroy() {\r\n this.unbindScrollListener();\r\n this.element = null;\r\n this.listener = null;\r\n this.scrollableParents = null;\r\n }\r\n }]);\r\n return ConnectedOverlayScrollHandler;\r\n}();\r\nfunction EventBus() {\r\n var allHandlers = new Map();\r\n return {\r\n on: function on(type, handler) {\r\n var handlers = allHandlers.get(type);\r\n if (!handlers) handlers = [handler];else handlers.push(handler);\r\n allHandlers.set(type, handlers);\r\n },\r\n off: function off(type, handler) {\r\n var handlers = allHandlers.get(type);\r\n handlers && handlers.splice(handlers.indexOf(handler) >>> 0, 1);\r\n },\r\n emit: function emit(type, evt) {\r\n var handlers = allHandlers.get(type);\r\n handlers && handlers.slice().forEach(function (handler) {\r\n return handler(evt);\r\n });\r\n }\r\n };\r\n}\r\nfunction _defineProperty(obj, key, value) {\r\n if (key in obj) {\r\n Object.defineProperty(obj, key, {\r\n value: value,\r\n enumerable: true,\r\n configurable: true,\r\n writable: true\r\n });\r\n } else {\r\n obj[key] = value;\r\n }\r\n return obj;\r\n}\r\nfunction ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\r\nfunction _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\r\nfunction mask(el, options) {\r\n var defaultOptions = {\r\n mask: null,\r\n slotChar: '_',\r\n autoClear: true,\r\n unmask: false,\r\n readOnly: false,\r\n onComplete: null,\r\n onChange: null,\r\n onFocus: null,\r\n onBlur: null\r\n };\r\n options = _objectSpread$1(_objectSpread$1({}, defaultOptions), options);\r\n var tests, partialPosition, len, firstNonMaskPos, defs, androidChrome, lastRequiredNonMaskPos, oldVal, focusText, caretTimeoutId, buffer, defaultBuffer;\r\n var caret = function caret(first, last) {\r\n var range, begin, end;\r\n if (!el.offsetParent || el !== document.activeElement) {\r\n return;\r\n }\r\n if (typeof first === 'number') {\r\n begin = first;\r\n end = typeof last === 'number' ? last : begin;\r\n if (el.setSelectionRange) {\r\n el.setSelectionRange(begin, end);\r\n } else if (el['createTextRange']) {\r\n range = el['createTextRange']();\r\n range.collapse(true);\r\n range.moveEnd('character', end);\r\n range.moveStart('character', begin);\r\n range.select();\r\n }\r\n } else {\r\n if (el.setSelectionRange) {\r\n begin = el.selectionStart;\r\n end = el.selectionEnd;\r\n } else if (document['selection'] && document['selection'].createRange) {\r\n range = document['selection'].createRange();\r\n begin = 0 - range.duplicate().moveStart('character', -100000);\r\n end = begin + range.text.length;\r\n }\r\n return {\r\n begin: begin,\r\n end: end\r\n };\r\n }\r\n };\r\n var isCompleted = function isCompleted() {\r\n for (var i = firstNonMaskPos; i <= lastRequiredNonMaskPos; i++) {\r\n if (tests[i] && buffer[i] === getPlaceholder(i)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n var getPlaceholder = function getPlaceholder(i) {\r\n if (i < options.slotChar.length) {\r\n return options.slotChar.charAt(i);\r\n }\r\n return options.slotChar.charAt(0);\r\n };\r\n var getValue = function getValue() {\r\n return options.unmask ? getUnmaskedValue() : el && el.value;\r\n };\r\n var seekNext = function seekNext(pos) {\r\n while (++pos < len && !tests[pos]) {\r\n }\r\n return pos;\r\n };\r\n var seekPrev = function seekPrev(pos) {\r\n while (--pos >= 0 && !tests[pos]) {\r\n }\r\n return pos;\r\n };\r\n var shiftL = function shiftL(begin, end) {\r\n var i, j;\r\n if (begin < 0) {\r\n return;\r\n }\r\n for (i = begin, j = seekNext(end); i < len; i++) {\r\n if (tests[i]) {\r\n if (j < len && tests[i].test(buffer[j])) {\r\n buffer[i] = buffer[j];\r\n buffer[j] = getPlaceholder(j);\r\n } else {\r\n break;\r\n }\r\n j = seekNext(j);\r\n }\r\n }\r\n writeBuffer();\r\n caret(Math.max(firstNonMaskPos, begin));\r\n };\r\n var shiftR = function shiftR(pos) {\r\n var i, c, j, t;\r\n for (i = pos, c = getPlaceholder(pos); i < len; i++) {\r\n if (tests[i]) {\r\n j = seekNext(i);\r\n t = buffer[i];\r\n buffer[i] = c;\r\n if (j < len && tests[j].test(t)) {\r\n c = t;\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n var handleAndroidInput = function handleAndroidInput(e) {\r\n var curVal = el.value;\r\n var pos = caret();\r\n if (oldVal && oldVal.length && oldVal.length > curVal.length) {\r\n // a deletion or backspace happened\r\n checkVal(true);\r\n while (pos.begin > 0 && !tests[pos.begin - 1]) {\r\n pos.begin--;\r\n }\r\n if (pos.begin === 0) {\r\n while (pos.begin < firstNonMaskPos && !tests[pos.begin]) {\r\n pos.begin++;\r\n }\r\n }\r\n caret(pos.begin, pos.begin);\r\n } else {\r\n checkVal(true);\r\n while (pos.begin < len && !tests[pos.begin]) {\r\n pos.begin++;\r\n }\r\n caret(pos.begin, pos.begin);\r\n }\r\n if (options.onComplete && isCompleted()) {\r\n options.onComplete({\r\n originalEvent: e,\r\n value: getValue()\r\n });\r\n }\r\n };\r\n var onBlur = function onBlur(e) {\r\n checkVal();\r\n updateModel(e);\r\n if (options.onBlur) {\r\n options.onBlur(e);\r\n }\r\n if (el.value !== focusText) {\r\n var event = document.createEvent('HTMLEvents');\r\n event.initEvent('change', true, false);\r\n el.dispatchEvent(event);\r\n }\r\n };\r\n var onKeyDown = function onKeyDown(e) {\r\n if (options.readOnly) {\r\n return;\r\n }\r\n var k = e.which || e.keyCode,\r\n pos,\r\n begin,\r\n end;\r\n var iPhone = /iphone/i.test(DomHandler.getUserAgent());\r\n oldVal = el.value; //backspace, delete, and escape get special treatment\r\n if (k === 8 || k === 46 || iPhone && k === 127) {\r\n pos = caret();\r\n begin = pos.begin;\r\n end = pos.end;\r\n if (end - begin === 0) {\r\n begin = k !== 46 ? seekPrev(begin) : end = seekNext(begin - 1);\r\n end = k === 46 ? seekNext(end) : end;\r\n }\r\n clearBuffer(begin, end);\r\n shiftL(begin, end - 1);\r\n updateModel(e);\r\n e.preventDefault();\r\n } else if (k === 13) {\r\n // enter\r\n onBlur(e);\r\n updateModel(e);\r\n } else if (k === 27) {\r\n // escape\r\n el.value = focusText;\r\n caret(0, checkVal());\r\n updateModel(e);\r\n e.preventDefault();\r\n }\r\n };\r\n var onKeyPress = function onKeyPress(e) {\r\n if (options.readOnly) {\r\n return;\r\n }\r\n var k = e.which || e.keyCode,\r\n pos = caret(),\r\n p,\r\n c,\r\n next,\r\n completed;\r\n if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {\r\n //Ignore\r\n return;\r\n } else if (k && k !== 13) {\r\n if (pos.end - pos.begin !== 0) {\r\n clearBuffer(pos.begin, pos.end);\r\n shiftL(pos.begin, pos.end - 1);\r\n }\r\n p = seekNext(pos.begin - 1);\r\n if (p < len) {\r\n c = String.fromCharCode(k);\r\n if (tests[p].test(c)) {\r\n shiftR(p);\r\n buffer[p] = c;\r\n writeBuffer();\r\n next = seekNext(p);\r\n if (/android/i.test(DomHandler.getUserAgent())) {\r\n //Path for CSP Violation on FireFox OS 1.1\r\n var proxy = function proxy() {\r\n caret(next);\r\n };\r\n setTimeout(proxy, 0);\r\n } else {\r\n caret(next);\r\n }\r\n if (pos.begin <= lastRequiredNonMaskPos) {\r\n completed = isCompleted();\r\n }\r\n }\r\n }\r\n e.preventDefault();\r\n }\r\n updateModel(e);\r\n if (options.onComplete && completed) {\r\n options.onComplete({\r\n originalEvent: e,\r\n value: getValue()\r\n });\r\n }\r\n };\r\n var clearBuffer = function clearBuffer(start, end) {\r\n var i;\r\n for (i = start; i < end && i < len; i++) {\r\n if (tests[i]) {\r\n buffer[i] = getPlaceholder(i);\r\n }\r\n }\r\n };\r\n var writeBuffer = function writeBuffer() {\r\n el.value = buffer.join('');\r\n };\r\n var checkVal = function checkVal(allow) {\r\n //try to place characters where they belong\r\n var test = el.value,\r\n lastMatch = -1,\r\n i,\r\n c,\r\n pos;\r\n for (i = 0, pos = 0; i < len; i++) {\r\n if (tests[i]) {\r\n buffer[i] = getPlaceholder(i);\r\n while (pos++ < test.length) {\r\n c = test.charAt(pos - 1);\r\n if (tests[i].test(c)) {\r\n buffer[i] = c;\r\n lastMatch = i;\r\n break;\r\n }\r\n }\r\n if (pos > test.length) {\r\n clearBuffer(i + 1, len);\r\n break;\r\n }\r\n } else {\r\n if (buffer[i] === test.charAt(pos)) {\r\n pos++;\r\n }\r\n if (i < partialPosition) {\r\n lastMatch = i;\r\n }\r\n }\r\n }\r\n if (allow) {\r\n writeBuffer();\r\n } else if (lastMatch + 1 < partialPosition) {\r\n if (options.autoClear || buffer.join('') === defaultBuffer) {\r\n // Invalid value. Remove it and replace it with the\r\n // mask, which is the default behavior.\r\n if (el.value) el.value = '';\r\n clearBuffer(0, len);\r\n } else {\r\n // Invalid value, but we opt to show the value to the\r\n // user and allow them to correct their mistake.\r\n writeBuffer();\r\n }\r\n } else {\r\n writeBuffer();\r\n el.value = el.value.substring(0, lastMatch + 1);\r\n }\r\n return partialPosition ? i : firstNonMaskPos;\r\n };\r\n var onFocus = function onFocus(e) {\r\n if (options.readOnly) {\r\n return;\r\n }\r\n clearTimeout(caretTimeoutId);\r\n var pos;\r\n focusText = el.value;\r\n pos = checkVal();\r\n caretTimeoutId = setTimeout(function () {\r\n if (el !== document.activeElement) {\r\n return;\r\n }\r\n writeBuffer();\r\n if (pos === options.mask.replace(\"?\", \"\").length) {\r\n caret(0, pos);\r\n } else {\r\n caret(pos);\r\n }\r\n }, 10);\r\n if (options.onFocus) {\r\n options.onFocus(e);\r\n }\r\n };\r\n var onInput = function onInput(event) {\r\n if (androidChrome) handleAndroidInput(event);else handleInputChange(event);\r\n };\r\n var handleInputChange = function handleInputChange(e) {\r\n if (options.readOnly) {\r\n return;\r\n }\r\n var pos = checkVal(true);\r\n caret(pos);\r\n updateModel(e);\r\n if (options.onComplete && isCompleted()) {\r\n options.onComplete({\r\n originalEvent: e,\r\n value: getValue()\r\n });\r\n }\r\n };\r\n var getUnmaskedValue = function getUnmaskedValue() {\r\n var unmaskedBuffer = [];\r\n for (var i = 0; i < buffer.length; i++) {\r\n var c = buffer[i];\r\n if (tests[i] && c !== getPlaceholder(i)) {\r\n unmaskedBuffer.push(c);\r\n }\r\n }\r\n return unmaskedBuffer.join('');\r\n };\r\n var updateModel = function updateModel(e) {\r\n if (options.onChange) {\r\n var val = getValue().replace(options.slotChar, '');\r\n options.onChange({\r\n originalEvent: e,\r\n value: defaultBuffer !== val ? val : ''\r\n });\r\n }\r\n };\r\n var bindEvents = function bindEvents() {\r\n el.addEventListener('focus', onFocus);\r\n el.addEventListener('blur', onBlur);\r\n el.addEventListener('keydown', onKeyDown);\r\n el.addEventListener('keypress', onKeyPress);\r\n el.addEventListener('input', onInput);\r\n el.addEventListener('paste', handleInputChange);\r\n };\r\n var unbindEvents = function unbindEvents() {\r\n el.removeEventListener('focus', onFocus);\r\n el.removeEventListener('blur', onBlur);\r\n el.removeEventListener('keydown', onKeyDown);\r\n el.removeEventListener('keypress', onKeyPress);\r\n el.removeEventListener('input', onInput);\r\n el.removeEventListener('paste', handleInputChange);\r\n };\r\n var init = function init() {\r\n tests = [];\r\n partialPosition = options.mask.length;\r\n len = options.mask.length;\r\n firstNonMaskPos = null;\r\n defs = {\r\n '9': '[0-9]',\r\n 'a': '[A-Za-z]',\r\n '*': '[A-Za-z0-9]'\r\n };\r\n var ua = DomHandler.getUserAgent();\r\n androidChrome = /chrome/i.test(ua) && /android/i.test(ua);\r\n var maskTokens = options.mask.split('');\r\n for (var i = 0; i < maskTokens.length; i++) {\r\n var c = maskTokens[i];\r\n if (c === '?') {\r\n len--;\r\n partialPosition = i;\r\n } else if (defs[c]) {\r\n tests.push(new RegExp(defs[c]));\r\n if (firstNonMaskPos === null) {\r\n firstNonMaskPos = tests.length - 1;\r\n }\r\n if (i < partialPosition) {\r\n lastRequiredNonMaskPos = tests.length - 1;\r\n }\r\n } else {\r\n tests.push(null);\r\n }\r\n }\r\n buffer = [];\r\n for (var _i = 0; _i < maskTokens.length; _i++) {\r\n var _c = maskTokens[_i];\r\n if (_c !== '?') {\r\n if (defs[_c]) buffer.push(getPlaceholder(_i));else buffer.push(_c);\r\n }\r\n }\r\n defaultBuffer = buffer.join('');\r\n };\r\n if (el && options.mask) {\r\n init();\r\n bindEvents();\r\n }\r\n return {\r\n init: init,\r\n bindEvents: bindEvents,\r\n unbindEvents: unbindEvents,\r\n updateModel: updateModel,\r\n getValue: getValue\r\n };\r\n}\r\nvar ObjectUtils = /*#__PURE__*/function () {\r\n function ObjectUtils() {\r\n _classCallCheck(this, ObjectUtils);\r\n }\r\n _createClass(ObjectUtils, null, [{\r\n key: \"equals\",\r\n value: function equals(obj1, obj2, field) {\r\n if (field && obj1 && _typeof(obj1) === 'object' && obj2 && _typeof(obj2) === 'object') return this.resolveFieldData(obj1, field) === this.resolveFieldData(obj2, field);else return this.deepEquals(obj1, obj2);\r\n }\r\n }, {\r\n key: \"deepEquals\",\r\n value: function deepEquals(a, b) {\r\n if (a === b) return true;\r\n if (a && b && _typeof(a) == 'object' && _typeof(b) == 'object') {\r\n var arrA = Array.isArray(a),\r\n arrB = Array.isArray(b),\r\n i,\r\n length,\r\n key;\r\n if (arrA && arrB) {\r\n length = a.length;\r\n if (length !== b.length) return false;\r\n for (i = length; i-- !== 0;) {\r\n if (!this.deepEquals(a[i], b[i])) return false;\r\n }\r\n return true;\r\n }\r\n if (arrA !== arrB) return false;\r\n var dateA = a instanceof Date,\r\n dateB = b instanceof Date;\r\n if (dateA !== dateB) return false;\r\n if (dateA && dateB) return a.getTime() === b.getTime();\r\n var regexpA = a instanceof RegExp,\r\n regexpB = b instanceof RegExp;\r\n if (regexpA !== regexpB) return false;\r\n if (regexpA && regexpB) return a.toString() === b.toString();\r\n var keys = Object.keys(a);\r\n length = keys.length;\r\n if (length !== Object.keys(b).length) return false;\r\n for (i = length; i-- !== 0;) {\r\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\r\n }\r\n for (i = length; i-- !== 0;) {\r\n key = keys[i];\r\n if (!this.deepEquals(a[key], b[key])) return false;\r\n }\r\n return true;\r\n }\r\n /*eslint no-self-compare: \"off\"*/\r\n return a !== a && b !== b;\r\n }\r\n }, {\r\n key: \"resolveFieldData\",\r\n value: function resolveFieldData(data, field) {\r\n if (data && Object.keys(data).length && field) {\r\n if (this.isFunction(field)) {\r\n return field(data);\r\n } else if (field.indexOf('.') === -1) {\r\n return data[field];\r\n } else {\r\n var fields = field.split('.');\r\n var value = data;\r\n for (var i = 0, len = fields.length; i < len; ++i) {\r\n if (value == null) {\r\n return null;\r\n }\r\n value = value[fields[i]];\r\n }\r\n return value;\r\n }\r\n } else {\r\n return null;\r\n }\r\n }\r\n }, {\r\n key: \"isFunction\",\r\n value: function isFunction(obj) {\r\n return !!(obj && obj.constructor && obj.call && obj.apply);\r\n }\r\n }, {\r\n key: \"findDiffKeys\",\r\n value: function findDiffKeys(obj1, obj2) {\r\n if (!obj1 || !obj2) {\r\n return {};\r\n }\r\n return Object.keys(obj1).filter(function (key) {\r\n return !obj2.hasOwnProperty(key);\r\n }).reduce(function (result, current) {\r\n result[current] = obj1[current];\r\n return result;\r\n }, {});\r\n }\r\n }, {\r\n key: \"reorderArray\",\r\n value: function reorderArray(value, from, to) {\r\n var target;\r\n if (value && from !== to) {\r\n if (to >= value.length) {\r\n target = to - value.length;\r\n while (target-- + 1) {\r\n value.push(undefined);\r\n }\r\n }\r\n value.splice(to, 0, value.splice(from, 1)[0]);\r\n }\r\n }\r\n }, {\r\n key: \"findIndexInList\",\r\n value: function findIndexInList(value, list, dataKey) {\r\n var _this = this;\r\n if (list) {\r\n return dataKey ? list.findIndex(function (item) {\r\n return _this.equals(item, value, dataKey);\r\n }) : list.findIndex(function (item) {\r\n return item === value;\r\n });\r\n }\r\n return -1;\r\n }\r\n }, {\r\n key: \"getJSXElement\",\r\n value: function getJSXElement(obj) {\r\n for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\r\n params[_key - 1] = arguments[_key];\r\n }\r\n return this.isFunction(obj) ? obj.apply(void 0, params) : obj;\r\n }\r\n }, {\r\n key: \"getPropValue\",\r\n value: function getPropValue(obj) {\r\n for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\r\n params[_key2 - 1] = arguments[_key2];\r\n }\r\n return this.isFunction(obj) ? obj.apply(void 0, params) : obj;\r\n }\r\n }, {\r\n key: \"getRefElement\",\r\n value: function getRefElement(ref) {\r\n if (ref) {\r\n return _typeof(ref) === 'object' && ref.hasOwnProperty('current') ? ref.current : ref;\r\n }\r\n return null;\r\n }\r\n }, {\r\n key: \"combinedRefs\",\r\n value: function combinedRefs(innerRef, forwardRef) {\r\n if (innerRef && forwardRef) {\r\n if (typeof forwardRef === 'function') {\r\n forwardRef(innerRef.current);\r\n } else {\r\n forwardRef.current = innerRef.current;\r\n }\r\n }\r\n }\r\n }, {\r\n key: \"removeAccents\",\r\n value: function removeAccents(str) {\r\n if (str && str.search(/[\\xC0-\\xFF]/g) > -1) {\r\n str = str.replace(/[\\xC0-\\xC5]/g, \"A\").replace(/[\\xC6]/g, \"AE\").replace(/[\\xC7]/g, \"C\").replace(/[\\xC8-\\xCB]/g, \"E\").replace(/[\\xCC-\\xCF]/g, \"I\").replace(/[\\xD0]/g, \"D\").replace(/[\\xD1]/g, \"N\").replace(/[\\xD2-\\xD6\\xD8]/g, \"O\").replace(/[\\xD9-\\xDC]/g, \"U\").replace(/[\\xDD]/g, \"Y\").replace(/[\\xDE]/g, \"P\").replace(/[\\xE0-\\xE5]/g, \"a\").replace(/[\\xE6]/g, \"ae\").replace(/[\\xE7]/g, \"c\").replace(/[\\xE8-\\xEB]/g, \"e\").replace(/[\\xEC-\\xEF]/g, \"i\").replace(/[\\xF1]/g, \"n\").replace(/[\\xF2-\\xF6\\xF8]/g, \"o\").replace(/[\\xF9-\\xFC]/g, \"u\").replace(/[\\xFE]/g, \"p\").replace(/[\\xFD\\xFF]/g, \"y\");\r\n }\r\n return str;\r\n }\r\n }, {\r\n key: \"isEmpty\",\r\n value: function isEmpty(value) {\r\n return value === null || value === undefined || value === '' || Array.isArray(value) && value.length === 0 || !(value instanceof Date) && _typeof(value) === 'object' && Object.keys(value).length === 0;\r\n }\r\n }, {\r\n key: \"isNotEmpty\",\r\n value: function isNotEmpty(value) {\r\n return !this.isEmpty(value);\r\n }\r\n }, {\r\n key: \"sort\",\r\n value: function sort(value1, value2) {\r\n var order = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\r\n var locale = arguments.length > 3 ? arguments[3] : undefined;\r\n var result = null;\r\n if (value1 == null && value2 != null) result = -1;else if (value1 != null && value2 == null) result = 1;else if (value1 == null && value2 == null) result = 0;else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2, locale, {\r\n numeric: true\r\n });else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;\r\n return order * result;\r\n }\r\n }]);\r\n return ObjectUtils;\r\n}();\r\nfunction _extends() {\r\n _extends = Object.assign || function (target) {\r\n for (var i = 1; i < arguments.length; i++) {\r\n var source = arguments[i];\r\n for (var key in source) {\r\n if (Object.prototype.hasOwnProperty.call(source, key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n };\r\n return _extends.apply(this, arguments);\r\n}\r\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\r\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\r\nvar IconUtils = /*#__PURE__*/function () {\r\n function IconUtils() {\r\n _classCallCheck(this, IconUtils);\r\n }\r\n _createClass(IconUtils, null, [{\r\n key: \"getJSXIcon\",\r\n value: function getJSXIcon(icon) {\r\n var iconProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\r\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\r\n var content = null;\r\n if (icon !== null) {\r\n var iconType = _typeof(icon);\r\n var className = classNames(iconProps.className, iconType === 'string' && icon);\r\n content = /*#__PURE__*/React.createElement(\"span\", _extends({}, iconProps, {\r\n className: className\r\n }));\r\n if (iconType !== 'string') {\r\n var defaultContentOptions = _objectSpread({\r\n iconProps: iconProps,\r\n element: content\r\n }, options);\r\n return ObjectUtils.getJSXElement(icon, defaultContentOptions);\r\n }\r\n }\r\n return content;\r\n }\r\n }]);\r\n return IconUtils;\r\n}();\r\nvar lastId = 0;\r\nfunction UniqueComponentId() {\r\n var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pr_id_';\r\n lastId++;\r\n return \"\".concat(prefix).concat(lastId);\r\n}\r\nfunction _arrayWithoutHoles(arr) {\r\n if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);\r\n}\r\nfunction _iterableToArray(iter) {\r\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\r\n}\r\nfunction _nonIterableSpread() {\r\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\r\n}\r\nfunction _toConsumableArray(arr) {\r\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();\r\n}\r\nfunction handler() {\r\n var zIndexes = [];\r\n var generateZIndex = function generateZIndex(key, autoZIndex) {\r\n var baseZIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 999;\r\n var lastZIndex = getLastZIndex(key, autoZIndex, baseZIndex);\r\n var newZIndex = lastZIndex.value + (lastZIndex.key === key ? 0 : baseZIndex) + 1;\r\n zIndexes.push({\r\n key: key,\r\n value: newZIndex\r\n });\r\n return newZIndex;\r\n };\r\n var revertZIndex = function revertZIndex(zIndex) {\r\n zIndexes = zIndexes.filter(function (obj) {\r\n return obj.value !== zIndex;\r\n });\r\n };\r\n var getCurrentZIndex = function getCurrentZIndex(key, autoZIndex) {\r\n return getLastZIndex(key, autoZIndex).value;\r\n };\r\n var getLastZIndex = function getLastZIndex(key, autoZIndex) {\r\n var baseZIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\r\n return _toConsumableArray(zIndexes).reverse().find(function (obj) {\r\n return autoZIndex ? true : obj.key === key;\r\n }) || {\r\n key: key,\r\n value: baseZIndex\r\n };\r\n };\r\n var getZIndex = function getZIndex(el) {\r\n return el ? parseInt(el.style.zIndex, 10) || 0 : 0;\r\n };\r\n return {\r\n get: getZIndex,\r\n set: function set(key, el, autoZIndex, baseZIndex) {\r\n if (el) {\r\n el.style.zIndex = String(generateZIndex(key, autoZIndex, baseZIndex));\r\n }\r\n },\r\n clear: function clear(el) {\r\n if (el) {\r\n revertZIndex(ZIndexUtils.get(el));\r\n el.style.zIndex = '';\r\n }\r\n },\r\n getCurrent: function getCurrent(key, autoZIndex) {\r\n return getCurrentZIndex(key, autoZIndex);\r\n }\r\n };\r\n}\r\nvar ZIndexUtils = handler();\r\nexport { ConnectedOverlayScrollHandler, DomHandler, EventBus, IconUtils, ObjectUtils, UniqueComponentId, ZIndexUtils, classNames, mask };\r\n","// shim for using process in browser\r\nvar process = module.exports = {};\r\n// cached from whatever global is present so that test runners that stub it\r\n// don't break things. But we need to wrap it in a try catch in case it is\r\n// wrapped in strict mode code which doesn't define any globals. It's inside a\r\n// function because try/catches deoptimize in certain engines.\r\nvar cachedSetTimeout;\r\nvar cachedClearTimeout;\r\nfunction defaultSetTimout() {\r\n throw new Error('setTimeout has not been defined');\r\n}\r\nfunction defaultClearTimeout () {\r\n throw new Error('clearTimeout has not been defined');\r\n}\r\n(function () {\r\n try {\r\n if (typeof setTimeout === 'function') {\r\n cachedSetTimeout = setTimeout;\r\n } else {\r\n cachedSetTimeout = defaultSetTimout;\r\n }\r\n } catch (e) {\r\n cachedSetTimeout = defaultSetTimout;\r\n }\r\n try {\r\n if (typeof clearTimeout === 'function') {\r\n cachedClearTimeout = clearTimeout;\r\n } else {\r\n cachedClearTimeout = defaultClearTimeout;\r\n }\r\n } catch (e) {\r\n cachedClearTimeout = defaultClearTimeout;\r\n }\r\n} ())\r\nfunction runTimeout(fun) {\r\n if (cachedSetTimeout === setTimeout) {\r\n //normal enviroments in sane situations\r\n return setTimeout(fun, 0);\r\n }\r\n // if setTimeout wasn't available but was latter defined\r\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\r\n cachedSetTimeout = setTimeout;\r\n return setTimeout(fun, 0);\r\n }\r\n try {\r\n // when when somebody has screwed with setTimeout but no I.E. maddness\r\n return cachedSetTimeout(fun, 0);\r\n } catch(e){\r\n try {\r\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\r\n return cachedSetTimeout.call(null, fun, 0);\r\n } catch(e){\r\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\r\n return cachedSetTimeout.call(this, fun, 0);\r\n }\r\n }\r\n}\r\nfunction runClearTimeout(marker) {\r\n if (cachedClearTimeout === clearTimeout) {\r\n //normal enviroments in sane situations\r\n return clearTimeout(marker);\r\n }\r\n // if clearTimeout wasn't available but was latter defined\r\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\r\n cachedClearTimeout = clearTimeout;\r\n return clearTimeout(marker);\r\n }\r\n try {\r\n // when when somebody has screwed with setTimeout but no I.E. maddness\r\n return cachedClearTimeout(marker);\r\n } catch (e){\r\n try {\r\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\r\n return cachedClearTimeout.call(null, marker);\r\n } catch (e){\r\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\r\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\r\n return cachedClearTimeout.call(this, marker);\r\n }\r\n }\r\n}\r\nvar queue = [];\r\nvar draining = false;\r\nvar currentQueue;\r\nvar queueIndex = -1;\r\nfunction cleanUpNextTick() {\r\n if (!draining || !currentQueue) {\r\n return;\r\n }\r\n draining = false;\r\n if (currentQueue.length) {\r\n queue = currentQueue.concat(queue);\r\n } else {\r\n queueIndex = -1;\r\n }\r\n if (queue.length) {\r\n drainQueue();\r\n }\r\n}\r\nfunction drainQueue() {\r\n if (draining) {\r\n return;\r\n }\r\n var timeout = runTimeout(cleanUpNextTick);\r\n draining = true;\r\n var len = queue.length;\r\n while(len) {\r\n currentQueue = queue;\r\n queue = [];\r\n while (++queueIndex < len) {\r\n if (currentQueue) {\r\n currentQueue[queueIndex].run();\r\n }\r\n }\r\n queueIndex = -1;\r\n len = queue.length;\r\n }\r\n currentQueue = null;\r\n draining = false;\r\n runClearTimeout(timeout);\r\n}\r\nprocess.nextTick = function (fun) {\r\n var args = new Array(arguments.length - 1);\r\n if (arguments.length > 1) {\r\n for (var i = 1; i < arguments.length; i++) {\r\n args[i - 1] = arguments[i];\r\n }\r\n }\r\n queue.push(new Item(fun, args));\r\n if (queue.length === 1 && !draining) {\r\n runTimeout(drainQueue);\r\n }\r\n};\r\n// v8 likes predictible objects\r\nfunction Item(fun, array) {\r\n this.fun = fun;\r\n this.array = array;\r\n}\r\nItem.prototype.run = function () {\r\n this.fun.apply(null, this.array);\r\n};\r\nprocess.title = 'browser';\r\nprocess.browser = true;\r\nprocess.env = {};\r\nprocess.argv = [];\r\nprocess.version = ''; // empty string to avoid regexp issues\r\nprocess.versions = {};\r\nfunction noop() {}\r\nprocess.on = noop;\r\nprocess.addListener = noop;\r\nprocess.once = noop;\r\nprocess.off = noop;\r\nprocess.removeListener = noop;\r\nprocess.removeAllListeners = noop;\r\nprocess.emit = noop;\r\nprocess.prependListener = noop;\r\nprocess.prependOnceListener = noop;\r\nprocess.listeners = function (name) { return [] }\r\nprocess.binding = function (name) {\r\n throw new Error('process.binding is not supported');\r\n};\r\nprocess.cwd = function () { return '/' };\r\nprocess.chdir = function (dir) {\r\n throw new Error('process.chdir is not supported');\r\n};\r\nprocess.umask = function() { return 0; };\r\n","/**\r\n * Copyright (c) 2013-present, Facebook, Inc.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n */\r\n'use strict';\r\nvar printWarning = function() {};\r\nif (process.env.NODE_ENV !== 'production') {\r\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\r\n var loggedTypeFailures = {};\r\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\r\n printWarning = function(text) {\r\n var message = 'Warning: ' + text;\r\n if (typeof console !== 'undefined') {\r\n console.error(message);\r\n }\r\n try {\r\n // --- Welcome to debugging React ---\r\n // This error was thrown as a convenience so that you can use this stack\r\n // to find the callsite that caused this warning to fire.\r\n throw new Error(message);\r\n } catch (x) {}\r\n };\r\n}\r\n/**\r\n * Assert that the values match with the type specs.\r\n * Error messages are memorized and will only be shown once.\r\n *\r\n * @param {object} typeSpecs Map of name to a ReactPropType\r\n * @param {object} values Runtime values that need to be type-checked\r\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\r\n * @param {string} componentName Name of the component for error messages.\r\n * @param {?Function} getStack Returns the component stack.\r\n * @private\r\n */\r\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n for (var typeSpecName in typeSpecs) {\r\n if (has(typeSpecs, typeSpecName)) {\r\n var error;\r\n // Prop type validation may throw. In case they do, we don't want to\r\n // fail the render phase where it didn't fail before. So we log it.\r\n // After these have been cleaned up, we'll let them throw.\r\n try {\r\n // This is intentionally an invariant that gets caught. It's the same\r\n // behavior as without this statement except with a better message.\r\n if (typeof typeSpecs[typeSpecName] !== 'function') {\r\n var err = Error(\r\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\r\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'\r\n );\r\n err.name = 'Invariant Violation';\r\n throw err;\r\n }\r\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\r\n } catch (ex) {\r\n error = ex;\r\n }\r\n if (error && !(error instanceof Error)) {\r\n printWarning(\r\n (componentName || 'React class') + ': type specification of ' +\r\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\r\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\r\n 'You may have forgotten to pass an argument to the type checker ' +\r\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\r\n 'shape all require an argument).'\r\n );\r\n }\r\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\r\n // Only monitor this failure once because there tends to be a lot of the\r\n // same error.\r\n loggedTypeFailures[error.message] = true;\r\n var stack = getStack ? getStack() : '';\r\n printWarning(\r\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\r\n );\r\n }\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Resets warning cache when testing.\r\n *\r\n * @private\r\n */\r\ncheckPropTypes.resetWarningCache = function() {\r\n if (process.env.NODE_ENV !== 'production') {\r\n loggedTypeFailures = {};\r\n }\r\n}\r\nmodule.exports = checkPropTypes;\r\n","/**\r\n * Copyright (c) 2013-present, Facebook, Inc.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n */\r\n'use strict';\r\nvar ReactIs = require('react-is');\r\nvar assign = require('object-assign');\r\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\r\nvar checkPropTypes = require('./checkPropTypes');\r\nvar has = Function.call.bind(Object.prototype.hasOwnProperty);\r\nvar printWarning = function() {};\r\nif (process.env.NODE_ENV !== 'production') {\r\n printWarning = function(text) {\r\n var message = 'Warning: ' + text;\r\n if (typeof console !== 'undefined') {\r\n console.error(message);\r\n }\r\n try {\r\n // --- Welcome to debugging React ---\r\n // This error was thrown as a convenience so that you can use this stack\r\n // to find the callsite that caused this warning to fire.\r\n throw new Error(message);\r\n } catch (x) {}\r\n };\r\n}\r\nfunction emptyFunctionThatReturnsNull() {\r\n return null;\r\n}\r\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\r\n /* global Symbol */\r\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\r\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\r\n /**\r\n * Returns the iterator method function contained on the iterable object.\r\n *\r\n * Be sure to invoke the function with the iterable as context:\r\n *\r\n * var iteratorFn = getIteratorFn(myIterable);\r\n * if (iteratorFn) {\r\n * var iterator = iteratorFn.call(myIterable);\r\n * ...\r\n * }\r\n *\r\n * @param {?object} maybeIterable\r\n * @return {?function}\r\n */\r\n function getIteratorFn(maybeIterable) {\r\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\r\n if (typeof iteratorFn === 'function') {\r\n return iteratorFn;\r\n }\r\n }\r\n /**\r\n * Collection of methods that allow declaration and validation of props that are\r\n * supplied to React components. Example usage:\r\n *\r\n * var Props = require('ReactPropTypes');\r\n * var MyArticle = React.createClass({\r\n * propTypes: {\r\n * // An optional string prop named \"description\".\r\n * description: Props.string,\r\n *\r\n * // A required enum prop named \"category\".\r\n * category: Props.oneOf(['News','Photos']).isRequired,\r\n *\r\n * // A prop named \"dialog\" that requires an instance of Dialog.\r\n * dialog: Props.instanceOf(Dialog).isRequired\r\n * },\r\n * render: function() { ... }\r\n * });\r\n *\r\n * A more formal specification of how these methods are used:\r\n *\r\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\r\n * decl := ReactPropTypes.{type}(.isRequired)?\r\n *\r\n * Each and every declaration produces a function with the same signature. This\r\n * allows the creation of custom validation functions. For example:\r\n *\r\n * var MyLink = React.createClass({\r\n * propTypes: {\r\n * // An optional string or URI prop named \"href\".\r\n * href: function(props, propName, componentName) {\r\n * var propValue = props[propName];\r\n * if (propValue != null && typeof propValue !== 'string' &&\r\n * !(propValue instanceof URI)) {\r\n * return new Error(\r\n * 'Expected a string or an URI for ' + propName + ' in ' +\r\n * componentName\r\n * );\r\n * }\r\n * }\r\n * },\r\n * render: function() {...}\r\n * });\r\n *\r\n * @internal\r\n */\r\n var ANONYMOUS = '<>';\r\n // Important!\r\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\r\n var ReactPropTypes = {\r\n array: createPrimitiveTypeChecker('array'),\r\n bool: createPrimitiveTypeChecker('boolean'),\r\n func: createPrimitiveTypeChecker('function'),\r\n number: createPrimitiveTypeChecker('number'),\r\n object: createPrimitiveTypeChecker('object'),\r\n string: createPrimitiveTypeChecker('string'),\r\n symbol: createPrimitiveTypeChecker('symbol'),\r\n any: createAnyTypeChecker(),\r\n arrayOf: createArrayOfTypeChecker,\r\n element: createElementTypeChecker(),\r\n elementType: createElementTypeTypeChecker(),\r\n instanceOf: createInstanceTypeChecker,\r\n node: createNodeChecker(),\r\n objectOf: createObjectOfTypeChecker,\r\n oneOf: createEnumTypeChecker,\r\n oneOfType: createUnionTypeChecker,\r\n shape: createShapeTypeChecker,\r\n exact: createStrictShapeTypeChecker,\r\n };\r\n /**\r\n * inlined Object.is polyfill to avoid requiring consumers ship their own\r\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\r\n */\r\n /*eslint-disable no-self-compare*/\r\n function is(x, y) {\r\n // SameValue algorithm\r\n if (x === y) {\r\n // Steps 1-5, 7-10\r\n // Steps 6.b-6.e: +0 != -0\r\n return x !== 0 || 1 / x === 1 / y;\r\n } else {\r\n // Step 6.a: NaN == NaN\r\n return x !== x && y !== y;\r\n }\r\n }\r\n /*eslint-enable no-self-compare*/\r\n /**\r\n * We use an Error-like object for backward compatibility as people may call\r\n * PropTypes directly and inspect their output. However, we don't use real\r\n * Errors anymore. We don't inspect their stack anyway, and creating them\r\n * is prohibitively expensive if they are created too often, such as what\r\n * happens in oneOfType() for any type before the one that matched.\r\n */\r\n function PropTypeError(message) {\r\n this.message = message;\r\n this.stack = '';\r\n }\r\n // Make `instanceof Error` still work for returned errors.\r\n PropTypeError.prototype = Error.prototype;\r\n function createChainableTypeChecker(validate) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n var manualPropTypeCallCache = {};\r\n var manualPropTypeWarningCount = 0;\r\n }\r\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\r\n componentName = componentName || ANONYMOUS;\r\n propFullName = propFullName || propName;\r\n if (secret !== ReactPropTypesSecret) {\r\n if (throwOnDirectAccess) {\r\n // New behavior only for users of `prop-types` package\r\n var err = new Error(\r\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\r\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\r\n 'Read more at http://fb.me/use-check-prop-types'\r\n );\r\n err.name = 'Invariant Violation';\r\n throw err;\r\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\r\n // Old behavior for people using React.PropTypes\r\n var cacheKey = componentName + ':' + propName;\r\n if (\r\n !manualPropTypeCallCache[cacheKey] &&\r\n // Avoid spamming the console because they are often not actionable except for lib authors\r\n manualPropTypeWarningCount < 3\r\n ) {\r\n printWarning(\r\n 'You are manually calling a React.PropTypes validation ' +\r\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\r\n 'and will throw in the standalone `prop-types` package. ' +\r\n 'You may be seeing this warning due to a third-party PropTypes ' +\r\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\r\n );\r\n manualPropTypeCallCache[cacheKey] = true;\r\n manualPropTypeWarningCount++;\r\n }\r\n }\r\n }\r\n if (props[propName] == null) {\r\n if (isRequired) {\r\n if (props[propName] === null) {\r\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\r\n }\r\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\r\n }\r\n return null;\r\n } else {\r\n return validate(props, propName, componentName, location, propFullName);\r\n }\r\n }\r\n var chainedCheckType = checkType.bind(null, false);\r\n chainedCheckType.isRequired = checkType.bind(null, true);\r\n return chainedCheckType;\r\n }\r\n function createPrimitiveTypeChecker(expectedType) {\r\n function validate(props, propName, componentName, location, propFullName, secret) {\r\n var propValue = props[propName];\r\n var propType = getPropType(propValue);\r\n if (propType !== expectedType) {\r\n // `propValue` being instance of, say, date/regexp, pass the 'object'\r\n // check, but we can offer a more precise error message here rather than\r\n // 'of type `object`'.\r\n var preciseType = getPreciseType(propValue);\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\r\n }\r\n return null;\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function createAnyTypeChecker() {\r\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\r\n }\r\n function createArrayOfTypeChecker(typeChecker) {\r\n function validate(props, propName, componentName, location, propFullName) {\r\n if (typeof typeChecker !== 'function') {\r\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\r\n }\r\n var propValue = props[propName];\r\n if (!Array.isArray(propValue)) {\r\n var propType = getPropType(propValue);\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\r\n }\r\n for (var i = 0; i < propValue.length; i++) {\r\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\r\n if (error instanceof Error) {\r\n return error;\r\n }\r\n }\r\n return null;\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function createElementTypeChecker() {\r\n function validate(props, propName, componentName, location, propFullName) {\r\n var propValue = props[propName];\r\n if (!isValidElement(propValue)) {\r\n var propType = getPropType(propValue);\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\r\n }\r\n return null;\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function createElementTypeTypeChecker() {\r\n function validate(props, propName, componentName, location, propFullName) {\r\n var propValue = props[propName];\r\n if (!ReactIs.isValidElementType(propValue)) {\r\n var propType = getPropType(propValue);\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\r\n }\r\n return null;\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function createInstanceTypeChecker(expectedClass) {\r\n function validate(props, propName, componentName, location, propFullName) {\r\n if (!(props[propName] instanceof expectedClass)) {\r\n var expectedClassName = expectedClass.name || ANONYMOUS;\r\n var actualClassName = getClassName(props[propName]);\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\r\n }\r\n return null;\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function createEnumTypeChecker(expectedValues) {\r\n if (!Array.isArray(expectedValues)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (arguments.length > 1) {\r\n printWarning(\r\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\r\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\r\n );\r\n } else {\r\n printWarning('Invalid argument supplied to oneOf, expected an array.');\r\n }\r\n }\r\n return emptyFunctionThatReturnsNull;\r\n }\r\n function validate(props, propName, componentName, location, propFullName) {\r\n var propValue = props[propName];\r\n for (var i = 0; i < expectedValues.length; i++) {\r\n if (is(propValue, expectedValues[i])) {\r\n return null;\r\n }\r\n }\r\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\r\n var type = getPreciseType(value);\r\n if (type === 'symbol') {\r\n return String(value);\r\n }\r\n return value;\r\n });\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function createObjectOfTypeChecker(typeChecker) {\r\n function validate(props, propName, componentName, location, propFullName) {\r\n if (typeof typeChecker !== 'function') {\r\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\r\n }\r\n var propValue = props[propName];\r\n var propType = getPropType(propValue);\r\n if (propType !== 'object') {\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\r\n }\r\n for (var key in propValue) {\r\n if (has(propValue, key)) {\r\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\r\n if (error instanceof Error) {\r\n return error;\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function createUnionTypeChecker(arrayOfTypeCheckers) {\r\n if (!Array.isArray(arrayOfTypeCheckers)) {\r\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\r\n return emptyFunctionThatReturnsNull;\r\n }\r\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\r\n var checker = arrayOfTypeCheckers[i];\r\n if (typeof checker !== 'function') {\r\n printWarning(\r\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\r\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\r\n );\r\n return emptyFunctionThatReturnsNull;\r\n }\r\n }\r\n function validate(props, propName, componentName, location, propFullName) {\r\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\r\n var checker = arrayOfTypeCheckers[i];\r\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\r\n return null;\r\n }\r\n }\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function createNodeChecker() {\r\n function validate(props, propName, componentName, location, propFullName) {\r\n if (!isNode(props[propName])) {\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\r\n }\r\n return null;\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function createShapeTypeChecker(shapeTypes) {\r\n function validate(props, propName, componentName, location, propFullName) {\r\n var propValue = props[propName];\r\n var propType = getPropType(propValue);\r\n if (propType !== 'object') {\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\r\n }\r\n for (var key in shapeTypes) {\r\n var checker = shapeTypes[key];\r\n if (!checker) {\r\n continue;\r\n }\r\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\r\n if (error) {\r\n return error;\r\n }\r\n }\r\n return null;\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function createStrictShapeTypeChecker(shapeTypes) {\r\n function validate(props, propName, componentName, location, propFullName) {\r\n var propValue = props[propName];\r\n var propType = getPropType(propValue);\r\n if (propType !== 'object') {\r\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\r\n }\r\n // We need to check all keys in case some are required but missing from\r\n // props.\r\n var allKeys = assign({}, props[propName], shapeTypes);\r\n for (var key in allKeys) {\r\n var checker = shapeTypes[key];\r\n if (!checker) {\r\n return new PropTypeError(\r\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\r\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\r\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\r\n );\r\n }\r\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\r\n if (error) {\r\n return error;\r\n }\r\n }\r\n return null;\r\n }\r\n return createChainableTypeChecker(validate);\r\n }\r\n function isNode(propValue) {\r\n switch (typeof propValue) {\r\n case 'number':\r\n case 'string':\r\n case 'undefined':\r\n return true;\r\n case 'boolean':\r\n return !propValue;\r\n case 'object':\r\n if (Array.isArray(propValue)) {\r\n return propValue.every(isNode);\r\n }\r\n if (propValue === null || isValidElement(propValue)) {\r\n return true;\r\n }\r\n var iteratorFn = getIteratorFn(propValue);\r\n if (iteratorFn) {\r\n var iterator = iteratorFn.call(propValue);\r\n var step;\r\n if (iteratorFn !== propValue.entries) {\r\n while (!(step = iterator.next()).done) {\r\n if (!isNode(step.value)) {\r\n return false;\r\n }\r\n }\r\n } else {\r\n // Iterator will provide entry [k,v] tuples rather than values.\r\n while (!(step = iterator.next()).done) {\r\n var entry = step.value;\r\n if (entry) {\r\n if (!isNode(entry[1])) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n return false;\r\n }\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n function isSymbol(propType, propValue) {\r\n // Native Symbol.\r\n if (propType === 'symbol') {\r\n return true;\r\n }\r\n // falsy value can't be a Symbol\r\n if (!propValue) {\r\n return false;\r\n }\r\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\r\n if (propValue['@@toStringTag'] === 'Symbol') {\r\n return true;\r\n }\r\n // Fallback for non-spec compliant Symbols which are polyfilled.\r\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // Equivalent of `typeof` but with special handling for array and regexp.\r\n function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }\r\n // This handles more types than `getPropType`. Only used for error messages.\r\n // See `createPrimitiveTypeChecker`.\r\n function getPreciseType(propValue) {\r\n if (typeof propValue === 'undefined' || propValue === null) {\r\n return '' + propValue;\r\n }\r\n var propType = getPropType(propValue);\r\n if (propType === 'object') {\r\n if (propValue instanceof Date) {\r\n return 'date';\r\n } else if (propValue instanceof RegExp) {\r\n return 'regexp';\r\n }\r\n }\r\n return propType;\r\n }\r\n // Returns a string that is postfixed to a warning about an invalid type.\r\n // For example, \"undefined\" or \"of type array\"\r\n function getPostfixForTypeWarning(value) {\r\n var type = getPreciseType(value);\r\n switch (type) {\r\n case 'array':\r\n case 'object':\r\n return 'an ' + type;\r\n case 'boolean':\r\n case 'date':\r\n case 'regexp':\r\n return 'a ' + type;\r\n default:\r\n return type;\r\n }\r\n }\r\n // Returns class name of the object, if any.\r\n function getClassName(propValue) {\r\n if (!propValue.constructor || !propValue.constructor.name) {\r\n return ANONYMOUS;\r\n }\r\n return propValue.constructor.name;\r\n }\r\n ReactPropTypes.checkPropTypes = checkPropTypes;\r\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\r\n ReactPropTypes.PropTypes = ReactPropTypes;\r\n return ReactPropTypes;\r\n};\r\n","/**\r\n * Copyright (c) 2013-present, Facebook, Inc.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n */\r\nif (process.env.NODE_ENV !== 'production') {\r\n var ReactIs = require('react-is');\r\n // By explicitly using `prop-types` you are opting into new development behavior.\r\n // http://fb.me/prop-types-in-prod\r\n var throwOnDirectAccess = true;\r\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\r\n} else {\r\n // By explicitly using `prop-types` you are opting into new production behavior.\r\n // http://fb.me/prop-types-in-prod\r\n module.exports = require('./factoryWithThrowingShims')();\r\n}\r\n","/**\r\n * Copyright (c) 2013-present, Facebook, Inc.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n */\r\n'use strict';\r\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\r\nmodule.exports = ReactPropTypesSecret;\r\n","/** @license React v16.9.0\r\n * react-dom.development.js\r\n *\r\n * Copyright (c) Facebook, Inc. and its affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n */\r\n'use strict';\r\nif (process.env.NODE_ENV !== \"production\") {\r\n (function() {\r\n'use strict';\r\nvar React = require('react');\r\nvar _assign = require('object-assign');\r\nvar checkPropTypes = require('prop-types/checkPropTypes');\r\nvar Scheduler = require('scheduler');\r\nvar tracing = require('scheduler/tracing');\r\n// Do not require this module directly! Use normal `invariant` calls with\r\n// template literal strings. The messages will be converted to ReactError during\r\n// build, and in production they will be minified.\r\n// Do not require this module directly! Use normal `invariant` calls with\r\n// template literal strings. The messages will be converted to ReactError during\r\n// build, and in production they will be minified.\r\nfunction ReactError(error) {\r\n error.name = 'Invariant Violation';\r\n return error;\r\n}\r\n/**\r\n * Use invariant() to assert state which your program assumes to be true.\r\n *\r\n * Provide sprintf-style format (only %s is supported) and arguments\r\n * to provide information about what broke and what you were\r\n * expecting.\r\n *\r\n * The invariant message will be stripped in production, but the invariant\r\n * will remain to ensure logic does not differ in production.\r\n */\r\n(function () {\r\n if (!React) {\r\n {\r\n throw ReactError(Error('ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.'));\r\n }\r\n }\r\n})();\r\n/**\r\n * Injectable ordering of event plugins.\r\n */\r\nvar eventPluginOrder = null;\r\n/**\r\n * Injectable mapping from names to event plugin modules.\r\n */\r\nvar namesToPlugins = {};\r\n/**\r\n * Recomputes the plugin list using the injected plugins and plugin ordering.\r\n *\r\n * @private\r\n */\r\nfunction recomputePluginOrdering() {\r\n if (!eventPluginOrder) {\r\n // Wait until an `eventPluginOrder` is injected.\r\n return;\r\n }\r\n for (var pluginName in namesToPlugins) {\r\n var pluginModule = namesToPlugins[pluginName];\r\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\r\n (function () {\r\n if (!(pluginIndex > -1)) {\r\n {\r\n throw ReactError(Error('EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `' + pluginName + '`.'));\r\n }\r\n }\r\n })();\r\n if (plugins[pluginIndex]) {\r\n continue;\r\n }\r\n (function () {\r\n if (!pluginModule.extractEvents) {\r\n {\r\n throw ReactError(Error('EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `' + pluginName + '` does not.'));\r\n }\r\n }\r\n })();\r\n plugins[pluginIndex] = pluginModule;\r\n var publishedEvents = pluginModule.eventTypes;\r\n for (var eventName in publishedEvents) {\r\n (function () {\r\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\r\n {\r\n throw ReactError(Error('EventPluginRegistry: Failed to publish event `' + eventName + '` for plugin `' + pluginName + '`.'));\r\n }\r\n }\r\n })();\r\n }\r\n }\r\n}\r\n/**\r\n * Publishes an event so that it can be dispatched by the supplied plugin.\r\n *\r\n * @param {object} dispatchConfig Dispatch configuration for the event.\r\n * @param {object} PluginModule Plugin publishing the event.\r\n * @return {boolean} True if the event was successfully published.\r\n * @private\r\n */\r\nfunction publishEventForPlugin(dispatchConfig, pluginModule, eventName) {\r\n (function () {\r\n if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {\r\n {\r\n throw ReactError(Error('EventPluginHub: More than one plugin attempted to publish the same event name, `' + eventName + '`.'));\r\n }\r\n }\r\n })();\r\n eventNameDispatchConfigs[eventName] = dispatchConfig;\r\n var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\r\n if (phasedRegistrationNames) {\r\n for (var phaseName in phasedRegistrationNames) {\r\n if (phasedRegistrationNames.hasOwnProperty(phaseName)) {\r\n var phasedRegistrationName = phasedRegistrationNames[phaseName];\r\n publishRegistrationName(phasedRegistrationName, pluginModule, eventName);\r\n }\r\n }\r\n return true;\r\n } else if (dispatchConfig.registrationName) {\r\n publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);\r\n return true;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Publishes a registration name that is used to identify dispatched events.\r\n *\r\n * @param {string} registrationName Registration name to add.\r\n * @param {object} PluginModule Plugin publishing the event.\r\n * @private\r\n */\r\nfunction publishRegistrationName(registrationName, pluginModule, eventName) {\r\n (function () {\r\n if (!!registrationNameModules[registrationName]) {\r\n {\r\n throw ReactError(Error('EventPluginHub: More than one plugin attempted to publish the same registration name, `' + registrationName + '`.'));\r\n }\r\n }\r\n })();\r\n registrationNameModules[registrationName] = pluginModule;\r\n registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;\r\n {\r\n var lowerCasedName = registrationName.toLowerCase();\r\n possibleRegistrationNames[lowerCasedName] = registrationName;\r\n if (registrationName === 'onDoubleClick') {\r\n possibleRegistrationNames.ondblclick = registrationName;\r\n }\r\n }\r\n}\r\n/**\r\n * Registers plugins so that they can extract and dispatch events.\r\n *\r\n * @see {EventPluginHub}\r\n */\r\n/**\r\n * Ordered list of injected plugins.\r\n */\r\nvar plugins = [];\r\n/**\r\n * Mapping from event name to dispatch config\r\n */\r\nvar eventNameDispatchConfigs = {};\r\n/**\r\n * Mapping from registration name to plugin module\r\n */\r\nvar registrationNameModules = {};\r\n/**\r\n * Mapping from registration name to event name\r\n */\r\nvar registrationNameDependencies = {};\r\n/**\r\n * Mapping from lowercase registration names to the properly cased version,\r\n * used to warn in the case of missing event handlers. Available\r\n * only in true.\r\n * @type {Object}\r\n */\r\nvar possibleRegistrationNames = {};\r\n// Trust the developer to only use possibleRegistrationNames in true\r\n/**\r\n * Injects an ordering of plugins (by plugin name). This allows the ordering\r\n * to be decoupled from injection of the actual plugins so that ordering is\r\n * always deterministic regardless of packaging, on-the-fly injection, etc.\r\n *\r\n * @param {array} InjectedEventPluginOrder\r\n * @internal\r\n * @see {EventPluginHub.injection.injectEventPluginOrder}\r\n */\r\nfunction injectEventPluginOrder(injectedEventPluginOrder) {\r\n (function () {\r\n if (!!eventPluginOrder) {\r\n {\r\n throw ReactError(Error('EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.'));\r\n }\r\n }\r\n })();\r\n // Clone the ordering so it cannot be dynamically mutated.\r\n eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);\r\n recomputePluginOrdering();\r\n}\r\n/**\r\n * Injects plugins to be used by `EventPluginHub`. The plugin names must be\r\n * in the ordering injected by `injectEventPluginOrder`.\r\n *\r\n * Plugins can be injected as part of page initialization or on-the-fly.\r\n *\r\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\r\n * @internal\r\n * @see {EventPluginHub.injection.injectEventPluginsByName}\r\n */\r\nfunction injectEventPluginsByName(injectedNamesToPlugins) {\r\n var isOrderingDirty = false;\r\n for (var pluginName in injectedNamesToPlugins) {\r\n if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {\r\n continue;\r\n }\r\n var pluginModule = injectedNamesToPlugins[pluginName];\r\n if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {\r\n (function () {\r\n if (!!namesToPlugins[pluginName]) {\r\n {\r\n throw ReactError(Error('EventPluginRegistry: Cannot inject two different event plugins using the same name, `' + pluginName + '`.'));\r\n }\r\n }\r\n })();\r\n namesToPlugins[pluginName] = pluginModule;\r\n isOrderingDirty = true;\r\n }\r\n }\r\n if (isOrderingDirty) {\r\n recomputePluginOrdering();\r\n }\r\n}\r\nvar invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {\r\n var funcArgs = Array.prototype.slice.call(arguments, 3);\r\n try {\r\n func.apply(context, funcArgs);\r\n } catch (error) {\r\n this.onError(error);\r\n }\r\n};\r\n{\r\n // In DEV mode, we swap out invokeGuardedCallback for a special version\r\n // that plays more nicely with the browser's DevTools. The idea is to preserve\r\n // \"Pause on exceptions\" behavior. Because React wraps all user-provided\r\n // functions in invokeGuardedCallback, and the production version of\r\n // invokeGuardedCallback uses a try-catch, all user exceptions are treated\r\n // like caught exceptions, and the DevTools won't pause unless the developer\r\n // takes the extra step of enabling pause on caught exceptions. This is\r\n // unintuitive, though, because even though React has caught the error, from\r\n // the developer's perspective, the error is uncaught.\r\n //\r\n // To preserve the expected \"Pause on exceptions\" behavior, we don't use a\r\n // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\r\n // DOM node, and call the user-provided callback from inside an event handler\r\n // for that fake event. If the callback throws, the error is \"captured\" using\r\n // a global event handler. But because the error happens in a different\r\n // event loop context, it does not interrupt the normal program flow.\r\n // Effectively, this gives us try-catch behavior without actually using\r\n // try-catch. Neat!\r\n // Check that the browser supports the APIs we need to implement our special\r\n // DEV version of invokeGuardedCallback\r\n if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\r\n var fakeNode = document.createElement('react');\r\n var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {\r\n // If document doesn't exist we know for sure we will crash in this method\r\n // when we call document.createEvent(). However this can cause confusing\r\n // errors: https://github.com/facebookincubator/create-react-app/issues/3482\r\n // So we preemptively throw with a better message instead.\r\n (function () {\r\n if (!(typeof document !== 'undefined')) {\r\n {\r\n throw ReactError(Error('The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.'));\r\n }\r\n }\r\n })();\r\n var evt = document.createEvent('Event');\r\n // Keeps track of whether the user-provided callback threw an error. We\r\n // set this to true at the beginning, then set it to false right after\r\n // calling the function. If the function errors, `didError` will never be\r\n // set to false. This strategy works even if the browser is flaky and\r\n // fails to call our global error handler, because it doesn't rely on\r\n // the error event at all.\r\n var didError = true;\r\n // Keeps track of the value of window.event so that we can reset it\r\n // during the callback to let user code access window.event in the\r\n // browsers that support it.\r\n var windowEvent = window.event;\r\n // Keeps track of the descriptor of window.event to restore it after event\r\n // dispatching: https://github.com/facebook/react/issues/13688\r\n var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');\r\n // Create an event handler for our fake event. We will synchronously\r\n // dispatch our fake event using `dispatchEvent`. Inside the handler, we\r\n // call the user-provided callback.\r\n var funcArgs = Array.prototype.slice.call(arguments, 3);\r\n function callCallback() {\r\n // We immediately remove the callback from event listeners so that\r\n // nested `invokeGuardedCallback` calls do not clash. Otherwise, a\r\n // nested call would trigger the fake event handlers of any call higher\r\n // in the stack.\r\n fakeNode.removeEventListener(evtType, callCallback, false);\r\n // We check for window.hasOwnProperty('event') to prevent the\r\n // window.event assignment in both IE <= 10 as they throw an error\r\n // \"Member not found\" in strict mode, and in Firefox which does not\r\n // support window.event.\r\n if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {\r\n window.event = windowEvent;\r\n }\r\n func.apply(context, funcArgs);\r\n didError = false;\r\n }\r\n // Create a global error event handler. We use this to capture the value\r\n // that was thrown. It's possible that this error handler will fire more\r\n // than once; for example, if non-React code also calls `dispatchEvent`\r\n // and a handler for that event throws. We should be resilient to most of\r\n // those cases. Even if our error event handler fires more than once, the\r\n // last error event is always used. If the callback actually does error,\r\n // we know that the last error event is the correct one, because it's not\r\n // possible for anything else to have happened in between our callback\r\n // erroring and the code that follows the `dispatchEvent` call below. If\r\n // the callback doesn't error, but the error event was fired, we know to\r\n // ignore it because `didError` will be false, as described above.\r\n var error = void 0;\r\n // Use this to track whether the error event is ever called.\r\n var didSetError = false;\r\n var isCrossOriginError = false;\r\n function handleWindowError(event) {\r\n error = event.error;\r\n didSetError = true;\r\n if (error === null && event.colno === 0 && event.lineno === 0) {\r\n isCrossOriginError = true;\r\n }\r\n if (event.defaultPrevented) {\r\n // Some other error handler has prevented default.\r\n // Browsers silence the error report if this happens.\r\n // We'll remember this to later decide whether to log it or not.\r\n if (error != null && typeof error === 'object') {\r\n try {\r\n error._suppressLogging = true;\r\n } catch (inner) {\r\n // Ignore.\r\n }\r\n }\r\n }\r\n }\r\n // Create a fake event type.\r\n var evtType = 'react-' + (name ? name : 'invokeguardedcallback');\r\n // Attach our event handlers\r\n window.addEventListener('error', handleWindowError);\r\n fakeNode.addEventListener(evtType, callCallback, false);\r\n // Synchronously dispatch our fake event. If the user-provided function\r\n // errors, it will trigger our global error handler.\r\n evt.initEvent(evtType, false, false);\r\n fakeNode.dispatchEvent(evt);\r\n if (windowEventDescriptor) {\r\n Object.defineProperty(window, 'event', windowEventDescriptor);\r\n }\r\n if (didError) {\r\n if (!didSetError) {\r\n // The callback errored, but the error event never fired.\r\n error = new Error('An error was thrown inside one of your components, but React ' + \"doesn't know what it was. This is likely due to browser \" + 'flakiness. React does its best to preserve the \"Pause on ' + 'exceptions\" behavior of the DevTools, which requires some ' + \"DEV-mode only tricks. It's possible that these don't work in \" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\r\n } else if (isCrossOriginError) {\r\n error = new Error(\"A cross-origin error was thrown. React doesn't have access to \" + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');\r\n }\r\n this.onError(error);\r\n }\r\n // Remove our event listeners\r\n window.removeEventListener('error', handleWindowError);\r\n };\r\n invokeGuardedCallbackImpl = invokeGuardedCallbackDev;\r\n }\r\n}\r\nvar invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;\r\n// Used by Fiber to simulate a try-catch.\r\nvar hasError = false;\r\nvar caughtError = null;\r\n// Used by event system to capture/rethrow the first error.\r\nvar hasRethrowError = false;\r\nvar rethrowError = null;\r\nvar reporter = {\r\n onError: function (error) {\r\n hasError = true;\r\n caughtError = error;\r\n }\r\n};\r\n/**\r\n * Call a function while guarding against errors that happens within it.\r\n * Returns an error if it throws, otherwise null.\r\n *\r\n * In production, this is implemented using a try-catch. The reason we don't\r\n * use a try-catch directly is so that we can swap out a different\r\n * implementation in DEV mode.\r\n *\r\n * @param {String} name of the guard to use for logging or debugging\r\n * @param {Function} func The function to invoke\r\n * @param {*} context The context to use when calling the function\r\n * @param {...*} args Arguments for function\r\n */\r\nfunction invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {\r\n hasError = false;\r\n caughtError = null;\r\n invokeGuardedCallbackImpl$1.apply(reporter, arguments);\r\n}\r\n/**\r\n * Same as invokeGuardedCallback, but instead of returning an error, it stores\r\n * it in a global so it can be rethrown by `rethrowCaughtError` later.\r\n * TODO: See if caughtError and rethrowError can be unified.\r\n *\r\n * @param {String} name of the guard to use for logging or debugging\r\n * @param {Function} func The function to invoke\r\n * @param {*} context The context to use when calling the function\r\n * @param {...*} args Arguments for function\r\n */\r\nfunction invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {\r\n invokeGuardedCallback.apply(this, arguments);\r\n if (hasError) {\r\n var error = clearCaughtError();\r\n if (!hasRethrowError) {\r\n hasRethrowError = true;\r\n rethrowError = error;\r\n }\r\n }\r\n}\r\n/**\r\n * During execution of guarded functions we will capture the first error which\r\n * we will rethrow to be handled by the top level error handler.\r\n */\r\nfunction rethrowCaughtError() {\r\n if (hasRethrowError) {\r\n var error = rethrowError;\r\n hasRethrowError = false;\r\n rethrowError = null;\r\n throw error;\r\n }\r\n}\r\nfunction hasCaughtError() {\r\n return hasError;\r\n}\r\nfunction clearCaughtError() {\r\n if (hasError) {\r\n var error = caughtError;\r\n hasError = false;\r\n caughtError = null;\r\n return error;\r\n } else {\r\n (function () {\r\n {\r\n {\r\n throw ReactError(Error('clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.'));\r\n }\r\n }\r\n })();\r\n }\r\n}\r\n/**\r\n * Similar to invariant but only logs a warning if the condition is not met.\r\n * This can be used to log issues in development environments in critical\r\n * paths. Removing the logging code for production environments will keep the\r\n * same logic and follow the same code paths.\r\n */\r\nvar warningWithoutStack = function () {};\r\n{\r\n warningWithoutStack = function (condition, format) {\r\n for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\r\n args[_key - 2] = arguments[_key];\r\n }\r\n if (format === undefined) {\r\n throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');\r\n }\r\n if (args.length > 8) {\r\n // Check before the condition to catch violations early.\r\n throw new Error('warningWithoutStack() currently supports at most 8 arguments.');\r\n }\r\n if (condition) {\r\n return;\r\n }\r\n if (typeof console !== 'undefined') {\r\n var argsWithFormat = args.map(function (item) {\r\n return '' + item;\r\n });\r\n argsWithFormat.unshift('Warning: ' + format);\r\n // We intentionally don't use spread (or .apply) directly because it\r\n // breaks IE9: https://github.com/facebook/react/issues/13610\r\n Function.prototype.apply.call(console.error, console, argsWithFormat);\r\n }\r\n try {\r\n // --- Welcome to debugging React ---\r\n // This error was thrown as a convenience so that you can use this stack\r\n // to find the callsite that caused this warning to fire.\r\n var argIndex = 0;\r\n var message = 'Warning: ' + format.replace(/%s/g, function () {\r\n return args[argIndex++];\r\n });\r\n throw new Error(message);\r\n } catch (x) {}\r\n };\r\n}\r\nvar warningWithoutStack$1 = warningWithoutStack;\r\nvar getFiberCurrentPropsFromNode = null;\r\nvar getInstanceFromNode = null;\r\nvar getNodeFromInstance = null;\r\nfunction setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {\r\n getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;\r\n getInstanceFromNode = getInstanceFromNodeImpl;\r\n getNodeFromInstance = getNodeFromInstanceImpl;\r\n {\r\n !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;\r\n }\r\n}\r\nvar validateEventDispatches = void 0;\r\n{\r\n validateEventDispatches = function (event) {\r\n var dispatchListeners = event._dispatchListeners;\r\n var dispatchInstances = event._dispatchInstances;\r\n var listenersIsArr = Array.isArray(dispatchListeners);\r\n var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;\r\n var instancesIsArr = Array.isArray(dispatchInstances);\r\n var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;\r\n !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;\r\n };\r\n}\r\n/**\r\n * Dispatch the event to the listener.\r\n * @param {SyntheticEvent} event SyntheticEvent to handle\r\n * @param {function} listener Application-level callback\r\n * @param {*} inst Internal component instance\r\n */\r\nfunction executeDispatch(event, listener, inst) {\r\n var type = event.type || 'unknown-event';\r\n event.currentTarget = getNodeFromInstance(inst);\r\n invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\r\n event.currentTarget = null;\r\n}\r\n/**\r\n * Standard/simple iteration through an event's collected dispatches.\r\n */\r\nfunction executeDispatchesInOrder(event) {\r\n var dispatchListeners = event._dispatchListeners;\r\n var dispatchInstances = event._dispatchInstances;\r\n {\r\n validateEventDispatches(event);\r\n }\r\n if (Array.isArray(dispatchListeners)) {\r\n for (var i = 0; i < dispatchListeners.length; i++) {\r\n if (event.isPropagationStopped()) {\r\n break;\r\n }\r\n // Listeners and Instances are two parallel arrays that are always in sync.\r\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\r\n }\r\n } else if (dispatchListeners) {\r\n executeDispatch(event, dispatchListeners, dispatchInstances);\r\n }\r\n event._dispatchListeners = null;\r\n event._dispatchInstances = null;\r\n}\r\n/**\r\n * @see executeDispatchesInOrderStopAtTrueImpl\r\n */\r\n/**\r\n * Execution of a \"direct\" dispatch - there must be at most one dispatch\r\n * accumulated on the event or it is considered an error. It doesn't really make\r\n * sense for an event with multiple dispatches (bubbled) to keep track of the\r\n * return values at each dispatch execution, but it does tend to make sense when\r\n * dealing with \"direct\" dispatches.\r\n *\r\n * @return {*} The return value of executing the single dispatch.\r\n */\r\n/**\r\n * @param {SyntheticEvent} event\r\n * @return {boolean} True iff number of dispatches accumulated is greater than 0.\r\n */\r\n/**\r\n * Accumulates items that must not be null or undefined into the first one. This\r\n * is used to conserve memory by avoiding array allocations, and thus sacrifices\r\n * API cleanness. Since `current` can be null before being passed in and not\r\n * null after this function, make sure to assign it back to `current`:\r\n *\r\n * `a = accumulateInto(a, b);`\r\n *\r\n * This API should be sparingly used. Try `accumulate` for something cleaner.\r\n *\r\n * @return {*|array<*>} An accumulation of items.\r\n */\r\nfunction accumulateInto(current, next) {\r\n (function () {\r\n if (!(next != null)) {\r\n {\r\n throw ReactError(Error('accumulateInto(...): Accumulated items must not be null or undefined.'));\r\n }\r\n }\r\n })();\r\n if (current == null) {\r\n return next;\r\n }\r\n // Both are not empty. Warning: Never call x.concat(y) when you are not\r\n // certain that x is an Array (x could be a string with concat method).\r\n if (Array.isArray(current)) {\r\n if (Array.isArray(next)) {\r\n current.push.apply(current, next);\r\n return current;\r\n }\r\n current.push(next);\r\n return current;\r\n }\r\n if (Array.isArray(next)) {\r\n // A bit too dangerous to mutate `next`.\r\n return [current].concat(next);\r\n }\r\n return [current, next];\r\n}\r\n/**\r\n * @param {array} arr an \"accumulation\" of items which is either an Array or\r\n * a single item. Useful when paired with the `accumulate` module. This is a\r\n * simple utility that allows us to reason about a collection of items, but\r\n * handling the case when there is exactly one item (and we do not need to\r\n * allocate an array).\r\n * @param {function} cb Callback invoked with each element or a collection.\r\n * @param {?} [scope] Scope used as `this` in a callback.\r\n */\r\nfunction forEachAccumulated(arr, cb, scope) {\r\n if (Array.isArray(arr)) {\r\n arr.forEach(cb, scope);\r\n } else if (arr) {\r\n cb.call(scope, arr);\r\n }\r\n}\r\n/**\r\n * Internal queue of events that have accumulated their dispatches and are\r\n * waiting to have their dispatches executed.\r\n */\r\nvar eventQueue = null;\r\n/**\r\n * Dispatches an event and releases it back into the pool, unless persistent.\r\n *\r\n * @param {?object} event Synthetic event to be dispatched.\r\n * @private\r\n */\r\nvar executeDispatchesAndRelease = function (event) {\r\n if (event) {\r\n executeDispatchesInOrder(event);\r\n if (!event.isPersistent()) {\r\n event.constructor.release(event);\r\n }\r\n }\r\n};\r\nvar executeDispatchesAndReleaseTopLevel = function (e) {\r\n return executeDispatchesAndRelease(e);\r\n};\r\nfunction runEventsInBatch(events) {\r\n if (events !== null) {\r\n eventQueue = accumulateInto(eventQueue, events);\r\n }\r\n // Set `eventQueue` to null before processing it so that we can tell if more\r\n // events get enqueued while processing.\r\n var processingEventQueue = eventQueue;\r\n eventQueue = null;\r\n if (!processingEventQueue) {\r\n return;\r\n }\r\n forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);\r\n (function () {\r\n if (!!eventQueue) {\r\n {\r\n throw ReactError(Error('processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.'));\r\n }\r\n }\r\n })();\r\n // This would be a good time to rethrow if any of the event handlers threw.\r\n rethrowCaughtError();\r\n}\r\nfunction isInteractive(tag) {\r\n return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\r\n}\r\nfunction shouldPreventMouseEvent(name, type, props) {\r\n switch (name) {\r\n case 'onClick':\r\n case 'onClickCapture':\r\n case 'onDoubleClick':\r\n case 'onDoubleClickCapture':\r\n case 'onMouseDown':\r\n case 'onMouseDownCapture':\r\n case 'onMouseMove':\r\n case 'onMouseMoveCapture':\r\n case 'onMouseUp':\r\n case 'onMouseUpCapture':\r\n return !!(props.disabled && isInteractive(type));\r\n default:\r\n return false;\r\n }\r\n}\r\n/**\r\n * This is a unified interface for event plugins to be installed and configured.\r\n *\r\n * Event plugins can implement the following properties:\r\n *\r\n * `extractEvents` {function(string, DOMEventTarget, string, object): *}\r\n * Required. When a top-level event is fired, this method is expected to\r\n * extract synthetic events that will in turn be queued and dispatched.\r\n *\r\n * `eventTypes` {object}\r\n * Optional, plugins that fire events must publish a mapping of registration\r\n * names that are used to register listeners. Values of this mapping must\r\n * be objects that contain `registrationName` or `phasedRegistrationNames`.\r\n *\r\n * `executeDispatch` {function(object, function, string)}\r\n * Optional, allows plugins to override how an event gets dispatched. By\r\n * default, the listener is simply invoked.\r\n *\r\n * Each plugin that is injected into `EventsPluginHub` is immediately operable.\r\n *\r\n * @public\r\n */\r\n/**\r\n * Methods for injecting dependencies.\r\n */\r\nvar injection = {\r\n /**\r\n * @param {array} InjectedEventPluginOrder\r\n * @public\r\n */\r\n injectEventPluginOrder: injectEventPluginOrder,\r\n /**\r\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\r\n */\r\n injectEventPluginsByName: injectEventPluginsByName\r\n};\r\n/**\r\n * @param {object} inst The instance, which is the source of events.\r\n * @param {string} registrationName Name of listener (e.g. `onClick`).\r\n * @return {?function} The stored callback.\r\n */\r\nfunction getListener(inst, registrationName) {\r\n var listener = void 0;\r\n // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not\r\n // live here; needs to be moved to a better place soon\r\n var stateNode = inst.stateNode;\r\n if (!stateNode) {\r\n // Work in progress (ex: onload events in incremental mode).\r\n return null;\r\n }\r\n var props = getFiberCurrentPropsFromNode(stateNode);\r\n if (!props) {\r\n // Work in progress.\r\n return null;\r\n }\r\n listener = props[registrationName];\r\n if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\r\n return null;\r\n }\r\n (function () {\r\n if (!(!listener || typeof listener === 'function')) {\r\n {\r\n throw ReactError(Error('Expected `' + registrationName + '` listener to be a function, instead got a value of `' + typeof listener + '` type.'));\r\n }\r\n }\r\n })();\r\n return listener;\r\n}\r\n/**\r\n * Allows registered plugins an opportunity to extract events from top-level\r\n * native browser events.\r\n *\r\n * @return {*} An accumulation of synthetic events.\r\n * @internal\r\n */\r\nfunction extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\r\n var events = null;\r\n for (var i = 0; i < plugins.length; i++) {\r\n // Not every plugin in the ordering may be loaded at runtime.\r\n var possiblePlugin = plugins[i];\r\n if (possiblePlugin) {\r\n var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);\r\n if (extractedEvents) {\r\n events = accumulateInto(events, extractedEvents);\r\n }\r\n }\r\n }\r\n return events;\r\n}\r\nfunction runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\r\n var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);\r\n runEventsInBatch(events);\r\n}\r\nvar FunctionComponent = 0;\r\nvar ClassComponent = 1;\r\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\r\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\r\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\r\nvar HostComponent = 5;\r\nvar HostText = 6;\r\nvar Fragment = 7;\r\nvar Mode = 8;\r\nvar ContextConsumer = 9;\r\nvar ContextProvider = 10;\r\nvar ForwardRef = 11;\r\nvar Profiler = 12;\r\nvar SuspenseComponent = 13;\r\nvar MemoComponent = 14;\r\nvar SimpleMemoComponent = 15;\r\nvar LazyComponent = 16;\r\nvar IncompleteClassComponent = 17;\r\nvar DehydratedSuspenseComponent = 18;\r\nvar SuspenseListComponent = 19;\r\nvar FundamentalComponent = 20;\r\nvar randomKey = Math.random().toString(36).slice(2);\r\nvar internalInstanceKey = '__reactInternalInstance$' + randomKey;\r\nvar internalEventHandlersKey = '__reactEventHandlers$' + randomKey;\r\nfunction precacheFiberNode(hostInst, node) {\r\n node[internalInstanceKey] = hostInst;\r\n}\r\n/**\r\n * Given a DOM node, return the closest ReactDOMComponent or\r\n * ReactDOMTextComponent instance ancestor.\r\n */\r\nfunction getClosestInstanceFromNode(node) {\r\n if (node[internalInstanceKey]) {\r\n return node[internalInstanceKey];\r\n }\r\n while (!node[internalInstanceKey]) {\r\n if (node.parentNode) {\r\n node = node.parentNode;\r\n } else {\r\n // Top of the tree. This node must not be part of a React tree (or is\r\n // unmounted, potentially).\r\n return null;\r\n }\r\n }\r\n var inst = node[internalInstanceKey];\r\n if (inst.tag === HostComponent || inst.tag === HostText) {\r\n // In Fiber, this will always be the deepest root.\r\n return inst;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent\r\n * instance, or null if the node was not rendered by this React.\r\n */\r\nfunction getInstanceFromNode$1(node) {\r\n var inst = node[internalInstanceKey];\r\n if (inst) {\r\n if (inst.tag === HostComponent || inst.tag === HostText) {\r\n return inst;\r\n } else {\r\n return null;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding\r\n * DOM node.\r\n */\r\nfunction getNodeFromInstance$1(inst) {\r\n if (inst.tag === HostComponent || inst.tag === HostText) {\r\n // In Fiber this, is just the state node right now. We assume it will be\r\n // a host component or host text.\r\n return inst.stateNode;\r\n }\r\n // Without this first invariant, passing a non-DOM-component triggers the next\r\n // invariant for a missing parent, which is super confusing.\r\n (function () {\r\n {\r\n {\r\n throw ReactError(Error('getNodeFromInstance: Invalid argument.'));\r\n }\r\n }\r\n })();\r\n}\r\nfunction getFiberCurrentPropsFromNode$1(node) {\r\n return node[internalEventHandlersKey] || null;\r\n}\r\nfunction updateFiberProps(node, props) {\r\n node[internalEventHandlersKey] = props;\r\n}\r\nfunction getParent(inst) {\r\n do {\r\n inst = inst.return;\r\n // TODO: If this is a HostRoot we might want to bail out.\r\n // That is depending on if we want nested subtrees (layers) to bubble\r\n // events to their parent. We could also go through parentNode on the\r\n // host node but that wouldn't work for React Native and doesn't let us\r\n // do the portal feature.\r\n } while (inst && inst.tag !== HostComponent);\r\n if (inst) {\r\n return inst;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Return the lowest common ancestor of A and B, or null if they are in\r\n * different trees.\r\n */\r\nfunction getLowestCommonAncestor(instA, instB) {\r\n var depthA = 0;\r\n for (var tempA = instA; tempA; tempA = getParent(tempA)) {\r\n depthA++;\r\n }\r\n var depthB = 0;\r\n for (var tempB = instB; tempB; tempB = getParent(tempB)) {\r\n depthB++;\r\n }\r\n // If A is deeper, crawl up.\r\n while (depthA - depthB > 0) {\r\n instA = getParent(instA);\r\n depthA--;\r\n }\r\n // If B is deeper, crawl up.\r\n while (depthB - depthA > 0) {\r\n instB = getParent(instB);\r\n depthB--;\r\n }\r\n // Walk in lockstep until we find a match.\r\n var depth = depthA;\r\n while (depth--) {\r\n if (instA === instB || instA === instB.alternate) {\r\n return instA;\r\n }\r\n instA = getParent(instA);\r\n instB = getParent(instB);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Return if A is an ancestor of B.\r\n */\r\n/**\r\n * Return the parent instance of the passed-in instance.\r\n */\r\n/**\r\n * Simulates the traversal of a two-phase, capture/bubble event dispatch.\r\n */\r\nfunction traverseTwoPhase(inst, fn, arg) {\r\n var path = [];\r\n while (inst) {\r\n path.push(inst);\r\n inst = getParent(inst);\r\n }\r\n var i = void 0;\r\n for (i = path.length; i-- > 0;) {\r\n fn(path[i], 'captured', arg);\r\n }\r\n for (i = 0; i < path.length; i++) {\r\n fn(path[i], 'bubbled', arg);\r\n }\r\n}\r\n/**\r\n * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that\r\n * should would receive a `mouseEnter` or `mouseLeave` event.\r\n *\r\n * Does not invoke the callback on the nearest common ancestor because nothing\r\n * \"entered\" or \"left\" that element.\r\n */\r\nfunction traverseEnterLeave(from, to, fn, argFrom, argTo) {\r\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\r\n var pathFrom = [];\r\n while (true) {\r\n if (!from) {\r\n break;\r\n }\r\n if (from === common) {\r\n break;\r\n }\r\n var alternate = from.alternate;\r\n if (alternate !== null && alternate === common) {\r\n break;\r\n }\r\n pathFrom.push(from);\r\n from = getParent(from);\r\n }\r\n var pathTo = [];\r\n while (true) {\r\n if (!to) {\r\n break;\r\n }\r\n if (to === common) {\r\n break;\r\n }\r\n var _alternate = to.alternate;\r\n if (_alternate !== null && _alternate === common) {\r\n break;\r\n }\r\n pathTo.push(to);\r\n to = getParent(to);\r\n }\r\n for (var i = 0; i < pathFrom.length; i++) {\r\n fn(pathFrom[i], 'bubbled', argFrom);\r\n }\r\n for (var _i = pathTo.length; _i-- > 0;) {\r\n fn(pathTo[_i], 'captured', argTo);\r\n }\r\n}\r\n/**\r\n * Some event types have a notion of different registration names for different\r\n * \"phases\" of propagation. This finds listeners by a given phase.\r\n */\r\nfunction listenerAtPhase(inst, event, propagationPhase) {\r\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\r\n return getListener(inst, registrationName);\r\n}\r\n/**\r\n * A small set of propagation patterns, each of which will accept a small amount\r\n * of information, and generate a set of \"dispatch ready event objects\" - which\r\n * are sets of events that have already been annotated with a set of dispatched\r\n * listener functions/ids. The API is designed this way to discourage these\r\n * propagation strategies from actually executing the dispatches, since we\r\n * always want to collect the entire set of dispatches before executing even a\r\n * single one.\r\n */\r\n/**\r\n * Tags a `SyntheticEvent` with dispatched listeners. Creating this function\r\n * here, allows us to not have to bind or create functions for each event.\r\n * Mutating the event's members allows us to not have to create a wrapping\r\n * \"dispatch\" object that pairs the event with the listener.\r\n */\r\nfunction accumulateDirectionalDispatches(inst, phase, event) {\r\n {\r\n !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0;\r\n }\r\n var listener = listenerAtPhase(inst, event, phase);\r\n if (listener) {\r\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\r\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\r\n }\r\n}\r\n/**\r\n * Collect dispatches (must be entirely collected before dispatching - see unit\r\n * tests). Lazily allocate the array to conserve memory. We must loop through\r\n * each event and perform the traversal for each one. We cannot perform a\r\n * single traversal for the entire collection of events because each event may\r\n * have a different target.\r\n */\r\nfunction accumulateTwoPhaseDispatchesSingle(event) {\r\n if (event && event.dispatchConfig.phasedRegistrationNames) {\r\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\r\n }\r\n}\r\n/**\r\n * Accumulates without regard to direction, does not look for phased\r\n * registration names. Same as `accumulateDirectDispatchesSingle` but without\r\n * requiring that the `dispatchMarker` be the same as the dispatched ID.\r\n */\r\nfunction accumulateDispatches(inst, ignoredDirection, event) {\r\n if (inst && event && event.dispatchConfig.registrationName) {\r\n var registrationName = event.dispatchConfig.registrationName;\r\n var listener = getListener(inst, registrationName);\r\n if (listener) {\r\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\r\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\r\n }\r\n }\r\n}\r\n/**\r\n * Accumulates dispatches on an `SyntheticEvent`, but only for the\r\n * `dispatchMarker`.\r\n * @param {SyntheticEvent} event\r\n */\r\nfunction accumulateDirectDispatchesSingle(event) {\r\n if (event && event.dispatchConfig.registrationName) {\r\n accumulateDispatches(event._targetInst, null, event);\r\n }\r\n}\r\nfunction accumulateTwoPhaseDispatches(events) {\r\n forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);\r\n}\r\nfunction accumulateEnterLeaveDispatches(leave, enter, from, to) {\r\n traverseEnterLeave(from, to, accumulateDispatches, leave, enter);\r\n}\r\nfunction accumulateDirectDispatches(events) {\r\n forEachAccumulated(events, accumulateDirectDispatchesSingle);\r\n}\r\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\r\n// Do not use the below two methods directly!\r\n// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.\r\n// (It is the only module that is allowed to access these methods.)\r\nfunction unsafeCastStringToDOMTopLevelType(topLevelType) {\r\n return topLevelType;\r\n}\r\nfunction unsafeCastDOMTopLevelTypeToString(topLevelType) {\r\n return topLevelType;\r\n}\r\n/**\r\n * Generate a mapping of standard vendor prefixes using the defined style property and event name.\r\n *\r\n * @param {string} styleProp\r\n * @param {string} eventName\r\n * @returns {object}\r\n */\r\nfunction makePrefixMap(styleProp, eventName) {\r\n var prefixes = {};\r\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\r\n prefixes['Webkit' + styleProp] = 'webkit' + eventName;\r\n prefixes['Moz' + styleProp] = 'moz' + eventName;\r\n return prefixes;\r\n}\r\n/**\r\n * A list of event names to a configurable list of vendor prefixes.\r\n */\r\nvar vendorPrefixes = {\r\n animationend: makePrefixMap('Animation', 'AnimationEnd'),\r\n animationiteration: makePrefixMap('Animation', 'AnimationIteration'),\r\n animationstart: makePrefixMap('Animation', 'AnimationStart'),\r\n transitionend: makePrefixMap('Transition', 'TransitionEnd')\r\n};\r\n/**\r\n * Event names that have already been detected and prefixed (if applicable).\r\n */\r\nvar prefixedEventNames = {};\r\n/**\r\n * Element to check for prefixes on.\r\n */\r\nvar style = {};\r\n/**\r\n * Bootstrap if a DOM exists.\r\n */\r\nif (canUseDOM) {\r\n style = document.createElement('div').style;\r\n // On some platforms, in particular some releases of Android 4.x,\r\n // the un-prefixed \"animation\" and \"transition\" properties are defined on the\r\n // style object but the events that fire will still be prefixed, so we need\r\n // to check if the un-prefixed events are usable, and if not remove them from the map.\r\n if (!('AnimationEvent' in window)) {\r\n delete vendorPrefixes.animationend.animation;\r\n delete vendorPrefixes.animationiteration.animation;\r\n delete vendorPrefixes.animationstart.animation;\r\n }\r\n // Same as above\r\n if (!('TransitionEvent' in window)) {\r\n delete vendorPrefixes.transitionend.transition;\r\n }\r\n}\r\n/**\r\n * Attempts to determine the correct vendor prefixed event name.\r\n *\r\n * @param {string} eventName\r\n * @returns {string}\r\n */\r\nfunction getVendorPrefixedEventName(eventName) {\r\n if (prefixedEventNames[eventName]) {\r\n return prefixedEventNames[eventName];\r\n } else if (!vendorPrefixes[eventName]) {\r\n return eventName;\r\n }\r\n var prefixMap = vendorPrefixes[eventName];\r\n for (var styleProp in prefixMap) {\r\n if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {\r\n return prefixedEventNames[eventName] = prefixMap[styleProp];\r\n }\r\n }\r\n return eventName;\r\n}\r\n/**\r\n * To identify top level events in ReactDOM, we use constants defined by this\r\n * module. This is the only module that uses the unsafe* methods to express\r\n * that the constants actually correspond to the browser event names. This lets\r\n * us save some bundle size by avoiding a top level type -> event name map.\r\n * The rest of ReactDOM code should import top level types from this file.\r\n */\r\nvar TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');\r\nvar TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));\r\nvar TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));\r\nvar TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));\r\nvar TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');\r\nvar TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');\r\nvar TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');\r\nvar TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');\r\nvar TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');\r\nvar TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');\r\nvar TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');\r\nvar TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');\r\nvar TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');\r\nvar TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');\r\nvar TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');\r\nvar TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');\r\nvar TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');\r\nvar TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');\r\nvar TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');\r\nvar TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');\r\nvar TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');\r\nvar TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');\r\nvar TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');\r\nvar TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');\r\nvar TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');\r\nvar TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');\r\nvar TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');\r\nvar TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');\r\nvar TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');\r\nvar TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');\r\nvar TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');\r\nvar TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');\r\nvar TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');\r\nvar TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');\r\nvar TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');\r\nvar TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');\r\nvar TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');\r\nvar TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');\r\nvar TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');\r\nvar TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');\r\nvar TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');\r\nvar TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');\r\nvar TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');\r\nvar TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');\r\nvar TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');\r\nvar TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');\r\nvar TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');\r\nvar TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');\r\nvar TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');\r\nvar TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');\r\nvar TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');\r\nvar TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');\r\nvar TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');\r\nvar TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');\r\nvar TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');\r\nvar TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');\r\nvar TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');\r\nvar TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');\r\nvar TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');\r\nvar TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');\r\nvar TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');\r\nvar TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');\r\nvar TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');\r\nvar TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');\r\nvar TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');\r\nvar TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');\r\nvar TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');\r\nvar TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');\r\nvar TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');\r\nvar TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');\r\nvar TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');\r\nvar TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');\r\nvar TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');\r\nvar TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');\r\nvar TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');\r\nvar TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');\r\nvar TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));\r\nvar TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');\r\nvar TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');\r\nvar TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');\r\n// List of events that need to be individually attached to media elements.\r\n// Note that events in this list will *not* be listened to at the top level\r\n// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.\r\nvar mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];\r\nfunction getRawEventName(topLevelType) {\r\n return unsafeCastDOMTopLevelTypeToString(topLevelType);\r\n}\r\n/**\r\n * These variables store information about text content of a target node,\r\n * allowing comparison of content before and after a given event.\r\n *\r\n * Identify the node where selection currently begins, then observe\r\n * both its text content and its current position in the DOM. Since the\r\n * browser may natively replace the target node during composition, we can\r\n * use its position to find its replacement.\r\n *\r\n *\r\n */\r\nvar root = null;\r\nvar startText = null;\r\nvar fallbackText = null;\r\nfunction initialize(nativeEventTarget) {\r\n root = nativeEventTarget;\r\n startText = getText();\r\n return true;\r\n}\r\nfunction reset() {\r\n root = null;\r\n startText = null;\r\n fallbackText = null;\r\n}\r\nfunction getData() {\r\n if (fallbackText) {\r\n return fallbackText;\r\n }\r\n var start = void 0;\r\n var startValue = startText;\r\n var startLength = startValue.length;\r\n var end = void 0;\r\n var endValue = getText();\r\n var endLength = endValue.length;\r\n for (start = 0; start < startLength; start++) {\r\n if (startValue[start] !== endValue[start]) {\r\n break;\r\n }\r\n }\r\n var minEnd = startLength - start;\r\n for (end = 1; end <= minEnd; end++) {\r\n if (startValue[startLength - end] !== endValue[endLength - end]) {\r\n break;\r\n }\r\n }\r\n var sliceTail = end > 1 ? 1 - end : undefined;\r\n fallbackText = endValue.slice(start, sliceTail);\r\n return fallbackText;\r\n}\r\nfunction getText() {\r\n if ('value' in root) {\r\n return root.value;\r\n }\r\n return root.textContent;\r\n}\r\n/* eslint valid-typeof: 0 */\r\nvar EVENT_POOL_SIZE = 10;\r\n/**\r\n * @interface Event\r\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\r\n */\r\nvar EventInterface = {\r\n type: null,\r\n target: null,\r\n // currentTarget is set when dispatching; no use in copying it here\r\n currentTarget: function () {\r\n return null;\r\n },\r\n eventPhase: null,\r\n bubbles: null,\r\n cancelable: null,\r\n timeStamp: function (event) {\r\n return event.timeStamp || Date.now();\r\n },\r\n defaultPrevented: null,\r\n isTrusted: null\r\n};\r\nfunction functionThatReturnsTrue() {\r\n return true;\r\n}\r\nfunction functionThatReturnsFalse() {\r\n return false;\r\n}\r\n/**\r\n * Synthetic events are dispatched by event plugins, typically in response to a\r\n * top-level event delegation handler.\r\n *\r\n * These systems should generally use pooling to reduce the frequency of garbage\r\n * collection. The system should check `isPersistent` to determine whether the\r\n * event should be released into the pool after being dispatched. Users that\r\n * need a persisted event should invoke `persist`.\r\n *\r\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\r\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\r\n * DOM interface; custom application-specific events can also subclass this.\r\n *\r\n * @param {object} dispatchConfig Configuration used to dispatch this event.\r\n * @param {*} targetInst Marker identifying the event target.\r\n * @param {object} nativeEvent Native browser event.\r\n * @param {DOMEventTarget} nativeEventTarget Target node.\r\n */\r\nfunction SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {\r\n {\r\n // these have a getter/setter for warnings\r\n delete this.nativeEvent;\r\n delete this.preventDefault;\r\n delete this.stopPropagation;\r\n delete this.isDefaultPrevented;\r\n delete this.isPropagationStopped;\r\n }\r\n this.dispatchConfig = dispatchConfig;\r\n this._targetInst = targetInst;\r\n this.nativeEvent = nativeEvent;\r\n var Interface = this.constructor.Interface;\r\n for (var propName in Interface) {\r\n if (!Interface.hasOwnProperty(propName)) {\r\n continue;\r\n }\r\n {\r\n delete this[propName]; // this has a getter/setter for warnings\r\n }\r\n var normalize = Interface[propName];\r\n if (normalize) {\r\n this[propName] = normalize(nativeEvent);\r\n } else {\r\n if (propName === 'target') {\r\n this.target = nativeEventTarget;\r\n } else {\r\n this[propName] = nativeEvent[propName];\r\n }\r\n }\r\n }\r\n var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\r\n if (defaultPrevented) {\r\n this.isDefaultPrevented = functionThatReturnsTrue;\r\n } else {\r\n this.isDefaultPrevented = functionThatReturnsFalse;\r\n }\r\n this.isPropagationStopped = functionThatReturnsFalse;\r\n return this;\r\n}\r\n_assign(SyntheticEvent.prototype, {\r\n preventDefault: function () {\r\n this.defaultPrevented = true;\r\n var event = this.nativeEvent;\r\n if (!event) {\r\n return;\r\n }\r\n if (event.preventDefault) {\r\n event.preventDefault();\r\n } else if (typeof event.returnValue !== 'unknown') {\r\n event.returnValue = false;\r\n }\r\n this.isDefaultPrevented = functionThatReturnsTrue;\r\n },\r\n stopPropagation: function () {\r\n var event = this.nativeEvent;\r\n if (!event) {\r\n return;\r\n }\r\n if (event.stopPropagation) {\r\n event.stopPropagation();\r\n } else if (typeof event.cancelBubble !== 'unknown') {\r\n // The ChangeEventPlugin registers a \"propertychange\" event for\r\n // IE. This event does not support bubbling or cancelling, and\r\n // any references to cancelBubble throw \"Member not found\". A\r\n // typeof check of \"unknown\" circumvents this issue (and is also\r\n // IE specific).\r\n event.cancelBubble = true;\r\n }\r\n this.isPropagationStopped = functionThatReturnsTrue;\r\n },\r\n /**\r\n * We release all dispatched `SyntheticEvent`s after each event loop, adding\r\n * them back into the pool. This allows a way to hold onto a reference that\r\n * won't be added back into the pool.\r\n */\r\n persist: function () {\r\n this.isPersistent = functionThatReturnsTrue;\r\n },\r\n /**\r\n * Checks if this event should be released back into the pool.\r\n *\r\n * @return {boolean} True if this should not be released, false otherwise.\r\n */\r\n isPersistent: functionThatReturnsFalse,\r\n /**\r\n * `PooledClass` looks for `destructor` on each instance it releases.\r\n */\r\n destructor: function () {\r\n var Interface = this.constructor.Interface;\r\n for (var propName in Interface) {\r\n {\r\n Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));\r\n }\r\n }\r\n this.dispatchConfig = null;\r\n this._targetInst = null;\r\n this.nativeEvent = null;\r\n this.isDefaultPrevented = functionThatReturnsFalse;\r\n this.isPropagationStopped = functionThatReturnsFalse;\r\n this._dispatchListeners = null;\r\n this._dispatchInstances = null;\r\n {\r\n Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));\r\n Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));\r\n Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));\r\n Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));\r\n Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));\r\n }\r\n }\r\n});\r\nSyntheticEvent.Interface = EventInterface;\r\n/**\r\n * Helper to reduce boilerplate when creating subclasses.\r\n */\r\nSyntheticEvent.extend = function (Interface) {\r\n var Super = this;\r\n var E = function () {};\r\n E.prototype = Super.prototype;\r\n var prototype = new E();\r\n function Class() {\r\n return Super.apply(this, arguments);\r\n }\r\n _assign(prototype, Class.prototype);\r\n Class.prototype = prototype;\r\n Class.prototype.constructor = Class;\r\n Class.Interface = _assign({}, Super.Interface, Interface);\r\n Class.extend = Super.extend;\r\n addEventPoolingTo(Class);\r\n return Class;\r\n};\r\naddEventPoolingTo(SyntheticEvent);\r\n/**\r\n * Helper to nullify syntheticEvent instance properties when destructing\r\n *\r\n * @param {String} propName\r\n * @param {?object} getVal\r\n * @return {object} defineProperty object\r\n */\r\nfunction getPooledWarningPropertyDefinition(propName, getVal) {\r\n var isFunction = typeof getVal === 'function';\r\n return {\r\n configurable: true,\r\n set: set,\r\n get: get\r\n };\r\n function set(val) {\r\n var action = isFunction ? 'setting the method' : 'setting the property';\r\n warn(action, 'This is effectively a no-op');\r\n return val;\r\n }\r\n function get() {\r\n var action = isFunction ? 'accessing the method' : 'accessing the property';\r\n var result = isFunction ? 'This is a no-op function' : 'This is set to null';\r\n warn(action, result);\r\n return getVal;\r\n }\r\n function warn(action, result) {\r\n var warningCondition = false;\r\n !warningCondition ? warningWithoutStack$1(false, \"This synthetic event is reused for performance reasons. If you're seeing this, \" + \"you're %s `%s` on a released/nullified synthetic event. %s. \" + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;\r\n }\r\n}\r\nfunction getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {\r\n var EventConstructor = this;\r\n if (EventConstructor.eventPool.length) {\r\n var instance = EventConstructor.eventPool.pop();\r\n EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);\r\n return instance;\r\n }\r\n return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);\r\n}\r\nfunction releasePooledEvent(event) {\r\n var EventConstructor = this;\r\n (function () {\r\n if (!(event instanceof EventConstructor)) {\r\n {\r\n throw ReactError(Error('Trying to release an event instance into a pool of a different type.'));\r\n }\r\n }\r\n })();\r\n event.destructor();\r\n if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {\r\n EventConstructor.eventPool.push(event);\r\n }\r\n}\r\nfunction addEventPoolingTo(EventConstructor) {\r\n EventConstructor.eventPool = [];\r\n EventConstructor.getPooled = getPooledEvent;\r\n EventConstructor.release = releasePooledEvent;\r\n}\r\n/**\r\n * @interface Event\r\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents\r\n */\r\nvar SyntheticCompositionEvent = SyntheticEvent.extend({\r\n data: null\r\n});\r\n/**\r\n * @interface Event\r\n * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105\r\n * /#events-inputevents\r\n */\r\nvar SyntheticInputEvent = SyntheticEvent.extend({\r\n data: null\r\n});\r\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\r\nvar START_KEYCODE = 229;\r\nvar canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;\r\nvar documentMode = null;\r\nif (canUseDOM && 'documentMode' in document) {\r\n documentMode = document.documentMode;\r\n}\r\n// Webkit offers a very useful `textInput` event that can be used to\r\n// directly represent `beforeInput`. The IE `textinput` event is not as\r\n// useful, so we don't use it.\r\nvar canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode;\r\n// In IE9+, we have access to composition events, but the data supplied\r\n// by the native compositionend event may be incorrect. Japanese ideographic\r\n// spaces, for instance (\\u3000) are not recorded correctly.\r\nvar useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);\r\nvar SPACEBAR_CODE = 32;\r\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);\r\n// Events and their corresponding property names.\r\nvar eventTypes = {\r\n beforeInput: {\r\n phasedRegistrationNames: {\r\n bubbled: 'onBeforeInput',\r\n captured: 'onBeforeInputCapture'\r\n },\r\n dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]\r\n },\r\n compositionEnd: {\r\n phasedRegistrationNames: {\r\n bubbled: 'onCompositionEnd',\r\n captured: 'onCompositionEndCapture'\r\n },\r\n dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\r\n },\r\n compositionStart: {\r\n phasedRegistrationNames: {\r\n bubbled: 'onCompositionStart',\r\n captured: 'onCompositionStartCapture'\r\n },\r\n dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\r\n },\r\n compositionUpdate: {\r\n phasedRegistrationNames: {\r\n bubbled: 'onCompositionUpdate',\r\n captured: 'onCompositionUpdateCapture'\r\n },\r\n dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\r\n }\r\n};\r\n// Track whether we've ever handled a keypress on the space key.\r\nvar hasSpaceKeypress = false;\r\n/**\r\n * Return whether a native keypress event is assumed to be a command.\r\n * This is required because Firefox fires `keypress` events for key commands\r\n * (cut, copy, select-all, etc.) even though no character is inserted.\r\n */\r\nfunction isKeypressCommand(nativeEvent) {\r\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\r\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\r\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\r\n}\r\n/**\r\n * Translate native top level events into event types.\r\n *\r\n * @param {string} topLevelType\r\n * @return {object}\r\n */\r\nfunction getCompositionEventType(topLevelType) {\r\n switch (topLevelType) {\r\n case TOP_COMPOSITION_START:\r\n return eventTypes.compositionStart;\r\n case TOP_COMPOSITION_END:\r\n return eventTypes.compositionEnd;\r\n case TOP_COMPOSITION_UPDATE:\r\n return eventTypes.compositionUpdate;\r\n }\r\n}\r\n/**\r\n * Does our fallback best-guess model think this event signifies that\r\n * composition has begun?\r\n *\r\n * @param {string} topLevelType\r\n * @param {object} nativeEvent\r\n * @return {boolean}\r\n */\r\nfunction isFallbackCompositionStart(topLevelType, nativeEvent) {\r\n return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;\r\n}\r\n/**\r\n * Does our fallback mode think that this event is the end of composition?\r\n *\r\n * @param {string} topLevelType\r\n * @param {object} nativeEvent\r\n * @return {boolean}\r\n */\r\nfunction isFallbackCompositionEnd(topLevelType, nativeEvent) {\r\n switch (topLevelType) {\r\n case TOP_KEY_UP:\r\n // Command keys insert or clear IME input.\r\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\r\n case TOP_KEY_DOWN:\r\n // Expect IME keyCode on each keydown. If we get any other\r\n // code we must have exited earlier.\r\n return nativeEvent.keyCode !== START_KEYCODE;\r\n case TOP_KEY_PRESS:\r\n case TOP_MOUSE_DOWN:\r\n case TOP_BLUR:\r\n // Events are not possible without cancelling IME.\r\n return true;\r\n default:\r\n return false;\r\n }\r\n}\r\n/**\r\n * Google Input Tools provides composition data via a CustomEvent,\r\n * with the `data` property populated in the `detail` object. If this\r\n * is available on the event object, use it. If not, this is a plain\r\n * composition event and we have nothing special to extract.\r\n *\r\n * @param {object} nativeEvent\r\n * @return {?string}\r\n */\r\nfunction getDataFromCustomEvent(nativeEvent) {\r\n var detail = nativeEvent.detail;\r\n if (typeof detail === 'object' && 'data' in detail) {\r\n return detail.data;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Check if a composition event was triggered by Korean IME.\r\n * Our fallback mode does not work well with IE's Korean IME,\r\n * so just use native composition events when Korean IME is used.\r\n * Although CompositionEvent.locale property is deprecated,\r\n * it is available in IE, where our fallback mode is enabled.\r\n *\r\n * @param {object} nativeEvent\r\n * @return {boolean}\r\n */\r\nfunction isUsingKoreanIME(nativeEvent) {\r\n return nativeEvent.locale === 'ko';\r\n}\r\n// Track the current IME composition status, if any.\r\nvar isComposing = false;\r\n/**\r\n * @return {?object} A SyntheticCompositionEvent.\r\n */\r\nfunction extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\r\n var eventType = void 0;\r\n var fallbackData = void 0;\r\n if (canUseCompositionEvent) {\r\n eventType = getCompositionEventType(topLevelType);\r\n } else if (!isComposing) {\r\n if (isFallbackCompositionStart(topLevelType, nativeEvent)) {\r\n eventType = eventTypes.compositionStart;\r\n }\r\n } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {\r\n eventType = eventTypes.compositionEnd;\r\n }\r\n if (!eventType) {\r\n return null;\r\n }\r\n if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {\r\n // The current composition is stored statically and must not be\r\n // overwritten while composition continues.\r\n if (!isComposing && eventType === eventTypes.compositionStart) {\r\n isComposing = initialize(nativeEventTarget);\r\n } else if (eventType === eventTypes.compositionEnd) {\r\n if (isComposing) {\r\n fallbackData = getData();\r\n }\r\n }\r\n }\r\n var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);\r\n if (fallbackData) {\r\n // Inject data generated from fallback path into the synthetic event.\r\n // This matches the property of native CompositionEventInterface.\r\n event.data = fallbackData;\r\n } else {\r\n var customData = getDataFromCustomEvent(nativeEvent);\r\n if (customData !== null) {\r\n event.data = customData;\r\n }\r\n }\r\n accumulateTwoPhaseDispatches(event);\r\n return event;\r\n}\r\n/**\r\n * @param {TopLevelType} topLevelType Number from `TopLevelType`.\r\n * @param {object} nativeEvent Native browser event.\r\n * @return {?string} The string corresponding to this `beforeInput` event.\r\n */\r\nfunction getNativeBeforeInputChars(topLevelType, nativeEvent) {\r\n switch (topLevelType) {\r\n case TOP_COMPOSITION_END:\r\n return getDataFromCustomEvent(nativeEvent);\r\n case TOP_KEY_PRESS:\r\n /**\r\n * If native `textInput` events are available, our goal is to make\r\n * use of them. However, there is a special case: the spacebar key.\r\n * In Webkit, preventing default on a spacebar `textInput` event\r\n * cancels character insertion, but it *also* causes the browser\r\n * to fall back to its default spacebar behavior of scrolling the\r\n * page.\r\n *\r\n * Tracking at:\r\n * https://code.google.com/p/chromium/issues/detail?id=355103\r\n *\r\n * To avoid this issue, use the keypress event as if no `textInput`\r\n * event is available.\r\n */\r\n var which = nativeEvent.which;\r\n if (which !== SPACEBAR_CODE) {\r\n return null;\r\n }\r\n hasSpaceKeypress = true;\r\n return SPACEBAR_CHAR;\r\n case TOP_TEXT_INPUT:\r\n // Record the characters to be added to the DOM.\r\n var chars = nativeEvent.data;\r\n // If it's a spacebar character, assume that we have already handled\r\n // it at the keypress level and bail immediately. Android Chrome\r\n // doesn't give us keycodes, so we need to ignore it.\r\n if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\r\n return null;\r\n }\r\n return chars;\r\n default:\r\n // For other native event types, do nothing.\r\n return null;\r\n }\r\n}\r\n/**\r\n * For browsers that do not provide the `textInput` event, extract the\r\n * appropriate string to use for SyntheticInputEvent.\r\n *\r\n * @param {number} topLevelType Number from `TopLevelEventTypes`.\r\n * @param {object} nativeEvent Native browser event.\r\n * @return {?string} The fallback string for this `beforeInput` event.\r\n */\r\nfunction getFallbackBeforeInputChars(topLevelType, nativeEvent) {\r\n // If we are currently composing (IME) and using a fallback to do so,\r\n // try to extract the composed characters from the fallback object.\r\n // If composition event is available, we extract a string only at\r\n // compositionevent, otherwise extract it at fallback events.\r\n if (isComposing) {\r\n if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {\r\n var chars = getData();\r\n reset();\r\n isComposing = false;\r\n return chars;\r\n }\r\n return null;\r\n }\r\n switch (topLevelType) {\r\n case TOP_PASTE:\r\n // If a paste event occurs after a keypress, throw out the input\r\n // chars. Paste events should not lead to BeforeInput events.\r\n return null;\r\n case TOP_KEY_PRESS:\r\n /**\r\n * As of v27, Firefox may fire keypress events even when no character\r\n * will be inserted. A few possibilities:\r\n *\r\n * - `which` is `0`. Arrow keys, Esc key, etc.\r\n *\r\n * - `which` is the pressed key code, but no char is available.\r\n * Ex: 'AltGr + d` in Polish. There is no modified character for\r\n * this key combination and no character is inserted into the\r\n * document, but FF fires the keypress for char code `100` anyway.\r\n * No `input` event will occur.\r\n *\r\n * - `which` is the pressed key code, but a command combination is\r\n * being used. Ex: `Cmd+C`. No character is inserted, and no\r\n * `input` event will occur.\r\n */\r\n if (!isKeypressCommand(nativeEvent)) {\r\n // IE fires the `keypress` event when a user types an emoji via\r\n // Touch keyboard of Windows. In such a case, the `char` property\r\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\r\n // is 2, the property `which` does not represent an emoji correctly.\r\n // In such a case, we directly return the `char` property instead of\r\n // using `which`.\r\n if (nativeEvent.char && nativeEvent.char.length > 1) {\r\n return nativeEvent.char;\r\n } else if (nativeEvent.which) {\r\n return String.fromCharCode(nativeEvent.which);\r\n }\r\n }\r\n return null;\r\n case TOP_COMPOSITION_END:\r\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\r\n default:\r\n return null;\r\n }\r\n}\r\n/**\r\n * Extract a SyntheticInputEvent for `beforeInput`, based on either native\r\n * `textInput` or fallback behavior.\r\n *\r\n * @return {?object} A SyntheticInputEvent.\r\n */\r\nfunction extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\r\n var chars = void 0;\r\n if (canUseTextInputEvent) {\r\n chars = getNativeBeforeInputChars(topLevelType, nativeEvent);\r\n } else {\r\n chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);\r\n }\r\n // If no characters are being inserted, no BeforeInput event should\r\n // be fired.\r\n if (!chars) {\r\n return null;\r\n }\r\n var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);\r\n event.data = chars;\r\n accumulateTwoPhaseDispatches(event);\r\n return event;\r\n}\r\n/**\r\n * Create an `onBeforeInput` event to match\r\n * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.\r\n *\r\n * This event plugin is based on the native `textInput` event\r\n * available in Chrome, Safari, Opera, and IE. This event fires after\r\n * `onKeyPress` and `onCompositionEnd`, but before `onInput`.\r\n *\r\n * `beforeInput` is spec'd but not implemented in any browsers, and\r\n * the `input` event does not provide any useful information about what has\r\n * actually been added, contrary to the spec. Thus, `textInput` is the best\r\n * available event to identify the characters that have actually been inserted\r\n * into the target node.\r\n *\r\n * This plugin is also responsible for emitting `composition` events, thus\r\n * allowing us to share composition fallback code for both `beforeInput` and\r\n * `composition` event types.\r\n */\r\nvar BeforeInputEventPlugin = {\r\n eventTypes: eventTypes,\r\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\r\n var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);\r\n var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);\r\n if (composition === null) {\r\n return beforeInput;\r\n }\r\n if (beforeInput === null) {\r\n return composition;\r\n }\r\n return [composition, beforeInput];\r\n }\r\n};\r\n// Use to restore controlled state after a change event has fired.\r\nvar restoreImpl = null;\r\nvar restoreTarget = null;\r\nvar restoreQueue = null;\r\nfunction restoreStateOfTarget(target) {\r\n // We perform this translation at the end of the event loop so that we\r\n // always receive the correct fiber here\r\n var internalInstance = getInstanceFromNode(target);\r\n if (!internalInstance) {\r\n // Unmounted\r\n return;\r\n }\r\n (function () {\r\n if (!(typeof restoreImpl === 'function')) {\r\n {\r\n throw ReactError(Error('setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.'));\r\n }\r\n }\r\n })();\r\n var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);\r\n restoreImpl(internalInstance.stateNode, internalInstance.type, props);\r\n}\r\nfunction setRestoreImplementation(impl) {\r\n restoreImpl = impl;\r\n}\r\nfunction enqueueStateRestore(target) {\r\n if (restoreTarget) {\r\n if (restoreQueue) {\r\n restoreQueue.push(target);\r\n } else {\r\n restoreQueue = [target];\r\n }\r\n } else {\r\n restoreTarget = target;\r\n }\r\n}\r\nfunction needsStateRestore() {\r\n return restoreTarget !== null || restoreQueue !== null;\r\n}\r\nfunction restoreStateIfNeeded() {\r\n if (!restoreTarget) {\r\n return;\r\n }\r\n var target = restoreTarget;\r\n var queuedTargets = restoreQueue;\r\n restoreTarget = null;\r\n restoreQueue = null;\r\n restoreStateOfTarget(target);\r\n if (queuedTargets) {\r\n for (var i = 0; i < queuedTargets.length; i++) {\r\n restoreStateOfTarget(queuedTargets[i]);\r\n }\r\n }\r\n}\r\nvar enableUserTimingAPI = true;\r\n// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:\r\nvar debugRenderPhaseSideEffects = false;\r\n// In some cases, StrictMode should also double-render lifecycles.\r\n// This can be confusing for tests though,\r\n// And it can be bad for performance in production.\r\n// This feature flag can be used to control the behavior:\r\nvar debugRenderPhaseSideEffectsForStrictMode = true;\r\n// To preserve the \"Pause on caught exceptions\" behavior of the debugger, we\r\n// replay the begin phase of a failed component inside invokeGuardedCallback.\r\nvar replayFailedUnitOfWorkWithInvokeGuardedCallback = true;\r\n// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:\r\nvar warnAboutDeprecatedLifecycles = true;\r\n// Gather advanced timing metrics for Profiler subtrees.\r\nvar enableProfilerTimer = true;\r\n// Trace which interactions trigger each commit.\r\nvar enableSchedulerTracing = true;\r\n// Only used in www builds.\r\nvar enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false.\r\n// Only used in www builds.\r\n// Only used in www builds.\r\n// Disable javascript: URL strings in href for XSS protection.\r\nvar disableJavaScriptURLs = false;\r\n// React Fire: prevent the value and checked attributes from syncing\r\n// with their related DOM properties\r\nvar disableInputAttributeSyncing = false;\r\n// These APIs will no longer be \"unstable\" in the upcoming 16.7 release,\r\n// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.\r\nvar enableStableConcurrentModeAPIs = false;\r\nvar warnAboutShorthandPropertyCollision = false;\r\n// See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information\r\n// This is a flag so we can fix warnings in RN core before turning it on\r\n// Experimental React Flare event system and event components support.\r\nvar enableFlareAPI = false;\r\n// Experimental Host Component support.\r\nvar enableFundamentalAPI = false;\r\n// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107\r\n// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)\r\n// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version\r\nvar warnAboutUnmockedScheduler = false;\r\n// Temporary flag to revert the fix in #15650\r\nvar revertPassiveEffectsChange = false;\r\n// For tests, we flush suspense fallbacks in an act scope;\r\n// *except* in some of our own tests, where we test incremental loading states.\r\nvar flushSuspenseFallbacksInTests = true;\r\n// Changes priority of some events like mousemove to user-blocking priority,\r\n// but without making them discrete. The flag exists in case it causes\r\n// starvation problems.\r\nvar enableUserBlockingEvents = false;\r\n// Add a callback property to suspense to notify which promises are currently\r\n// in the update queue. This allows reporting and tracing of what is causing\r\n// the user to see a loading state.\r\nvar enableSuspenseCallback = false;\r\n// Part of the simplification of React.createElement so we can eventually move\r\n// from React.createElement to React.jsx\r\n// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md\r\nvar warnAboutDefaultPropsOnFunctionComponents = false;\r\nvar disableLegacyContext = false;\r\nvar disableSchedulerTimeoutBasedOnReactExpirationTime = false;\r\n// Used as a way to call batchedUpdates when we don't have a reference to\r\n// the renderer. Such as when we're dispatching events or if third party\r\n// libraries need to call batchedUpdates. Eventually, this API will go away when\r\n// everything is batched by default. We'll then have a similar API to opt-out of\r\n// scheduled work and instead do synchronous work.\r\n// Defaults\r\nvar batchedUpdatesImpl = function (fn, bookkeeping) {\r\n return fn(bookkeeping);\r\n};\r\nvar discreteUpdatesImpl = function (fn, a, b, c) {\r\n return fn(a, b, c);\r\n};\r\nvar flushDiscreteUpdatesImpl = function () {};\r\nvar batchedEventUpdatesImpl = batchedUpdatesImpl;\r\nvar isInsideEventHandler = false;\r\nfunction finishEventHandler() {\r\n // Here we wait until all updates have propagated, which is important\r\n // when using controlled components within layers:\r\n // https://github.com/facebook/react/issues/1698\r\n // Then we restore state of any controlled component.\r\n var controlledComponentsHavePendingUpdates = needsStateRestore();\r\n if (controlledComponentsHavePendingUpdates) {\r\n // If a controlled event was fired, we may need to restore the state of\r\n // the DOM node back to the controlled value. This is necessary when React\r\n // bails out of the update without touching the DOM.\r\n flushDiscreteUpdatesImpl();\r\n restoreStateIfNeeded();\r\n }\r\n}\r\nfunction batchedUpdates(fn, bookkeeping) {\r\n if (isInsideEventHandler) {\r\n // If we are currently inside another batch, we need to wait until it\r\n // fully completes before restoring state.\r\n return fn(bookkeeping);\r\n }\r\n isInsideEventHandler = true;\r\n try {\r\n return batchedUpdatesImpl(fn, bookkeeping);\r\n } finally {\r\n isInsideEventHandler = false;\r\n finishEventHandler();\r\n }\r\n}\r\nfunction batchedEventUpdates(fn, a, b) {\r\n if (isInsideEventHandler) {\r\n // If we are currently inside another batch, we need to wait until it\r\n // fully completes before restoring state.\r\n return fn(a, b);\r\n }\r\n isInsideEventHandler = true;\r\n try {\r\n return batchedEventUpdatesImpl(fn, a, b);\r\n } finally {\r\n isInsideEventHandler = false;\r\n finishEventHandler();\r\n }\r\n}\r\nfunction discreteUpdates(fn, a, b, c) {\r\n var prevIsInsideEventHandler = isInsideEventHandler;\r\n isInsideEventHandler = true;\r\n try {\r\n return discreteUpdatesImpl(fn, a, b, c);\r\n } finally {\r\n isInsideEventHandler = prevIsInsideEventHandler;\r\n if (!isInsideEventHandler) {\r\n finishEventHandler();\r\n }\r\n }\r\n}\r\nvar lastFlushedEventTimeStamp = 0;\r\nfunction flushDiscreteUpdatesIfNeeded(timeStamp) {\r\n // event.timeStamp isn't overly reliable due to inconsistencies in\r\n // how different browsers have historically provided the time stamp.\r\n // Some browsers provide high-resolution time stamps for all events,\r\n // some provide low-resolution time stamps for all events. FF < 52\r\n // even mixes both time stamps together. Some browsers even report\r\n // negative time stamps or time stamps that are 0 (iOS9) in some cases.\r\n // Given we are only comparing two time stamps with equality (!==),\r\n // we are safe from the resolution differences. If the time stamp is 0\r\n // we bail-out of preventing the flush, which can affect semantics,\r\n // such as if an earlier flush removes or adds event listeners that\r\n // are fired in the subsequent flush. However, this is the same\r\n // behaviour as we had before this change, so the risks are low.\r\n if (!isInsideEventHandler && (!enableFlareAPI || timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)) {\r\n lastFlushedEventTimeStamp = timeStamp;\r\n flushDiscreteUpdatesImpl();\r\n }\r\n}\r\nfunction setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {\r\n batchedUpdatesImpl = _batchedUpdatesImpl;\r\n discreteUpdatesImpl = _discreteUpdatesImpl;\r\n flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;\r\n batchedEventUpdatesImpl = _batchedEventUpdatesImpl;\r\n}\r\n/**\r\n * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\r\n */\r\nvar supportedInputTypes = {\r\n color: true,\r\n date: true,\r\n datetime: true,\r\n 'datetime-local': true,\r\n email: true,\r\n month: true,\r\n number: true,\r\n password: true,\r\n range: true,\r\n search: true,\r\n tel: true,\r\n text: true,\r\n time: true,\r\n url: true,\r\n week: true\r\n};\r\nfunction isTextInputElement(elem) {\r\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\r\n if (nodeName === 'input') {\r\n return !!supportedInputTypes[elem.type];\r\n }\r\n if (nodeName === 'textarea') {\r\n return true;\r\n }\r\n return false;\r\n}\r\n/**\r\n * HTML nodeType values that represent the type of the node\r\n */\r\nvar ELEMENT_NODE = 1;\r\nvar TEXT_NODE = 3;\r\nvar COMMENT_NODE = 8;\r\nvar DOCUMENT_NODE = 9;\r\nvar DOCUMENT_FRAGMENT_NODE = 11;\r\n/**\r\n * Gets the target node from a native browser event by accounting for\r\n * inconsistencies in browser DOM APIs.\r\n *\r\n * @param {object} nativeEvent Native browser event.\r\n * @return {DOMEventTarget} Target node.\r\n */\r\nfunction getEventTarget(nativeEvent) {\r\n // Fallback to nativeEvent.srcElement for IE9\r\n // https://github.com/facebook/react/issues/12506\r\n var target = nativeEvent.target || nativeEvent.srcElement || window;\r\n // Normalize SVG