exports.ids = [1];
exports.modules = {

/***/ 138:
/***/ (function(module, exports, __webpack_require__) {

var parse = __webpack_require__(25)
var getDaysInMonth = __webpack_require__(139)

/**
 * @category Month Helpers
 * @summary Add the specified number of months to the given date.
 *
 * @description
 * Add the specified number of months to the given date.
 *
 * @param {Date|String|Number} date - the date to be changed
 * @param {Number} amount - the amount of months to be added
 * @returns {Date} the new date with the months added
 *
 * @example
 * // Add 5 months to 1 September 2014:
 * var result = addMonths(new Date(2014, 8, 1), 5)
 * //=> Sun Feb 01 2015 00:00:00
 */
function addMonths (dirtyDate, dirtyAmount) {
  var date = parse(dirtyDate)
  var amount = Number(dirtyAmount)
  var desiredMonth = date.getMonth() + amount
  var dateWithDesiredMonth = new Date(0)
  dateWithDesiredMonth.setFullYear(date.getFullYear(), desiredMonth, 1)
  dateWithDesiredMonth.setHours(0, 0, 0, 0)
  var daysInMonth = getDaysInMonth(dateWithDesiredMonth)
  // Set the last day of the new month
  // if the original date was the last day of the longer month
  date.setMonth(desiredMonth, Math.min(daysInMonth, date.getDate()))
  return date
}

module.exports = addMonths


/***/ }),

/***/ 139:
/***/ (function(module, exports, __webpack_require__) {

var parse = __webpack_require__(25)

/**
 * @category Month Helpers
 * @summary Get the number of days in a month of the given date.
 *
 * @description
 * Get the number of days in a month of the given date.
 *
 * @param {Date|String|Number} date - the given date
 * @returns {Number} the number of days in a month
 *
 * @example
 * // How many days are in February 2000?
 * var result = getDaysInMonth(new Date(2000, 1))
 * //=> 29
 */
function getDaysInMonth (dirtyDate) {
  var date = parse(dirtyDate)
  var year = date.getFullYear()
  var monthIndex = date.getMonth()
  var lastDayOfMonth = new Date(0)
  lastDayOfMonth.setFullYear(year, monthIndex + 1, 0)
  lastDayOfMonth.setHours(0, 0, 0, 0)
  return lastDayOfMonth.getDate()
}

module.exports = getDaysInMonth


/***/ }),

/***/ 140:
/***/ (function(module, exports, __webpack_require__) {

var parse = __webpack_require__(25)

/**
 * @category Day Helpers
 * @summary Add the specified number of days to the given date.
 *
 * @description
 * Add the specified number of days to the given date.
 *
 * @param {Date|String|Number} date - the date to be changed
 * @param {Number} amount - the amount of days to be added
 * @returns {Date} the new date with the days added
 *
 * @example
 * // Add 10 days to 1 September 2014:
 * var result = addDays(new Date(2014, 8, 1), 10)
 * //=> Thu Sep 11 2014 00:00:00
 */
function addDays (dirtyDate, dirtyAmount) {
  var date = parse(dirtyDate)
  var amount = Number(dirtyAmount)
  date.setDate(date.getDate() + amount)
  return date
}

module.exports = addDays


/***/ }),

/***/ 141:
/***/ (function(module, exports, __webpack_require__) {

var parse = __webpack_require__(25)

/**
 * @category Month Helpers
 * @summary Return the end of a month for the given date.
 *
 * @description
 * Return the end of a month for the given date.
 * The result will be in the local timezone.
 *
 * @param {Date|String|Number} date - the original date
 * @returns {Date} the end of a month
 *
 * @example
 * // The end of a month for 2 September 2014 11:55:00:
 * var result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Tue Sep 30 2014 23:59:59.999
 */
function endOfMonth (dirtyDate) {
  var date = parse(dirtyDate)
  var month = date.getMonth()
  date.setFullYear(date.getFullYear(), month + 1, 0)
  date.setHours(23, 59, 59, 999)
  return date
}

module.exports = endOfMonth


/***/ }),

/***/ 142:
/***/ (function(module, exports, __webpack_require__) {

var startOfDay = __webpack_require__(55)

/**
 * @category Day Helpers
 * @summary Are the given dates in the same day?
 *
 * @description
 * Are the given dates in the same day?
 *
 * @param {Date|String|Number} dateLeft - the first date to check
 * @param {Date|String|Number} dateRight - the second date to check
 * @returns {Boolean} the dates are in the same day
 *
 * @example
 * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
 * var result = isSameDay(
 *   new Date(2014, 8, 4, 6, 0),
 *   new Date(2014, 8, 4, 18, 0)
 * )
 * //=> true
 */
function isSameDay (dirtyDateLeft, dirtyDateRight) {
  var dateLeftStartOfDay = startOfDay(dirtyDateLeft)
  var dateRightStartOfDay = startOfDay(dirtyDateRight)

  return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime()
}

module.exports = isSameDay


/***/ }),

/***/ 143:
/***/ (function(module, exports, __webpack_require__) {

var parse = __webpack_require__(25)

/**
 * @category Month Helpers
 * @summary Are the given dates in the same month?
 *
 * @description
 * Are the given dates in the same month?
 *
 * @param {Date|String|Number} dateLeft - the first date to check
 * @param {Date|String|Number} dateRight - the second date to check
 * @returns {Boolean} the dates are in the same month
 *
 * @example
 * // Are 2 September 2014 and 25 September 2014 in the same month?
 * var result = isSameMonth(
 *   new Date(2014, 8, 2),
 *   new Date(2014, 8, 25)
 * )
 * //=> true
 */
function isSameMonth (dirtyDateLeft, dirtyDateRight) {
  var dateLeft = parse(dirtyDateLeft)
  var dateRight = parse(dirtyDateRight)
  return dateLeft.getFullYear() === dateRight.getFullYear() &&
    dateLeft.getMonth() === dateRight.getMonth()
}

module.exports = isSameMonth


/***/ }),

/***/ 144:
/***/ (function(module, exports, __webpack_require__) {

var startOfDay = __webpack_require__(55)

/**
 * @category Day Helpers
 * @summary Is the given date today?
 *
 * @description
 * Is the given date today?
 *
 * @param {Date|String|Number} date - the date to check
 * @returns {Boolean} the date is today
 *
 * @example
 * // If today is 6 October 2014, is 6 October 14:00:00 today?
 * var result = isToday(new Date(2014, 9, 6, 14, 0))
 * //=> true
 */
function isToday (dirtyDate) {
  return startOfDay(dirtyDate).getTime() === startOfDay(new Date()).getTime()
}

module.exports = isToday


/***/ }),

/***/ 145:
/***/ (function(module, exports, __webpack_require__) {

var parse = __webpack_require__(25)

/**
 * @category Month Helpers
 * @summary Return the start of a month for the given date.
 *
 * @description
 * Return the start of a month for the given date.
 * The result will be in the local timezone.
 *
 * @param {Date|String|Number} date - the original date
 * @returns {Date} the start of a month
 *
 * @example
 * // The start of a month for 2 September 2014 11:55:00:
 * var result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Mon Sep 01 2014 00:00:00
 */
function startOfMonth (dirtyDate) {
  var date = parse(dirtyDate)
  date.setDate(1)
  date.setHours(0, 0, 0, 0)
  return date
}

module.exports = startOfMonth


/***/ }),

/***/ 146:
/***/ (function(module, exports, __webpack_require__) {

var startOfDay = __webpack_require__(55)

/**
 * @category Day Helpers
 * @summary Return the start of today.
 *
 * @description
 * Return the start of today.
 *
 * @returns {Date} the start of today
 *
 * @example
 * // If today is 6 October 2014:
 * var result = startOfToday()
 * //=> Mon Oct 6 2014 00:00:00
 */
function startOfToday () {
  return startOfDay(new Date())
}

module.exports = startOfToday


/***/ }),

/***/ 147:
/***/ (function(module, exports, __webpack_require__) {

var addMonths = __webpack_require__(138)

/**
 * @category Month Helpers
 * @summary Subtract the specified number of months from the given date.
 *
 * @description
 * Subtract the specified number of months from the given date.
 *
 * @param {Date|String|Number} date - the date to be changed
 * @param {Number} amount - the amount of months to be subtracted
 * @returns {Date} the new date with the months subtracted
 *
 * @example
 * // Subtract 5 months from 1 February 2015:
 * var result = subMonths(new Date(2015, 1, 1), 5)
 * //=> Mon Sep 01 2014 00:00:00
 */
function subMonths (dirtyDate, dirtyAmount) {
  var amount = Number(dirtyAmount)
  return addMonths(dirtyDate, -amount)
}

module.exports = subMonths


/***/ }),

/***/ 149:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);

// EXTERNAL MODULE: ./src/theme.ts
var theme = __webpack_require__(1);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/add_days/index.js
var add_days = __webpack_require__(140);
var add_days_default = /*#__PURE__*/__webpack_require__.n(add_days);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/add_months/index.js
var add_months = __webpack_require__(138);
var add_months_default = /*#__PURE__*/__webpack_require__.n(add_months);

// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(0);
var react_default = /*#__PURE__*/__webpack_require__.n(react);

// EXTERNAL MODULE: ./src/icons/styles.ts
var styles = __webpack_require__(8);

// EXTERNAL MODULE: ./node_modules/react-native-web/dist/exports/createElement/index.js + 2 modules
var createElement = __webpack_require__(20);

// CONCATENATED MODULE: ./src/icons/ArrowLeft.tsx
var __assign = (undefined && undefined.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
/**
 * Material design redistributed from https://github.com/google/material-design-icons
 *
 * SVG contents redistributed under Apache License 2.0:
 * https://github.com/google/material-design-icons/blob/master/LICENSE
 * Copyright 2015 Google, Inc. All Rights Reserved.
 */



var ArrowLeft = function (props) {
    return Object(createElement["a" /* default */])('svg', __assign(__assign({}, props), { style: [styles["a" /* default */].root, props.style], viewBox: '0 0 24 24' }), react_default.a.createElement("g", null,
        react_default.a.createElement("path", { d: "M14 7l-5 5 5 5V7z" }),
        react_default.a.createElement("path", { fill: "none", d: "M24 0v24H0V0h24z" })));
};
ArrowLeft.metadata = { height: 24, width: 24 };
/* harmony default export */ var icons_ArrowLeft = (ArrowLeft);

// CONCATENATED MODULE: ./src/icons/ArrowRight.tsx
var ArrowRight_assign = (undefined && undefined.__assign) || function () {
    ArrowRight_assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return ArrowRight_assign.apply(this, arguments);
};
/**
 * Material design redistributed from https://github.com/google/material-design-icons
 *
 * SVG contents redistributed under Apache License 2.0:
 * https://github.com/google/material-design-icons/blob/master/LICENSE
 * Copyright 2015 Google, Inc. All Rights Reserved.
 */



var ArrowRight = function (props) {
    return Object(createElement["a" /* default */])('svg', ArrowRight_assign(ArrowRight_assign({}, props), { style: [styles["a" /* default */].root, props.style], viewBox: '0 0 24 24' }), react_default.a.createElement("g", null,
        react_default.a.createElement("path", { d: "M10 17l5-5-5-5v10z" }),
        react_default.a.createElement("path", { fill: "none", d: "M0 24V0h24v24H0z" })));
};
ArrowRight.metadata = { height: 24, width: 24 };
/* harmony default export */ var icons_ArrowRight = (ArrowRight);

// EXTERNAL MODULE: ./src/components/Button.tsx
var Button = __webpack_require__(27);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/end_of_month/index.js
var end_of_month = __webpack_require__(141);
var end_of_month_default = /*#__PURE__*/__webpack_require__.n(end_of_month);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/format/index.js
var format = __webpack_require__(58);
var format_default = /*#__PURE__*/__webpack_require__.n(format);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/get_days_in_month/index.js
var get_days_in_month = __webpack_require__(139);
var get_days_in_month_default = /*#__PURE__*/__webpack_require__.n(get_days_in_month);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/is_same_day/index.js
var is_same_day = __webpack_require__(142);
var is_same_day_default = /*#__PURE__*/__webpack_require__.n(is_same_day);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/is_same_month/index.js
var is_same_month = __webpack_require__(143);
var is_same_month_default = /*#__PURE__*/__webpack_require__.n(is_same_month);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/is_today/index.js
var is_today = __webpack_require__(144);
var is_today_default = /*#__PURE__*/__webpack_require__.n(is_today);

// EXTERNAL MODULE: ./src/components/RelativeModal.tsx
var RelativeModal = __webpack_require__(63);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/start_of_month/index.js
var start_of_month = __webpack_require__(145);
var start_of_month_default = /*#__PURE__*/__webpack_require__.n(start_of_month);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/start_of_today/index.js
var start_of_today = __webpack_require__(146);
var start_of_today_default = /*#__PURE__*/__webpack_require__.n(start_of_today);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/start_of_week/index.js
var start_of_week = __webpack_require__(95);
var start_of_week_default = /*#__PURE__*/__webpack_require__.n(start_of_week);

// EXTERNAL MODULE: /Users/parmstrong/Development/build-tracker/node_modules/date-fns/sub_months/index.js
var sub_months = __webpack_require__(147);
var sub_months_default = /*#__PURE__*/__webpack_require__.n(sub_months);

// EXTERNAL MODULE: ./node_modules/react-native-web/dist/exports/View/index.js
var View = __webpack_require__(7);

// EXTERNAL MODULE: ./node_modules/react-native-web/dist/exports/Text/index.js
var Text = __webpack_require__(62);

// EXTERNAL MODULE: ./node_modules/react-native-web/dist/exports/StyleSheet/index.js + 1 modules
var StyleSheet = __webpack_require__(3);

// CONCATENATED MODULE: ./src/components/DatePicker.tsx
/**
 * Copyright (c) 2019 Paul Armstrong
 */



















var DatePicker = function (props) {
    var _a = props.maxDate, maxDate = _a === void 0 ? new Date(8640000000000000) : _a, _b = props.minDate, minDate = _b === void 0 ? new Date(-8640000000000000) : _b, onDismiss = props.onDismiss, onSelect = props.onSelect, relativeTo = props.relativeTo, _c = props.selectedDate, selectedDate = _c === void 0 ? start_of_today_default()() : _c;
    var _d = react_default.a.useState(start_of_month_default()(selectedDate)), currentMonth = _d[0], setCurrentMonth = _d[1];
    var daysInMonth = get_days_in_month_default()(currentMonth);
    var startDate = start_of_week_default()(start_of_month_default()(currentMonth), { weekStartsOn: 0 });
    var weeksInMonth = Math.ceil(daysInMonth / 7 + 2);
    var month = new Array(weeksInMonth).fill(0).reduce(function (memo, _week, weekIndex) {
        var firstDayOfWeek = add_days_default()(startDate, weekIndex * 7);
        if (weekIndex > 0 && !is_same_month_default()(firstDayOfWeek, currentMonth)) {
            return memo;
        }
        memo.push(new Array(7).fill(0).map(function (_, dayIndex) {
            var date = add_days_default()(firstDayOfWeek, dayIndex);
            return { date: date, isSameMonth: is_same_month_default()(date, currentMonth) };
        }));
        return memo;
    }, []);
    var handleNextMonth = react_default.a.useCallback(function () {
        setCurrentMonth(function (currentMonth) { return add_months_default()(currentMonth, 1); });
    }, []);
    var handlePreviousMonth = react_default.a.useCallback(function () {
        setCurrentMonth(function (currentMonth) { return sub_months_default()(currentMonth, 1); });
    }, []);
    return (react_default.a.createElement(RelativeModal["a" /* default */], { onDismiss: onDismiss, portalRootID: "menuPortal", relativeTo: relativeTo },
        react_default.a.createElement(View["a" /* default */], { style: [DatePicker_styles.month] },
            react_default.a.createElement(View["a" /* default */], { style: DatePicker_styles.header },
                react_default.a.createElement(View["a" /* default */], { style: DatePicker_styles.day },
                    react_default.a.createElement(Button["a" /* default */], { disabled: end_of_month_default()(sub_months_default()(currentMonth, 1)) < minDate, icon: icons_ArrowLeft, iconOnly: true, onPress: handlePreviousMonth, title: "Previous month" })),
                react_default.a.createElement(View["a" /* default */], { style: DatePicker_styles.monthHeader },
                    react_default.a.createElement(Text["a" /* default */], { style: DatePicker_styles.monthText }, format_default()(currentMonth, 'MMMM'))),
                react_default.a.createElement(View["a" /* default */], { style: DatePicker_styles.day },
                    react_default.a.createElement(Button["a" /* default */], { disabled: start_of_month_default()(add_months_default()(currentMonth, 1)) > maxDate, icon: icons_ArrowRight, iconOnly: true, onPress: handleNextMonth, title: "Next month" }))),
            react_default.a.createElement(View["a" /* default */], { style: DatePicker_styles.week }, month[0].map(function (day, index) { return (react_default.a.createElement(View["a" /* default */], { key: index, style: DatePicker_styles.day },
                react_default.a.createElement(Text["a" /* default */], { style: DatePicker_styles.text }, format_default()(day.date, 'dd')))); })),
            month.map(function (week, index) { return (react_default.a.createElement(View["a" /* default */], { key: index, style: DatePicker_styles.week }, week.map(function (day, index) {
                var inRange = day.date <= maxDate && day.date >= minDate;
                var isSelected = is_same_day_default()(day.date, selectedDate);
                var today = is_today_default()(day.date);
                return (react_default.a.createElement(View["a" /* default */], { key: index, style: DatePicker_styles.day },
                    react_default.a.createElement(Button["a" /* default */], { accessibilityLabel: format_default()(day.date, 'YYYY-MM-DD'), color: today ? 'secondary' : 'primary', disabled: !inRange, onPress: function () {
                            onSelect(day.date);
                        }, title: format_default()(day.date, 'D'), type: isSelected ? 'unelevated' : 'text' })));
            }))); }))));
};
var DatePicker_styles = StyleSheet["a" /* default */].create({
    root: {},
    month: {
        padding: theme["f" /* Spacing */].Xsmall,
    },
    header: {
        flexDirection: 'row',
    },
    day: {
        flexGrow: 1,
        flexBasis: (1 / 7) * 100 + "%",
    },
    hovered: {},
    monthHeader: {
        flexGrow: 1,
        flexShrink: 0,
        flexBasis: (5 / 7) * 100 + "%",
        justifyContent: 'center',
    },
    monthText: {
        textAlign: 'center',
        fontWeight: theme["d" /* FontWeight */].Bold,
    },
    week: {
        flexDirection: 'row',
    },
    text: {
        textAlign: 'center',
    },
});
/* harmony default export */ var components_DatePicker = __webpack_exports__["default"] = (DatePicker);


/***/ })

};;