?
return Object(external_this_wp_element_["createElement"])("ul", {
ref: this.bindList,
className: "components-form-token-field__suggestions-list",
id: "components-form-token-suggestions-".concat(this.props.instanceId),
role: "listbox"
}, Object(external_this_lodash_["map"])(this.props.suggestions, function (suggestion, index) {
var match = _this5.computeSuggestionMatch(suggestion);
var classeName = classnames_default()('components-form-token-field__suggestion', {
'is-selected': index === _this5.props.selectedIndex
});
/* eslint-disable jsx-a11y/click-events-have-key-events */
return Object(external_this_wp_element_["createElement"])("li", {
id: "components-form-token-suggestions-".concat(_this5.props.instanceId, "-").concat(index),
role: "option",
className: classeName,
key: suggestion,
onMouseDown: _this5.handleMouseDown,
onClick: _this5.handleClick(suggestion),
onMouseEnter: _this5.handleHover(suggestion),
"aria-selected": index === _this5.props.selectedIndex
}, match ? Object(external_this_wp_element_["createElement"])("span", {
"aria-label": _this5.props.displayTransform(suggestion)
}, match.suggestionBeforeMatch, Object(external_this_wp_element_["createElement"])("strong", {
className: "components-form-token-field__suggestion-match"
}, match.suggestionMatch), match.suggestionAfterMatch) : _this5.props.displayTransform(suggestion));
/* eslint-enable jsx-a11y/click-events-have-key-events */
}));
}
}]);
return SuggestionsList;
}(external_this_wp_element_["Component"]);
suggestions_list_SuggestionsList.defaultProps = {
match: '',
onHover: function onHover() {},
onSelect: function onSelect() {},
suggestions: Object.freeze([])
};
/* harmony default export */ var suggestions_list = (Object(external_this_wp_compose_["withSafeTimeout"])(suggestions_list_SuggestionsList));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/index.js
function form_token_field_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function form_token_field_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { form_token_field_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { form_token_field_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function form_token_field_createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (form_token_field_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function form_token_field_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var form_token_field_initialState = {
incompleteTokenValue: '',
inputOffsetFromEnd: 0,
isActive: false,
isExpanded: false,
selectedSuggestionIndex: -1,
selectedSuggestionScroll: false
};
var form_token_field_FormTokenField = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(FormTokenField, _Component);
var _super = form_token_field_createSuper(FormTokenField);
function FormTokenField() {
var _this;
Object(classCallCheck["a" /* default */])(this, FormTokenField);
_this = _super.apply(this, arguments);
_this.state = form_token_field_initialState;
_this.onKeyDown = _this.onKeyDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onKeyPress = _this.onKeyPress.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onFocus = _this.onFocus.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onBlur = _this.onBlur.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.deleteTokenBeforeInput = _this.deleteTokenBeforeInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.deleteTokenAfterInput = _this.deleteTokenAfterInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.addCurrentToken = _this.addCurrentToken.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onContainerTouched = _this.onContainerTouched.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.renderToken = _this.renderToken.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onTokenClickRemove = _this.onTokenClickRemove.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onSuggestionHovered = _this.onSuggestionHovered.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onSuggestionSelected = _this.onSuggestionSelected.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onInputChange = _this.onInputChange.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.bindInput = _this.bindInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.bindTokensAndInput = _this.bindTokensAndInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.updateSuggestions = _this.updateSuggestions.bind(Object(assertThisInitialized["a" /* default */])(_this));
return _this;
}
Object(createClass["a" /* default */])(FormTokenField, [{
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
// Make sure to focus the input when the isActive state is true.
if (this.state.isActive && !this.input.hasFocus()) {
this.input.focus();
}
var _this$props = this.props,
suggestions = _this$props.suggestions,
value = _this$props.value;
var suggestionsDidUpdate = !external_this_wp_isShallowEqual_default()(suggestions, prevProps.suggestions);
if (suggestionsDidUpdate || value !== prevProps.value) {
this.updateSuggestions(suggestionsDidUpdate);
}
}
}, {
key: "bindInput",
value: function bindInput(ref) {
this.input = ref;
}
}, {
key: "bindTokensAndInput",
value: function bindTokensAndInput(ref) {
this.tokensAndInput = ref;
}
}, {
key: "onFocus",
value: function onFocus(event) {
// If focus is on the input or on the container, set the isActive state to true.
if (this.input.hasFocus() || event.target === this.tokensAndInput) {
this.setState({
isActive: true
});
} else {
/*
* Otherwise, focus is on one of the token "remove" buttons and we
* set the isActive state to false to prevent the input to be
* re-focused, see componentDidUpdate().
*/
this.setState({
isActive: false
});
}
if ('function' === typeof this.props.onFocus) {
this.props.onFocus(event);
}
}
}, {
key: "onBlur",
value: function onBlur() {
if (this.inputHasValidValue()) {
this.setState({
isActive: false
});
} else {
this.setState(form_token_field_initialState);
}
}
}, {
key: "onKeyDown",
value: function onKeyDown(event) {
var preventDefault = false;
switch (event.keyCode) {
case external_this_wp_keycodes_["BACKSPACE"]:
preventDefault = this.handleDeleteKey(this.deleteTokenBeforeInput);
break;
case external_this_wp_keycodes_["ENTER"]:
preventDefault = this.addCurrentToken();
break;
case external_this_wp_keycodes_["LEFT"]:
preventDefault = this.handleLeftArrowKey();
break;
case external_this_wp_keycodes_["UP"]:
preventDefault = this.handleUpArrowKey();
break;
case external_this_wp_keycodes_["RIGHT"]:
preventDefault = this.handleRightArrowKey();
break;
case external_this_wp_keycodes_["DOWN"]:
preventDefault = this.handleDownArrowKey();
break;
case external_this_wp_keycodes_["DELETE"]:
preventDefault = this.handleDeleteKey(this.deleteTokenAfterInput);
break;
case external_this_wp_keycodes_["SPACE"]:
if (this.props.tokenizeOnSpace) {
preventDefault = this.addCurrentToken();
}
break;
case external_this_wp_keycodes_["ESCAPE"]:
preventDefault = this.handleEscapeKey(event);
event.stopPropagation();
break;
default:
break;
}
if (preventDefault) {
event.preventDefault();
}
}
}, {
key: "onKeyPress",
value: function onKeyPress(event) {
var preventDefault = false;
switch (event.charCode) {
case 44:
// comma
preventDefault = this.handleCommaKey();
break;
default:
break;
}
if (preventDefault) {
event.preventDefault();
}
}
}, {
key: "onContainerTouched",
value: function onContainerTouched(event) {
// Prevent clicking/touching the tokensAndInput container from blurring
// the input and adding the current token.
if (event.target === this.tokensAndInput && this.state.isActive) {
event.preventDefault();
}
}
}, {
key: "onTokenClickRemove",
value: function onTokenClickRemove(event) {
this.deleteToken(event.value);
this.input.focus();
}
}, {
key: "onSuggestionHovered",
value: function onSuggestionHovered(suggestion) {
var index = this.getMatchingSuggestions().indexOf(suggestion);
if (index >= 0) {
this.setState({
selectedSuggestionIndex: index,
selectedSuggestionScroll: false
});
}
}
}, {
key: "onSuggestionSelected",
value: function onSuggestionSelected(suggestion) {
this.addNewToken(suggestion);
}
}, {
key: "onInputChange",
value: function onInputChange(event) {
var text = event.value;
var separator = this.props.tokenizeOnSpace ? /[ ,\t]+/ : /[,\t]+/;
var items = text.split(separator);
var tokenValue = Object(external_this_lodash_["last"])(items) || '';
if (items.length > 1) {
this.addNewTokens(items.slice(0, -1));
}
this.setState({
incompleteTokenValue: tokenValue
}, this.updateSuggestions);
this.props.onInputChange(tokenValue);
}
}, {
key: "handleDeleteKey",
value: function handleDeleteKey(deleteToken) {
var preventDefault = false;
if (this.input.hasFocus() && this.isInputEmpty()) {
deleteToken();
preventDefault = true;
}
return preventDefault;
}
}, {
key: "handleLeftArrowKey",
value: function handleLeftArrowKey() {
var preventDefault = false;
if (this.isInputEmpty()) {
this.moveInputBeforePreviousToken();
preventDefault = true;
}
return preventDefault;
}
}, {
key: "handleRightArrowKey",
value: function handleRightArrowKey() {
var preventDefault = false;
if (this.isInputEmpty()) {
this.moveInputAfterNextToken();
preventDefault = true;
}
return preventDefault;
}
}, {
key: "handleUpArrowKey",
value: function handleUpArrowKey() {
var _this2 = this;
this.setState(function (state, props) {
return {
selectedSuggestionIndex: (state.selectedSuggestionIndex === 0 ? _this2.getMatchingSuggestions(state.incompleteTokenValue, props.suggestions, props.value, props.maxSuggestions, props.saveTransform).length : state.selectedSuggestionIndex) - 1,
selectedSuggestionScroll: true
};
});
return true; // preventDefault
}
}, {
key: "handleDownArrowKey",
value: function handleDownArrowKey() {
var _this3 = this;
this.setState(function (state, props) {
return {
selectedSuggestionIndex: (state.selectedSuggestionIndex + 1) % _this3.getMatchingSuggestions(state.incompleteTokenValue, props.suggestions, props.value, props.maxSuggestions, props.saveTransform).length,
selectedSuggestionScroll: true
};
});
return true; // preventDefault
}
}, {
key: "handleEscapeKey",
value: function handleEscapeKey(event) {
this.setState({
incompleteTokenValue: event.target.value,
isExpanded: false,
selectedSuggestionIndex: -1,
selectedSuggestionScroll: false
});
return true; // preventDefault
}
}, {
key: "handleCommaKey",
value: function handleCommaKey() {
if (this.inputHasValidValue()) {
this.addNewToken(this.state.incompleteTokenValue);
}
return true; // preventDefault
}
}, {
key: "moveInputToIndex",
value: function moveInputToIndex(index) {
this.setState(function (state, props) {
return {
inputOffsetFromEnd: props.value.length - Math.max(index, -1) - 1
};
});
}
}, {
key: "moveInputBeforePreviousToken",
value: function moveInputBeforePreviousToken() {
this.setState(function (state, props) {
return {
inputOffsetFromEnd: Math.min(state.inputOffsetFromEnd + 1, props.value.length)
};
});
}
}, {
key: "moveInputAfterNextToken",
value: function moveInputAfterNextToken() {
this.setState(function (state) {
return {
inputOffsetFromEnd: Math.max(state.inputOffsetFromEnd - 1, 0)
};
});
}
}, {
key: "deleteTokenBeforeInput",
value: function deleteTokenBeforeInput() {
var index = this.getIndexOfInput() - 1;
if (index > -1) {
this.deleteToken(this.props.value[index]);
}
}
}, {
key: "deleteTokenAfterInput",
value: function deleteTokenAfterInput() {
var index = this.getIndexOfInput();
if (index < this.props.value.length) {
this.deleteToken(this.props.value[index]); // update input offset since it's the offset from the last token
this.moveInputToIndex(index);
}
}
}, {
key: "addCurrentToken",
value: function addCurrentToken() {
var preventDefault = false;
var selectedSuggestion = this.getSelectedSuggestion();
if (selectedSuggestion) {
this.addNewToken(selectedSuggestion);
preventDefault = true;
} else if (this.inputHasValidValue()) {
this.addNewToken(this.state.incompleteTokenValue);
preventDefault = true;
}
return preventDefault;
}
}, {
key: "addNewTokens",
value: function addNewTokens(tokens) {
var _this4 = this;
var tokensToAdd = Object(external_this_lodash_["uniq"])(tokens.map(this.props.saveTransform).filter(Boolean).filter(function (token) {
return !_this4.valueContainsToken(token);
}));
if (tokensToAdd.length > 0) {
var newValue = Object(external_this_lodash_["clone"])(this.props.value);
newValue.splice.apply(newValue, [this.getIndexOfInput(), 0].concat(tokensToAdd));
this.props.onChange(newValue);
}
}
}, {
key: "addNewToken",
value: function addNewToken(token) {
this.addNewTokens([token]);
this.props.speak(this.props.messages.added, 'assertive');
this.setState({
incompleteTokenValue: '',
selectedSuggestionIndex: -1,
selectedSuggestionScroll: false,
isExpanded: false
});
if (this.state.isActive) {
this.input.focus();
}
}
}, {
key: "deleteToken",
value: function deleteToken(token) {
var _this5 = this;
var newTokens = this.props.value.filter(function (item) {
return _this5.getTokenValue(item) !== _this5.getTokenValue(token);
});
this.props.onChange(newTokens);
this.props.speak(this.props.messages.removed, 'assertive');
}
}, {
key: "getTokenValue",
value: function getTokenValue(token) {
if ('object' === Object(esm_typeof["a" /* default */])(token)) {
return token.value;
}
return token;
}
}, {
key: "getMatchingSuggestions",
value: function getMatchingSuggestions() {
var searchValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.incompleteTokenValue;
var suggestions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.props.suggestions;
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.props.value;
var maxSuggestions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.props.maxSuggestions;
var saveTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.props.saveTransform;
var match = saveTransform(searchValue);
var startsWithMatch = [];
var containsMatch = [];
if (match.length === 0) {
suggestions = Object(external_this_lodash_["difference"])(suggestions, value);
} else {
match = match.toLocaleLowerCase();
Object(external_this_lodash_["each"])(suggestions, function (suggestion) {
var index = suggestion.toLocaleLowerCase().indexOf(match);
if (value.indexOf(suggestion) === -1) {
if (index === 0) {
startsWithMatch.push(suggestion);
} else if (index > 0) {
containsMatch.push(suggestion);
}
}
});
suggestions = startsWithMatch.concat(containsMatch);
}
return Object(external_this_lodash_["take"])(suggestions, maxSuggestions);
}
}, {
key: "getSelectedSuggestion",
value: function getSelectedSuggestion() {
if (this.state.selectedSuggestionIndex !== -1) {
return this.getMatchingSuggestions()[this.state.selectedSuggestionIndex];
}
}
}, {
key: "valueContainsToken",
value: function valueContainsToken(token) {
var _this6 = this;
return Object(external_this_lodash_["some"])(this.props.value, function (item) {
return _this6.getTokenValue(token) === _this6.getTokenValue(item);
});
}
}, {
key: "getIndexOfInput",
value: function getIndexOfInput() {
return this.props.value.length - this.state.inputOffsetFromEnd;
}
}, {
key: "isInputEmpty",
value: function isInputEmpty() {
return this.state.incompleteTokenValue.length === 0;
}
}, {
key: "inputHasValidValue",
value: function inputHasValidValue() {
return this.props.saveTransform(this.state.incompleteTokenValue).length > 0;
}
}, {
key: "updateSuggestions",
value: function updateSuggestions() {
var resetSelectedSuggestion = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
var incompleteTokenValue = this.state.incompleteTokenValue;
var inputHasMinimumChars = incompleteTokenValue.trim().length > 1;
var matchingSuggestions = this.getMatchingSuggestions(incompleteTokenValue);
var hasMatchingSuggestions = matchingSuggestions.length > 0;
var newState = {
isExpanded: inputHasMinimumChars && hasMatchingSuggestions
};
if (resetSelectedSuggestion) {
newState.selectedSuggestionIndex = -1;
newState.selectedSuggestionScroll = false;
}
this.setState(newState);
if (inputHasMinimumChars) {
var debouncedSpeak = this.props.debouncedSpeak;
var message = hasMatchingSuggestions ? Object(external_this_wp_i18n_["sprintf"])(
/* translators: %d: number of results. */
Object(external_this_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : Object(external_this_wp_i18n_["__"])('No results.');
debouncedSpeak(message, 'assertive');
}
}
}, {
key: "renderTokensAndInput",
value: function renderTokensAndInput() {
var components = Object(external_this_lodash_["map"])(this.props.value, this.renderToken);
components.splice(this.getIndexOfInput(), 0, this.renderInput());
return components;
}
}, {
key: "renderToken",
value: function renderToken(token, index, tokens) {
var value = this.getTokenValue(token);
var status = token.status ? token.status : undefined;
var termPosition = index + 1;
var termsCount = tokens.length;
return Object(external_this_wp_element_["createElement"])(Token, {
key: 'token-' + value,
value: value,
status: status,
title: token.title,
displayTransform: this.props.displayTransform,
onClickRemove: this.onTokenClickRemove,
isBorderless: token.isBorderless || this.props.isBorderless,
onMouseEnter: token.onMouseEnter,
onMouseLeave: token.onMouseLeave,
disabled: 'error' !== status && this.props.disabled,
messages: this.props.messages,
termsCount: termsCount,
termPosition: termPosition
});
}
}, {
key: "renderInput",
value: function renderInput() {
var _this$props2 = this.props,
autoCapitalize = _this$props2.autoCapitalize,
autoComplete = _this$props2.autoComplete,
maxLength = _this$props2.maxLength,
value = _this$props2.value,
instanceId = _this$props2.instanceId;
var props = {
instanceId: instanceId,
autoCapitalize: autoCapitalize,
autoComplete: autoComplete,
ref: this.bindInput,
key: 'input',
disabled: this.props.disabled,
value: this.state.incompleteTokenValue,
onBlur: this.onBlur,
isExpanded: this.state.isExpanded,
selectedSuggestionIndex: this.state.selectedSuggestionIndex
};
if (!(maxLength && value.length >= maxLength)) {
props = form_token_field_objectSpread({}, props, {
onChange: this.onInputChange
});
}
return Object(external_this_wp_element_["createElement"])(token_input, props);
}
}, {
key: "render",
value: function render() {
var _this$props3 = this.props,
disabled = _this$props3.disabled,
_this$props3$label = _this$props3.label,
label = _this$props3$label === void 0 ? Object(external_this_wp_i18n_["__"])('Add item') : _this$props3$label,
instanceId = _this$props3.instanceId,
className = _this$props3.className;
var isExpanded = this.state.isExpanded;
var classes = classnames_default()(className, 'components-form-token-field__input-container', {
'is-active': this.state.isActive,
'is-disabled': disabled
});
var tokenFieldProps = {
className: 'components-form-token-field',
tabIndex: '-1'
};
var matchingSuggestions = this.getMatchingSuggestions();
if (!disabled) {
tokenFieldProps = Object.assign({}, tokenFieldProps, {
onKeyDown: this.onKeyDown,
onKeyPress: this.onKeyPress,
onFocus: this.onFocus
});
} // Disable reason: There is no appropriate role which describes the
// input container intended accessible usability.
// TODO: Refactor click detection to use blur to stop propagation.
/* eslint-disable jsx-a11y/no-static-element-interactions */
return Object(external_this_wp_element_["createElement"])("div", tokenFieldProps, Object(external_this_wp_element_["createElement"])("label", {
htmlFor: "components-form-token-input-".concat(instanceId),
className: "components-form-token-field__label"
}, label), Object(external_this_wp_element_["createElement"])("div", {
ref: this.bindTokensAndInput,
className: classes,
tabIndex: "-1",
onMouseDown: this.onContainerTouched,
onTouchStart: this.onContainerTouched
}, this.renderTokensAndInput(), isExpanded && Object(external_this_wp_element_["createElement"])(suggestions_list, {
instanceId: instanceId,
match: this.props.saveTransform(this.state.incompleteTokenValue),
displayTransform: this.props.displayTransform,
suggestions: matchingSuggestions,
selectedIndex: this.state.selectedSuggestionIndex,
scrollIntoView: this.state.selectedSuggestionScroll,
onHover: this.onSuggestionHovered,
onSelect: this.onSuggestionSelected
})), Object(external_this_wp_element_["createElement"])("p", {
id: "components-form-token-suggestions-howto-".concat(instanceId),
className: "components-form-token-field__help"
}, this.props.tokenizeOnSpace ? Object(external_this_wp_i18n_["__"])('Separate with commas, spaces, or the Enter key.') : Object(external_this_wp_i18n_["__"])('Separate with commas or the Enter key.')));
/* eslint-enable jsx-a11y/no-static-element-interactions */
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(props, state) {
if (!props.disabled || !state.isActive) {
return null;
}
return {
isActive: false,
incompleteTokenValue: ''
};
}
}]);
return FormTokenField;
}(external_this_wp_element_["Component"]);
form_token_field_FormTokenField.defaultProps = {
suggestions: Object.freeze([]),
maxSuggestions: 100,
value: Object.freeze([]),
displayTransform: external_this_lodash_["identity"],
saveTransform: function saveTransform(token) {
return token.trim();
},
onChange: function onChange() {},
onInputChange: function onInputChange() {},
isBorderless: false,
disabled: false,
tokenizeOnSpace: false,
messages: {
added: Object(external_this_wp_i18n_["__"])('Item added.'),
removed: Object(external_this_wp_i18n_["__"])('Item removed.'),
remove: Object(external_this_wp_i18n_["__"])('Remove item')
}
};
/* harmony default export */ var form_token_field = (with_spoken_messages(Object(external_this_wp_compose_["withInstanceId"])(form_token_field_FormTokenField)));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/icons.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var LinearGradientIcon = Object(external_this_wp_compose_["withInstanceId"])(function (_ref) {
var instanceId = _ref.instanceId;
var linerGradientId = "linear-gradient-".concat(instanceId);
return Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], {
fill: "none",
height: "20",
viewBox: "0 0 20 20",
width: "20",
xmlns: "http://www.w3.org/2000/svg"
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["LinearGradient"], {
id: linerGradientId,
gradientUnits: "userSpaceOnUse",
x1: "10",
x2: "10",
y1: "1",
y2: "19"
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Stop"], {
offset: "0",
stopColor: "#000000"
}), Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Stop"], {
offset: "1",
stopColor: "#ffffff"
})), Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], {
d: "m1 1h18v18h-18z",
fill: "url(#".concat(linerGradientId, ")")
}));
});
var RadialGradientIcon = Object(external_this_wp_compose_["withInstanceId"])(function (_ref2) {
var instanceId = _ref2.instanceId;
var radialGradientId = "radial-gradient-".concat(instanceId);
return Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], {
fill: "none",
height: "20",
viewBox: "0 0 20 20",
width: "20",
xmlns: "http://www.w3.org/2000/svg"
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["RadialGradient"], {
id: radialGradientId,
cx: "0",
cy: "0",
gradientTransform: "matrix(0 9 -9 0 10 10)",
gradientUnits: "userSpaceOnUse",
r: "1"
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Stop"], {
offset: "0",
stopColor: "#000000"
}), Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Stop"], {
offset: "1",
stopColor: "#ffffff"
})), Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Circle"], {
cx: "10",
cy: "10",
fill: "url(#".concat(radialGradientId, ")"),
r: "9"
}));
});
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus-circle.js
/**
* WordPress dependencies
*/
var plusCircle = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "-2 -2 24 24"
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], {
d: "M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6zM10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z"
}));
/* harmony default export */ var plus_circle = (plusCircle);
// EXTERNAL MODULE: ./node_modules/gradient-parser/build/node.js
var build_node = __webpack_require__(187);
var node_default = /*#__PURE__*/__webpack_require__.n(build_node);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/constants.js
var INSERT_POINT_WIDTH = 23;
var GRADIENT_MARKERS_WIDTH = 18;
var MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_MARKER = (INSERT_POINT_WIDTH + GRADIENT_MARKERS_WIDTH) / 2;
var MINIMUM_ABSOLUTE_LEFT_POSITION = 5;
var MINIMUM_DISTANCE_BETWEEN_POINTS = 9;
var MINIMUM_SIGNIFICANT_MOVE = 5;
var DEFAULT_GRADIENT = 'linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)';
var COLOR_POPOVER_PROPS = {
className: 'components-custom-gradient-picker__color-picker-popover',
position: 'top'
};
var DEFAULT_LINEAR_GRADIENT_ANGLE = 180;
var HORIZONTAL_GRADIENT_ORIENTATION = {
type: 'angular',
value: 90
};
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/serializer.js
/**
* External dependencies
*/
function serializeGradientColor(_ref) {
var type = _ref.type,
value = _ref.value;
if (type === 'literal') {
return value;
}
return "".concat(type, "(").concat(value.join(','), ")");
}
function serializeGradientPosition(_ref2) {
var type = _ref2.type,
value = _ref2.value;
return "".concat(value).concat(type);
}
function serializeGradientColorStop(_ref3) {
var type = _ref3.type,
value = _ref3.value,
length = _ref3.length;
return "".concat(serializeGradientColor({
type: type,
value: value
}), " ").concat(serializeGradientPosition(length));
}
function serializeGradientOrientation(orientation) {
if (!orientation || orientation.type !== 'angular') {
return;
}
return "".concat(orientation.value, "deg");
}
function serializeGradient(_ref4) {
var type = _ref4.type,
orientation = _ref4.orientation,
colorStops = _ref4.colorStops;
var serializedOrientation = serializeGradientOrientation(orientation);
var serializedColorStops = colorStops.sort(function (colorStop1, colorStop2) {
return Object(external_this_lodash_["get"])(colorStop1, ['length', 'value'], 0) - Object(external_this_lodash_["get"])(colorStop2, ['length', 'value'], 0);
}).map(serializeGradientColorStop);
return "".concat(type, "(").concat(Object(external_this_lodash_["compact"])([serializedOrientation].concat(Object(toConsumableArray["a" /* default */])(serializedColorStops))).join(','), ")");
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/utils.js
function utils_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { utils_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { utils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function tinyColorRgbToGradientColorStop(_ref) {
var r = _ref.r,
g = _ref.g,
b = _ref.b,
a = _ref.a;
if (a === 1) {
return {
type: 'rgb',
value: [r, g, b]
};
}
return {
type: 'rgba',
value: [r, g, b, a]
};
}
function getGradientWithColorStopAdded(gradientAST, relativePosition, rgbaColor) {
var colorStop = tinyColorRgbToGradientColorStop(rgbaColor);
colorStop.length = {
type: '%',
value: relativePosition
};
return utils_objectSpread({}, gradientAST, {
colorStops: [].concat(Object(toConsumableArray["a" /* default */])(gradientAST.colorStops), [colorStop])
});
}
function getGradientWithPositionAtIndexChanged(gradientAST, index, relativePosition) {
return utils_objectSpread({}, gradientAST, {
colorStops: gradientAST.colorStops.map(function (colorStop, colorStopIndex) {
if (colorStopIndex !== index) {
return colorStop;
}
return utils_objectSpread({}, colorStop, {
length: utils_objectSpread({}, colorStop.length, {
value: relativePosition
})
});
})
});
}
function isControlPointOverlapping(gradientAST, position, initialIndex) {
var initialPosition = parseInt(gradientAST.colorStops[initialIndex].length.value);
var minPosition = Math.min(initialPosition, position);
var maxPosition = Math.max(initialPosition, position);
return Object(external_this_lodash_["some"])(gradientAST.colorStops, function (_ref2, index) {
var length = _ref2.length;
var itemPosition = parseInt(length.value);
return index !== initialIndex && (Math.abs(itemPosition - position) < MINIMUM_DISTANCE_BETWEEN_POINTS || minPosition < itemPosition && itemPosition < maxPosition);
});
}
function getGradientWithPositionAtIndexSummed(gradientAST, index, valueToSum) {
var currentPosition = gradientAST.colorStops[index].length.value;
var newPosition = Math.max(0, Math.min(100, parseInt(currentPosition) + valueToSum));
if (isControlPointOverlapping(gradientAST, newPosition, index)) {
return gradientAST;
}
return getGradientWithPositionAtIndexChanged(gradientAST, index, newPosition);
}
function getGradientWithPositionAtIndexIncreased(gradientAST, index) {
return getGradientWithPositionAtIndexSummed(gradientAST, index, MINIMUM_DISTANCE_BETWEEN_POINTS);
}
function getGradientWithPositionAtIndexDecreased(gradientAST, index) {
return getGradientWithPositionAtIndexSummed(gradientAST, index, -MINIMUM_DISTANCE_BETWEEN_POINTS);
}
function getGradientWithColorAtIndexChanged(gradientAST, index, rgbaColor) {
return utils_objectSpread({}, gradientAST, {
colorStops: gradientAST.colorStops.map(function (colorStop, colorStopIndex) {
if (colorStopIndex !== index) {
return colorStop;
}
return utils_objectSpread({}, colorStop, {}, tinyColorRgbToGradientColorStop(rgbaColor));
})
});
}
function getGradientWithColorAtPositionChanged(gradientAST, relativePositionValue, rgbaColor) {
var index = Object(external_this_lodash_["findIndex"])(gradientAST.colorStops, function (colorStop) {
return colorStop && colorStop.length && colorStop.length.type === '%' && colorStop.length.value === relativePositionValue.toString();
});
return getGradientWithColorAtIndexChanged(gradientAST, index, rgbaColor);
}
function getGradientWithControlPointRemoved(gradientAST, index) {
return utils_objectSpread({}, gradientAST, {
colorStops: gradientAST.colorStops.filter(function (elem, elemIndex) {
return elemIndex !== index;
})
});
}
function getHorizontalRelativeGradientPosition(mouseXCoordinate, containerElement, positionedElementWidth) {
if (!containerElement) {
return;
}
var _containerElement$get = containerElement.getBoundingClientRect(),
x = _containerElement$get.x,
width = _containerElement$get.width;
var absolutePositionValue = mouseXCoordinate - x - MINIMUM_ABSOLUTE_LEFT_POSITION - positionedElementWidth / 2;
var availableWidth = width - MINIMUM_ABSOLUTE_LEFT_POSITION - INSERT_POINT_WIDTH;
return Math.round(Math.min(Math.max(absolutePositionValue * 100 / availableWidth, 0), 100));
}
/**
* Returns the marker points from a gradient AST.
*
* @param {Object} gradientAST An object representing the gradient AST.
*
* @return {Array.<{color: string, position: string, positionValue: number}>}
* An array of markerPoint objects.
* color: A string with the color code ready to be used in css style e.g: "rgba( 1, 2 , 3, 0.5)".
* position: A string with the position ready to be used in css style e.g: "70%".
* positionValue: A number with the relative position value e.g: 70.
*/
function getMarkerPoints(gradientAST) {
if (!gradientAST) {
return [];
}
return Object(external_this_lodash_["map"])(gradientAST.colorStops, function (colorStop) {
if (!colorStop || !colorStop.length || colorStop.length.type !== '%') {
return null;
}
return {
color: serializeGradientColor(colorStop),
position: serializeGradientPosition(colorStop.length),
positionValue: parseInt(colorStop.length.value)
};
});
}
function getLinearGradientRepresentationOfARadial(gradientAST) {
return serializeGradient({
type: 'linear-gradient',
orientation: HORIZONTAL_GRADIENT_ORIENTATION,
colorStops: gradientAST.colorStops
});
}
var DIRECTIONAL_ORIENTATION_ANGLE_MAP = {
top: 0,
'top right': 45,
'right top': 45,
right: 90,
'right bottom': 135,
'bottom right': 135,
bottom: 180,
'bottom left': 225,
'left bottom': 225,
left: 270,
'top left': 315,
'left top': 315
};
function getGradientParsed(value) {
var hasGradient = !!value; // gradientAST will contain the gradient AST as parsed by gradient-parser npm module.
// More information of its structure available at https://www.npmjs.com/package/gradient-parser#ast.
var gradientAST;
var gradientValue;
try {
gradientAST = node_default.a.parse(value || DEFAULT_GRADIENT)[0];
gradientValue = value || DEFAULT_GRADIENT;
} catch (error) {
hasGradient = false;
gradientAST = node_default.a.parse(DEFAULT_GRADIENT)[0];
gradientValue = DEFAULT_GRADIENT;
}
if (gradientAST.orientation && gradientAST.orientation.type === 'directional') {
gradientAST.orientation.type = 'angular';
gradientAST.orientation.value = DIRECTIONAL_ORIENTATION_ANGLE_MAP[gradientAST.orientation.value].toString();
}
return {
hasGradient: hasGradient,
gradientAST: gradientAST,
gradientValue: gradientValue
};
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/control-points.js
function control_points_createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (control_points_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function control_points_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var control_points_ControlPointKeyboardMove = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(ControlPointKeyboardMove, _Component);
var _super = control_points_createSuper(ControlPointKeyboardMove);
function ControlPointKeyboardMove() {
var _this;
Object(classCallCheck["a" /* default */])(this, ControlPointKeyboardMove);
_this = _super.apply(this, arguments);
_this.increase = _this.increase.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.decrease = _this.decrease.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.shortcuts = {
right: _this.increase,
left: _this.decrease
};
return _this;
}
Object(createClass["a" /* default */])(ControlPointKeyboardMove, [{
key: "increase",
value: function increase(event) {
// Stop propagation of the key press event to avoid focus moving
// to another editor area.
event.stopPropagation();
var _this$props = this.props,
gradientIndex = _this$props.gradientIndex,
onChange = _this$props.onChange,
gradientAST = _this$props.gradientAST;
onChange(getGradientWithPositionAtIndexIncreased(gradientAST, gradientIndex));
}
}, {
key: "decrease",
value: function decrease(event) {
// Stop propagation of the key press event to avoid focus moving
// to another editor area.
event.stopPropagation();
var _this$props2 = this.props,
gradientIndex = _this$props2.gradientIndex,
onChange = _this$props2.onChange,
gradientAST = _this$props2.gradientAST;
onChange(getGradientWithPositionAtIndexDecreased(gradientAST, gradientIndex));
}
}, {
key: "render",
value: function render() {
var children = this.props.children;
return Object(external_this_wp_element_["createElement"])(keyboard_shortcuts, {
shortcuts: this.shortcuts
}, children);
}
}]);
return ControlPointKeyboardMove;
}(external_this_wp_element_["Component"]);
function ControlPointButton(_ref) {
var isOpen = _ref.isOpen,
position = _ref.position,
color = _ref.color,
onChange = _ref.onChange,
gradientIndex = _ref.gradientIndex,
gradientAST = _ref.gradientAST,
additionalProps = Object(objectWithoutProperties["a" /* default */])(_ref, ["isOpen", "position", "color", "onChange", "gradientIndex", "gradientAST"]);
var instanceId = Object(external_this_wp_compose_["useInstanceId"])(ControlPointButton);
var descriptionId = "components-custom-gradient-picker__control-point-button-description-".concat(instanceId);
return Object(external_this_wp_element_["createElement"])(control_points_ControlPointKeyboardMove, {
onChange: onChange,
gradientIndex: gradientIndex,
gradientAST: gradientAST
}, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
"aria-label": Object(external_this_wp_i18n_["sprintf"])( // translators: %1$s: gradient position e.g: 70%, %2$s: gradient color code e.g: rgb(52,121,151).
Object(external_this_wp_i18n_["__"])('Gradient control point at position %1$s with color code %2$s.'), position, color),
"aria-describedby": descriptionId,
"aria-expanded": isOpen,
className: classnames_default()('components-custom-gradient-picker__control-point-button', {
'is-active': isOpen
}),
style: {
left: position
}
}, additionalProps)), Object(external_this_wp_element_["createElement"])(visually_hidden, {
id: descriptionId
}, Object(external_this_wp_i18n_["__"])('Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.')));
}
function ControlPoints(_ref2) {
var gradientPickerDomRef = _ref2.gradientPickerDomRef,
ignoreMarkerPosition = _ref2.ignoreMarkerPosition,
markerPoints = _ref2.markerPoints,
onChange = _ref2.onChange,
gradientAST = _ref2.gradientAST,
onStartControlPointChange = _ref2.onStartControlPointChange,
onStopControlPointChange = _ref2.onStopControlPointChange;
var controlPointMoveState = Object(external_this_wp_element_["useRef"])();
var onMouseMove = function onMouseMove(event) {
var relativePosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current, GRADIENT_MARKERS_WIDTH);
var _controlPointMoveStat = controlPointMoveState.current,
referenceGradientAST = _controlPointMoveStat.gradientAST,
position = _controlPointMoveStat.position,
significantMoveHappened = _controlPointMoveStat.significantMoveHappened;
if (!significantMoveHappened) {
var initialPosition = referenceGradientAST.colorStops[position].length.value;
if (Math.abs(initialPosition - relativePosition) >= MINIMUM_SIGNIFICANT_MOVE) {
controlPointMoveState.current.significantMoveHappened = true;
}
}
if (!isControlPointOverlapping(referenceGradientAST, relativePosition, position)) {
onChange(getGradientWithPositionAtIndexChanged(referenceGradientAST, position, relativePosition));
}
};
var cleanEventListeners = function cleanEventListeners() {
if (window && window.removeEventListener && controlPointMoveState.current && controlPointMoveState.current.listenersActivated) {
window.removeEventListener('mousemove', onMouseMove);
window.removeEventListener('mouseup', cleanEventListeners);
onStopControlPointChange();
controlPointMoveState.current.listenersActivated = false;
}
};
Object(external_this_wp_element_["useEffect"])(function () {
return function () {
cleanEventListeners();
};
}, []);
return markerPoints.map(function (point, index) {
return point && ignoreMarkerPosition !== point.positionValue && Object(external_this_wp_element_["createElement"])(dropdown, {
key: index,
onClose: onStopControlPointChange,
renderToggle: function renderToggle(_ref3) {
var isOpen = _ref3.isOpen,
onToggle = _ref3.onToggle;
return Object(external_this_wp_element_["createElement"])(ControlPointButton, {
key: index,
onClick: function onClick() {
if (controlPointMoveState.current && controlPointMoveState.current.significantMoveHappened) {
return;
}
if (isOpen) {
onStopControlPointChange();
} else {
onStartControlPointChange();
}
onToggle();
},
onMouseDown: function onMouseDown() {
if (window && window.addEventListener) {
controlPointMoveState.current = {
gradientAST: gradientAST,
position: index,
significantMoveHappened: false,
listenersActivated: true
};
onStartControlPointChange();
window.addEventListener('mousemove', onMouseMove);
window.addEventListener('mouseup', cleanEventListeners);
}
},
isOpen: isOpen,
position: point.position,
color: point.color,
onChange: onChange,
gradientAST: gradientAST,
gradientIndex: index
});
},
renderContent: function renderContent(_ref4) {
var onClose = _ref4.onClose;
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(color_picker_ColorPicker, {
color: point.color,
onChangeComplete: function onChangeComplete(_ref5) {
var rgb = _ref5.rgb;
onChange(getGradientWithColorAtIndexChanged(gradientAST, index, rgb));
}
}), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: "components-custom-gradient-picker__remove-control-point",
onClick: function onClick() {
onChange(getGradientWithControlPointRemoved(gradientAST, index));
onClose();
},
isLink: true
}, Object(external_this_wp_i18n_["__"])('Remove Control Point')));
},
popoverProps: COLOR_POPOVER_PROPS
});
});
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/custom-gradient-bar.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function InsertPoint(_ref) {
var onChange = _ref.onChange,
gradientAST = _ref.gradientAST,
onOpenInserter = _ref.onOpenInserter,
onCloseInserter = _ref.onCloseInserter,
insertPosition = _ref.insertPosition;
var _useState = Object(external_this_wp_element_["useState"])(false),
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
alreadyInsertedPoint = _useState2[0],
setAlreadyInsertedPoint = _useState2[1];
return Object(external_this_wp_element_["createElement"])(dropdown, {
className: "components-custom-gradient-picker__inserter",
onClose: function onClose() {
onCloseInserter();
},
renderToggle: function renderToggle(_ref2) {
var isOpen = _ref2.isOpen,
onToggle = _ref2.onToggle;
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
"aria-expanded": isOpen,
onClick: function onClick() {
if (isOpen) {
onCloseInserter();
} else {
setAlreadyInsertedPoint(false);
onOpenInserter();
}
onToggle();
},
className: "components-custom-gradient-picker__insert-point",
icon: plus_circle,
style: {
left: insertPosition !== null ? "".concat(insertPosition, "%") : undefined
}
});
},
renderContent: function renderContent() {
return Object(external_this_wp_element_["createElement"])(color_picker_ColorPicker, {
onChangeComplete: function onChangeComplete(_ref3) {
var rgb = _ref3.rgb;
var newGradient;
if (alreadyInsertedPoint) {
newGradient = getGradientWithColorAtPositionChanged(gradientAST, insertPosition, rgb);
} else {
newGradient = getGradientWithColorStopAdded(gradientAST, insertPosition, rgb);
setAlreadyInsertedPoint(true);
}
onChange(newGradient);
}
});
},
popoverProps: COLOR_POPOVER_PROPS
});
}
function customGradientBarReducer(state, action) {
switch (action.type) {
case 'MOVE_INSERTER':
if (state.id === 'IDLE' || state.id === 'MOVING_INSERTER') {
return {
id: 'MOVING_INSERTER',
insertPosition: action.insertPosition
};
}
break;
case 'STOP_INSERTER_MOVE':
if (state.id === 'MOVING_INSERTER') {
return {
id: 'IDLE'
};
}
break;
case 'OPEN_INSERTER':
if (state.id === 'MOVING_INSERTER') {
return {
id: 'INSERTING_CONTROL_POINT',
insertPosition: state.insertPosition
};
}
break;
case 'CLOSE_INSERTER':
if (state.id === 'INSERTING_CONTROL_POINT') {
return {
id: 'IDLE'
};
}
break;
case 'START_CONTROL_CHANGE':
if (state.id === 'IDLE') {
return {
id: 'MOVING_CONTROL_POINT'
};
}
break;
case 'STOP_CONTROL_CHANGE':
if (state.id === 'MOVING_CONTROL_POINT') {
return {
id: 'IDLE'
};
}
break;
}
return state;
}
var customGradientBarReducerInitialState = {
id: 'IDLE'
};
function CustomGradientBar(_ref4) {
var value = _ref4.value,
onChange = _ref4.onChange;
var _getGradientParsed = getGradientParsed(value),
gradientAST = _getGradientParsed.gradientAST,
gradientValue = _getGradientParsed.gradientValue,
hasGradient = _getGradientParsed.hasGradient;
var onGradientStructureChange = function onGradientStructureChange(newGradientStructure) {
onChange(serializeGradient(newGradientStructure));
};
var gradientPickerDomRef = Object(external_this_wp_element_["useRef"])();
var markerPoints = getMarkerPoints(gradientAST);
var _useReducer = Object(external_this_wp_element_["useReducer"])(customGradientBarReducer, customGradientBarReducerInitialState),
_useReducer2 = Object(slicedToArray["a" /* default */])(_useReducer, 2),
gradientBarState = _useReducer2[0],
gradientBarStateDispatch = _useReducer2[1];
var onMouseEnterAndMove = function onMouseEnterAndMove(event) {
var insertPosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current, INSERT_POINT_WIDTH); // If the insert point is close to an existing control point don't show it.
if (Object(external_this_lodash_["some"])(markerPoints, function (_ref5) {
var positionValue = _ref5.positionValue;
return Math.abs(insertPosition - positionValue) < MINIMUM_DISTANCE_BETWEEN_POINTS;
})) {
if (gradientBarState.id === 'MOVING_INSERTER') {
gradientBarStateDispatch({
type: 'STOP_INSERTER_MOVE'
});
}
return;
}
gradientBarStateDispatch({
type: 'MOVE_INSERTER',
insertPosition: insertPosition
});
};
var onMouseLeave = function onMouseLeave() {
gradientBarStateDispatch({
type: 'STOP_INSERTER_MOVE'
});
};
var isMovingInserter = gradientBarState.id === 'MOVING_INSERTER';
var isInsertingControlPoint = gradientBarState.id === 'INSERTING_CONTROL_POINT';
return Object(external_this_wp_element_["createElement"])("div", {
ref: gradientPickerDomRef,
className: classnames_default()('components-custom-gradient-picker__gradient-bar', {
'has-gradient': hasGradient
}),
onMouseEnter: onMouseEnterAndMove,
onMouseMove: onMouseEnterAndMove // On radial gradients the bar should display a linear gradient.
// On radial gradients the bar represents a slice of the gradient from the center until the outside.
,
style: {
background: gradientAST.type === 'radial-gradient' ? getLinearGradientRepresentationOfARadial(gradientAST) : gradientValue
},
onMouseLeave: onMouseLeave
}, Object(external_this_wp_element_["createElement"])("div", {
className: "components-custom-gradient-picker__markers-container"
}, (isMovingInserter || isInsertingControlPoint) && Object(external_this_wp_element_["createElement"])(InsertPoint, {
insertPosition: gradientBarState.insertPosition,
onChange: onGradientStructureChange,
gradientAST: gradientAST,
onOpenInserter: function onOpenInserter() {
gradientBarStateDispatch({
type: 'OPEN_INSERTER'
});
},
onCloseInserter: function onCloseInserter() {
gradientBarStateDispatch({
type: 'CLOSE_INSERTER'
});
}
}), Object(external_this_wp_element_["createElement"])(ControlPoints, {
gradientPickerDomRef: gradientPickerDomRef,
ignoreMarkerPosition: isInsertingControlPoint ? gradientBarState.insertPosition : undefined,
markerPoints: markerPoints,
onChange: onGradientStructureChange,
gradientAST: gradientAST,
onStartControlPointChange: function onStartControlPointChange() {
gradientBarStateDispatch({
type: 'START_CONTROL_CHANGE'
});
},
onStopControlPointChange: function onStopControlPointChange() {
gradientBarStateDispatch({
type: 'STOP_CONTROL_CHANGE'
});
}
})));
}
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/toolbar-item/index.js
var toolbar_item = __webpack_require__(125);
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/toolbar-context/index.js
var toolbar_context = __webpack_require__(77);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-button/toolbar-button-container.js
var toolbar_button_container_ToolbarButtonContainer = function ToolbarButtonContainer(props) {
return Object(external_this_wp_element_["createElement"])("div", {
className: props.className
}, props.children);
};
/* harmony default export */ var toolbar_button_container = (toolbar_button_container_ToolbarButtonContainer);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-button/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ToolbarButton(_ref, ref) {
var containerClassName = _ref.containerClassName,
className = _ref.className,
extraProps = _ref.extraProps,
children = _ref.children,
title = _ref.title,
isActive = _ref.isActive,
isDisabled = _ref.isDisabled,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["containerClassName", "className", "extraProps", "children", "title", "isActive", "isDisabled"]);
var accessibleToolbarState = Object(external_this_wp_element_["useContext"])(toolbar_context["a" /* default */]);
if (!accessibleToolbarState) {
// This should be deprecated when
// becomes stable.
return Object(external_this_wp_element_["createElement"])(toolbar_button_container, {
className: containerClassName
}, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
ref: ref,
icon: props.icon,
label: title,
shortcut: props.shortcut,
"data-subscript": props.subscript,
onClick: function onClick(event) {
event.stopPropagation();
if (props.onClick) {
props.onClick(event);
}
},
className: classnames_default()('components-toolbar__control', className),
isPressed: isActive,
disabled: isDisabled,
"data-experimental-toolbar-item": true
}, extraProps, props), children));
} // ToobarItem will pass all props to the render prop child, which will pass
// all props to Button. This means that ToolbarButton has the same API as
// Button.
return Object(external_this_wp_element_["createElement"])(toolbar_item["a" /* default */], Object(esm_extends["a" /* default */])({
className: classnames_default()('components-toolbar-button', className)
}, extraProps, props, {
ref: ref
}), function (toolbarItemProps) {
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
label: title,
isPressed: isActive,
disabled: isDisabled
}, toolbarItemProps), children);
});
}
/* harmony default export */ var toolbar_button = (Object(external_this_wp_element_["forwardRef"])(ToolbarButton));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-group/toolbar-group-container.js
var toolbar_group_container_ToolbarGroupContainer = function ToolbarGroupContainer(_ref) {
var className = _ref.className,
children = _ref.children,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "children"]);
return Object(external_this_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({
className: className
}, props), children);
};
/* harmony default export */ var toolbar_group_container = (toolbar_group_container_ToolbarGroupContainer);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-group/toolbar-group-collapsed.js
function toolbar_group_collapsed_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function toolbar_group_collapsed_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { toolbar_group_collapsed_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { toolbar_group_collapsed_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ToolbarGroupCollapsed(_ref) {
var _ref$controls = _ref.controls,
controls = _ref$controls === void 0 ? [] : _ref$controls,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["controls"]);
// It'll contain state if `ToolbarGroup` is being used within
// ``
var accessibleToolbarState = Object(external_this_wp_element_["useContext"])(toolbar_context["a" /* default */]);
var renderDropdownMenu = function renderDropdownMenu(toggleProps) {
return Object(external_this_wp_element_["createElement"])(dropdown_menu, Object(esm_extends["a" /* default */])({
controls: controls,
toggleProps: toolbar_group_collapsed_objectSpread({}, toggleProps, {
'data-experimental-toolbar-item': true
})
}, props));
};
if (accessibleToolbarState) {
return Object(external_this_wp_element_["createElement"])(toolbar_item["a" /* default */], null, renderDropdownMenu);
}
return renderDropdownMenu();
}
/* harmony default export */ var toolbar_group_collapsed = (ToolbarGroupCollapsed);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-group/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Renders a collapsible group of controls
*
* The `controls` prop accepts an array of sets. A set is an array of controls.
* Controls have the following shape:
*
* ```
* {
* icon: string,
* title: string,
* subscript: string,
* onClick: Function,
* isActive: boolean,
* isDisabled: boolean
* }
* ```
*
* For convenience it is also possible to pass only an array of controls. It is
* then assumed this is the only set.
*
* Either `controls` or `children` is required, otherwise this components
* renders nothing.
*
* @param {Object} props Component props.
* @param {Array} [props.controls] The controls to render in this toolbar.
* @param {WPElement} [props.children] Any other things to render inside the toolbar besides the controls.
* @param {string} [props.className] Class to set on the container div.
* @param {boolean} [props.isCollapsed] Turns ToolbarGroup into a dropdown menu.
* @param {string} [props.title] ARIA label for dropdown menu if is collapsed.
*/
function ToolbarGroup(_ref) {
var _ref$controls = _ref.controls,
controls = _ref$controls === void 0 ? [] : _ref$controls,
children = _ref.children,
className = _ref.className,
isCollapsed = _ref.isCollapsed,
title = _ref.title,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["controls", "children", "className", "isCollapsed", "title"]);
// It'll contain state if `ToolbarGroup` is being used within
// ``
var accessibleToolbarState = Object(external_this_wp_element_["useContext"])(toolbar_context["a" /* default */]);
if ((!controls || !controls.length) && !children) {
return null;
}
var finalClassName = classnames_default()( // Unfortunately, there's legacy code referencing to `.components-toolbar`
// So we can't get rid of it
accessibleToolbarState ? 'components-toolbar-group' : 'components-toolbar', className); // Normalize controls to nested array of objects (sets of controls)
var controlSets = controls;
if (!Array.isArray(controlSets[0])) {
controlSets = [controlSets];
}
if (isCollapsed) {
return Object(external_this_wp_element_["createElement"])(toolbar_group_collapsed, Object(esm_extends["a" /* default */])({
label: title,
controls: controlSets,
className: finalClassName,
children: children
}, props));
}
return Object(external_this_wp_element_["createElement"])(toolbar_group_container, Object(esm_extends["a" /* default */])({
className: finalClassName
}, props), Object(external_this_lodash_["flatMap"])(controlSets, function (controlSet, indexOfSet) {
return controlSet.map(function (control, indexOfControl) {
return Object(external_this_wp_element_["createElement"])(toolbar_button, Object(esm_extends["a" /* default */])({
key: [indexOfSet, indexOfControl].join(),
containerClassName: indexOfSet > 0 && indexOfControl === 0 ? 'has-left-divider' : null
}, control));
});
}), children);
}
/* harmony default export */ var toolbar_group = (ToolbarGroup);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/index.js
function custom_gradient_picker_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function custom_gradient_picker_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { custom_gradient_picker_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { custom_gradient_picker_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var custom_gradient_picker_GradientAnglePicker = function GradientAnglePicker(_ref) {
var gradientAST = _ref.gradientAST,
hasGradient = _ref.hasGradient,
onChange = _ref.onChange;
var angle = Object(external_this_lodash_["get"])(gradientAST, ['orientation', 'value'], DEFAULT_LINEAR_GRADIENT_ANGLE);
var onAngleChange = function onAngleChange(newAngle) {
onChange(serializeGradient(custom_gradient_picker_objectSpread({}, gradientAST, {
orientation: {
type: 'angular',
value: newAngle
}
})));
};
return Object(external_this_wp_element_["createElement"])(AnglePickerControl, {
value: hasGradient ? angle : '',
onChange: onAngleChange
});
};
var custom_gradient_picker_GradientTypePicker = function GradientTypePicker(_ref2) {
var gradientAST = _ref2.gradientAST,
hasGradient = _ref2.hasGradient,
onChange = _ref2.onChange;
var type = gradientAST.type;
var onSetLinearGradient = function onSetLinearGradient() {
onChange(serializeGradient(custom_gradient_picker_objectSpread({}, gradientAST, {}, gradientAST.orientation ? {} : {
orientation: HORIZONTAL_GRADIENT_ORIENTATION
}, {
type: 'linear-gradient'
})));
};
var onSetRadialGradient = function onSetRadialGradient() {
onChange(serializeGradient(custom_gradient_picker_objectSpread({}, Object(external_this_lodash_["omit"])(gradientAST, ['orientation']), {
type: 'radial-gradient'
})));
};
return Object(external_this_wp_element_["createElement"])(base_control, {
className: "components-custom-gradient-picker__type-picker"
}, Object(external_this_wp_element_["createElement"])(base_control.VisualLabel, null, Object(external_this_wp_i18n_["__"])('Type')), Object(external_this_wp_element_["createElement"])(toolbar_group, {
className: "components-custom-gradient-picker__toolbar",
controls: [{
icon: Object(external_this_wp_element_["createElement"])(LinearGradientIcon, null),
title: Object(external_this_wp_i18n_["__"])('Linear Gradient'),
isActive: hasGradient && type === 'linear-gradient',
onClick: onSetLinearGradient
}, {
icon: Object(external_this_wp_element_["createElement"])(RadialGradientIcon, null),
title: Object(external_this_wp_i18n_["__"])('Radial Gradient'),
isActive: hasGradient && type === 'radial-gradient',
onClick: onSetRadialGradient
}]
}));
};
function CustomGradientPicker(_ref3) {
var value = _ref3.value,
onChange = _ref3.onChange;
var _getGradientParsed = getGradientParsed(value),
gradientAST = _getGradientParsed.gradientAST,
hasGradient = _getGradientParsed.hasGradient;
var type = gradientAST.type;
return Object(external_this_wp_element_["createElement"])("div", {
className: "components-custom-gradient-picker"
}, Object(external_this_wp_element_["createElement"])(CustomGradientBar, {
value: value,
onChange: onChange
}), Object(external_this_wp_element_["createElement"])("div", {
className: "components-custom-gradient-picker__ui-line"
}, Object(external_this_wp_element_["createElement"])(custom_gradient_picker_GradientTypePicker, {
gradientAST: gradientAST,
hasGradient: hasGradient,
onChange: onChange
}), type === 'linear-gradient' && Object(external_this_wp_element_["createElement"])(custom_gradient_picker_GradientAnglePicker, {
gradientAST: gradientAST,
hasGradient: hasGradient,
onChange: onChange
})));
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/gradient-picker/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function GradientPicker(_ref) {
var className = _ref.className,
gradients = _ref.gradients,
onChange = _ref.onChange,
value = _ref.value,
_ref$clearable = _ref.clearable,
clearable = _ref$clearable === void 0 ? true : _ref$clearable,
_ref$disableCustomGra = _ref.disableCustomGradients,
disableCustomGradients = _ref$disableCustomGra === void 0 ? false : _ref$disableCustomGra;
var clearGradient = Object(external_this_wp_element_["useCallback"])(function () {
return onChange(undefined);
}, [onChange]);
var gradientOptions = Object(external_this_wp_element_["useMemo"])(function () {
return Object(external_this_lodash_["map"])(gradients, function (_ref2) {
var gradient = _ref2.gradient,
name = _ref2.name;
return Object(external_this_wp_element_["createElement"])(CircularOptionPicker.Option, {
key: gradient,
value: gradient,
isSelected: value === gradient,
tooltipText: name || // translators: %s: gradient code e.g: "linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);".
Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('Gradient code: %s'), gradient),
style: {
color: 'rgba( 0,0,0,0 )',
background: gradient
},
onClick: value === gradient ? clearGradient : function () {
return onChange(gradient);
},
"aria-label": name ? // translators: %s: The name of the gradient e.g: "Angular red to blue".
Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('Gradient: %s'), name) : // translators: %s: gradient code e.g: "linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);".
Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('Gradient code: %s'), gradient)
});
});
}, [gradients, value, onChange, clearGradient]);
return Object(external_this_wp_element_["createElement"])(CircularOptionPicker, {
className: className,
options: gradientOptions,
actions: clearable && Object(external_this_wp_element_["createElement"])(CircularOptionPicker.ButtonAction, {
onClick: clearGradient
}, Object(external_this_wp_i18n_["__"])('Clear'))
}, !disableCustomGradients && Object(external_this_wp_element_["createElement"])(CustomGradientPicker, {
value: value,
onChange: onChange
}));
}
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/isolated-event-container/index.js
var isolated_event_container = __webpack_require__(123);
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js
var with_focus_return = __webpack_require__(122);
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js
var with_constrained_tabbing = __webpack_require__(121);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/frame.js
function frame_createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (frame_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function frame_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var frame_ModalFrame = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(ModalFrame, _Component);
var _super = frame_createSuper(ModalFrame);
function ModalFrame() {
var _this;
Object(classCallCheck["a" /* default */])(this, ModalFrame);
_this = _super.apply(this, arguments);
_this.containerRef = Object(external_this_wp_element_["createRef"])();
_this.handleKeyDown = _this.handleKeyDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.handleFocusOutside = _this.handleFocusOutside.bind(Object(assertThisInitialized["a" /* default */])(_this));
return _this;
}
/**
* Focuses the first tabbable element when props.focusOnMount is true.
*/
Object(createClass["a" /* default */])(ModalFrame, [{
key: "componentDidMount",
value: function componentDidMount() {
// Focus on mount
if (this.props.focusOnMount) {
this.containerRef.current.focus();
}
}
/**
* Callback function called when clicked outside the modal.
*
* @param {Object} event Mouse click event.
*/
}, {
key: "handleFocusOutside",
value: function handleFocusOutside(event) {
if (this.props.shouldCloseOnClickOutside) {
this.onRequestClose(event);
}
}
/**
* Callback function called when a key is pressed.
*
* @param {KeyboardEvent} event Key down event.
*/
}, {
key: "handleKeyDown",
value: function handleKeyDown(event) {
if (event.keyCode === external_this_wp_keycodes_["ESCAPE"]) {
this.handleEscapeKeyDown(event);
}
}
/**
* Handles a escape key down event.
*
* Calls onRequestClose and prevents propagation of the event outside the modal.
*
* @param {Object} event Key down event.
*/
}, {
key: "handleEscapeKeyDown",
value: function handleEscapeKeyDown(event) {
if (this.props.shouldCloseOnEsc) {
event.stopPropagation();
this.onRequestClose(event);
}
}
/**
* Calls the onRequestClose callback props when it is available.
*
* @param {Object} event Event object.
*/
}, {
key: "onRequestClose",
value: function onRequestClose(event) {
var onRequestClose = this.props.onRequestClose;
if (onRequestClose) {
onRequestClose(event);
}
}
/**
* Renders the modal frame element.
*
* @return {WPElement} The modal frame element.
*/
}, {
key: "render",
value: function render() {
var _this$props = this.props,
overlayClassName = _this$props.overlayClassName,
contentLabel = _this$props.contentLabel,
_this$props$aria = _this$props.aria,
describedby = _this$props$aria.describedby,
labelledby = _this$props$aria.labelledby,
children = _this$props.children,
className = _this$props.className,
role = _this$props.role,
style = _this$props.style;
return Object(external_this_wp_element_["createElement"])(isolated_event_container["a" /* default */], {
className: classnames_default()('components-modal__screen-overlay', overlayClassName),
onKeyDown: this.handleKeyDown
}, Object(external_this_wp_element_["createElement"])("div", {
className: classnames_default()('components-modal__frame', className),
style: style,
ref: this.containerRef,
role: role,
"aria-label": contentLabel,
"aria-labelledby": contentLabel ? null : labelledby,
"aria-describedby": describedby,
tabIndex: "-1"
}, children));
}
}]);
return ModalFrame;
}(external_this_wp_element_["Component"]);
/* harmony default export */ var modal_frame = (Object(external_this_wp_compose_["compose"])([with_focus_return["a" /* default */], with_constrained_tabbing["a" /* default */], with_focus_outside["a" /* default */]])(frame_ModalFrame));
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
var library_close = __webpack_require__(133);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/header.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var header_ModalHeader = function ModalHeader(_ref) {
var icon = _ref.icon,
title = _ref.title,
onClose = _ref.onClose,
closeLabel = _ref.closeLabel,
headingId = _ref.headingId,
isDismissible = _ref.isDismissible;
var label = closeLabel ? closeLabel : Object(external_this_wp_i18n_["__"])('Close dialog');
return Object(external_this_wp_element_["createElement"])("div", {
className: "components-modal__header"
}, Object(external_this_wp_element_["createElement"])("div", {
className: "components-modal__header-heading-container"
}, icon && Object(external_this_wp_element_["createElement"])("span", {
className: "components-modal__icon-container",
"aria-hidden": true
}, icon), title && Object(external_this_wp_element_["createElement"])("h1", {
id: headingId,
className: "components-modal__header-heading"
}, title)), isDismissible && Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
onClick: onClose,
icon: library_close["a" /* default */],
label: label
}));
};
/* harmony default export */ var modal_header = (header_ModalHeader);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/aria-helper.js
/**
* External dependencies
*/
var LIVE_REGION_ARIA_ROLES = new Set(['alert', 'status', 'log', 'marquee', 'timer']);
var hiddenElements = [],
isHidden = false;
/**
* Hides all elements in the body element from screen-readers except
* the provided element and elements that should not be hidden from
* screen-readers.
*
* The reason we do this is because `aria-modal="true"` currently is bugged
* in Safari, and support is spotty in other browsers overall. In the future
* we should consider removing these helper functions in favor of
* `aria-modal="true"`.
*
* @param {Element} unhiddenElement The element that should not be hidden.
*/
function hideApp(unhiddenElement) {
if (isHidden) {
return;
}
var elements = document.body.children;
Object(external_this_lodash_["forEach"])(elements, function (element) {
if (element === unhiddenElement) {
return;
}
if (elementShouldBeHidden(element)) {
element.setAttribute('aria-hidden', 'true');
hiddenElements.push(element);
}
});
isHidden = true;
}
/**
* Determines if the passed element should not be hidden from screen readers.
*
* @param {HTMLElement} element The element that should be checked.
*
* @return {boolean} Whether the element should not be hidden from screen-readers.
*/
function elementShouldBeHidden(element) {
var role = element.getAttribute('role');
return !(element.tagName === 'SCRIPT' || element.hasAttribute('aria-hidden') || element.hasAttribute('aria-live') || LIVE_REGION_ARIA_ROLES.has(role));
}
/**
* Makes all elements in the body that have been hidden by `hideApp`
* visible again to screen-readers.
*/
function showApp() {
if (!isHidden) {
return;
}
Object(external_this_lodash_["forEach"])(hiddenElements, function (element) {
element.removeAttribute('aria-hidden');
});
hiddenElements = [];
isHidden = false;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/index.js
function modal_createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (modal_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function modal_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
// Used to count the number of open modals.
var parentElement,
openModalCount = 0;
var modal_Modal = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(Modal, _Component);
var _super = modal_createSuper(Modal);
function Modal(props) {
var _this;
Object(classCallCheck["a" /* default */])(this, Modal);
_this = _super.call(this, props);
_this.prepareDOM();
return _this;
}
/**
* Appends the modal's node to the DOM, so the portal can render the
* modal in it. Also calls the openFirstModal when this is the first modal to be
* opened.
*/
Object(createClass["a" /* default */])(Modal, [{
key: "componentDidMount",
value: function componentDidMount() {
openModalCount++;
if (openModalCount === 1) {
this.openFirstModal();
}
}
/**
* Removes the modal's node from the DOM. Also calls closeLastModal when this is
* the last modal to be closed.
*/
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
openModalCount--;
if (openModalCount === 0) {
this.closeLastModal();
}
this.cleanDOM();
}
/**
* Prepares the DOM for the modals to be rendered.
*
* Every modal is mounted in a separate div appended to a parent div
* that is appended to the document body.
*
* The parent div will be created if it does not yet exist, and the
* separate div for this specific modal will be appended to that.
*/
}, {
key: "prepareDOM",
value: function prepareDOM() {
if (!parentElement) {
parentElement = document.createElement('div');
document.body.appendChild(parentElement);
}
this.node = document.createElement('div');
parentElement.appendChild(this.node);
}
/**
* Removes the specific mounting point for this modal from the DOM.
*/
}, {
key: "cleanDOM",
value: function cleanDOM() {
parentElement.removeChild(this.node);
}
/**
* Prepares the DOM for this modal and any additional modal to be mounted.
*
* It appends an additional div to the body for the modals to be rendered in,
* it hides any other elements from screen-readers and adds an additional class
* to the body to prevent scrolling while the modal is open.
*/
}, {
key: "openFirstModal",
value: function openFirstModal() {
hideApp(parentElement);
document.body.classList.add(this.props.bodyOpenClassName);
}
/**
* Cleans up the DOM after the last modal is closed and makes the app available
* for screen-readers again.
*/
}, {
key: "closeLastModal",
value: function closeLastModal() {
document.body.classList.remove(this.props.bodyOpenClassName);
showApp();
}
/**
* Renders the modal.
*
* @return {WPElement} The modal element.
*/
}, {
key: "render",
value: function render() {
var _this$props = this.props,
onRequestClose = _this$props.onRequestClose,
title = _this$props.title,
icon = _this$props.icon,
closeButtonLabel = _this$props.closeButtonLabel,
children = _this$props.children,
aria = _this$props.aria,
instanceId = _this$props.instanceId,
isDismissible = _this$props.isDismissible,
isDismissable = _this$props.isDismissable,
otherProps = Object(objectWithoutProperties["a" /* default */])(_this$props, ["onRequestClose", "title", "icon", "closeButtonLabel", "children", "aria", "instanceId", "isDismissible", "isDismissable"]);
var headingId = aria.labelledby || "components-modal-header-".concat(instanceId);
if (isDismissable) {
external_this_wp_deprecated_default()('isDismissable prop of the Modal component', {
alternative: 'isDismissible prop (renamed) of the Modal component'
});
} // Disable reason: this stops mouse events from triggering tooltips and
// other elements underneath the modal overlay.
return Object(external_this_wp_element_["createPortal"])(Object(external_this_wp_element_["createElement"])(modal_frame, Object(esm_extends["a" /* default */])({
onRequestClose: onRequestClose,
aria: {
labelledby: title ? headingId : null,
describedby: aria.describedby
}
}, otherProps), Object(external_this_wp_element_["createElement"])("div", {
className: 'components-modal__content',
role: "document"
}, Object(external_this_wp_element_["createElement"])(modal_header, {
closeLabel: closeButtonLabel,
headingId: headingId,
icon: icon,
isDismissible: isDismissible || isDismissable,
onClose: onRequestClose,
title: title
}), children)), this.node);
}
}]);
return Modal;
}(external_this_wp_element_["Component"]);
modal_Modal.defaultProps = {
bodyOpenClassName: 'modal-open',
role: 'dialog',
title: null,
focusOnMount: true,
shouldCloseOnEsc: true,
shouldCloseOnClickOutside: true,
isDismissible: true,
/* accessibility */
aria: {
labelledby: null,
describedby: null
}
};
/* harmony default export */ var modal = (Object(external_this_wp_compose_["withInstanceId"])(modal_Modal));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/icons.js
/**
* WordPress dependencies
*/
var icons_PageControlIcon = function PageControlIcon(_ref) {
var isSelected = _ref.isSelected;
return Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], {
width: "8",
height: "8",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Circle"], {
cx: "4",
cy: "4",
r: "4",
fill: isSelected ? '#419ECD' : '#E1E3E6'
}));
};
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/page-control.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function PageControl(_ref) {
var currentPage = _ref.currentPage,
numberOfPages = _ref.numberOfPages,
setCurrentPage = _ref.setCurrentPage;
return Object(external_this_wp_element_["createElement"])("ul", {
className: "components-guide__page-control",
"aria-label": Object(external_this_wp_i18n_["__"])('Guide controls')
}, Object(external_this_lodash_["times"])(numberOfPages, function (page) {
return Object(external_this_wp_element_["createElement"])("li", {
key: page // Set aria-current="step" on the active page, see https://www.w3.org/TR/wai-aria-1.1/#aria-current
,
"aria-current": page === currentPage ? 'step' : undefined
}, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
key: page,
icon: Object(external_this_wp_element_["createElement"])(icons_PageControlIcon, {
isSelected: page === currentPage
}),
"aria-label": Object(external_this_wp_i18n_["sprintf"])(
/* translators: 1: current page number 2: total number of pages */
Object(external_this_wp_i18n_["__"])('Page %1$d of %2$d'), page + 1, numberOfPages),
onClick: function onClick() {
return setCurrentPage(page);
}
}));
}));
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/finish-button.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function FinishButton(_ref) {
var className = _ref.className,
onClick = _ref.onClick,
children = _ref.children;
var button = Object(external_this_wp_element_["useRef"])(null); // Focus the button on mount if nothing else is focused. This prevents a
// focus loss when the 'Next' button is swapped out.
Object(external_this_wp_element_["useLayoutEffect"])(function () {
if (!document.activeElement || document.activeElement === document.body) {
button.current.focus();
}
}, [button]);
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
ref: button,
className: className,
isPrimary: true,
onClick: onClick
}, children);
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function Guide(_ref) {
var children = _ref.children,
className = _ref.className,
contentLabel = _ref.contentLabel,
finishButtonText = _ref.finishButtonText,
onFinish = _ref.onFinish,
_ref$pages = _ref.pages,
pages = _ref$pages === void 0 ? [] : _ref$pages;
var _useState = Object(external_this_wp_element_["useState"])(0),
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
currentPage = _useState2[0],
setCurrentPage = _useState2[1];
Object(external_this_wp_element_["useEffect"])(function () {
if (external_this_wp_element_["Children"].count(children)) {
external_this_wp_deprecated_default()('Passing children to ', {
alternative: 'the `pages` prop'
});
}
}, [children]);
if (external_this_wp_element_["Children"].count(children)) {
pages = external_this_wp_element_["Children"].map(children, function (child) {
return {
content: child
};
});
}
var canGoBack = currentPage > 0;
var canGoForward = currentPage < pages.length - 1;
var goBack = function goBack() {
if (canGoBack) {
setCurrentPage(currentPage - 1);
}
};
var goForward = function goForward() {
if (canGoForward) {
setCurrentPage(currentPage + 1);
}
};
if (pages.length === 0) {
return null;
}
return Object(external_this_wp_element_["createElement"])(modal, {
className: classnames_default()('components-guide', className),
contentLabel: contentLabel,
onRequestClose: onFinish
}, Object(external_this_wp_element_["createElement"])(keyboard_shortcuts, {
key: currentPage,
shortcuts: {
left: goBack,
right: goForward
}
}), Object(external_this_wp_element_["createElement"])("div", {
className: "components-guide__container"
}, Object(external_this_wp_element_["createElement"])("div", {
className: "components-guide__page"
}, pages[currentPage].image, Object(external_this_wp_element_["createElement"])(PageControl, {
currentPage: currentPage,
numberOfPages: pages.length,
setCurrentPage: setCurrentPage
}), pages[currentPage].content, !canGoForward && Object(external_this_wp_element_["createElement"])(FinishButton, {
className: "components-guide__inline-finish-button",
onClick: onFinish
}, finishButtonText || Object(external_this_wp_i18n_["__"])('Finish'))), Object(external_this_wp_element_["createElement"])("div", {
className: "components-guide__footer"
}, canGoBack && Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: "components-guide__back-button",
onClick: goBack
}, Object(external_this_wp_i18n_["__"])('Previous')), canGoForward && Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: "components-guide__forward-button",
onClick: goForward
}, Object(external_this_wp_i18n_["__"])('Next')), !canGoForward && Object(external_this_wp_element_["createElement"])(FinishButton, {
className: "components-guide__finish-button",
onClick: onFinish
}, finishButtonText || Object(external_this_wp_i18n_["__"])('Finish')))));
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/page.js
/**
* WordPress dependencies
*/
function GuidePage(props) {
Object(external_this_wp_element_["useEffect"])(function () {
external_this_wp_deprecated_default()('', {
alternative: 'the `pages` prop in '
});
}, []);
return Object(external_this_wp_element_["createElement"])("div", props);
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button/deprecated.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function IconButton(_ref, ref) {
var labelPosition = _ref.labelPosition,
size = _ref.size,
tooltip = _ref.tooltip,
label = _ref.label,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["labelPosition", "size", "tooltip", "label"]);
external_this_wp_deprecated_default()('wp.components.IconButton', {
alternative: 'wp.components.Button'
});
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, props, {
ref: ref,
tooltipPosition: labelPosition,
iconSize: size,
showTooltip: tooltip !== undefined ? !!tooltip : undefined,
label: tooltip || label
}));
}
/* harmony default export */ var deprecated = (Object(external_this_wp_element_["forwardRef"])(IconButton));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-group/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function MenuGroup(_ref) {
var children = _ref.children,
_ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className,
label = _ref.label;
var instanceId = Object(external_this_wp_compose_["useInstanceId"])(MenuGroup);
if (!external_this_wp_element_["Children"].count(children)) {
return null;
}
var labelId = "components-menu-group-label-".concat(instanceId);
var classNames = classnames_default()(className, 'components-menu-group');
return Object(external_this_wp_element_["createElement"])("div", {
className: classNames
}, label && Object(external_this_wp_element_["createElement"])("div", {
className: "components-menu-group__label",
id: labelId,
"aria-hidden": "true"
}, label), Object(external_this_wp_element_["createElement"])("div", {
role: "group",
"aria-labelledby": label ? labelId : null
}, children));
}
/* harmony default export */ var menu_group = (MenuGroup);
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/shortcut/index.js
var build_module_shortcut = __webpack_require__(157);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-item/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Renders a generic menu item for use inside the more menu.
*
* @param {Object} props Component props.
* @param {WPElement} props.children Element to render as child of button.
* @param {string} props.info Text to use as description for button text.
* @param {string} props.className Class to set on the container.
* @param {WPIcon} props.icon Button's `icon` prop.
* @param {string|Object} props.shortcut Shortcut's `shortcut` prop.
* @param {boolean} props.isSelected Whether or not the menu item is currently selected.
* @param {string} [props.role="menuitem"] ARIA role of the menu item.
* @param {Object} ref React Element ref.
*
* @return {WPComponent} The component to be rendered.
*/
function MenuItem(_ref, ref) {
var children = _ref.children,
info = _ref.info,
className = _ref.className,
icon = _ref.icon,
shortcut = _ref.shortcut,
isSelected = _ref.isSelected,
_ref$role = _ref.role,
role = _ref$role === void 0 ? 'menuitem' : _ref$role,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children", "info", "className", "icon", "shortcut", "isSelected", "role"]);
className = classnames_default()('components-menu-item__button', className);
if (info) {
children = Object(external_this_wp_element_["createElement"])("span", {
className: "components-menu-item__info-wrapper"
}, children, Object(external_this_wp_element_["createElement"])("span", {
className: "components-menu-item__info"
}, info));
}
if (icon && !Object(external_this_lodash_["isString"])(icon)) {
icon = Object(external_this_wp_element_["cloneElement"])(icon, {
className: 'components-menu-items__item-icon'
});
}
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
ref: ref,
icon: icon // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked
,
"aria-checked": role === 'menuitemcheckbox' || role === 'menuitemradio' ? isSelected : undefined,
role: role,
className: className
}, props), children, Object(external_this_wp_element_["createElement"])(build_module_shortcut["a" /* default */], {
className: "components-menu-item__shortcut",
shortcut: shortcut
}));
}
/* harmony default export */ var menu_item = (Object(external_this_wp_element_["forwardRef"])(MenuItem));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-items-choice/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function MenuItemsChoice(_ref) {
var _ref$choices = _ref.choices,
choices = _ref$choices === void 0 ? [] : _ref$choices,
_ref$onHover = _ref.onHover,
onHover = _ref$onHover === void 0 ? external_this_lodash_["noop"] : _ref$onHover,
onSelect = _ref.onSelect,
value = _ref.value;
return choices.map(function (item) {
var isSelected = value === item.value;
return Object(external_this_wp_element_["createElement"])(menu_item, {
key: item.value,
role: "menuitemradio",
icon: isSelected && check["a" /* default */],
isSelected: isSelected,
shortcut: item.shortcut,
className: "components-menu-items-choice",
onClick: function onClick() {
if (!isSelected) {
onSelect(item.value);
}
},
onMouseEnter: function onMouseEnter() {
return onHover(item.value);
},
onMouseLeave: function onMouseLeave() {
return onHover(null);
}
}, item.label);
});
}
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js
var scroll_lock = __webpack_require__(152);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/tabbable.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function TabbableContainer(_ref, ref) {
var eventToOffset = _ref.eventToOffset,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["eventToOffset"]);
var innerEventToOffset = function innerEventToOffset(evt) {
var keyCode = evt.keyCode,
shiftKey = evt.shiftKey;
if (external_this_wp_keycodes_["TAB"] === keyCode) {
return shiftKey ? -1 : 1;
} // Allow custom handling of keys besides Tab.
//
// By default, TabbableContainer will move focus forward on Tab and
// backward on Shift+Tab. The handler below will be used for all other
// events. The semantics for `eventToOffset`'s return
// values are the following:
//
// - +1: move focus forward
// - -1: move focus backward
// - 0: don't move focus, but acknowledge event and thus stop it
// - undefined: do nothing, let the event propagate
if (eventToOffset) {
return eventToOffset(evt);
}
};
return Object(external_this_wp_element_["createElement"])(navigable_container_container, Object(esm_extends["a" /* default */])({
ref: ref,
stopNavigationEvents: true,
onlyBrowserTabstops: true,
eventToOffset: innerEventToOffset
}, props));
}
/* harmony default export */ var tabbable = (Object(external_this_wp_element_["forwardRef"])(TabbableContainer));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/** @typedef {import('@wordpress/element').WPElement} WPElement */
/**
* Custom hook which announces the message with the given politeness, if a
* valid message is provided.
*
* @param {string|WPElement} [message] Message to announce.
* @param {'polite'|'assertive'} politeness Politeness to announce.
*/
function useSpokenMessage(message, politeness) {
var spokenMessage = typeof message === 'string' ? message : Object(external_this_wp_element_["renderToString"])(message);
Object(external_this_wp_element_["useEffect"])(function () {
if (spokenMessage) {
Object(external_this_wp_a11y_["speak"])(spokenMessage, politeness);
}
}, [spokenMessage, politeness]);
}
/**
* Given a notice status, returns an assumed default politeness for the status.
* Defaults to 'assertive'.
*
* @param {string} [status] Notice status.
*
* @return {'polite'|'assertive'} Notice politeness.
*/
function getDefaultPoliteness(status) {
switch (status) {
case 'success':
case 'warning':
case 'info':
return 'polite';
case 'error':
default:
return 'assertive';
}
}
function Notice(_ref) {
var className = _ref.className,
_ref$status = _ref.status,
status = _ref$status === void 0 ? 'info' : _ref$status,
children = _ref.children,
_ref$spokenMessage = _ref.spokenMessage,
spokenMessage = _ref$spokenMessage === void 0 ? children : _ref$spokenMessage,
_ref$onRemove = _ref.onRemove,
onRemove = _ref$onRemove === void 0 ? external_this_lodash_["noop"] : _ref$onRemove,
_ref$isDismissible = _ref.isDismissible,
isDismissible = _ref$isDismissible === void 0 ? true : _ref$isDismissible,
_ref$actions = _ref.actions,
actions = _ref$actions === void 0 ? [] : _ref$actions,
_ref$politeness = _ref.politeness,
politeness = _ref$politeness === void 0 ? getDefaultPoliteness(status) : _ref$politeness,
__unstableHTML = _ref.__unstableHTML;
useSpokenMessage(spokenMessage, politeness);
var classes = classnames_default()(className, 'components-notice', 'is-' + status, {
'is-dismissible': isDismissible
});
if (__unstableHTML) {
children = Object(external_this_wp_element_["createElement"])(external_this_wp_element_["RawHTML"], null, children);
}
return Object(external_this_wp_element_["createElement"])("div", {
className: classes
}, Object(external_this_wp_element_["createElement"])("div", {
className: "components-notice__content"
}, children, actions.map(function (_ref2, index) {
var buttonCustomClasses = _ref2.className,
label = _ref2.label,
isPrimary = _ref2.isPrimary,
_ref2$noDefaultClasse = _ref2.noDefaultClasses,
noDefaultClasses = _ref2$noDefaultClasse === void 0 ? false : _ref2$noDefaultClasse,
onClick = _ref2.onClick,
url = _ref2.url;
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
key: index,
href: url,
isPrimary: isPrimary,
isSecondary: !noDefaultClasses && !url,
isLink: !noDefaultClasses && !!url,
onClick: url ? undefined : onClick,
className: classnames_default()('components-notice__action', buttonCustomClasses)
}, label);
})), isDismissible && Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: "components-notice__dismiss",
icon: library_close["a" /* default */],
label: Object(external_this_wp_i18n_["__"])('Dismiss this notice'),
onClick: onRemove,
showTooltip: false
}));
}
/* harmony default export */ var build_module_notice = (Notice);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/list.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Renders a list of notices.
*
* @param {Object} $0 Props passed to the component.
* @param {Array} $0.notices Array of notices to render.
* @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.
* @param {Object} $0.className Name of the class used by the component.
* @param {Object} $0.children Array of children to be rendered inside the notice list.
* @return {Object} The rendered notices list.
*/
function NoticeList(_ref) {
var notices = _ref.notices,
_ref$onRemove = _ref.onRemove,
onRemove = _ref$onRemove === void 0 ? external_this_lodash_["noop"] : _ref$onRemove,
className = _ref.className,
children = _ref.children;
var removeNotice = function removeNotice(id) {
return function () {
return onRemove(id);
};
};
className = classnames_default()('components-notice-list', className);
return Object(external_this_wp_element_["createElement"])("div", {
className: className
}, children, Object(toConsumableArray["a" /* default */])(notices).reverse().map(function (notice) {
return Object(external_this_wp_element_["createElement"])(build_module_notice, Object(esm_extends["a" /* default */])({}, Object(external_this_lodash_["omit"])(notice, ['content']), {
key: notice.id,
onRemove: removeNotice(notice.id)
}), notice.content);
}));
}
/* harmony default export */ var list = (NoticeList);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/header.js
function PanelHeader(_ref) {
var label = _ref.label,
children = _ref.children;
return Object(external_this_wp_element_["createElement"])("div", {
className: "components-panel__header"
}, label && Object(external_this_wp_element_["createElement"])("h2", null, label), children);
}
/* harmony default export */ var panel_header = (PanelHeader);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/index.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function Panel(_ref) {
var header = _ref.header,
className = _ref.className,
children = _ref.children;
var classNames = classnames_default()(className, 'components-panel');
return Object(external_this_wp_element_["createElement"])("div", {
className: classNames
}, header && Object(external_this_wp_element_["createElement"])(panel_header, {
label: header
}), children);
}
/* harmony default export */ var panel = (Panel);
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
var chevron_up = __webpack_require__(291);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/body.js
function body_createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (body_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function body_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var body_PanelBody = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(PanelBody, _Component);
var _super = body_createSuper(PanelBody);
function PanelBody(props) {
var _this;
Object(classCallCheck["a" /* default */])(this, PanelBody);
_this = _super.apply(this, arguments);
_this.state = {
opened: props.initialOpen === undefined ? true : props.initialOpen
};
_this.toggle = _this.toggle.bind(Object(assertThisInitialized["a" /* default */])(_this));
return _this;
}
Object(createClass["a" /* default */])(PanelBody, [{
key: "toggle",
value: function toggle(event) {
event.preventDefault();
if (this.props.opened === undefined) {
this.setState(function (state) {
return {
opened: !state.opened
};
});
}
if (this.props.onToggle) {
this.props.onToggle();
}
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
title = _this$props.title,
children = _this$props.children,
opened = _this$props.opened,
className = _this$props.className,
icon = _this$props.icon,
forwardedRef = _this$props.forwardedRef;
var isOpened = opened === undefined ? this.state.opened : opened;
var classes = classnames_default()('components-panel__body', className, {
'is-opened': isOpened
});
return Object(external_this_wp_element_["createElement"])("div", {
className: classes,
ref: forwardedRef
}, !!title && Object(external_this_wp_element_["createElement"])("h2", {
className: "components-panel__body-title"
}, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: "components-panel__body-toggle",
onClick: this.toggle,
"aria-expanded": isOpened
}, Object(external_this_wp_element_["createElement"])("span", {
"aria-hidden": "true"
}, Object(external_this_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
className: "components-panel__arrow",
icon: isOpened ? chevron_up["a" /* default */] : chevron_down["a" /* default */]
})), title, icon && Object(external_this_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
icon: icon,
className: "components-panel__icon",
size: 20
}))), isOpened && children);
}
}]);
return PanelBody;
}(external_this_wp_element_["Component"]);
var body_forwardedPanelBody = function forwardedPanelBody(props, ref) {
return Object(external_this_wp_element_["createElement"])(body_PanelBody, Object(esm_extends["a" /* default */])({}, props, {
forwardedRef: ref
}));
};
body_forwardedPanelBody.displayName = 'PanelBody';
/* harmony default export */ var panel_body = (Object(external_this_wp_element_["forwardRef"])(body_forwardedPanelBody));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/row.js
/**
* External dependencies
*/
function PanelRow(_ref) {
var className = _ref.className,
children = _ref.children;
var classes = classnames_default()('components-panel__row', className);
return Object(external_this_wp_element_["createElement"])("div", {
className: classes
}, children);
}
/* harmony default export */ var row = (PanelRow);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/placeholder/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Renders a placeholder. Normally used by blocks to render their empty state.
*
* @param {Object} props The component props.
* @param {WPIcon} props.icon An icon rendered before the label.
* @param {WPElement} props.children Children to be rendered.
* @param {string} props.label Title of the placeholder.
* @param {string} props.instructions Instructions of the placeholder.
* @param {string} props.className Class to set on the container div.
* @param {Object} props.notices A rendered notices list.
* @param {Object} props.preview Preview to be rendered in the placeholder.
* @param {boolean} props.isColumnLayout Whether a column layout should be used.
*
* @return {Object} The rendered placeholder.
*/
function Placeholder(_ref) {
var icon = _ref.icon,
children = _ref.children,
label = _ref.label,
instructions = _ref.instructions,
className = _ref.className,
notices = _ref.notices,
preview = _ref.preview,
isColumnLayout = _ref.isColumnLayout,
additionalProps = Object(objectWithoutProperties["a" /* default */])(_ref, ["icon", "children", "label", "instructions", "className", "notices", "preview", "isColumnLayout"]);
var _useResizeObserver = Object(external_this_wp_compose_["useResizeObserver"])(),
_useResizeObserver2 = Object(slicedToArray["a" /* default */])(_useResizeObserver, 2),
resizeListener = _useResizeObserver2[0],
width = _useResizeObserver2[1].width; // Since `useResizeObserver` will report a width of `null` until after the
// first render, avoid applying any modifier classes until width is known.
var modifierClassNames;
if (typeof width === 'number') {
modifierClassNames = {
'is-large': width >= 320,
'is-medium': width >= 160 && width < 320,
'is-small': width < 160
};
}
var classes = classnames_default()('components-placeholder', className, modifierClassNames);
var fieldsetClasses = classnames_default()('components-placeholder__fieldset', {
'is-column-layout': isColumnLayout
});
return Object(external_this_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, additionalProps, {
className: classes
}), resizeListener, notices, preview && Object(external_this_wp_element_["createElement"])("div", {
className: "components-placeholder__preview"
}, preview), Object(external_this_wp_element_["createElement"])("div", {
className: "components-placeholder__label"
}, Object(external_this_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
icon: icon
}), label), !!instructions && Object(external_this_wp_element_["createElement"])("div", {
className: "components-placeholder__instructions"
}, instructions), Object(external_this_wp_element_["createElement"])("div", {
className: fieldsetClasses
}, children));
}
/* harmony default export */ var placeholder = (Placeholder);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/terms.js
function terms_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function terms_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { terms_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { terms_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/**
* External dependencies
*/
/**
* Returns terms in a tree form.
*
* @param {Array} flatTerms Array of terms in flat format.
*
* @return {Array} Array of terms in tree format.
*/
function buildTermsTree(flatTerms) {
var flatTermsWithParentAndChildren = flatTerms.map(function (term) {
return terms_objectSpread({
children: [],
parent: null
}, term);
});
var termsByParent = Object(external_this_lodash_["groupBy"])(flatTermsWithParentAndChildren, 'parent');
if (termsByParent.null && termsByParent.null.length) {
return flatTermsWithParentAndChildren;
}
var fillWithChildren = function fillWithChildren(terms) {
return terms.map(function (term) {
var children = termsByParent[term.id];
return terms_objectSpread({}, term, {
children: children && children.length ? fillWithChildren(children) : []
});
});
};
return fillWithChildren(termsByParent['0'] || []);
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-select/index.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function tree_select_getSelectOptions(tree) {
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
return Object(external_this_lodash_["flatMap"])(tree, function (treeNode) {
return [{
value: treeNode.id,
label: Object(external_this_lodash_["repeat"])("\xA0", level * 3) + Object(external_this_lodash_["unescape"])(treeNode.name)
}].concat(Object(toConsumableArray["a" /* default */])(tree_select_getSelectOptions(treeNode.children || [], level + 1)));
});
}
function TreeSelect(_ref) {
var label = _ref.label,
noOptionLabel = _ref.noOptionLabel,
onChange = _ref.onChange,
selectedId = _ref.selectedId,
tree = _ref.tree,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["label", "noOptionLabel", "onChange", "selectedId", "tree"]);
var options = Object(external_this_lodash_["compact"])([noOptionLabel && {
value: '',
label: noOptionLabel
}].concat(Object(toConsumableArray["a" /* default */])(tree_select_getSelectOptions(tree))));
return Object(external_this_wp_element_["createElement"])(SelectControl, Object(esm_extends["a" /* default */])({
label: label,
options: options,
onChange: onChange
}, {
value: selectedId
}, props));
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/author-select.js
/**
* Internal dependencies
*/
function AuthorSelect(_ref) {
var label = _ref.label,
noOptionLabel = _ref.noOptionLabel,
authorList = _ref.authorList,
selectedAuthorId = _ref.selectedAuthorId,
onChange = _ref.onChange;
var termsTree = buildTermsTree(authorList);
return Object(external_this_wp_element_["createElement"])(TreeSelect, Object(esm_extends["a" /* default */])({
label: label,
noOptionLabel: noOptionLabel,
onChange: onChange
}, {
tree: termsTree,
selectedId: selectedAuthorId
}));
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var DEFAULT_MIN_ITEMS = 1;
var DEFAULT_MAX_ITEMS = 100;
var MAX_CATEGORIES_SUGGESTIONS = 20;
function QueryControls(_ref) {
var authorList = _ref.authorList,
selectedAuthorId = _ref.selectedAuthorId,
categorySuggestions = _ref.categorySuggestions,
selectedCategories = _ref.selectedCategories,
numberOfItems = _ref.numberOfItems,
order = _ref.order,
orderBy = _ref.orderBy,
_ref$maxItems = _ref.maxItems,
maxItems = _ref$maxItems === void 0 ? DEFAULT_MAX_ITEMS : _ref$maxItems,
_ref$minItems = _ref.minItems,
minItems = _ref$minItems === void 0 ? DEFAULT_MIN_ITEMS : _ref$minItems,
onCategoryChange = _ref.onCategoryChange,
onAuthorChange = _ref.onAuthorChange,
onNumberOfItemsChange = _ref.onNumberOfItemsChange,
onOrderChange = _ref.onOrderChange,
onOrderByChange = _ref.onOrderByChange;
return [onOrderChange && onOrderByChange && Object(external_this_wp_element_["createElement"])(SelectControl, {
key: "query-controls-order-select",
label: Object(external_this_wp_i18n_["__"])('Order by'),
value: "".concat(orderBy, "/").concat(order),
options: [{
label: Object(external_this_wp_i18n_["__"])('Newest to oldest'),
value: 'date/desc'
}, {
label: Object(external_this_wp_i18n_["__"])('Oldest to newest'),
value: 'date/asc'
}, {
/* translators: label for ordering posts by title in ascending order */
label: Object(external_this_wp_i18n_["__"])('A → Z'),
value: 'title/asc'
}, {
/* translators: label for ordering posts by title in descending order */
label: Object(external_this_wp_i18n_["__"])('Z → A'),
value: 'title/desc'
}],
onChange: function onChange(value) {
var _value$split = value.split('/'),
_value$split2 = Object(slicedToArray["a" /* default */])(_value$split, 2),
newOrderBy = _value$split2[0],
newOrder = _value$split2[1];
if (newOrder !== order) {
onOrderChange(newOrder);
}
if (newOrderBy !== orderBy) {
onOrderByChange(newOrderBy);
}
}
}), onCategoryChange && Object(external_this_wp_element_["createElement"])(form_token_field, {
key: "query-controls-categories-select",
label: Object(external_this_wp_i18n_["__"])('Categories'),
value: selectedCategories && selectedCategories.map(function (item) {
return {
id: item.id,
value: item.name || item.value
};
}),
suggestions: Object.keys(categorySuggestions),
onChange: onCategoryChange,
maxSuggestions: MAX_CATEGORIES_SUGGESTIONS
}), onAuthorChange && Object(external_this_wp_element_["createElement"])(AuthorSelect, {
key: "query-controls-author-select",
authorList: authorList,
label: Object(external_this_wp_i18n_["__"])('Author'),
noOptionLabel: Object(external_this_wp_i18n_["__"])('All'),
selectedAuthorId: selectedAuthorId,
onChange: onAuthorChange
}), onNumberOfItemsChange && Object(external_this_wp_element_["createElement"])(range_control, {
key: "query-controls-range-control",
label: Object(external_this_wp_i18n_["__"])('Number of items'),
value: numberOfItems,
onChange: onNumberOfItemsChange,
min: minItems,
max: maxItems,
required: true
})];
}
// EXTERNAL MODULE: ./node_modules/reakit-warning/es/warning.js
var warning = __webpack_require__(146);
// EXTERNAL MODULE: ./node_modules/reakit-utils/es/useSealedState.js
var useSealedState = __webpack_require__(64);
// CONCATENATED MODULE: ./node_modules/reakit/es/Radio/RadioState.js
function useRadioState(initialState) {
if (initialState === void 0) {
initialState = {};
}
var _useSealedState = Object(useSealedState["a" /* useSealedState */])(initialState),
initialValue = _useSealedState.state,
_useSealedState$loop = _useSealedState.loop,
loop = _useSealedState$loop === void 0 ? true : _useSealedState$loop,
sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_useSealedState, ["state", "loop"]);
var _React$useState = Object(external_this_React_["useState"])(initialValue),
state = _React$useState[0],
setState = _React$useState[1];
var composite = Object(CompositeState_3a25dcee["g" /* u */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, sealed), {}, {
loop: loop
}));
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, composite), {}, {
state: state,
setState: setState
});
}
var keys = [].concat(CompositeState_3a25dcee["g" /* u */].__keys, ["state", "setState"]);
useRadioState.__keys = keys;
// CONCATENATED MODULE: ./node_modules/reakit/es/Radio/Radio.js
function getChecked(options) {
if (typeof options.checked !== "undefined") {
return options.checked;
}
return typeof options.value !== "undefined" && options.state === options.value;
}
function useInitialChecked(options) {
var _React$useState = Object(external_this_React_["useState"])(function () {
return getChecked(options);
}),
initialChecked = _React$useState[0];
var _React$useState2 = Object(external_this_React_["useState"])(options.currentId),
initialCurrentId = _React$useState2[0];
var id = options.id,
setCurrentId = options.setCurrentId;
Object(external_this_React_["useEffect"])(function () {
if (initialChecked && id && initialCurrentId !== id) {
setCurrentId === null || setCurrentId === void 0 ? void 0 : setCurrentId(id);
}
}, [initialChecked, id, setCurrentId, initialCurrentId]);
}
function fireChange(element, onChange) {
var event = createEvent(element, "change");
Object.defineProperties(event, {
type: {
value: "change"
},
target: {
value: element
},
currentTarget: {
value: element
}
});
onChange === null || onChange === void 0 ? void 0 : onChange(event);
}
var useRadio = Object(createHook["a" /* createHook */])({
name: "Radio",
compose: CompositeItem["b" /* useCompositeItem */],
useState: useRadioState,
keys: ["value", "checked", "unstable_checkOnFocus"],
useOptions: function useOptions(_ref, _ref2) {
var _options$value;
var value = _ref2.value,
checked = _ref2.checked;
var _ref$unstable_clickOn = _ref.unstable_clickOnEnter,
unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? false : _ref$unstable_clickOn,
_ref$unstable_checkOn = _ref.unstable_checkOnFocus,
unstable_checkOnFocus = _ref$unstable_checkOn === void 0 ? true : _ref$unstable_checkOn,
options = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["unstable_clickOnEnter", "unstable_checkOnFocus"]);
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
checked: checked,
unstable_clickOnEnter: unstable_clickOnEnter,
unstable_checkOnFocus: unstable_checkOnFocus
}, options), {}, {
value: (_options$value = options.value) != null ? _options$value : value
});
},
useProps: function useProps(options, _ref3) {
var htmlRef = _ref3.ref,
htmlOnChange = _ref3.onChange,
htmlOnClick = _ref3.onClick,
htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref3, ["ref", "onChange", "onClick"]);
var ref = Object(external_this_React_["useRef"])(null);
var _React$useState3 = Object(external_this_React_["useState"])(true),
isNativeRadio = _React$useState3[0],
setIsNativeRadio = _React$useState3[1];
var checked = getChecked(options);
var isCurrentItemRef = Object(useLiveRef["a" /* useLiveRef */])(options.currentId === options.id);
var onChangeRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnChange);
var onClickRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnClick);
useInitialChecked(options);
Object(external_this_React_["useEffect"])(function () {
var element = ref.current;
if (!element) {
false ? undefined : void 0;
return;
}
if (element.tagName !== "INPUT" || element.type !== "radio") {
setIsNativeRadio(false);
}
}, []);
var onChange = Object(external_this_React_["useCallback"])(function (event) {
var _onChangeRef$current, _options$setState;
(_onChangeRef$current = onChangeRef.current) === null || _onChangeRef$current === void 0 ? void 0 : _onChangeRef$current.call(onChangeRef, event);
if (event.defaultPrevented) return;
if (options.disabled) return;
(_options$setState = options.setState) === null || _options$setState === void 0 ? void 0 : _options$setState.call(options, options.value);
}, [options.disabled, options.setState, options.value]);
var onClick = Object(external_this_React_["useCallback"])(function (event) {
var _onClickRef$current;
(_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event);
if (event.defaultPrevented) return;
fireChange(event.currentTarget, onChange);
}, [onChange]);
Object(external_this_React_["useEffect"])(function () {
var element = ref.current;
if (!element) return;
if (options.unstable_moves && isCurrentItemRef.current && options.unstable_checkOnFocus) {
fireChange(element, onChange);
}
}, [options.unstable_moves, options.unstable_checkOnFocus, onChange]);
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
ref: Object(useForkRef["a" /* useForkRef */])(ref, htmlRef),
role: !isNativeRadio ? "radio" : undefined,
type: isNativeRadio ? "radio" : undefined,
value: isNativeRadio ? options.value : undefined,
"aria-checked": checked,
checked: checked,
onChange: onChange,
onClick: onClick
}, htmlProps);
}
});
var Radio = Object(createComponent["a" /* createComponent */])({
as: "input",
memo: true,
useHook: useRadio
});
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-context/index.js
/**
* WordPress dependencies
*/
var RadioContext = Object(external_this_wp_element_["createContext"])({
state: null,
setState: function setState() {}
});
/* harmony default export */ var radio_context = (RadioContext);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function radio_Radio(_ref, ref) {
var children = _ref.children,
value = _ref.value,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children", "value"]);
var radioContext = Object(external_this_wp_element_["useContext"])(radio_context);
var checked = radioContext.state === value;
return Object(external_this_wp_element_["createElement"])(Radio, Object(esm_extends["a" /* default */])({
ref: ref,
as: build_module_button["a" /* default */],
isPrimary: checked,
isSecondary: !checked,
value: value
}, radioContext, props), children || value);
}
/* harmony default export */ var build_module_radio = (Object(external_this_wp_element_["forwardRef"])(radio_Radio));
// CONCATENATED MODULE: ./node_modules/reakit/es/Radio/RadioGroup.js
var useRadioGroup = Object(createHook["a" /* createHook */])({
name: "RadioGroup",
compose: useComposite,
useState: useRadioState,
useProps: function useProps(_, htmlProps) {
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
role: "radiogroup"
}, htmlProps);
}
});
var RadioGroup = Object(createComponent["a" /* createComponent */])({
as: "div",
useHook: useRadioGroup,
useCreateElement: function useCreateElement$1(type, props, children) {
false ? undefined : void 0;
return Object(useCreateElement["a" /* useCreateElement */])(type, props, children);
}
});
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-group/index.js
function radio_group_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function radio_group_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { radio_group_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { radio_group_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function radio_group_RadioGroup(_ref, ref) {
var accessibilityLabel = _ref.accessibilityLabel,
checked = _ref.checked,
defaultChecked = _ref.defaultChecked,
disabled = _ref.disabled,
onChange = _ref.onChange,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["accessibilityLabel", "checked", "defaultChecked", "disabled", "onChange"]);
var radioState = useRadioState({
state: defaultChecked,
baseId: props.id
});
var radioContext = radio_group_objectSpread({}, radioState, {
disabled: disabled,
// controlled or uncontrolled
state: checked || radioState.state,
setState: onChange || radioState.setState
});
return Object(external_this_wp_element_["createElement"])(radio_context.Provider, {
value: radioContext
}, Object(external_this_wp_element_["createElement"])(RadioGroup, Object(esm_extends["a" /* default */])({
ref: ref,
as: button_group,
"aria-label": accessibilityLabel
}, radioState, props)));
}
/* harmony default export */ var radio_group = (Object(external_this_wp_element_["forwardRef"])(radio_group_RadioGroup));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-control/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function RadioControl(_ref) {
var label = _ref.label,
className = _ref.className,
selected = _ref.selected,
help = _ref.help,
onChange = _ref.onChange,
_ref$options = _ref.options,
options = _ref$options === void 0 ? [] : _ref$options;
var instanceId = Object(external_this_wp_compose_["useInstanceId"])(RadioControl);
var id = "inspector-radio-control-".concat(instanceId);
var onChangeValue = function onChangeValue(event) {
return onChange(event.target.value);
};
return !Object(external_this_lodash_["isEmpty"])(options) && Object(external_this_wp_element_["createElement"])(base_control, {
label: label,
id: id,
help: help,
className: classnames_default()(className, 'components-radio-control')
}, options.map(function (option, index) {
return Object(external_this_wp_element_["createElement"])("div", {
key: "".concat(id, "-").concat(index),
className: "components-radio-control__option"
}, Object(external_this_wp_element_["createElement"])("input", {
id: "".concat(id, "-").concat(index),
className: "components-radio-control__input",
type: "radio",
name: id,
value: option.value,
onChange: onChangeValue,
checked: option.value === selected,
"aria-describedby": !!help ? "".concat(id, "__help") : undefined
}), Object(external_this_wp_element_["createElement"])("label", {
htmlFor: "".concat(id, "-").concat(index)
}, option.label));
}));
}
// CONCATENATED MODULE: ./node_modules/re-resizable/lib/resizer.js
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
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);
};
var resizer_styles = {
top: {
width: '100%',
height: '10px',
top: '-5px',
left: '0px',
cursor: 'row-resize',
},
right: {
width: '10px',
height: '100%',
top: '0px',
right: '-5px',
cursor: 'col-resize',
},
bottom: {
width: '100%',
height: '10px',
bottom: '-5px',
left: '0px',
cursor: 'row-resize',
},
left: {
width: '10px',
height: '100%',
top: '0px',
left: '-5px',
cursor: 'col-resize',
},
topRight: {
width: '20px',
height: '20px',
position: 'absolute',
right: '-10px',
top: '-10px',
cursor: 'ne-resize',
},
bottomRight: {
width: '20px',
height: '20px',
position: 'absolute',
right: '-10px',
bottom: '-10px',
cursor: 'se-resize',
},
bottomLeft: {
width: '20px',
height: '20px',
position: 'absolute',
left: '-10px',
bottom: '-10px',
cursor: 'sw-resize',
},
topLeft: {
width: '20px',
height: '20px',
position: 'absolute',
left: '-10px',
top: '-10px',
cursor: 'nw-resize',
},
};
var resizer_Resizer = /** @class */ (function (_super) {
__extends(Resizer, _super);
function Resizer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.onMouseDown = function (e) {
_this.props.onResizeStart(e, _this.props.direction);
};
_this.onTouchStart = function (e) {
_this.props.onResizeStart(e, _this.props.direction);
};
return _this;
}
Resizer.prototype.render = function () {
return (external_this_React_["createElement"]("div", { className: this.props.className || '', style: __assign(__assign({ position: 'absolute', userSelect: 'none' }, resizer_styles[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));
};
return Resizer;
}(external_this_React_["PureComponent"]));
// EXTERNAL MODULE: ./node_modules/fast-memoize/src/index.js
var fast_memoize_src = __webpack_require__(109);
var src_default = /*#__PURE__*/__webpack_require__.n(fast_memoize_src);
// CONCATENATED MODULE: ./node_modules/re-resizable/lib/index.js
var lib_extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var lib_assign = (undefined && undefined.__assign) || function () {
lib_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 lib_assign.apply(this, arguments);
};
var DEFAULT_SIZE = {
width: 'auto',
height: 'auto',
};
var clamp = src_default()(function (n, min, max) { return Math.max(Math.min(n, max), min); });
var snap = src_default()(function (n, size) { return Math.round(n / size) * size; });
var hasDirection = src_default()(function (dir, target) {
return new RegExp(dir, 'i').test(target);
});
var findClosestSnap = src_default()(function (n, snapArray, snapGap) {
if (snapGap === void 0) { snapGap = 0; }
var closestGapIndex = snapArray.reduce(function (prev, curr, index) { return (Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev); }, 0);
var gap = Math.abs(snapArray[closestGapIndex] - n);
return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n;
});
var endsWith = src_default()(function (str, searchStr) {
return str.substr(str.length - searchStr.length, searchStr.length) === searchStr;
});
var getStringSize = src_default()(function (n) {
n = n.toString();
if (n === 'auto') {
return n;
}
if (endsWith(n, 'px')) {
return n;
}
if (endsWith(n, '%')) {
return n;
}
if (endsWith(n, 'vh')) {
return n;
}
if (endsWith(n, 'vw')) {
return n;
}
if (endsWith(n, 'vmax')) {
return n;
}
if (endsWith(n, 'vmin')) {
return n;
}
return n + "px";
});
var getPixelSize = function (size, parentSize, innerWidth, innerHeight) {
if (size && typeof size === 'string') {
if (endsWith(size, '%')) {
var ratio = Number(size.replace('%', '')) / 100;
return parentSize * ratio;
}
else if (endsWith(size, 'vw')) {
var ratio = Number(size.replace('vw', '')) / 100;
return innerWidth * ratio;
}
else if (endsWith(size, 'vh')) {
var ratio = Number(size.replace('vh', '')) / 100;
return innerHeight * ratio;
}
}
return size;
};
var calculateNewMax = src_default()(function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight);
maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight);
minWidth = getPixelSize(minWidth, parentSize.width, innerWidth, innerHeight);
minHeight = getPixelSize(minHeight, parentSize.height, innerWidth, innerHeight);
return {
maxWidth: typeof maxWidth === 'undefined' ? undefined : Number(maxWidth),
maxHeight: typeof maxHeight === 'undefined' ? undefined : Number(maxHeight),
minWidth: typeof minWidth === 'undefined' ? undefined : Number(minWidth),
minHeight: typeof minHeight === 'undefined' ? undefined : Number(minHeight),
};
});
var definedProps = [
'as',
'style',
'className',
'grid',
'snap',
'bounds',
'size',
'defaultSize',
'minWidth',
'minHeight',
'maxWidth',
'maxHeight',
'lockAspectRatio',
'lockAspectRatioExtraWidth',
'lockAspectRatioExtraHeight',
'enable',
'handleStyles',
'handleClasses',
'handleWrapperStyle',
'handleWrapperClass',
'children',
'onResizeStart',
'onResize',
'onResizeStop',
'handleComponent',
'scale',
'resizeRatio',
'snapGap',
];
// HACK: This class is used to calculate % size.
var baseClassName = '__resizable_base__';
var lib_Resizable = /** @class */ (function (_super) {
lib_extends(Resizable, _super);
function Resizable(props) {
var _this = _super.call(this, props) || this;
_this.ratio = 1;
_this.resizable = null;
// For parent boundary
_this.parentLeft = 0;
_this.parentTop = 0;
// For boundary
_this.resizableLeft = 0;
_this.resizableTop = 0;
// For target boundary
_this.targetLeft = 0;
_this.targetTop = 0;
_this.ref = function (c) {
if (c) {
_this.resizable = c;
}
};
_this.state = {
isResizing: false,
width: typeof (_this.propsSize && _this.propsSize.width) === 'undefined'
? 'auto'
: _this.propsSize && _this.propsSize.width,
height: typeof (_this.propsSize && _this.propsSize.height) === 'undefined'
? 'auto'
: _this.propsSize && _this.propsSize.height,
direction: 'right',
original: {
x: 0,
y: 0,
width: 0,
height: 0,
},
backgroundStyle: {
height: '100%',
width: '100%',
backgroundColor: 'rgba(0,0,0,0)',
cursor: 'auto',
opacity: 0,
position: 'fixed',
zIndex: 9999,
top: '0',
left: '0',
bottom: '0',
right: '0',
},
flexBasis: undefined,
};
_this.onResizeStart = _this.onResizeStart.bind(_this);
_this.onMouseMove = _this.onMouseMove.bind(_this);
_this.onMouseUp = _this.onMouseUp.bind(_this);
return _this;
}
Object.defineProperty(Resizable.prototype, "parentNode", {
get: function () {
if (!this.resizable) {
return null;
}
return this.resizable.parentNode;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Resizable.prototype, "window", {
get: function () {
if (!this.resizable) {
return null;
}
if (!this.resizable.ownerDocument) {
return null;
}
return this.resizable.ownerDocument.defaultView;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Resizable.prototype, "propsSize", {
get: function () {
return this.props.size || this.props.defaultSize || DEFAULT_SIZE;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Resizable.prototype, "base", {
get: function () {
var parent = this.parentNode;
if (!parent) {
return undefined;
}
var children = [].slice.call(parent.children);
for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
var n = children_1[_i];
if (n.classList.contains(baseClassName)) {
return n;
}
}
return undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Resizable.prototype, "size", {
get: function () {
var width = 0;
var height = 0;
if (this.resizable && this.window) {
var orgWidth = this.resizable.offsetWidth;
var orgHeight = this.resizable.offsetHeight;
// HACK: Set position `relative` to get parent size.
// This is because when re-resizable set `absolute`, I can not get base width correctly.
var orgPosition = this.resizable.style.position;
if (orgPosition !== 'relative') {
this.resizable.style.position = 'relative';
}
// INFO: Use original width or height if set auto.
width = this.resizable.style.width !== 'auto' ? this.resizable.offsetWidth : orgWidth;
height = this.resizable.style.height !== 'auto' ? this.resizable.offsetHeight : orgHeight;
// Restore original position
this.resizable.style.position = orgPosition;
}
return { width: width, height: height };
},
enumerable: true,
configurable: true
});
Object.defineProperty(Resizable.prototype, "sizeStyle", {
get: function () {
var _this = this;
var size = this.props.size;
var getSize = function (key) {
if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') {
return 'auto';
}
if (_this.propsSize && _this.propsSize[key] && endsWith(_this.propsSize[key].toString(), '%')) {
if (endsWith(_this.state[key].toString(), '%')) {
return _this.state[key].toString();
}
var parentSize = _this.getParentSize();
var value = Number(_this.state[key].toString().replace('px', ''));
var percent = (value / parentSize[key]) * 100;
return percent + "%";
}
return getStringSize(_this.state[key]);
};
var width = size && typeof size.width !== 'undefined' && !this.state.isResizing
? getStringSize(size.width)
: getSize('width');
var height = size && typeof size.height !== 'undefined' && !this.state.isResizing
? getStringSize(size.height)
: getSize('height');
return { width: width, height: height };
},
enumerable: true,
configurable: true
});
Resizable.prototype.getParentSize = function () {
if (!this.base || !this.parentNode) {
if (!this.window) {
return { width: 0, height: 0 };
}
return { width: this.window.innerWidth, height: this.window.innerHeight };
}
// INFO: To calculate parent width with flex layout
var wrapChanged = false;
var wrap = this.parentNode.style.flexWrap;
var minWidth = this.base.style.minWidth;
if (wrap !== 'wrap') {
wrapChanged = true;
this.parentNode.style.flexWrap = 'wrap';
// HACK: Use relative to get parent padding size
}
this.base.style.position = 'relative';
this.base.style.minWidth = '100%';
var size = {
width: this.base.offsetWidth,
height: this.base.offsetHeight,
};
this.base.style.position = 'absolute';
if (wrapChanged) {
this.parentNode.style.flexWrap = wrap;
}
this.base.style.minWidth = minWidth;
return size;
};
Resizable.prototype.bindEvents = function () {
if (this.window) {
this.window.addEventListener('mouseup', this.onMouseUp);
this.window.addEventListener('mousemove', this.onMouseMove);
this.window.addEventListener('mouseleave', this.onMouseUp);
this.window.addEventListener('touchmove', this.onMouseMove);
this.window.addEventListener('touchend', this.onMouseUp);
}
};
Resizable.prototype.unbindEvents = function () {
if (this.window) {
this.window.removeEventListener('mouseup', this.onMouseUp);
this.window.removeEventListener('mousemove', this.onMouseMove);
this.window.removeEventListener('mouseleave', this.onMouseUp);
this.window.removeEventListener('touchmove', this.onMouseMove);
this.window.removeEventListener('touchend', this.onMouseUp);
}
};
Resizable.prototype.componentDidMount = function () {
if (!this.resizable || !this.window) {
return;
}
var computedStyle = this.window.getComputedStyle(this.resizable);
this.setState({
width: this.state.width || this.size.width,
height: this.state.height || this.size.height,
flexBasis: computedStyle.flexBasis !== 'auto' ? computedStyle.flexBasis : undefined,
});
var parent = this.parentNode;
if (!parent) {
return;
}
if (this.base) {
return;
}
var element = this.window.document.createElement('div');
element.style.width = '100%';
element.style.height = '100%';
element.style.position = 'absolute';
element.style.transform = 'scale(0, 0)';
element.style.left = '0';
element.style.flex = '0';
if (element.classList) {
element.classList.add(baseClassName);
}
else {
element.className += baseClassName;
}
parent.appendChild(element);
};
Resizable.prototype.componentWillUnmount = function () {
if (this.window) {
this.unbindEvents();
var parent_1 = this.parentNode;
if (!this.base || !parent_1) {
return;
}
if (!parent_1 || !this.base) {
return;
}
parent_1.removeChild(this.base);
}
};
Resizable.prototype.createSizeForCssProperty = function (newSize, kind) {
var propsSize = this.propsSize && this.propsSize[kind];
return this.state[kind] === 'auto' &&
this.state.original[kind] === newSize &&
(typeof propsSize === 'undefined' || propsSize === 'auto')
? 'auto'
: newSize;
};
Resizable.prototype.calculateNewMaxFromBoundary = function (maxWidth, maxHeight) {
if (this.props.bounds === 'parent') {
var parent_2 = this.parentNode;
if (parent_2) {
var boundWidth = parent_2.offsetWidth + (this.parentLeft - this.resizableLeft);
var boundHeight = parent_2.offsetHeight + (this.parentTop - this.resizableTop);
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
}
}
else if (this.props.bounds === 'window') {
if (this.window) {
var boundWidth = this.window.innerWidth - this.resizableLeft;
var boundHeight = this.window.innerHeight - this.resizableTop;
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
}
}
else if (this.props.bounds) {
var boundWidth = this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft);
var boundHeight = this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop);
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
}
return { maxWidth: maxWidth, maxHeight: maxHeight };
};
Resizable.prototype.calculateNewSizeFromDirection = function (clientX, clientY) {
var scale = this.props.scale || 1;
var resizeRatio = this.props.resizeRatio || 1;
var _a = this.state, direction = _a.direction, original = _a.original;
var _b = this.props, lockAspectRatio = _b.lockAspectRatio, lockAspectRatioExtraHeight = _b.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _b.lockAspectRatioExtraWidth;
var newWidth = original.width;
var newHeight = original.height;
var extraHeight = lockAspectRatioExtraHeight || 0;
var extraWidth = lockAspectRatioExtraWidth || 0;
if (hasDirection('right', direction)) {
newWidth = original.width + ((clientX - original.x) * resizeRatio) / scale;
if (lockAspectRatio) {
newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
}
}
if (hasDirection('left', direction)) {
newWidth = original.width - ((clientX - original.x) * resizeRatio) / scale;
if (lockAspectRatio) {
newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
}
}
if (hasDirection('bottom', direction)) {
newHeight = original.height + ((clientY - original.y) * resizeRatio) / scale;
if (lockAspectRatio) {
newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
}
}
if (hasDirection('top', direction)) {
newHeight = original.height - ((clientY - original.y) * resizeRatio) / scale;
if (lockAspectRatio) {
newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
}
}
return { newWidth: newWidth, newHeight: newHeight };
};
Resizable.prototype.calculateNewSizeFromAspectRatio = function (newWidth, newHeight, max, min) {
var _a = this.props, lockAspectRatio = _a.lockAspectRatio, lockAspectRatioExtraHeight = _a.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _a.lockAspectRatioExtraWidth;
var computedMinWidth = typeof min.width === 'undefined' ? 10 : min.width;
var computedMaxWidth = typeof max.width === 'undefined' || max.width < 0 ? newWidth : max.width;
var computedMinHeight = typeof min.height === 'undefined' ? 10 : min.height;
var computedMaxHeight = typeof max.height === 'undefined' || max.height < 0 ? newHeight : max.height;
var extraHeight = lockAspectRatioExtraHeight || 0;
var extraWidth = lockAspectRatioExtraWidth || 0;
if (lockAspectRatio) {
var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth;
var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth;
var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight;
var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight;
var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth);
var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth);
var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight);
var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight);
newWidth = clamp(newWidth, lockedMinWidth, lockedMaxWidth);
newHeight = clamp(newHeight, lockedMinHeight, lockedMaxHeight);
}
else {
newWidth = clamp(newWidth, computedMinWidth, computedMaxWidth);
newHeight = clamp(newHeight, computedMinHeight, computedMaxHeight);
}
return { newWidth: newWidth, newHeight: newHeight };
};
Resizable.prototype.setBoundingClientRect = function () {
// For parent boundary
if (this.props.bounds === 'parent') {
var parent_3 = this.parentNode;
if (parent_3) {
var parentRect = parent_3.getBoundingClientRect();
this.parentLeft = parentRect.left;
this.parentTop = parentRect.top;
}
}
// For target(html element) boundary
if (this.props.bounds && typeof this.props.bounds !== 'string') {
var targetRect = this.props.bounds.getBoundingClientRect();
this.targetLeft = targetRect.left;
this.targetTop = targetRect.top;
}
// For boundary
if (this.resizable) {
var _a = this.resizable.getBoundingClientRect(), left = _a.left, top_1 = _a.top;
this.resizableLeft = left;
this.resizableTop = top_1;
}
};
Resizable.prototype.onResizeStart = function (event, direction) {
if (!this.resizable || !this.window) {
return;
}
var clientX = 0;
var clientY = 0;
if (event.nativeEvent instanceof this.window.MouseEvent) {
clientX = event.nativeEvent.clientX;
clientY = event.nativeEvent.clientY;
// When user click with right button the resize is stuck in resizing mode
// until users clicks again, dont continue if right click is used.
// HACK: MouseEvent does not have `which` from flow-bin v0.68.
if (event.nativeEvent.which === 3) {
return;
}
}
else if (event.nativeEvent instanceof this.window.TouchEvent) {
clientX = event.nativeEvent.touches[0].clientX;
clientY = event.nativeEvent.touches[0].clientY;
}
if (this.props.onResizeStart) {
if (this.resizable) {
var startResize = this.props.onResizeStart(event, direction, this.resizable);
if (startResize === false) {
return;
}
}
}
// Fix #168
if (this.props.size) {
if (typeof this.props.size.height !== 'undefined' && this.props.size.height !== this.state.height) {
this.setState({ height: this.props.size.height });
}
if (typeof this.props.size.width !== 'undefined' && this.props.size.width !== this.state.width) {
this.setState({ width: this.props.size.width });
}
}
// For lockAspectRatio case
this.ratio =
typeof this.props.lockAspectRatio === 'number' ? this.props.lockAspectRatio : this.size.width / this.size.height;
var flexBasis;
var computedStyle = this.window.getComputedStyle(this.resizable);
if (computedStyle.flexBasis !== 'auto') {
var parent_4 = this.parentNode;
if (parent_4) {
var dir = this.window.getComputedStyle(parent_4).flexDirection;
this.flexDir = dir.startsWith('row') ? 'row' : 'column';
flexBasis = computedStyle.flexBasis;
}
}
// For boundary
this.setBoundingClientRect();
this.bindEvents();
var state = {
original: {
x: clientX,
y: clientY,
width: this.size.width,
height: this.size.height,
},
isResizing: true,
backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(event.target).cursor || 'auto' }),
direction: direction,
flexBasis: flexBasis,
};
this.setState(state);
};
Resizable.prototype.onMouseMove = function (event) {
if (!this.state.isResizing || !this.resizable || !this.window) {
return;
}
var _a = this.props, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, minWidth = _a.minWidth, minHeight = _a.minHeight;
var clientX = event instanceof this.window.MouseEvent ? event.clientX : event.touches[0].clientX;
var clientY = event instanceof this.window.MouseEvent ? event.clientY : event.touches[0].clientY;
var _b = this.state, direction = _b.direction, original = _b.original, width = _b.width, height = _b.height;
var parentSize = this.getParentSize();
var max = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight);
maxWidth = max.maxWidth;
maxHeight = max.maxHeight;
minWidth = max.minWidth;
minHeight = max.minHeight;
// Calculate new size
var _c = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c.newHeight, newWidth = _c.newWidth;
// Calculate max size from boundary settings
var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight);
// Calculate new size from aspect ratio
var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight });
newWidth = newSize.newWidth;
newHeight = newSize.newHeight;
if (this.props.grid) {
var newGridWidth = snap(newWidth, this.props.grid[0]);
var newGridHeight = snap(newHeight, this.props.grid[1]);
var gap = this.props.snapGap || 0;
newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth;
newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight;
}
if (this.props.snap && this.props.snap.x) {
newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);
}
if (this.props.snap && this.props.snap.y) {
newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);
}
var delta = {
width: newWidth - original.width,
height: newHeight - original.height,
};
if (width && typeof width === 'string') {
if (endsWith(width, '%')) {
var percent = (newWidth / parentSize.width) * 100;
newWidth = percent + "%";
}
else if (endsWith(width, 'vw')) {
var vw = (newWidth / this.window.innerWidth) * 100;
newWidth = vw + "vw";
}
else if (endsWith(width, 'vh')) {
var vh = (newWidth / this.window.innerHeight) * 100;
newWidth = vh + "vh";
}
}
if (height && typeof height === 'string') {
if (endsWith(height, '%')) {
var percent = (newHeight / parentSize.height) * 100;
newHeight = percent + "%";
}
else if (endsWith(height, 'vw')) {
var vw = (newHeight / this.window.innerWidth) * 100;
newHeight = vw + "vw";
}
else if (endsWith(height, 'vh')) {
var vh = (newHeight / this.window.innerHeight) * 100;
newHeight = vh + "vh";
}
}
var newState = {
width: this.createSizeForCssProperty(newWidth, 'width'),
height: this.createSizeForCssProperty(newHeight, 'height'),
};
if (this.flexDir === 'row') {
newState.flexBasis = newState.width;
}
else if (this.flexDir === 'column') {
newState.flexBasis = newState.height;
}
this.setState(newState);
if (this.props.onResize) {
this.props.onResize(event, direction, this.resizable, delta);
}
};
Resizable.prototype.onMouseUp = function (event) {
var _a = this.state, isResizing = _a.isResizing, direction = _a.direction, original = _a.original;
if (!isResizing || !this.resizable) {
return;
}
var delta = {
width: this.size.width - original.width,
height: this.size.height - original.height,
};
if (this.props.onResizeStop) {
this.props.onResizeStop(event, direction, this.resizable, delta);
}
if (this.props.size) {
this.setState(this.props.size);
}
this.unbindEvents();
this.setState({
isResizing: false,
backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: 'auto' }),
});
};
Resizable.prototype.updateSize = function (size) {
this.setState({ width: size.width, height: size.height });
};
Resizable.prototype.renderResizer = function () {
var _this = this;
var _a = this.props, enable = _a.enable, handleStyles = _a.handleStyles, handleClasses = _a.handleClasses, handleWrapperStyle = _a.handleWrapperStyle, handleWrapperClass = _a.handleWrapperClass, handleComponent = _a.handleComponent;
if (!enable) {
return null;
}
var resizers = Object.keys(enable).map(function (dir) {
if (enable[dir] !== false) {
return (external_this_React_["createElement"](resizer_Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null));
}
return null;
});
// #93 Wrap the resize box in span (will not break 100% width/height)
return (external_this_React_["createElement"]("span", { className: handleWrapperClass, style: handleWrapperStyle }, resizers));
};
Resizable.prototype.render = function () {
var _this = this;
var extendsProps = Object.keys(this.props).reduce(function (acc, key) {
if (definedProps.indexOf(key) !== -1) {
return acc;
}
acc[key] = _this.props[key];
return acc;
}, {});
var style = lib_assign(lib_assign(lib_assign({ position: 'relative', userSelect: this.state.isResizing ? 'none' : 'auto' }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: 'border-box', flexShrink: 0 });
if (this.state.flexBasis) {
style.flexBasis = this.state.flexBasis;
}
var Wrapper = this.props.as;
return (external_this_React_["createElement"](Wrapper, lib_assign({ ref: this.ref, style: style, className: this.props.className }, extendsProps),
this.state.isResizing && external_this_React_["createElement"]("div", { style: this.state.backgroundStyle }),
this.props.children,
this.renderResizer()));
};
Resizable.defaultProps = {
as: 'div',
onResizeStart: function () { },
onResize: function () { },
onResizeStop: function () { },
enable: {
top: true,
right: true,
bottom: true,
left: true,
topRight: true,
bottomRight: true,
bottomLeft: true,
topLeft: true,
},
style: {},
grid: [1, 1],
lockAspectRatio: false,
lockAspectRatioExtraWidth: 0,
lockAspectRatioExtraHeight: 0,
scale: 1,
resizeRatio: 1,
snapGap: 0,
};
return Resizable;
}(external_this_React_["PureComponent"]));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/index.js
/**
* External dependencies
*/
function ResizableBox(_ref) {
var className = _ref.className,
_ref$showHandle = _ref.showHandle,
showHandle = _ref$showHandle === void 0 ? true : _ref$showHandle,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "showHandle"]);
// Removes the inline styles in the drag handles.
var handleStylesOverrides = {
width: null,
height: null,
top: null,
right: null,
bottom: null,
left: null
};
var handleClassName = 'components-resizable-box__handle';
var sideHandleClassName = 'components-resizable-box__side-handle';
var cornerHandleClassName = 'components-resizable-box__corner-handle';
return Object(external_this_wp_element_["createElement"])(lib_Resizable, Object(esm_extends["a" /* default */])({
className: classnames_default()('components-resizable-box__container', showHandle && 'has-show-handle', className),
handleClasses: {
top: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-top'),
right: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-right'),
bottom: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-bottom'),
left: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-left'),
topLeft: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-top', 'components-resizable-box__handle-left'),
topRight: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-top', 'components-resizable-box__handle-right'),
bottomRight: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-bottom', 'components-resizable-box__handle-right'),
bottomLeft: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-bottom', 'components-resizable-box__handle-left')
},
handleStyles: {
top: handleStylesOverrides,
right: handleStylesOverrides,
bottom: handleStylesOverrides,
left: handleStylesOverrides,
topLeft: handleStylesOverrides,
topRight: handleStylesOverrides,
bottomRight: handleStylesOverrides,
bottomLeft: handleStylesOverrides
}
}, props));
}
/* harmony default export */ var resizable_box = (ResizableBox);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/responsive-wrapper/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function ResponsiveWrapper(_ref) {
var naturalWidth = _ref.naturalWidth,
naturalHeight = _ref.naturalHeight,
children = _ref.children,
_ref$isInline = _ref.isInline,
isInline = _ref$isInline === void 0 ? false : _ref$isInline;
var _useResizeObserver = Object(external_this_wp_compose_["useResizeObserver"])(),
_useResizeObserver2 = Object(slicedToArray["a" /* default */])(_useResizeObserver, 2),
containerResizeListener = _useResizeObserver2[0],
containerWidth = _useResizeObserver2[1].width;
if (external_this_wp_element_["Children"].count(children) !== 1) {
return null;
}
var imageStyle = {
paddingBottom: naturalWidth < containerWidth ? naturalHeight : naturalHeight / naturalWidth * 100 + '%'
};
var TagName = isInline ? 'span' : 'div';
return Object(external_this_wp_element_["createElement"])(TagName, {
className: "components-responsive-wrapper"
}, containerResizeListener, Object(external_this_wp_element_["createElement"])(TagName, {
style: imageStyle
}), Object(external_this_wp_element_["cloneElement"])(children, {
className: classnames_default()('components-responsive-wrapper__content', children.props.className)
}));
}
/* harmony default export */ var responsive_wrapper = (ResponsiveWrapper);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/sandbox/index.js
function sandbox_createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (sandbox_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function sandbox_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var sandbox_Sandbox = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(Sandbox, _Component);
var _super = sandbox_createSuper(Sandbox);
function Sandbox() {
var _this;
Object(classCallCheck["a" /* default */])(this, Sandbox);
_this = _super.apply(this, arguments);
_this.trySandbox = _this.trySandbox.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.checkMessageForResize = _this.checkMessageForResize.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.iframe = Object(external_this_wp_element_["createRef"])();
_this.state = {
width: 0,
height: 0
};
return _this;
}
Object(createClass["a" /* default */])(Sandbox, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
this.trySandbox();
this.trySandboxWithoutRerender = function () {
_this2.trySandbox(false);
}; // This used to be registered using , but it made the iframe blank
// after reordering the containing block. See these two issues for more details:
// https://github.com/WordPress/gutenberg/issues/6146
// https://github.com/facebook/react/issues/18752
this.iframe.current.addEventListener('load', this.trySandboxWithoutRerender, false);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var forceRerender = prevProps.html !== this.props.html;
this.trySandbox(forceRerender);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.iframe.current.removeEventListener('load', this.trySandboxWithoutRerender);
}
}, {
key: "isFrameAccessible",
value: function isFrameAccessible() {
try {
return !!this.iframe.current.contentDocument.body;
} catch (e) {
return false;
}
}
}, {
key: "checkMessageForResize",
value: function checkMessageForResize(event) {
var iframe = this.iframe.current; // Attempt to parse the message data as JSON if passed as string
var data = event.data || {};
if ('string' === typeof data) {
try {
data = JSON.parse(data);
} catch (e) {}
} // Verify that the mounted element is the source of the message
if (!iframe || iframe.contentWindow !== event.source) {
return;
} // Update the state only if the message is formatted as we expect, i.e.
// as an object with a 'resize' action, width, and height
var _data = data,
action = _data.action,
width = _data.width,
height = _data.height;
var _this$state = this.state,
oldWidth = _this$state.width,
oldHeight = _this$state.height;
if ('resize' === action && (oldWidth !== width || oldHeight !== height)) {
this.setState({
width: width,
height: height
});
}
}
}, {
key: "trySandbox",
value: function trySandbox() {
var forceRerender = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
if (!this.isFrameAccessible()) {
return;
}
var body = this.iframe.current.contentDocument.body;
if (!forceRerender && null !== body.getAttribute('data-resizable-iframe-connected')) {
return;
}
var observeAndResizeJS = "\n\t\t\t( function() {\n\t\t\t\tvar observer;\n\n\t\t\t\tif ( ! window.MutationObserver || ! document.body || ! window.parent ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfunction sendResize() {\n\t\t\t\t\tvar clientBoundingRect = document.body.getBoundingClientRect();\n\n\t\t\t\t\twindow.parent.postMessage( {\n\t\t\t\t\t\taction: 'resize',\n\t\t\t\t\t\twidth: clientBoundingRect.width,\n\t\t\t\t\t\theight: clientBoundingRect.height,\n\t\t\t\t\t}, '*' );\n\t\t\t\t}\n\n\t\t\t\tobserver = new MutationObserver( sendResize );\n\t\t\t\tobserver.observe( document.body, {\n\t\t\t\t\tattributes: true,\n\t\t\t\t\tattributeOldValue: false,\n\t\t\t\t\tcharacterData: true,\n\t\t\t\t\tcharacterDataOldValue: false,\n\t\t\t\t\tchildList: true,\n\t\t\t\t\tsubtree: true\n\t\t\t\t} );\n\n\t\t\t\twindow.addEventListener( 'load', sendResize, true );\n\n\t\t\t\t// Hack: Remove viewport unit styles, as these are relative\n\t\t\t\t// the iframe root and interfere with our mechanism for\n\t\t\t\t// determining the unconstrained page bounds.\n\t\t\t\tfunction removeViewportStyles( ruleOrNode ) {\n\t\t\t\t\tif( ruleOrNode.style ) {\n\t\t\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {\n\t\t\t\t\t\t\tif ( /^\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {\n\t\t\t\t\t\t\t\truleOrNode.style[ style ] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tArray.prototype.forEach.call( document.querySelectorAll( '[style]' ), removeViewportStyles );\n\t\t\t\tArray.prototype.forEach.call( document.styleSheets, function( stylesheet ) {\n\t\t\t\t\tArray.prototype.forEach.call( stylesheet.cssRules || stylesheet.rules, removeViewportStyles );\n\t\t\t\t} );\n\n\t\t\t\tdocument.body.style.position = 'absolute';\n\t\t\t\tdocument.body.style.width = '100%';\n\t\t\t\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\n\t\t\t\tsendResize();\n\n\t\t\t\t// Resize events can change the width of elements with 100% width, but we don't\n\t\t\t\t// get an DOM mutations for that, so do the resize when the window is resized, too.\n\t\t\t\twindow.addEventListener( 'resize', sendResize, true );\n\t\t} )();";
var style = "\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\thtml,\n\t\t\tbody,\n\t\t\tbody > div,\n\t\t\tbody > div > iframe {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\thtml.wp-has-aspect-ratio,\n\t\t\tbody.wp-has-aspect-ratio,\n\t\t\tbody.wp-has-aspect-ratio > div,\n\t\t\tbody.wp-has-aspect-ratio > div > iframe {\n\t\t\t\theight: 100%;\n\t\t\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t\t\t}\n\t\t\tbody > div > * {\n\t\t\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\t\t\tmargin-bottom: 0 !important;\n\t\t\t}\n\t\t"; // put the html snippet into a html document, and then write it to the iframe's document
// we can use this in the future to inject custom styles or scripts.
// Scripts go into the body rather than the head, to support embedded content such as Instagram
// that expect the scripts to be part of the body.
var htmlDoc = Object(external_this_wp_element_["createElement"])("html", {
lang: document.documentElement.lang,
className: this.props.type
}, Object(external_this_wp_element_["createElement"])("head", null, Object(external_this_wp_element_["createElement"])("title", null, this.props.title), Object(external_this_wp_element_["createElement"])("style", {
dangerouslySetInnerHTML: {
__html: style
}
}), this.props.styles && this.props.styles.map(function (rules, i) {
return Object(external_this_wp_element_["createElement"])("style", {
key: i,
dangerouslySetInnerHTML: {
__html: rules
}
});
})), Object(external_this_wp_element_["createElement"])("body", {
"data-resizable-iframe-connected": "data-resizable-iframe-connected",
className: this.props.type
}, Object(external_this_wp_element_["createElement"])("div", {
dangerouslySetInnerHTML: {
__html: this.props.html
}
}), Object(external_this_wp_element_["createElement"])("script", {
type: "text/javascript",
dangerouslySetInnerHTML: {
__html: observeAndResizeJS
}
}), this.props.scripts && this.props.scripts.map(function (src) {
return Object(external_this_wp_element_["createElement"])("script", {
key: src,
src: src
});
}))); // writing the document like this makes it act in the same way as if it was
// loaded over the network, so DOM creation and mutation, script execution, etc.
// all work as expected
var iframeDocument = this.iframe.current.contentWindow.document;
iframeDocument.open();
iframeDocument.write('' + Object(external_this_wp_element_["renderToString"])(htmlDoc));
iframeDocument.close();
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
title = _this$props.title,
onFocus = _this$props.onFocus;
return Object(external_this_wp_element_["createElement"])(focusable_iframe, {
iframeRef: this.iframe,
title: title,
className: "components-sandbox",
sandbox: "allow-scripts allow-same-origin allow-presentation",
onFocus: onFocus,
width: Math.ceil(this.state.width),
height: Math.ceil(this.state.height)
});
}
}], [{
key: "defaultProps",
get: function get() {
return {
html: '',
title: ''
};
}
}]);
return Sandbox;
}(external_this_wp_element_["Component"]);
sandbox_Sandbox = Object(external_this_wp_compose_["withGlobalEvents"])({
message: 'checkMessageForResize'
})(sandbox_Sandbox);
/* harmony default export */ var sandbox = (sandbox_Sandbox);
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/snackbar/index.js
var snackbar = __webpack_require__(153);
// EXTERNAL MODULE: external {"this":"regeneratorRuntime"}
var external_this_regeneratorRuntime_ = __webpack_require__(23);
var external_this_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_this_regeneratorRuntime_);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(46);
// EXTERNAL MODULE: ./node_modules/react-spring/web.cjs.js
var web_cjs = __webpack_require__(107);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/snackbar/list.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Renders a list of notices.
*
* @param {Object} $0 Props passed to the component.
* @param {Array} $0.notices Array of notices to render.
* @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.
* @param {Object} $0.className Name of the class used by the component.
* @param {Object} $0.children Array of children to be rendered inside the notice list.
* @return {Object} The rendered notices list.
*/
function SnackbarList(_ref) {
var notices = _ref.notices,
className = _ref.className,
children = _ref.children,
_ref$onRemove = _ref.onRemove,
onRemove = _ref$onRemove === void 0 ? external_this_lodash_["noop"] : _ref$onRemove;
var isReducedMotion = Object(external_this_wp_compose_["useReducedMotion"])();
var _useState = Object(external_this_wp_element_["useState"])(function () {
return new WeakMap();
}),
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 1),
refMap = _useState2[0];
var transitions = Object(web_cjs["useTransition"])(notices, function (notice) {
return notice.id;
}, {
from: {
opacity: 0,
height: 0
},
enter: function enter(item) {
return /*#__PURE__*/function () {
var _ref2 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(function _callee(next) {
return external_this_regeneratorRuntime_default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return next({
opacity: 1,
height: refMap.get(item).offsetHeight
});
case 2:
return _context.abrupt("return", _context.sent);
case 3:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}();
},
leave: function leave() {
return /*#__PURE__*/function () {
var _ref3 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(function _callee2(next) {
return external_this_regeneratorRuntime_default.a.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return next({
opacity: 0
});
case 2:
_context2.next = 4;
return next({
height: 0
});
case 4:
case "end":
return _context2.stop();
}
}
}, _callee2);
}));
return function (_x2) {
return _ref3.apply(this, arguments);
};
}();
},
immediate: isReducedMotion
});
className = classnames_default()('components-snackbar-list', className);
var removeNotice = function removeNotice(notice) {
return function () {
return onRemove(notice.id);
};
};
return Object(external_this_wp_element_["createElement"])("div", {
className: className
}, children, transitions.map(function (_ref4) {
var notice = _ref4.item,
key = _ref4.key,
style = _ref4.props;
return Object(external_this_wp_element_["createElement"])(web_cjs["animated"].div, {
key: key,
style: style
}, Object(external_this_wp_element_["createElement"])("div", {
className: "components-snackbar-list__notice-container",
ref: function ref(_ref5) {
return _ref5 && refMap.set(notice, _ref5);
}
}, Object(external_this_wp_element_["createElement"])(snackbar["a" /* default */], Object(esm_extends["a" /* default */])({}, Object(external_this_lodash_["omit"])(notice, ['content']), {
onRemove: removeNotice(notice)
}), notice.content)));
}));
}
/* harmony default export */ var snackbar_list = (SnackbarList);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spinner/index.js
function Spinner() {
return Object(external_this_wp_element_["createElement"])("span", {
className: "components-spinner"
});
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tab-panel/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var tab_panel_TabButton = function TabButton(_ref) {
var tabId = _ref.tabId,
onClick = _ref.onClick,
children = _ref.children,
selected = _ref.selected,
rest = Object(objectWithoutProperties["a" /* default */])(_ref, ["tabId", "onClick", "children", "selected"]);
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
role: "tab",
tabIndex: selected ? null : -1,
"aria-selected": selected,
id: tabId,
onClick: onClick
}, rest), children);
};
function TabPanel(_ref2) {
var className = _ref2.className,
children = _ref2.children,
tabs = _ref2.tabs,
initialTabName = _ref2.initialTabName,
_ref2$orientation = _ref2.orientation,
orientation = _ref2$orientation === void 0 ? 'horizontal' : _ref2$orientation,
_ref2$activeClass = _ref2.activeClass,
activeClass = _ref2$activeClass === void 0 ? 'is-active' : _ref2$activeClass,
_ref2$onSelect = _ref2.onSelect,
onSelect = _ref2$onSelect === void 0 ? external_this_lodash_["noop"] : _ref2$onSelect;
var instanceId = Object(external_this_wp_compose_["useInstanceId"])(TabPanel, 'tab-panel');
var _useState = Object(external_this_wp_element_["useState"])(initialTabName || (tabs.length > 0 ? tabs[0].name : null)),
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
selected = _useState2[0],
setSelected = _useState2[1];
var handleClick = function handleClick(tabKey) {
setSelected(tabKey);
onSelect(tabKey);
};
var onNavigate = function onNavigate(childIndex, child) {
child.click();
};
var selectedTab = Object(external_this_lodash_["find"])(tabs, {
name: selected
});
var selectedId = "".concat(instanceId, "-").concat(selectedTab.name);
return Object(external_this_wp_element_["createElement"])("div", {
className: className
}, Object(external_this_wp_element_["createElement"])(menu, {
role: "tablist",
orientation: orientation,
onNavigate: onNavigate,
className: "components-tab-panel__tabs"
}, tabs.map(function (tab) {
return Object(external_this_wp_element_["createElement"])(tab_panel_TabButton, {
className: classnames_default()('components-tab-panel__tabs-item', tab.className, Object(defineProperty["a" /* default */])({}, activeClass, tab.name === selected)),
tabId: "".concat(instanceId, "-").concat(tab.name),
"aria-controls": "".concat(instanceId, "-").concat(tab.name, "-view"),
selected: tab.name === selected,
key: tab.name,
onClick: Object(external_this_lodash_["partial"])(handleClick, tab.name)
}, tab.title);
})), selectedTab && Object(external_this_wp_element_["createElement"])("div", {
"aria-labelledby": selectedId,
role: "tabpanel",
id: "".concat(selectedId, "-view"),
className: "components-tab-panel__tab-content"
}, children(selectedTab)));
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/textarea-control/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function TextareaControl(_ref) {
var label = _ref.label,
hideLabelFromVision = _ref.hideLabelFromVision,
value = _ref.value,
help = _ref.help,
onChange = _ref.onChange,
_ref$rows = _ref.rows,
rows = _ref$rows === void 0 ? 4 : _ref$rows,
className = _ref.className,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["label", "hideLabelFromVision", "value", "help", "onChange", "rows", "className"]);
var instanceId = Object(external_this_wp_compose_["useInstanceId"])(TextareaControl);
var id = "inspector-textarea-control-".concat(instanceId);
var onChangeValue = function onChangeValue(event) {
return onChange(event.target.value);
};
return Object(external_this_wp_element_["createElement"])(base_control, {
label: label,
hideLabelFromVision: hideLabelFromVision,
id: id,
help: help,
className: className
}, Object(external_this_wp_element_["createElement"])("textarea", Object(esm_extends["a" /* default */])({
className: "components-textarea-control__input",
id: id,
rows: rows,
onChange: onChangeValue,
"aria-describedby": !!help ? id + '__help' : undefined,
value: value
}, props)));
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text-highlight/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var text_highlight_TextHighlight = function TextHighlight(_ref) {
var _ref$text = _ref.text,
text = _ref$text === void 0 ? '' : _ref$text,
_ref$highlight = _ref.highlight,
highlight = _ref$highlight === void 0 ? '' : _ref$highlight;
var trimmedHighlightText = highlight.trim();
if (!trimmedHighlightText) {
return text;
}
var regex = new RegExp("(".concat(Object(external_this_lodash_["escapeRegExp"])(trimmedHighlightText), ")"), 'gi');
return Object(external_this_wp_element_["createInterpolateElement"])(text.replace(regex, '$&'), {
mark: Object(external_this_wp_element_["createElement"])("mark", null)
});
};
/* harmony default export */ var text_highlight = (text_highlight_TextHighlight);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tip/index.js
/**
* Internal dependencies
*/
function Tip(props) {
return Object(external_this_wp_element_["createElement"])("div", {
className: "components-tip"
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], {
width: "24",
height: "24",
viewBox: "0 0 24 24"
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], {
d: "M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"
})), Object(external_this_wp_element_["createElement"])("p", null, props.children));
}
/* harmony default export */ var tip = (Tip);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-control/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ToggleControl(_ref) {
var label = _ref.label,
checked = _ref.checked,
help = _ref.help,
className = _ref.className,
onChange = _ref.onChange;
function onChangeToggle(event) {
onChange(event.target.checked);
}
var instanceId = Object(external_this_wp_compose_["useInstanceId"])(ToggleControl);
var id = "inspector-toggle-control-".concat(instanceId);
var describedBy, helpLabel;
if (help) {
describedBy = id + '__help';
helpLabel = Object(external_this_lodash_["isFunction"])(help) ? help(checked) : help;
}
return Object(external_this_wp_element_["createElement"])(base_control, {
id: id,
help: helpLabel,
className: classnames_default()('components-toggle-control', className)
}, Object(external_this_wp_element_["createElement"])(form_toggle, {
id: id,
checked: checked,
onChange: onChangeToggle,
"aria-describedby": describedBy
}), Object(external_this_wp_element_["createElement"])("label", {
htmlFor: id,
className: "components-toggle-control__label"
}, label));
}
// EXTERNAL MODULE: ./node_modules/reakit/es/Toolbar/ToolbarState.js
var ToolbarState = __webpack_require__(158);
// CONCATENATED MODULE: ./node_modules/reakit/es/Toolbar/Toolbar.js
var useToolbar = Object(createHook["a" /* createHook */])({
name: "Toolbar",
compose: useComposite,
useState: ToolbarState["a" /* useToolbarState */],
useProps: function useProps(options, htmlProps) {
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
role: "toolbar",
"aria-orientation": options.orientation
}, htmlProps);
}
});
var Toolbar = Object(createComponent["a" /* createComponent */])({
as: "div",
useHook: useToolbar,
useCreateElement: function useCreateElement$1(type, props, children) {
false ? undefined : void 0;
return Object(useCreateElement["a" /* useCreateElement */])(type, props, children);
}
});
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-container.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ToolbarContainer(_ref, ref) {
var accessibilityLabel = _ref.accessibilityLabel,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["accessibilityLabel"]);
// https://reakit.io/docs/basic-concepts/#state-hooks
// Passing baseId for server side rendering (which includes snapshots)
// If an id prop is passed to Toolbar, toolbar items will use it as a base for their ids
var toolbarState = Object(ToolbarState["a" /* useToolbarState */])({
loop: true,
baseId: props.id
});
return (// This will provide state for `ToolbarButton`'s
Object(external_this_wp_element_["createElement"])(toolbar_context["a" /* default */].Provider, {
value: toolbarState
}, Object(external_this_wp_element_["createElement"])(Toolbar, Object(esm_extends["a" /* default */])({
ref: ref,
"aria-label": accessibilityLabel
}, toolbarState, props)))
);
}
/* harmony default export */ var toolbar_container = (Object(external_this_wp_element_["forwardRef"])(ToolbarContainer));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Renders a toolbar.
*
* To add controls, simply pass `ToolbarButton` components as children.
*
* @param {Object} props Component props.
* @param {string} [props.className] Class to set on the container div.
* @param {string} [props.__experimentalAccessibilityLabel] ARIA label for toolbar container.
* @param {Object} ref React Element ref.
*/
function toolbar_Toolbar(_ref, ref) {
var className = _ref.className,
__experimentalAccessibilityLabel = _ref.__experimentalAccessibilityLabel,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "__experimentalAccessibilityLabel"]);
if (__experimentalAccessibilityLabel) {
return Object(external_this_wp_element_["createElement"])(toolbar_container // `ToolbarGroup` already uses components-toolbar for compatibility reasons
, Object(esm_extends["a" /* default */])({
className: classnames_default()('components-accessible-toolbar', className),
accessibilityLabel: __experimentalAccessibilityLabel,
ref: ref
}, props));
} // When the __experimentalAccessibilityLabel prop is not passed, Toolbar will
// fallback to ToolbarGroup. This should be deprecated as soon as the new API
// gets stable.
// See https://github.com/WordPress/gutenberg/pull/20008#issuecomment-624503410
return Object(external_this_wp_element_["createElement"])(toolbar_group, Object(esm_extends["a" /* default */])({}, props, {
className: className
}));
}
/* harmony default export */ var toolbar = (Object(external_this_wp_element_["forwardRef"])(toolbar_Toolbar));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-context.js
/**
* WordPress dependencies
*/
var RovingTabIndexContext = Object(external_this_wp_element_["createContext"])();
var roving_tab_index_context_useRovingTabIndexContext = function useRovingTabIndexContext() {
return Object(external_this_wp_element_["useContext"])(RovingTabIndexContext);
};
var RovingTabIndexProvider = RovingTabIndexContext.Provider;
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Provider for adding roving tab index behaviors to tree grid structures.
*
* @see https://github.com/WordPress/gutenberg/blob/master/packages/components/src/tree-grid/README.md
*
* @param {Object} props Component props.
* @param {WPElement} props.children Children to be rendered
*/
function RovingTabIndex(_ref) {
var children = _ref.children;
var _useState = Object(external_this_wp_element_["useState"])(),
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
lastFocusedElement = _useState2[0],
setLastFocusedElement = _useState2[1]; // Use `useMemo` to avoid creation of a new object for the providerValue
// on every render. Only create a new object when the `lastFocusedElement`
// value changes.
var providerValue = Object(external_this_wp_element_["useMemo"])(function () {
return {
lastFocusedElement: lastFocusedElement,
setLastFocusedElement: setLastFocusedElement
};
}, [lastFocusedElement]);
return Object(external_this_wp_element_["createElement"])(RovingTabIndexProvider, {
value: providerValue
}, children);
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Return focusables in a row element, excluding those from other branches
* nested within the row.
*
* @param {Element} rowElement The DOM element representing the row.
*
* @return {?Array} The array of focusables in the row.
*/
function getRowFocusables(rowElement) {
var focusablesInRow = external_this_wp_dom_["focus"].focusable.find(rowElement);
if (!focusablesInRow || !focusablesInRow.length) {
return;
}
return focusablesInRow.filter(function (focusable) {
return focusable.closest('[role="row"]') === rowElement;
});
}
/**
* Renders both a table and tbody element, used to create a tree hierarchy.
*
* @see https://github.com/WordPress/gutenberg/blob/master/packages/components/src/tree-grid/README.md
*
* @param {Object} props Component props.
* @param {WPElement} props.children Children to be rendered
*/
function TreeGrid(_ref) {
var children = _ref.children,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children"]);
var onKeyDown = Object(external_this_wp_element_["useCallback"])(function (event) {
var keyCode = event.keyCode,
metaKey = event.metaKey,
ctrlKey = event.ctrlKey,
altKey = event.altKey,
shiftKey = event.shiftKey;
var hasModifierKeyPressed = metaKey || ctrlKey || altKey || shiftKey;
if (hasModifierKeyPressed || !Object(external_this_lodash_["includes"])([external_this_wp_keycodes_["UP"], external_this_wp_keycodes_["DOWN"], external_this_wp_keycodes_["LEFT"], external_this_wp_keycodes_["RIGHT"]], keyCode)) {
return;
} // The event will be handled, stop propagation.
event.stopPropagation();
var _document = document,
activeElement = _document.activeElement;
var treeGridElement = event.currentTarget;
if (!treeGridElement.contains(activeElement)) {
return;
} // Calculate the columnIndex of the active element.
var activeRow = activeElement.closest('[role="row"]');
var focusablesInRow = getRowFocusables(activeRow);
var currentColumnIndex = focusablesInRow.indexOf(activeElement);
if (Object(external_this_lodash_["includes"])([external_this_wp_keycodes_["LEFT"], external_this_wp_keycodes_["RIGHT"]], keyCode)) {
// Calculate to the next element.
var nextIndex;
if (keyCode === external_this_wp_keycodes_["LEFT"]) {
nextIndex = Math.max(0, currentColumnIndex - 1);
} else {
nextIndex = Math.min(currentColumnIndex + 1, focusablesInRow.length - 1);
} // Focus is either at the left or right edge of the grid. Do nothing.
if (nextIndex === currentColumnIndex) {
// Prevent key use for anything else. For example, Voiceover
// will start reading text on continued use of left/right arrow
// keys.
event.preventDefault();
return;
} // Focus the next element.
focusablesInRow[nextIndex].focus(); // Prevent key use for anything else. This ensures Voiceover
// doesn't try to handle key navigation.
event.preventDefault();
} else if (Object(external_this_lodash_["includes"])([external_this_wp_keycodes_["UP"], external_this_wp_keycodes_["DOWN"]], keyCode)) {
// Calculate the rowIndex of the next row.
var rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
var currentRowIndex = rows.indexOf(activeRow);
var nextRowIndex;
if (keyCode === external_this_wp_keycodes_["UP"]) {
nextRowIndex = Math.max(0, currentRowIndex - 1);
} else {
nextRowIndex = Math.min(currentRowIndex + 1, rows.length - 1);
} // Focus is either at the top or bottom edge of the grid. Do nothing.
if (nextRowIndex === currentRowIndex) {
// Prevent key use for anything else. For example, Voiceover
// will start navigating horizontally when reaching the vertical
// bounds of a table.
event.preventDefault();
return;
} // Get the focusables in the next row.
var focusablesInNextRow = getRowFocusables(rows[nextRowIndex]); // If for some reason there are no focusables in the next row, do nothing.
if (!focusablesInNextRow || !focusablesInNextRow.length) {
// Prevent key use for anything else. For example, Voiceover
// will still focus text when using arrow keys, while this
// component should limit navigation to focusables.
event.preventDefault();
return;
} // Try to focus the element in the next row that's at a similar column to the activeElement.
var _nextIndex = Math.min(currentColumnIndex, focusablesInNextRow.length - 1);
focusablesInNextRow[_nextIndex].focus(); // Prevent key use for anything else. This ensures Voiceover
// doesn't try to handle key navigation.
event.preventDefault();
}
}, []);
return Object(external_this_wp_element_["createElement"])(RovingTabIndex, null, Object(external_this_wp_element_["createElement"])("table", Object(esm_extends["a" /* default */])({}, props, {
role: "treegrid",
onKeyDown: onKeyDown
}), Object(external_this_wp_element_["createElement"])("tbody", null, children)));
}
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/row.js
/**
* WordPress dependencies
*/
function TreeGridRow(_ref, ref) {
var children = _ref.children,
level = _ref.level,
positionInSet = _ref.positionInSet,
setSize = _ref.setSize,
isExpanded = _ref.isExpanded,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children", "level", "positionInSet", "setSize", "isExpanded"]);
return (// Disable reason: Due to an error in the ARIA 1.1 specification, the
// aria-posinset and aria-setsize properties are not supported on row
// elements. This is being corrected in ARIA 1.2. Consequently, the
// linting rule fails when validating this markup.
//
// eslint-disable-next-line jsx-a11y/role-supports-aria-props
Object(external_this_wp_element_["createElement"])("tr", Object(esm_extends["a" /* default */])({}, props, {
ref: ref,
role: "row",
"aria-level": level,
"aria-posinset": positionInSet,
"aria-setsize": setSize,
"aria-expanded": isExpanded
}), children)
);
}
/* harmony default export */ var tree_grid_row = (Object(external_this_wp_element_["forwardRef"])(TreeGridRow));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-item.js
function roving_tab_index_item_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function roving_tab_index_item_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { roving_tab_index_item_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { roving_tab_index_item_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/* harmony default export */ var roving_tab_index_item = (Object(external_this_wp_element_["forwardRef"])(function RovingTabIndexItem(_ref, forwardedRef) {
var children = _ref.children,
Component = _ref.as,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children", "as"]);
var localRef = Object(external_this_wp_element_["useRef"])();
var ref = forwardedRef || localRef;
var _useRovingTabIndexCon = roving_tab_index_context_useRovingTabIndexContext(),
lastFocusedElement = _useRovingTabIndexCon.lastFocusedElement,
setLastFocusedElement = _useRovingTabIndexCon.setLastFocusedElement;
var tabIndex;
if (lastFocusedElement) {
tabIndex = lastFocusedElement === ref.current ? 0 : -1;
}
var onFocus = function onFocus(event) {
return setLastFocusedElement(event.target);
};
var allProps = roving_tab_index_item_objectSpread({
ref: ref,
tabIndex: tabIndex,
onFocus: onFocus
}, props);
if (typeof children === 'function') {
return children(allProps);
}
return Object(external_this_wp_element_["createElement"])(Component, allProps, children);
}));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/item.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/* harmony default export */ var tree_grid_item = (Object(external_this_wp_element_["forwardRef"])(function TreeGridItem(_ref, ref) {
var children = _ref.children,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children"]);
return Object(external_this_wp_element_["createElement"])(roving_tab_index_item, Object(esm_extends["a" /* default */])({
ref: ref
}, props), children);
}));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/cell.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/* harmony default export */ var tree_grid_cell = (Object(external_this_wp_element_["forwardRef"])(function TreeGridCell(_ref, ref) {
var children = _ref.children,
_ref$withoutGridItem = _ref.withoutGridItem,
withoutGridItem = _ref$withoutGridItem === void 0 ? false : _ref$withoutGridItem,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children", "withoutGridItem"]);
return Object(external_this_wp_element_["createElement"])("td", Object(esm_extends["a" /* default */])({}, props, {
role: "gridcell"
}), withoutGridItem ? children : Object(external_this_wp_element_["createElement"])(tree_grid_item, {
ref: ref
}, children));
}));
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 4 modules
var slot_fill = __webpack_require__(113);
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js + 1 modules
var slot_fill_context = __webpack_require__(116);
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
var use_slot = __webpack_require__(150);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/navigate-regions/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var defaultShortcuts = {
previous: ['ctrl+shift+`', external_this_wp_keycodes_["rawShortcut"].access('p')],
next: ['ctrl+`', external_this_wp_keycodes_["rawShortcut"].access('n')]
};
/* harmony default export */ var navigate_regions = (Object(external_this_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) {
return function (_ref) {
var _ref$shortcuts = _ref.shortcuts,
shortcuts = _ref$shortcuts === void 0 ? defaultShortcuts : _ref$shortcuts,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["shortcuts"]);
var container = Object(external_this_wp_element_["useRef"])();
var _useState = Object(external_this_wp_element_["useState"])(false),
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
isFocusingRegions = _useState2[0],
setIsFocusingRegions = _useState2[1];
var className = classnames_default()('components-navigate-regions', {
'is-focusing-regions': isFocusingRegions
});
function focusRegion(offset) {
var regions = Array.from(container.current.querySelectorAll('[role="region"]'));
if (!regions.length) {
return;
}
var nextRegion = regions[0];
var selectedIndex = regions.indexOf(document.activeElement);
if (selectedIndex !== -1) {
var nextIndex = selectedIndex + offset;
nextIndex = nextIndex === -1 ? regions.length - 1 : nextIndex;
nextIndex = nextIndex === regions.length ? 0 : nextIndex;
nextRegion = regions[nextIndex];
}
nextRegion.focus();
setIsFocusingRegions(true);
}
var focusPrevious = Object(external_this_wp_element_["useCallback"])(function () {
return focusRegion(-1);
}, [container]);
var focusNext = Object(external_this_wp_element_["useCallback"])(function () {
return focusRegion(1);
}, [container]);
Object(external_this_wp_compose_["useKeyboardShortcut"])(shortcuts.previous, focusPrevious, {
bindGlobal: true
});
Object(external_this_wp_compose_["useKeyboardShortcut"])(shortcuts.next, focusNext, {
bindGlobal: true
}); // Disable reason: Clicking the editor should dismiss the regions focus style
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
return Object(external_this_wp_element_["createElement"])("div", {
ref: container,
className: className,
onClick: function onClick() {
return setIsFocusingRegions(false);
}
}, Object(external_this_wp_element_["createElement"])(WrappedComponent, props));
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
};
}, 'navigateRegions'));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-fallback-styles/index.js
function with_fallback_styles_createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (with_fallback_styles_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function with_fallback_styles_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/* harmony default export */ var with_fallback_styles = (function (mapNodeToProps) {
return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) {
return /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(_class, _Component);
var _super = with_fallback_styles_createSuper(_class);
function _class() {
var _this;
Object(classCallCheck["a" /* default */])(this, _class);
_this = _super.apply(this, arguments);
_this.nodeRef = _this.props.node;
_this.state = {
fallbackStyles: undefined,
grabStylesCompleted: false
};
_this.bindRef = _this.bindRef.bind(Object(assertThisInitialized["a" /* default */])(_this));
return _this;
}
Object(createClass["a" /* default */])(_class, [{
key: "bindRef",
value: function bindRef(node) {
if (!node) {
return;
}
this.nodeRef = node;
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
this.grabFallbackStyles();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
this.grabFallbackStyles();
}
}, {
key: "grabFallbackStyles",
value: function grabFallbackStyles() {
var _this$state = this.state,
grabStylesCompleted = _this$state.grabStylesCompleted,
fallbackStyles = _this$state.fallbackStyles;
if (this.nodeRef && !grabStylesCompleted) {
var newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);
if (!Object(external_this_lodash_["isEqual"])(newFallbackStyles, fallbackStyles)) {
this.setState({
fallbackStyles: newFallbackStyles,
grabStylesCompleted: !!Object(external_this_lodash_["every"])(newFallbackStyles)
});
}
}
}
}, {
key: "render",
value: function render() {
var wrappedComponent = Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, this.props, this.state.fallbackStyles));
return this.props.node ? wrappedComponent : Object(external_this_wp_element_["createElement"])("div", {
ref: this.bindRef
}, " ", wrappedComponent, " ");
}
}]);
return _class;
}(external_this_wp_element_["Component"]);
}, 'withFallbackStyles');
});
// EXTERNAL MODULE: external {"this":["wp","hooks"]}
var external_this_wp_hooks_ = __webpack_require__(31);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-filters/index.js
function with_filters_createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (with_filters_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function with_filters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var ANIMATION_FRAME_PERIOD = 16;
/**
* Creates a higher-order component which adds filtering capability to the
* wrapped component. Filters get applied when the original component is about
* to be mounted. When a filter is added or removed that matches the hook name,
* the wrapped component re-renders.
*
* @param {string} hookName Hook name exposed to be used by filters.
*
* @return {Function} Higher-order component factory.
*/
function withFilters(hookName) {
return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) {
var namespace = 'core/with-filters/' + hookName;
/**
* The component definition with current filters applied. Each instance
* reuse this shared reference as an optimization to avoid excessive
* calls to `applyFilters` when many instances exist.
*
* @type {?Component}
*/
var FilteredComponent;
/**
* Initializes the FilteredComponent variable once, if not already
* assigned. Subsequent calls are effectively a noop.
*/
function ensureFilteredComponent() {
if (FilteredComponent === undefined) {
FilteredComponent = Object(external_this_wp_hooks_["applyFilters"])(hookName, OriginalComponent);
}
}
var FilteredComponentRenderer = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(FilteredComponentRenderer, _Component);
var _super = with_filters_createSuper(FilteredComponentRenderer);
function FilteredComponentRenderer() {
var _this;
Object(classCallCheck["a" /* default */])(this, FilteredComponentRenderer);
_this = _super.apply(this, arguments);
ensureFilteredComponent();
return _this;
}
Object(createClass["a" /* default */])(FilteredComponentRenderer, [{
key: "componentDidMount",
value: function componentDidMount() {
FilteredComponentRenderer.instances.push(this); // If there were previously no mounted instances for components
// filtered on this hook, add the hook handler.
if (FilteredComponentRenderer.instances.length === 1) {
Object(external_this_wp_hooks_["addAction"])('hookRemoved', namespace, onHooksUpdated);
Object(external_this_wp_hooks_["addAction"])('hookAdded', namespace, onHooksUpdated);
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
FilteredComponentRenderer.instances = Object(external_this_lodash_["without"])(FilteredComponentRenderer.instances, this); // If this was the last of the mounted components filtered on
// this hook, remove the hook handler.
if (FilteredComponentRenderer.instances.length === 0) {
Object(external_this_wp_hooks_["removeAction"])('hookRemoved', namespace);
Object(external_this_wp_hooks_["removeAction"])('hookAdded', namespace);
}
}
}, {
key: "render",
value: function render() {
return Object(external_this_wp_element_["createElement"])(FilteredComponent, this.props);
}
}]);
return FilteredComponentRenderer;
}(external_this_wp_element_["Component"]);
FilteredComponentRenderer.instances = [];
/**
* Updates the FilteredComponent definition, forcing a render for each
* mounted instance. This occurs a maximum of once per animation frame.
*/
var throttledForceUpdate = Object(external_this_lodash_["debounce"])(function () {
// Recreate the filtered component, only after delay so that it's
// computed once, even if many filters added.
FilteredComponent = Object(external_this_wp_hooks_["applyFilters"])(hookName, OriginalComponent); // Force each instance to render.
FilteredComponentRenderer.instances.forEach(function (instance) {
instance.forceUpdate();
});
}, ANIMATION_FRAME_PERIOD);
/**
* When a filter is added or removed for the matching hook name, each
* mounted instance should re-render with the new filters having been
* applied to the original component.
*
* @param {string} updatedHookName Name of the hook that was updated.
*/
function onHooksUpdated(updatedHookName) {
if (updatedHookName === hookName) {
throttledForceUpdate();
}
}
return FilteredComponentRenderer;
}, 'withFilters');
}
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/context.js
var with_focus_return_context = __webpack_require__(185);
// EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 2 modules
var v4 = __webpack_require__(253);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-notices/index.js
function with_notices_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function with_notices_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { with_notices_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { with_notices_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function with_notices_createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (with_notices_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function with_notices_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Override the default edit UI to include notices if supported.
*
* @param {WPComponent} OriginalComponent Original component.
*
* @return {WPComponent} Wrapped component.
*/
/* harmony default export */ var with_notices = (Object(external_this_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) {
return /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(WrappedBlockEdit, _Component);
var _super = with_notices_createSuper(WrappedBlockEdit);
function WrappedBlockEdit() {
var _this;
Object(classCallCheck["a" /* default */])(this, WrappedBlockEdit);
_this = _super.apply(this, arguments);
_this.createNotice = _this.createNotice.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.createErrorNotice = _this.createErrorNotice.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.removeNotice = _this.removeNotice.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.removeAllNotices = _this.removeAllNotices.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.state = {
noticeList: []
};
_this.noticeOperations = {
createNotice: _this.createNotice,
createErrorNotice: _this.createErrorNotice,
removeAllNotices: _this.removeAllNotices,
removeNotice: _this.removeNotice
};
return _this;
}
/**
* Function passed down as a prop that adds a new notice.
*
* @param {Object} notice Notice to add.
*/
Object(createClass["a" /* default */])(WrappedBlockEdit, [{
key: "createNotice",
value: function createNotice(notice) {
var noticeToAdd = notice.id ? notice : with_notices_objectSpread({}, notice, {
id: Object(v4["a" /* default */])()
});
this.setState(function (state) {
return {
noticeList: [].concat(Object(toConsumableArray["a" /* default */])(state.noticeList), [noticeToAdd])
};
});
}
/**
* Function passed as a prop that adds a new error notice.
*
* @param {string} msg Error message of the notice.
*/
}, {
key: "createErrorNotice",
value: function createErrorNotice(msg) {
this.createNotice({
status: 'error',
content: msg
});
}
/**
* Removes a notice by id.
*
* @param {string} id Id of the notice to remove.
*/
}, {
key: "removeNotice",
value: function removeNotice(id) {
this.setState(function (state) {
return {
noticeList: state.noticeList.filter(function (notice) {
return notice.id !== id;
})
};
});
}
/**
* Removes all notices
*/
}, {
key: "removeAllNotices",
value: function removeAllNotices() {
this.setState({
noticeList: []
});
}
}, {
key: "render",
value: function render() {
return Object(external_this_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({
noticeList: this.state.noticeList,
noticeOperations: this.noticeOperations,
noticeUI: this.state.noticeList.length > 0 && Object(external_this_wp_element_["createElement"])(list, {
className: "components-with-notices-ui",
notices: this.state.noticeList,
onRemove: this.removeNotice
})
}, this.props));
}
}]);
return WrappedBlockEdit;
}(external_this_wp_element_["Component"]);
}));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/index.js
// Primitives
// Components
// Higher-Order Components
/***/ }),
/* 253 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js
// Unique ID creation requires a high quality random # generator. In the browser we therefore
// require the crypto API and do not support built-in fallback to lower quality random number
// generators (like Math.random()).
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
// find the complete implementation of crypto (msCrypto) on IE11.
var getRandomValues = typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != 'undefined' && typeof msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto);
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
function rng() {
if (!getRandomValues) {
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
}
return getRandomValues(rnds8);
}
// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/bytesToUuid.js
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
var byteToHex = [];
for (var bytesToUuid_i = 0; bytesToUuid_i < 256; ++bytesToUuid_i) {
byteToHex[bytesToUuid_i] = (bytesToUuid_i + 0x100).toString(16).substr(1);
}
function bytesToUuid(buf, offset) {
var i = offset || 0;
var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');
}
/* harmony default export */ var esm_browser_bytesToUuid = (bytesToUuid);
// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js
function v4(options, buf, offset) {
var i = buf && offset || 0;
if (typeof options == 'string') {
buf = options === 'binary' ? new Array(16) : null;
options = null;
}
options = options || {};
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = rnds[6] & 0x0f | 0x40;
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
if (buf) {
for (var ii = 0; ii < 16; ++ii) {
buf[i + ii] = rnds[ii];
}
}
return buf || esm_browser_bytesToUuid(rnds);
}
/* harmony default export */ var esm_browser_v4 = __webpack_exports__["a"] = (v4);
/***/ }),
/* 254 */,
/* 255 */,
/* 256 */,
/* 257 */,
/* 258 */,
/* 259 */,
/* 260 */,
/* 261 */,
/* 262 */,
/* 263 */
/***/ (function(module, exports) {
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty;
/***/ }),
/* 264 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _object = __webpack_require__(82);
var _object2 = _interopRequireDefault(_object);
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(33);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactMomentProptypes = __webpack_require__(135);
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(75);
var _moment = __webpack_require__(43);
var _moment2 = _interopRequireDefault(_moment);
var _object3 = __webpack_require__(219);
var _object4 = _interopRequireDefault(_object3);
var _isTouchDevice = __webpack_require__(229);
var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
var _defaultPhrases = __webpack_require__(97);
var _getPhrasePropTypes = __webpack_require__(98);
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _isSameDay = __webpack_require__(181);
var _isSameDay2 = _interopRequireDefault(_isSameDay);
var _isAfterDay = __webpack_require__(230);
var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
var _getVisibleDays = __webpack_require__(364);
var _getVisibleDays2 = _interopRequireDefault(_getVisibleDays);
var _isDayVisible = __webpack_require__(233);
var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
var _toISODateString = __webpack_require__(234);
var _toISODateString2 = _interopRequireDefault(_toISODateString);
var _toISOMonthString = __webpack_require__(182);
var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
var _ScrollableOrientationShape = __webpack_require__(136);
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _DayOfWeekShape = __webpack_require__(147);
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _CalendarInfoPositionShape = __webpack_require__(235);
var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
var _constants = __webpack_require__(66);
var _DayPicker = __webpack_require__(365);
var _DayPicker2 = _interopRequireDefault(_DayPicker);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
date: _reactMomentProptypes2['default'].momentObj,
onDateChange: _propTypes2['default'].func,
focused: _propTypes2['default'].bool,
onFocusChange: _propTypes2['default'].func,
onClose: _propTypes2['default'].func,
keepOpenOnDateSelect: _propTypes2['default'].bool,
isOutsideRange: _propTypes2['default'].func,
isDayBlocked: _propTypes2['default'].func,
isDayHighlighted: _propTypes2['default'].func,
// DayPicker props
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
enableOutsideDays: _propTypes2['default'].bool,
numberOfMonths: _propTypes2['default'].number,
orientation: _ScrollableOrientationShape2['default'],
withPortal: _propTypes2['default'].bool,
initialVisibleMonth: _propTypes2['default'].func,
firstDayOfWeek: _DayOfWeekShape2['default'],
hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
daySize: _airbnbPropTypes.nonNegativeInteger,
verticalHeight: _airbnbPropTypes.nonNegativeInteger,
noBorder: _propTypes2['default'].bool,
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
navPrev: _propTypes2['default'].node,
navNext: _propTypes2['default'].node,
onPrevMonthClick: _propTypes2['default'].func,
onNextMonthClick: _propTypes2['default'].func,
onOutsideClick: _propTypes2['default'].func,
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
renderCalendarInfo: _propTypes2['default'].func,
calendarInfoPosition: _CalendarInfoPositionShape2['default'],
// accessibility
onBlur: _propTypes2['default'].func,
isFocused: _propTypes2['default'].bool,
showKeyboardShortcuts: _propTypes2['default'].bool,
// i18n
monthFormat: _propTypes2['default'].string,
weekDayFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string,
isRTL: _propTypes2['default'].bool
});
var defaultProps = {
date: undefined, // TODO: use null
onDateChange: function () {
function onDateChange() {}
return onDateChange;
}(),
focused: false,
onFocusChange: function () {
function onFocusChange() {}
return onFocusChange;
}(),
onClose: function () {
function onClose() {}
return onClose;
}(),
keepOpenOnDateSelect: false,
isOutsideRange: function () {
function isOutsideRange() {}
return isOutsideRange;
}(),
isDayBlocked: function () {
function isDayBlocked() {}
return isDayBlocked;
}(),
isDayHighlighted: function () {
function isDayHighlighted() {}
return isDayHighlighted;
}(),
// DayPicker props
renderMonthText: null,
enableOutsideDays: false,
numberOfMonths: 1,
orientation: _constants.HORIZONTAL_ORIENTATION,
withPortal: false,
hideKeyboardShortcutsPanel: false,
initialVisibleMonth: null,
firstDayOfWeek: null,
daySize: _constants.DAY_SIZE,
verticalHeight: null,
noBorder: false,
verticalBorderSpacing: undefined,
transitionDuration: undefined,
horizontalMonthPadding: 13,
navPrev: null,
navNext: null,
onPrevMonthClick: function () {
function onPrevMonthClick() {}
return onPrevMonthClick;
}(),
onNextMonthClick: function () {
function onNextMonthClick() {}
return onNextMonthClick;
}(),
onOutsideClick: function () {
function onOutsideClick() {}
return onOutsideClick;
}(),
renderCalendarDay: undefined,
renderDayContents: null,
renderCalendarInfo: null,
renderMonthElement: null,
calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
// accessibility
onBlur: function () {
function onBlur() {}
return onBlur;
}(),
isFocused: false,
showKeyboardShortcuts: false,
// i18n
monthFormat: 'MMMM YYYY',
weekDayFormat: 'dd',
phrases: _defaultPhrases.DayPickerPhrases,
dayAriaLabelFormat: undefined,
isRTL: false
};
var DayPickerSingleDateController = function (_React$Component) {
_inherits(DayPickerSingleDateController, _React$Component);
function DayPickerSingleDateController(props) {
_classCallCheck(this, DayPickerSingleDateController);
var _this = _possibleConstructorReturn(this, (DayPickerSingleDateController.__proto__ || Object.getPrototypeOf(DayPickerSingleDateController)).call(this, props));
_this.isTouchDevice = false;
_this.today = (0, _moment2['default'])();
_this.modifiers = {
today: function () {
function today(day) {
return _this.isToday(day);
}
return today;
}(),
blocked: function () {
function blocked(day) {
return _this.isBlocked(day);
}
return blocked;
}(),
'blocked-calendar': function () {
function blockedCalendar(day) {
return props.isDayBlocked(day);
}
return blockedCalendar;
}(),
'blocked-out-of-range': function () {
function blockedOutOfRange(day) {
return props.isOutsideRange(day);
}
return blockedOutOfRange;
}(),
'highlighted-calendar': function () {
function highlightedCalendar(day) {
return props.isDayHighlighted(day);
}
return highlightedCalendar;
}(),
valid: function () {
function valid(day) {
return !_this.isBlocked(day);
}
return valid;
}(),
hovered: function () {
function hovered(day) {
return _this.isHovered(day);
}
return hovered;
}(),
selected: function () {
function selected(day) {
return _this.isSelected(day);
}
return selected;
}(),
'first-day-of-week': function () {
function firstDayOfWeek(day) {
return _this.isFirstDayOfWeek(day);
}
return firstDayOfWeek;
}(),
'last-day-of-week': function () {
function lastDayOfWeek(day) {
return _this.isLastDayOfWeek(day);
}
return lastDayOfWeek;
}()
};
var _this$getStateForNewM = _this.getStateForNewMonth(props),
currentMonth = _this$getStateForNewM.currentMonth,
visibleDays = _this$getStateForNewM.visibleDays;
_this.state = {
hoverDate: null,
currentMonth: currentMonth,
visibleDays: visibleDays
};
_this.onDayMouseEnter = _this.onDayMouseEnter.bind(_this);
_this.onDayMouseLeave = _this.onDayMouseLeave.bind(_this);
_this.onDayClick = _this.onDayClick.bind(_this);
_this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
_this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
_this.onMonthChange = _this.onMonthChange.bind(_this);
_this.onYearChange = _this.onYearChange.bind(_this);
_this.getFirstFocusableDay = _this.getFirstFocusableDay.bind(_this);
return _this;
}
_createClass(DayPickerSingleDateController, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
this.isTouchDevice = (0, _isTouchDevice2['default'])();
}
return componentDidMount;
}()
}, {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var _this2 = this;
var date = nextProps.date,
focused = nextProps.focused,
isOutsideRange = nextProps.isOutsideRange,
isDayBlocked = nextProps.isDayBlocked,
isDayHighlighted = nextProps.isDayHighlighted,
initialVisibleMonth = nextProps.initialVisibleMonth,
numberOfMonths = nextProps.numberOfMonths,
enableOutsideDays = nextProps.enableOutsideDays;
var _props = this.props,
prevIsOutsideRange = _props.isOutsideRange,
prevIsDayBlocked = _props.isDayBlocked,
prevIsDayHighlighted = _props.isDayHighlighted,
prevNumberOfMonths = _props.numberOfMonths,
prevEnableOutsideDays = _props.enableOutsideDays,
prevInitialVisibleMonth = _props.initialVisibleMonth,
prevFocused = _props.focused,
prevDate = _props.date;
var visibleDays = this.state.visibleDays;
var recomputeOutsideRange = false;
var recomputeDayBlocked = false;
var recomputeDayHighlighted = false;
if (isOutsideRange !== prevIsOutsideRange) {
this.modifiers['blocked-out-of-range'] = function (day) {
return isOutsideRange(day);
};
recomputeOutsideRange = true;
}
if (isDayBlocked !== prevIsDayBlocked) {
this.modifiers['blocked-calendar'] = function (day) {
return isDayBlocked(day);
};
recomputeDayBlocked = true;
}
if (isDayHighlighted !== prevIsDayHighlighted) {
this.modifiers['highlighted-calendar'] = function (day) {
return isDayHighlighted(day);
};
recomputeDayHighlighted = true;
}
var recomputePropModifiers = recomputeOutsideRange || recomputeDayBlocked || recomputeDayHighlighted;
if (numberOfMonths !== prevNumberOfMonths || enableOutsideDays !== prevEnableOutsideDays || initialVisibleMonth !== prevInitialVisibleMonth && !prevFocused && focused) {
var newMonthState = this.getStateForNewMonth(nextProps);
var currentMonth = newMonthState.currentMonth;
visibleDays = newMonthState.visibleDays;
this.setState({
currentMonth: currentMonth,
visibleDays: visibleDays
});
}
var didDateChange = date !== prevDate;
var didFocusChange = focused !== prevFocused;
var modifiers = {};
if (didDateChange) {
modifiers = this.deleteModifier(modifiers, prevDate, 'selected');
modifiers = this.addModifier(modifiers, date, 'selected');
}
if (didFocusChange || recomputePropModifiers) {
(0, _object4['default'])(visibleDays).forEach(function (days) {
Object.keys(days).forEach(function (day) {
var momentObj = (0, _moment2['default'])(day);
if (_this2.isBlocked(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'blocked');
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked');
}
if (didFocusChange || recomputeOutsideRange) {
if (isOutsideRange(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-out-of-range');
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-out-of-range');
}
}
if (didFocusChange || recomputeDayBlocked) {
if (isDayBlocked(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-calendar');
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-calendar');
}
}
if (didFocusChange || recomputeDayHighlighted) {
if (isDayHighlighted(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'highlighted-calendar');
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'highlighted-calendar');
}
}
});
});
}
var today = (0, _moment2['default'])();
if (!(0, _isSameDay2['default'])(this.today, today)) {
modifiers = this.deleteModifier(modifiers, this.today, 'today');
modifiers = this.addModifier(modifiers, today, 'today');
this.today = today;
}
if (Object.keys(modifiers).length > 0) {
this.setState({
visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
});
}
}
return componentWillReceiveProps;
}()
}, {
key: 'componentWillUpdate',
value: function () {
function componentWillUpdate() {
this.today = (0, _moment2['default'])();
}
return componentWillUpdate;
}()
}, {
key: 'onDayClick',
value: function () {
function onDayClick(day, e) {
if (e) e.preventDefault();
if (this.isBlocked(day)) return;
var _props2 = this.props,
onDateChange = _props2.onDateChange,
keepOpenOnDateSelect = _props2.keepOpenOnDateSelect,
onFocusChange = _props2.onFocusChange,
onClose = _props2.onClose;
onDateChange(day);
if (!keepOpenOnDateSelect) {
onFocusChange({ focused: false });
onClose({ date: day });
}
}
return onDayClick;
}()
}, {
key: 'onDayMouseEnter',
value: function () {
function onDayMouseEnter(day) {
if (this.isTouchDevice) return;
var _state = this.state,
hoverDate = _state.hoverDate,
visibleDays = _state.visibleDays;
var modifiers = this.deleteModifier({}, hoverDate, 'hovered');
modifiers = this.addModifier(modifiers, day, 'hovered');
this.setState({
hoverDate: day,
visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
});
}
return onDayMouseEnter;
}()
}, {
key: 'onDayMouseLeave',
value: function () {
function onDayMouseLeave() {
var _state2 = this.state,
hoverDate = _state2.hoverDate,
visibleDays = _state2.visibleDays;
if (this.isTouchDevice || !hoverDate) return;
var modifiers = this.deleteModifier({}, hoverDate, 'hovered');
this.setState({
hoverDate: null,
visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
});
}
return onDayMouseLeave;
}()
}, {
key: 'onPrevMonthClick',
value: function () {
function onPrevMonthClick() {
var _props3 = this.props,
onPrevMonthClick = _props3.onPrevMonthClick,
numberOfMonths = _props3.numberOfMonths,
enableOutsideDays = _props3.enableOutsideDays;
var _state3 = this.state,
currentMonth = _state3.currentMonth,
visibleDays = _state3.visibleDays;
var newVisibleDays = {};
Object.keys(visibleDays).sort().slice(0, numberOfMonths + 1).forEach(function (month) {
newVisibleDays[month] = visibleDays[month];
});
var prevMonth = currentMonth.clone().subtract(1, 'month');
var prevMonthVisibleDays = (0, _getVisibleDays2['default'])(prevMonth, 1, enableOutsideDays);
this.setState({
currentMonth: prevMonth,
visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(prevMonthVisibleDays))
}, function () {
onPrevMonthClick(prevMonth.clone());
});
}
return onPrevMonthClick;
}()
}, {
key: 'onNextMonthClick',
value: function () {
function onNextMonthClick() {
var _props4 = this.props,
onNextMonthClick = _props4.onNextMonthClick,
numberOfMonths = _props4.numberOfMonths,
enableOutsideDays = _props4.enableOutsideDays;
var _state4 = this.state,
currentMonth = _state4.currentMonth,
visibleDays = _state4.visibleDays;
var newVisibleDays = {};
Object.keys(visibleDays).sort().slice(1).forEach(function (month) {
newVisibleDays[month] = visibleDays[month];
});
var nextMonth = currentMonth.clone().add(numberOfMonths, 'month');
var nextMonthVisibleDays = (0, _getVisibleDays2['default'])(nextMonth, 1, enableOutsideDays);
var newCurrentMonth = currentMonth.clone().add(1, 'month');
this.setState({
currentMonth: newCurrentMonth,
visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(nextMonthVisibleDays))
}, function () {
onNextMonthClick(newCurrentMonth.clone());
});
}
return onNextMonthClick;
}()
}, {
key: 'onMonthChange',
value: function () {
function onMonthChange(newMonth) {
var _props5 = this.props,
numberOfMonths = _props5.numberOfMonths,
enableOutsideDays = _props5.enableOutsideDays,
orientation = _props5.orientation;
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths);
this.setState({
currentMonth: newMonth.clone(),
visibleDays: this.getModifiers(newVisibleDays)
});
}
return onMonthChange;
}()
}, {
key: 'onYearChange',
value: function () {
function onYearChange(newMonth) {
var _props6 = this.props,
numberOfMonths = _props6.numberOfMonths,
enableOutsideDays = _props6.enableOutsideDays,
orientation = _props6.orientation;
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths);
this.setState({
currentMonth: newMonth.clone(),
visibleDays: this.getModifiers(newVisibleDays)
});
}
return onYearChange;
}()
}, {
key: 'getFirstFocusableDay',
value: function () {
function getFirstFocusableDay(newMonth) {
var _this3 = this;
var _props7 = this.props,
date = _props7.date,
numberOfMonths = _props7.numberOfMonths;
var focusedDate = newMonth.clone().startOf('month');
if (date) {
focusedDate = date.clone();
}
if (this.isBlocked(focusedDate)) {
var days = [];
var lastVisibleDay = newMonth.clone().add(numberOfMonths - 1, 'months').endOf('month');
var currentDay = focusedDate.clone();
while (!(0, _isAfterDay2['default'])(currentDay, lastVisibleDay)) {
currentDay = currentDay.clone().add(1, 'day');
days.push(currentDay);
}
var viableDays = days.filter(function (day) {
return !_this3.isBlocked(day) && (0, _isAfterDay2['default'])(day, focusedDate);
});
if (viableDays.length > 0) {
var _viableDays = _slicedToArray(viableDays, 1);
focusedDate = _viableDays[0];
}
}
return focusedDate;
}
return getFirstFocusableDay;
}()
}, {
key: 'getModifiers',
value: function () {
function getModifiers(visibleDays) {
var _this4 = this;
var modifiers = {};
Object.keys(visibleDays).forEach(function (month) {
modifiers[month] = {};
visibleDays[month].forEach(function (day) {
modifiers[month][(0, _toISODateString2['default'])(day)] = _this4.getModifiersForDay(day);
});
});
return modifiers;
}
return getModifiers;
}()
}, {
key: 'getModifiersForDay',
value: function () {
function getModifiersForDay(day) {
var _this5 = this;
return new Set(Object.keys(this.modifiers).filter(function (modifier) {
return _this5.modifiers[modifier](day);
}));
}
return getModifiersForDay;
}()
}, {
key: 'getStateForNewMonth',
value: function () {
function getStateForNewMonth(nextProps) {
var _this6 = this;
var initialVisibleMonth = nextProps.initialVisibleMonth,
date = nextProps.date,
numberOfMonths = nextProps.numberOfMonths,
enableOutsideDays = nextProps.enableOutsideDays;
var initialVisibleMonthThunk = initialVisibleMonth || (date ? function () {
return date;
} : function () {
return _this6.today;
});
var currentMonth = initialVisibleMonthThunk();
var visibleDays = this.getModifiers((0, _getVisibleDays2['default'])(currentMonth, numberOfMonths, enableOutsideDays));
return { currentMonth: currentMonth, visibleDays: visibleDays };
}
return getStateForNewMonth;
}()
}, {
key: 'addModifier',
value: function () {
function addModifier(updatedDays, day, modifier) {
var _props8 = this.props,
numberOfVisibleMonths = _props8.numberOfMonths,
enableOutsideDays = _props8.enableOutsideDays,
orientation = _props8.orientation;
var _state5 = this.state,
firstVisibleMonth = _state5.currentMonth,
visibleDays = _state5.visibleDays;
var currentMonth = firstVisibleMonth;
var numberOfMonths = numberOfVisibleMonths;
if (orientation === _constants.VERTICAL_SCROLLABLE) {
numberOfMonths = Object.keys(visibleDays).length;
} else {
currentMonth = currentMonth.clone().subtract(1, 'month');
numberOfMonths += 2;
}
if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) {
return updatedDays;
}
var iso = (0, _toISODateString2['default'])(day);
var updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDays);
if (enableOutsideDays) {
var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) {
return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1;
});
updatedDaysAfterAddition = monthsToUpdate.reduce(function (days, monthIso) {
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers.add(modifier);
return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}, updatedDaysAfterAddition);
} else {
var monthIso = (0, _toISOMonthString2['default'])(day);
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers.add(modifier);
updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDaysAfterAddition, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}
return updatedDaysAfterAddition;
}
return addModifier;
}()
}, {
key: 'deleteModifier',
value: function () {
function deleteModifier(updatedDays, day, modifier) {
var _props9 = this.props,
numberOfVisibleMonths = _props9.numberOfMonths,
enableOutsideDays = _props9.enableOutsideDays,
orientation = _props9.orientation;
var _state6 = this.state,
firstVisibleMonth = _state6.currentMonth,
visibleDays = _state6.visibleDays;
var currentMonth = firstVisibleMonth;
var numberOfMonths = numberOfVisibleMonths;
if (orientation === _constants.VERTICAL_SCROLLABLE) {
numberOfMonths = Object.keys(visibleDays).length;
} else {
currentMonth = currentMonth.clone().subtract(1, 'month');
numberOfMonths += 2;
}
if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) {
return updatedDays;
}
var iso = (0, _toISODateString2['default'])(day);
var updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDays);
if (enableOutsideDays) {
var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) {
return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1;
});
updatedDaysAfterDeletion = monthsToUpdate.reduce(function (days, monthIso) {
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers['delete'](modifier);
return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}, updatedDaysAfterDeletion);
} else {
var monthIso = (0, _toISOMonthString2['default'])(day);
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers['delete'](modifier);
updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDaysAfterDeletion, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}
return updatedDaysAfterDeletion;
}
return deleteModifier;
}()
}, {
key: 'isBlocked',
value: function () {
function isBlocked(day) {
var _props10 = this.props,
isDayBlocked = _props10.isDayBlocked,
isOutsideRange = _props10.isOutsideRange;
return isDayBlocked(day) || isOutsideRange(day);
}
return isBlocked;
}()
}, {
key: 'isHovered',
value: function () {
function isHovered(day) {
var _ref = this.state || {},
hoverDate = _ref.hoverDate;
return (0, _isSameDay2['default'])(day, hoverDate);
}
return isHovered;
}()
}, {
key: 'isSelected',
value: function () {
function isSelected(day) {
var date = this.props.date;
return (0, _isSameDay2['default'])(day, date);
}
return isSelected;
}()
}, {
key: 'isToday',
value: function () {
function isToday(day) {
return (0, _isSameDay2['default'])(day, this.today);
}
return isToday;
}()
}, {
key: 'isFirstDayOfWeek',
value: function () {
function isFirstDayOfWeek(day) {
var firstDayOfWeek = this.props.firstDayOfWeek;
return day.day() === (firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek());
}
return isFirstDayOfWeek;
}()
}, {
key: 'isLastDayOfWeek',
value: function () {
function isLastDayOfWeek(day) {
var firstDayOfWeek = this.props.firstDayOfWeek;
return day.day() === ((firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek()) + 6) % 7;
}
return isLastDayOfWeek;
}()
}, {
key: 'render',
value: function () {
function render() {
var _props11 = this.props,
numberOfMonths = _props11.numberOfMonths,
orientation = _props11.orientation,
monthFormat = _props11.monthFormat,
renderMonthText = _props11.renderMonthText,
navPrev = _props11.navPrev,
navNext = _props11.navNext,
onOutsideClick = _props11.onOutsideClick,
withPortal = _props11.withPortal,
focused = _props11.focused,
enableOutsideDays = _props11.enableOutsideDays,
hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
daySize = _props11.daySize,
firstDayOfWeek = _props11.firstDayOfWeek,
renderCalendarDay = _props11.renderCalendarDay,
renderDayContents = _props11.renderDayContents,
renderCalendarInfo = _props11.renderCalendarInfo,
renderMonthElement = _props11.renderMonthElement,
calendarInfoPosition = _props11.calendarInfoPosition,
isFocused = _props11.isFocused,
isRTL = _props11.isRTL,
phrases = _props11.phrases,
dayAriaLabelFormat = _props11.dayAriaLabelFormat,
onBlur = _props11.onBlur,
showKeyboardShortcuts = _props11.showKeyboardShortcuts,
weekDayFormat = _props11.weekDayFormat,
verticalHeight = _props11.verticalHeight,
noBorder = _props11.noBorder,
transitionDuration = _props11.transitionDuration,
verticalBorderSpacing = _props11.verticalBorderSpacing,
horizontalMonthPadding = _props11.horizontalMonthPadding;
var _state7 = this.state,
currentMonth = _state7.currentMonth,
visibleDays = _state7.visibleDays;
return _react2['default'].createElement(_DayPicker2['default'], {
orientation: orientation,
enableOutsideDays: enableOutsideDays,
modifiers: visibleDays,
numberOfMonths: numberOfMonths,
onDayClick: this.onDayClick,
onDayMouseEnter: this.onDayMouseEnter,
onDayMouseLeave: this.onDayMouseLeave,
onPrevMonthClick: this.onPrevMonthClick,
onNextMonthClick: this.onNextMonthClick,
onMonthChange: this.onMonthChange,
onYearChange: this.onYearChange,
monthFormat: monthFormat,
withPortal: withPortal,
hidden: !focused,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
initialVisibleMonth: function () {
function initialVisibleMonth() {
return currentMonth;
}
return initialVisibleMonth;
}(),
firstDayOfWeek: firstDayOfWeek,
onOutsideClick: onOutsideClick,
navPrev: navPrev,
navNext: navNext,
renderMonthText: renderMonthText,
renderCalendarDay: renderCalendarDay,
renderDayContents: renderDayContents,
renderCalendarInfo: renderCalendarInfo,
renderMonthElement: renderMonthElement,
calendarInfoPosition: calendarInfoPosition,
isFocused: isFocused,
getFirstFocusableDay: this.getFirstFocusableDay,
onBlur: onBlur,
phrases: phrases,
daySize: daySize,
isRTL: isRTL,
showKeyboardShortcuts: showKeyboardShortcuts,
weekDayFormat: weekDayFormat,
dayAriaLabelFormat: dayAriaLabelFormat,
verticalHeight: verticalHeight,
noBorder: noBorder,
transitionDuration: transitionDuration,
verticalBorderSpacing: verticalBorderSpacing,
horizontalMonthPadding: horizontalMonthPadding
});
}
return render;
}()
}]);
return DayPickerSingleDateController;
}(_react2['default'].Component);
exports['default'] = DayPickerSingleDateController;
DayPickerSingleDateController.propTypes = propTypes;
DayPickerSingleDateController.defaultProps = defaultProps;
/***/ }),
/* 265 */,
/* 266 */,
/* 267 */,
/* 268 */,
/* 269 */,
/* 270 */,
/* 271 */,
/* 272 */,
/* 273 */,
/* 274 */,
/* 275 */,
/* 276 */,
/* 277 */,
/* 278 */,
/* 279 */,
/* 280 */,
/* 281 */,
/* 282 */,
/* 283 */,
/* 284 */,
/* 285 */,
/* 286 */,
/* 287 */,
/* 288 */,
/* 289 */,
/* 290 */,
/* 291 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
/**
* WordPress dependencies
*/
var chevronUp = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
d: "M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
}));
/* harmony default export */ __webpack_exports__["a"] = (chevronUp);
/***/ }),
/* 292 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
/**
* WordPress dependencies
*/
var chevronDown = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
d: "M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
}));
/* harmony default export */ __webpack_exports__["a"] = (chevronDown);
/***/ }),
/* 293 */,
/* 294 */,
/* 295 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
/**
* WordPress dependencies
*/
var upload = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-5.7-5.3-.6.6-.5-.5-5.2 5.2 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"
}));
/* harmony default export */ __webpack_exports__["a"] = (upload);
/***/ }),
/* 296 */,
/* 297 */,
/* 298 */,
/* 299 */,
/* 300 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
/**
* WordPress dependencies
*/
var linkOff = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"
}));
/* harmony default export */ __webpack_exports__["a"] = (linkOff);
/***/ }),
/* 301 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
/***/ }),
/* 302 */
/***/ (function(module, exports, __webpack_require__) {
// eslint-disable-next-line import/no-unresolved
__webpack_require__(303);
/***/ }),
/* 303 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _registerCSSInterfaceWithDefaultTheme = __webpack_require__(304);
var _registerCSSInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerCSSInterfaceWithDefaultTheme);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
(0, _registerCSSInterfaceWithDefaultTheme2['default'])();
/***/ }),
/* 304 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = registerCSSInterfaceWithDefaultTheme;
var _reactWithStylesInterfaceCss = __webpack_require__(305);
var _reactWithStylesInterfaceCss2 = _interopRequireDefault(_reactWithStylesInterfaceCss);
var _registerInterfaceWithDefaultTheme = __webpack_require__(349);
var _registerInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerInterfaceWithDefaultTheme);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function registerCSSInterfaceWithDefaultTheme() {
(0, _registerInterfaceWithDefaultTheme2['default'])(_reactWithStylesInterfaceCss2['default']);
}
/***/ }),
/* 305 */
/***/ (function(module, exports, __webpack_require__) {
// eslint-disable-next-line import/no-unresolved
module.exports = __webpack_require__(306).default;
/***/ }),
/* 306 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _arrayPrototype = __webpack_require__(307);
var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype);
var _globalCache = __webpack_require__(345);
var _globalCache2 = _interopRequireDefault(_globalCache);
var _constants = __webpack_require__(346);
var _getClassName = __webpack_require__(347);
var _getClassName2 = _interopRequireDefault(_getClassName);
var _separateStyles2 = __webpack_require__(348);
var _separateStyles3 = _interopRequireDefault(_separateStyles2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Function required as part of the react-with-styles interface. Parses the styles provided by
* react-with-styles to produce class names based on the style name and optionally the namespace if
* available.
*
* stylesObject {Object} The styles object passed to withStyles.
*
* Return an object mapping style names to class names.
*/
function create(stylesObject) {
var stylesToClasses = {};
var styleNames = Object.keys(stylesObject);
var sharedState = _globalCache2['default'].get(_constants.GLOBAL_CACHE_KEY) || {};
var _sharedState$namespac = sharedState.namespace,
namespace = _sharedState$namespac === undefined ? '' : _sharedState$namespac;
styleNames.forEach(function (styleName) {
var className = (0, _getClassName2['default'])(namespace, styleName);
stylesToClasses[styleName] = className;
});
return stylesToClasses;
}
/**
* Process styles to be consumed by a component.
*
* stylesArray {Array} Array of the following: values returned by create, plain JavaScript objects
* representing inline styles, or arrays thereof.
*
* Return an object with optional className and style properties to be spread on a component.
*/
function resolve(stylesArray) {
var flattenedStyles = (0, _arrayPrototype2['default'])(stylesArray, Infinity);
var _separateStyles = (0, _separateStyles3['default'])(flattenedStyles),
classNames = _separateStyles.classNames,
hasInlineStyles = _separateStyles.hasInlineStyles,
inlineStyles = _separateStyles.inlineStyles;
var specificClassNames = classNames.map(function (name, index) {
return String(name) + ' ' + String(name) + '_' + String(index + 1);
});
var className = specificClassNames.join(' ');
var result = { className: className };
if (hasInlineStyles) result.style = inlineStyles;
return result;
}
exports['default'] = { create: create, resolve: resolve };
/***/ }),
/* 307 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(91);
var callBind = __webpack_require__(173);
var implementation = __webpack_require__(199);
var getPolyfill = __webpack_require__(214);
var polyfill = getPolyfill();
var shim = __webpack_require__(344);
var boundFlat = callBind(polyfill);
define(boundFlat, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = boundFlat;
/***/ }),
/* 308 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var keysShim;
if (!Object.keys) {
// modified from https://github.com/es-shims/es5-shim
var has = Object.prototype.hasOwnProperty;
var toStr = Object.prototype.toString;
var isArgs = __webpack_require__(197); // eslint-disable-line global-require
var isEnumerable = Object.prototype.propertyIsEnumerable;
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
var dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
];
var equalsConstructorPrototype = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
var excludedKeys = {
$applicationCache: true,
$console: true,
$external: true,
$frame: true,
$frameElement: true,
$frames: true,
$innerHeight: true,
$innerWidth: true,
$onmozfullscreenchange: true,
$onmozfullscreenerror: true,
$outerHeight: true,
$outerWidth: true,
$pageXOffset: true,
$pageYOffset: true,
$parent: true,
$scrollLeft: true,
$scrollTop: true,
$scrollX: true,
$scrollY: true,
$self: true,
$webkitIndexedDB: true,
$webkitStorageInfo: true,
$window: true
};
var hasAutomationEqualityBug = (function () {
/* global window */
if (typeof window === 'undefined') { return false; }
for (var k in window) {
try {
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
try {
equalsConstructorPrototype(window[k]);
} catch (e) {
return true;
}
}
} catch (e) {
return true;
}
}
return false;
}());
var equalsConstructorPrototypeIfNotBuggy = function (o) {
/* global window */
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
return equalsConstructorPrototype(o);
}
try {
return equalsConstructorPrototype(o);
} catch (e) {
return false;
}
};
keysShim = function keys(object) {
var isObject = object !== null && typeof object === 'object';
var isFunction = toStr.call(object) === '[object Function]';
var isArguments = isArgs(object);
var isString = isObject && toStr.call(object) === '[object String]';
var theKeys = [];
if (!isObject && !isFunction && !isArguments) {
throw new TypeError('Object.keys called on a non-object');
}
var skipProto = hasProtoEnumBug && isFunction;
if (isString && object.length > 0 && !has.call(object, 0)) {
for (var i = 0; i < object.length; ++i) {
theKeys.push(String(i));
}
}
if (isArguments && object.length > 0) {
for (var j = 0; j < object.length; ++j) {
theKeys.push(String(j));
}
} else {
for (var name in object) {
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
theKeys.push(String(name));
}
}
}
if (hasDontEnumBug) {
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
for (var k = 0; k < dontEnums.length; ++k) {
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
theKeys.push(dontEnums[k]);
}
}
}
return theKeys;
};
}
module.exports = keysShim;
/***/ }),
/* 309 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var slice = Array.prototype.slice;
var toStr = Object.prototype.toString;
var funcType = '[object Function]';
module.exports = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slice.call(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
args.concat(slice.call(arguments))
);
if (Object(result) === result) {
return result;
}
return this;
} else {
return target.apply(
that,
args.concat(slice.call(arguments))
);
}
};
var boundLength = Math.max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs.push('$' + i);
}
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
/***/ }),
/* 310 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* eslint complexity: [2, 18], max-statements: [2, 33] */
module.exports = function hasSymbols() {
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
if (typeof Symbol.iterator === 'symbol') { return true; }
var obj = {};
var sym = Symbol('test');
var symObj = Object(sym);
if (typeof sym === 'string') { return false; }
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
// temp disabled per https://github.com/ljharb/object.assign/issues/17
// if (sym instanceof Symbol) { return false; }
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
// if (!(symObj instanceof Symbol)) { return false; }
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
var symVal = 42;
obj[sym] = symVal;
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
var syms = Object.getOwnPropertySymbols(obj);
if (syms.length !== 1 || syms[0] !== sym) { return false; }
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
if (typeof Object.getOwnPropertyDescriptor === 'function') {
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
}
return true;
};
/***/ }),
/* 311 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $Array = GetIntrinsic('%Array%');
var $species = GetIntrinsic('%Symbol.species%', true);
var $TypeError = GetIntrinsic('%TypeError%');
var Get = __webpack_require__(174);
var IsArray = __webpack_require__(175);
var IsConstructor = __webpack_require__(315);
var IsInteger = __webpack_require__(320);
var Type = __webpack_require__(80);
// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate
module.exports = function ArraySpeciesCreate(originalArray, length) {
if (!IsInteger(length) || length < 0) {
throw new $TypeError('Assertion failed: length must be an integer >= 0');
}
var len = length === 0 ? 0 : length;
var C;
var isArray = IsArray(originalArray);
if (isArray) {
C = Get(originalArray, 'constructor');
// TODO: figure out how to make a cross-realm normal Array, a same-realm Array
// if (IsConstructor(C)) {
// if C is another realm's Array, C = undefined
// Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
// }
if ($species && Type(C) === 'Object') {
C = Get(C, $species);
if (C === null) {
C = void 0;
}
}
}
if (typeof C === 'undefined') {
return $Array(len);
}
if (!IsConstructor(C)) {
throw new $TypeError('C must be a constructor');
}
return new C(len); // Construct(C, len);
};
/***/ }),
/* 312 */
/***/ (function(module, exports, __webpack_require__) {
var hasMap = typeof Map === 'function' && Map.prototype;
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
var mapForEach = hasMap && Map.prototype.forEach;
var hasSet = typeof Set === 'function' && Set.prototype;
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
var setForEach = hasSet && Set.prototype.forEach;
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
var booleanValueOf = Boolean.prototype.valueOf;
var objectToString = Object.prototype.toString;
var match = String.prototype.match;
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
var inspectCustom = __webpack_require__(313).custom;
var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
module.exports = function inspect_(obj, options, depth, seen) {
var opts = options || {};
if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
throw new TypeError('option "quoteStyle" must be "single" or "double"');
}
if (typeof obj === 'undefined') {
return 'undefined';
}
if (obj === null) {
return 'null';
}
if (typeof obj === 'boolean') {
return obj ? 'true' : 'false';
}
if (typeof obj === 'string') {
return inspectString(obj, opts);
}
if (typeof obj === 'number') {
if (obj === 0) {
return Infinity / obj > 0 ? '0' : '-0';
}
return String(obj);
}
if (typeof obj === 'bigint') { // eslint-disable-line valid-typeof
return String(obj) + 'n';
}
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
if (typeof depth === 'undefined') { depth = 0; }
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
return '[Object]';
}
if (typeof seen === 'undefined') {
seen = [];
} else if (indexOf(seen, obj) >= 0) {
return '[Circular]';
}
function inspect(value, from) {
if (from) {
seen = seen.slice();
seen.push(from);
}
return inspect_(value, opts, depth + 1, seen);
}
if (typeof obj === 'function') {
var name = nameOf(obj);
return '[Function' + (name ? ': ' + name : '') + ']';
}
if (isSymbol(obj)) {
var symString = Symbol.prototype.toString.call(obj);
return typeof obj === 'object' ? markBoxed(symString) : symString;
}
if (isElement(obj)) {
var s = '<' + String(obj.nodeName).toLowerCase();
var attrs = obj.attributes || [];
for (var i = 0; i < attrs.length; i++) {
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
}
s += '>';
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
s += '' + String(obj.nodeName).toLowerCase() + '>';
return s;
}
if (isArray(obj)) {
if (obj.length === 0) { return '[]'; }
return '[ ' + arrObjKeys(obj, inspect).join(', ') + ' ]';
}
if (isError(obj)) {
var parts = arrObjKeys(obj, inspect);
if (parts.length === 0) { return '[' + String(obj) + ']'; }
return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';
}
if (typeof obj === 'object') {
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
return obj[inspectSymbol]();
} else if (typeof obj.inspect === 'function') {
return obj.inspect();
}
}
if (isMap(obj)) {
var mapParts = [];
mapForEach.call(obj, function (value, key) {
mapParts.push(inspect(key, obj) + ' => ' + inspect(value, obj));
});
return collectionOf('Map', mapSize.call(obj), mapParts);
}
if (isSet(obj)) {
var setParts = [];
setForEach.call(obj, function (value) {
setParts.push(inspect(value, obj));
});
return collectionOf('Set', setSize.call(obj), setParts);
}
if (isWeakMap(obj)) {
return weakCollectionOf('WeakMap');
}
if (isWeakSet(obj)) {
return weakCollectionOf('WeakSet');
}
if (isNumber(obj)) {
return markBoxed(inspect(Number(obj)));
}
if (isBigInt(obj)) {
return markBoxed(inspect(bigIntValueOf.call(obj)));
}
if (isBoolean(obj)) {
return markBoxed(booleanValueOf.call(obj));
}
if (isString(obj)) {
return markBoxed(inspect(String(obj)));
}
if (!isDate(obj) && !isRegExp(obj)) {
var xs = arrObjKeys(obj, inspect);
if (xs.length === 0) { return '{}'; }
return '{ ' + xs.join(', ') + ' }';
}
return String(obj);
};
function wrapQuotes(s, defaultStyle, opts) {
var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
return quoteChar + s + quoteChar;
}
function quote(s) {
return String(s).replace(/"/g, '"');
}
function isArray(obj) { return toStr(obj) === '[object Array]'; }
function isDate(obj) { return toStr(obj) === '[object Date]'; }
function isRegExp(obj) { return toStr(obj) === '[object RegExp]'; }
function isError(obj) { return toStr(obj) === '[object Error]'; }
function isSymbol(obj) { return toStr(obj) === '[object Symbol]'; }
function isString(obj) { return toStr(obj) === '[object String]'; }
function isNumber(obj) { return toStr(obj) === '[object Number]'; }
function isBigInt(obj) { return toStr(obj) === '[object BigInt]'; }
function isBoolean(obj) { return toStr(obj) === '[object Boolean]'; }
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
function has(obj, key) {
return hasOwn.call(obj, key);
}
function toStr(obj) {
return objectToString.call(obj);
}
function nameOf(f) {
if (f.name) { return f.name; }
var m = match.call(f, /^function\s*([\w$]+)/);
if (m) { return m[1]; }
return null;
}
function indexOf(xs, x) {
if (xs.indexOf) { return xs.indexOf(x); }
for (var i = 0, l = xs.length; i < l; i++) {
if (xs[i] === x) { return i; }
}
return -1;
}
function isMap(x) {
if (!mapSize || !x || typeof x !== 'object') {
return false;
}
try {
mapSize.call(x);
try {
setSize.call(x);
} catch (s) {
return true;
}
return x instanceof Map; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isWeakMap(x) {
if (!weakMapHas || !x || typeof x !== 'object') {
return false;
}
try {
weakMapHas.call(x, weakMapHas);
try {
weakSetHas.call(x, weakSetHas);
} catch (s) {
return true;
}
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isSet(x) {
if (!setSize || !x || typeof x !== 'object') {
return false;
}
try {
setSize.call(x);
try {
mapSize.call(x);
} catch (m) {
return true;
}
return x instanceof Set; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isWeakSet(x) {
if (!weakSetHas || !x || typeof x !== 'object') {
return false;
}
try {
weakSetHas.call(x, weakSetHas);
try {
weakMapHas.call(x, weakMapHas);
} catch (s) {
return true;
}
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isElement(x) {
if (!x || typeof x !== 'object') { return false; }
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
return true;
}
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
}
function inspectString(str, opts) {
// eslint-disable-next-line no-control-regex
var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte);
return wrapQuotes(s, 'single', opts);
}
function lowbyte(c) {
var n = c.charCodeAt(0);
var x = {
8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r'
}[n];
if (x) { return '\\' + x; }
return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16);
}
function markBoxed(str) {
return 'Object(' + str + ')';
}
function weakCollectionOf(type) {
return type + ' { ? }';
}
function collectionOf(type, size, entries) {
return type + ' (' + size + ') {' + entries.join(', ') + '}';
}
function arrObjKeys(obj, inspect) {
var isArr = isArray(obj);
var xs = [];
if (isArr) {
xs.length = obj.length;
for (var i = 0; i < obj.length; i++) {
xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
}
}
for (var key in obj) { // eslint-disable-line no-restricted-syntax
if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
if ((/[^\w$]/).test(key)) {
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
} else {
xs.push(key + ': ' + inspect(obj[key], obj));
}
}
return xs;
}
/***/ }),
/* 313 */
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/* 314 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://www.ecma-international.org/ecma-262/5.1/#sec-8
module.exports = function Type(x) {
if (x === null) {
return 'Null';
}
if (typeof x === 'undefined') {
return 'Undefined';
}
if (typeof x === 'function' || typeof x === 'object') {
return 'Object';
}
if (typeof x === 'number') {
return 'Number';
}
if (typeof x === 'boolean') {
return 'Boolean';
}
if (typeof x === 'string') {
return 'String';
}
};
/***/ }),
/* 315 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $construct = GetIntrinsic('%Reflect.construct%', true);
var DefinePropertyOrThrow = __webpack_require__(316);
try {
DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });
} catch (e) {
// Accessor properties aren't supported
DefinePropertyOrThrow = null;
}
// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor
if (DefinePropertyOrThrow && $construct) {
var isConstructorMarker = {};
var badArrayLike = {};
DefinePropertyOrThrow(badArrayLike, 'length', {
'[[Get]]': function () {
throw isConstructorMarker;
},
'[[Enumerable]]': true
});
module.exports = function IsConstructor(argument) {
try {
// `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:
$construct(argument, badArrayLike);
} catch (err) {
return err === isConstructorMarker;
}
};
} else {
module.exports = function IsConstructor(argument) {
// unfortunately there's no way to truly check this without try/catch `new argument` in old environments
return typeof argument === 'function' && !!argument.prototype;
};
}
/***/ }),
/* 316 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $TypeError = GetIntrinsic('%TypeError%');
var isPropertyDescriptor = __webpack_require__(317);
var DefineOwnProperty = __webpack_require__(200);
var FromPropertyDescriptor = __webpack_require__(201);
var IsAccessorDescriptor = __webpack_require__(318);
var IsDataDescriptor = __webpack_require__(202);
var IsPropertyKey = __webpack_require__(120);
var SameValue = __webpack_require__(203);
var ToPropertyDescriptor = __webpack_require__(204);
var Type = __webpack_require__(80);
// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow
module.exports = function DefinePropertyOrThrow(O, P, desc) {
if (Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var Desc = isPropertyDescriptor({
Type: Type,
IsDataDescriptor: IsDataDescriptor,
IsAccessorDescriptor: IsAccessorDescriptor
}, desc) ? desc : ToPropertyDescriptor(desc);
if (!isPropertyDescriptor({
Type: Type,
IsDataDescriptor: IsDataDescriptor,
IsAccessorDescriptor: IsAccessorDescriptor
}, Desc)) {
throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');
}
return DefineOwnProperty(
IsDataDescriptor,
SameValue,
FromPropertyDescriptor,
O,
P,
Desc
);
};
/***/ }),
/* 317 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var has = __webpack_require__(81);
var $TypeError = GetIntrinsic('%TypeError%');
module.exports = function IsPropertyDescriptor(ES, Desc) {
if (ES.Type(Desc) !== 'Object') {
return false;
}
var allowed = {
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Get]]': true,
'[[Set]]': true,
'[[Value]]': true,
'[[Writable]]': true
};
for (var key in Desc) { // eslint-disable-line no-restricted-syntax
if (has(Desc, key) && !allowed[key]) {
return false;
}
}
if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {
throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
}
return true;
};
/***/ }),
/* 318 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var has = __webpack_require__(81);
var assertRecord = __webpack_require__(176);
var Type = __webpack_require__(80);
// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor
module.exports = function IsAccessorDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
return false;
}
return true;
};
/***/ }),
/* 319 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11
module.exports = __webpack_require__(206);
/***/ }),
/* 320 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $Math = GetIntrinsic('%Math%');
var $floor = $Math.floor;
var $abs = $Math.abs;
var $isNaN = __webpack_require__(177);
var $isFinite = __webpack_require__(207);
// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger
module.exports = function IsInteger(argument) {
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
return false;
}
var abs = $abs(argument);
return $floor(abs) === abs;
};
/***/ }),
/* 321 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $TypeError = GetIntrinsic('%TypeError%');
var MAX_SAFE_INTEGER = __webpack_require__(208);
var Call = __webpack_require__(322);
var CreateDataPropertyOrThrow = __webpack_require__(323);
var Get = __webpack_require__(174);
var HasProperty = __webpack_require__(330);
var IsArray = __webpack_require__(175);
var ToLength = __webpack_require__(210);
var ToString = __webpack_require__(340);
// https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray
// eslint-disable-next-line max-params, max-statements
module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) {
var mapperFunction;
if (arguments.length > 5) {
mapperFunction = arguments[5];
}
var targetIndex = start;
var sourceIndex = 0;
while (sourceIndex < sourceLen) {
var P = ToString(sourceIndex);
var exists = HasProperty(source, P);
if (exists === true) {
var element = Get(source, P);
if (typeof mapperFunction !== 'undefined') {
if (arguments.length <= 6) {
throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided');
}
element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]);
}
var shouldFlatten = false;
if (depth > 0) {
shouldFlatten = IsArray(element);
}
if (shouldFlatten) {
var elementLen = ToLength(Get(element, 'length'));
targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1);
} else {
if (targetIndex >= MAX_SAFE_INTEGER) {
throw new $TypeError('index too large');
}
CreateDataPropertyOrThrow(target, ToString(targetIndex), element);
targetIndex += 1;
}
}
sourceIndex += 1;
}
return targetIndex;
};
/***/ }),
/* 322 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var callBound = __webpack_require__(134);
var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%');
// https://www.ecma-international.org/ecma-262/6.0/#sec-call
module.exports = function Call(F, V) {
var args = arguments.length > 2 ? arguments[2] : [];
return $apply(F, V, args);
};
/***/ }),
/* 323 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $TypeError = GetIntrinsic('%TypeError%');
var CreateDataProperty = __webpack_require__(324);
var IsPropertyKey = __webpack_require__(120);
var Type = __webpack_require__(80);
// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow
module.exports = function CreateDataPropertyOrThrow(O, P, V) {
if (Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var success = CreateDataProperty(O, P, V);
if (!success) {
throw new $TypeError('unable to create data property');
}
return success;
};
/***/ }),
/* 324 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $TypeError = GetIntrinsic('%TypeError%');
var DefineOwnProperty = __webpack_require__(200);
var FromPropertyDescriptor = __webpack_require__(201);
var OrdinaryGetOwnProperty = __webpack_require__(325);
var IsDataDescriptor = __webpack_require__(202);
var IsExtensible = __webpack_require__(329);
var IsPropertyKey = __webpack_require__(120);
var SameValue = __webpack_require__(203);
var Type = __webpack_require__(80);
// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty
module.exports = function CreateDataProperty(O, P, V) {
if (Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var oldDesc = OrdinaryGetOwnProperty(O, P);
var extensible = !oldDesc || IsExtensible(O);
var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']);
if (immutable || !extensible) {
return false;
}
return DefineOwnProperty(
IsDataDescriptor,
SameValue,
FromPropertyDescriptor,
O,
P,
{
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Value]]': V,
'[[Writable]]': true
}
);
};
/***/ }),
/* 325 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $gOPD = __webpack_require__(326);
var $TypeError = GetIntrinsic('%TypeError%');
var callBound = __webpack_require__(134);
var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
var has = __webpack_require__(81);
var IsArray = __webpack_require__(175);
var IsPropertyKey = __webpack_require__(120);
var IsRegExp = __webpack_require__(327);
var ToPropertyDescriptor = __webpack_require__(204);
var Type = __webpack_require__(80);
// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
module.exports = function OrdinaryGetOwnProperty(O, P) {
if (Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: O must be an Object');
}
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: P must be a Property Key');
}
if (!has(O, P)) {
return void 0;
}
if (!$gOPD) {
// ES3 / IE 8 fallback
var arrayLength = IsArray(O) && P === 'length';
var regexLastIndex = IsRegExp(O) && P === 'lastIndex';
return {
'[[Configurable]]': !(arrayLength || regexLastIndex),
'[[Enumerable]]': $isEnumerable(O, P),
'[[Value]]': O[P],
'[[Writable]]': true
};
}
return ToPropertyDescriptor($gOPD(O, P));
};
/***/ }),
/* 326 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%');
if ($gOPD) {
try {
$gOPD([], 'length');
} catch (e) {
// IE 8 has a broken gOPD
$gOPD = null;
}
}
module.exports = $gOPD;
/***/ }),
/* 327 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $match = GetIntrinsic('%Symbol.match%', true);
var hasRegExpMatcher = __webpack_require__(328);
var ToBoolean = __webpack_require__(205);
// https://ecma-international.org/ecma-262/6.0/#sec-isregexp
module.exports = function IsRegExp(argument) {
if (!argument || typeof argument !== 'object') {
return false;
}
if ($match) {
var isRegExp = argument[$match];
if (typeof isRegExp !== 'undefined') {
return ToBoolean(isRegExp);
}
}
return hasRegExpMatcher(argument);
};
/***/ }),
/* 328 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var hasSymbols = __webpack_require__(198)();
var hasToStringTag = hasSymbols && typeof Symbol.toStringTag === 'symbol';
var regexExec;
var isRegexMarker;
var badStringifier;
if (hasToStringTag) {
regexExec = Function.call.bind(RegExp.prototype.exec);
isRegexMarker = {};
var throwRegexMarker = function () {
throw isRegexMarker;
};
badStringifier = {
toString: throwRegexMarker,
valueOf: throwRegexMarker
};
if (typeof Symbol.toPrimitive === 'symbol') {
badStringifier[Symbol.toPrimitive] = throwRegexMarker;
}
}
var toStr = Object.prototype.toString;
var regexClass = '[object RegExp]';
module.exports = hasToStringTag
// eslint-disable-next-line consistent-return
? function isRegex(value) {
if (!value || typeof value !== 'object') {
return false;
}
try {
regexExec(value, badStringifier);
} catch (e) {
return e === isRegexMarker;
}
}
: function isRegex(value) {
// In older browsers, typeof regex incorrectly returns 'function'
if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
return false;
}
return toStr.call(value) === regexClass;
};
/***/ }),
/* 329 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $Object = GetIntrinsic('%Object%');
var isPrimitive = __webpack_require__(209);
var $preventExtensions = $Object.preventExtensions;
var $isExtensible = $Object.isExtensible;
// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o
module.exports = $preventExtensions
? function IsExtensible(obj) {
return !isPrimitive(obj) && $isExtensible(obj);
}
: function IsExtensible(obj) {
return !isPrimitive(obj);
};
/***/ }),
/* 330 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $TypeError = GetIntrinsic('%TypeError%');
var IsPropertyKey = __webpack_require__(120);
var Type = __webpack_require__(80);
// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty
module.exports = function HasProperty(O, P) {
if (Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: `O` must be an Object');
}
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: `P` must be a Property Key');
}
return P in O;
};
/***/ }),
/* 331 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $Math = GetIntrinsic('%Math%');
var ToNumber = __webpack_require__(332);
var $isNaN = __webpack_require__(177);
var $isFinite = __webpack_require__(207);
var $sign = __webpack_require__(333);
var $floor = $Math.floor;
var $abs = $Math.abs;
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.4
module.exports = function ToInteger(value) {
var number = ToNumber(value);
if ($isNaN(number)) { return 0; }
if (number === 0 || !$isFinite(number)) { return number; }
return $sign(number) * $floor($abs(number));
};
/***/ }),
/* 332 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.3
module.exports = function ToNumber(value) {
return +value; // eslint-disable-line no-implicit-coercion
};
/***/ }),
/* 333 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function sign(number) {
return number >= 0 ? 1 : -1;
};
/***/ }),
/* 334 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $TypeError = GetIntrinsic('%TypeError%');
var $Number = GetIntrinsic('%Number%');
var $RegExp = GetIntrinsic('%RegExp%');
var $parseInteger = GetIntrinsic('%parseInt%');
var callBound = __webpack_require__(134);
var regexTester = __webpack_require__(335);
var isPrimitive = __webpack_require__(209);
var $strSlice = callBound('String.prototype.slice');
var isBinary = regexTester(/^0b[01]+$/i);
var isOctal = regexTester(/^0o[0-7]+$/i);
var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);
var nonWS = ['\u0085', '\u200b', '\ufffe'].join('');
var nonWSregex = new $RegExp('[' + nonWS + ']', 'g');
var hasNonWS = regexTester(nonWSregex);
// whitespace from: https://es5.github.io/#x15.5.4.20
// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324
var ws = [
'\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003',
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028',
'\u2029\uFEFF'
].join('');
var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g');
var $replace = callBound('String.prototype.replace');
var $trim = function (value) {
return $replace(value, trimRegex, '');
};
var ToPrimitive = __webpack_require__(336);
// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber
module.exports = function ToNumber(argument) {
var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);
if (typeof value === 'symbol') {
throw new $TypeError('Cannot convert a Symbol value to a number');
}
if (typeof value === 'string') {
if (isBinary(value)) {
return ToNumber($parseInteger($strSlice(value, 2), 2));
} else if (isOctal(value)) {
return ToNumber($parseInteger($strSlice(value, 2), 8));
} else if (hasNonWS(value) || isInvalidHexLiteral(value)) {
return NaN;
} else {
var trimmed = $trim(value);
if (trimmed !== value) {
return ToNumber(trimmed);
}
}
}
return $Number(value);
};
/***/ }),
/* 335 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $test = GetIntrinsic('RegExp.prototype.test');
var callBind = __webpack_require__(173);
module.exports = function regexTester(regex) {
return callBind($test, regex);
};
/***/ }),
/* 336 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toPrimitive = __webpack_require__(337);
// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive
module.exports = function ToPrimitive(input) {
if (arguments.length > 1) {
return toPrimitive(input, arguments[1]);
}
return toPrimitive(input);
};
/***/ }),
/* 337 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
var isPrimitive = __webpack_require__(338);
var isCallable = __webpack_require__(206);
var isDate = __webpack_require__(212);
var isSymbol = __webpack_require__(178);
var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {
if (typeof O === 'undefined' || O === null) {
throw new TypeError('Cannot call method on ' + O);
}
if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {
throw new TypeError('hint must be "string" or "number"');
}
var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
var method, result, i;
for (i = 0; i < methodNames.length; ++i) {
method = O[methodNames[i]];
if (isCallable(method)) {
result = method.call(O);
if (isPrimitive(result)) {
return result;
}
}
}
throw new TypeError('No default value');
};
var GetMethod = function GetMethod(O, P) {
var func = O[P];
if (func !== null && typeof func !== 'undefined') {
if (!isCallable(func)) {
throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');
}
return func;
}
return void 0;
};
// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive
module.exports = function ToPrimitive(input) {
if (isPrimitive(input)) {
return input;
}
var hint = 'default';
if (arguments.length > 1) {
if (arguments[1] === String) {
hint = 'string';
} else if (arguments[1] === Number) {
hint = 'number';
}
}
var exoticToPrim;
if (hasSymbols) {
if (Symbol.toPrimitive) {
exoticToPrim = GetMethod(input, Symbol.toPrimitive);
} else if (isSymbol(input)) {
exoticToPrim = Symbol.prototype.valueOf;
}
}
if (typeof exoticToPrim !== 'undefined') {
var result = exoticToPrim.call(input, hint);
if (isPrimitive(result)) {
return result;
}
throw new TypeError('unable to convert exotic object to primitive');
}
if (hint === 'default' && (isDate(input) || isSymbol(input))) {
hint = 'string';
}
return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);
};
/***/ }),
/* 338 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function isPrimitive(value) {
return value === null || (typeof value !== 'function' && typeof value !== 'object');
};
/***/ }),
/* 339 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {
var origSymbol = global.Symbol;
var hasSymbolSham = __webpack_require__(213);
module.exports = function hasNativeSymbols() {
if (typeof origSymbol !== 'function') { return false; }
if (typeof Symbol !== 'function') { return false; }
if (typeof origSymbol('foo') !== 'symbol') { return false; }
if (typeof Symbol('bar') !== 'symbol') { return false; }
return hasSymbolSham();
};
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(119)))
/***/ }),
/* 340 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $String = GetIntrinsic('%String%');
var $TypeError = GetIntrinsic('%TypeError%');
// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring
module.exports = function ToString(argument) {
if (typeof argument === 'symbol') {
throw new $TypeError('Cannot convert a Symbol value to a string');
}
return $String(argument);
};
/***/ }),
/* 341 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $Object = GetIntrinsic('%Object%');
var RequireObjectCoercible = __webpack_require__(342);
// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject
module.exports = function ToObject(value) {
RequireObjectCoercible(value);
return $Object(value);
};
/***/ }),
/* 342 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(343);
/***/ }),
/* 343 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(48);
var $TypeError = GetIntrinsic('%TypeError%');
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.10
module.exports = function CheckObjectCoercible(value, optMessage) {
if (value == null) {
throw new $TypeError(optMessage || ('Cannot call method on ' + value));
}
return value;
};
/***/ }),
/* 344 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(91);
var getPolyfill = __webpack_require__(214);
module.exports = function shimFlat() {
var polyfill = getPolyfill();
define(
Array.prototype,
{ flat: polyfill },
{ flat: function () { return Array.prototype.flat !== polyfill; } }
);
return polyfill;
};
/***/ }),
/* 345 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {
var define = __webpack_require__(91);
var isSymbol = __webpack_require__(178);
var globalKey = '__ global cache key __';
/* istanbul ignore else */
// eslint-disable-next-line no-restricted-properties
if (typeof Symbol === 'function' && isSymbol(Symbol('foo')) && typeof Symbol['for'] === 'function') {
// eslint-disable-next-line no-restricted-properties
globalKey = Symbol['for'](globalKey);
}
var trueThunk = function () {
return true;
};
var ensureCache = function ensureCache() {
if (!global[globalKey]) {
var properties = {};
properties[globalKey] = {};
var predicates = {};
predicates[globalKey] = trueThunk;
define(global, properties, predicates);
}
return global[globalKey];
};
var cache = ensureCache();
var isPrimitive = function isPrimitive(val) {
return val === null || (typeof val !== 'object' && typeof val !== 'function');
};
var getPrimitiveKey = function getPrimitiveKey(val) {
if (isSymbol(val)) {
return Symbol.prototype.valueOf.call(val);
}
return typeof val + ' | ' + String(val);
};
var requirePrimitiveKey = function requirePrimitiveKey(val) {
if (!isPrimitive(val)) {
throw new TypeError('key must not be an object');
}
};
var globalCache = {
clear: function clear() {
delete global[globalKey];
cache = ensureCache();
},
'delete': function deleteKey(key) {
requirePrimitiveKey(key);
delete cache[getPrimitiveKey(key)];
return !globalCache.has(key);
},
get: function get(key) {
requirePrimitiveKey(key);
return cache[getPrimitiveKey(key)];
},
has: function has(key) {
requirePrimitiveKey(key);
return getPrimitiveKey(key) in cache;
},
set: function set(key, value) {
requirePrimitiveKey(key);
var primitiveKey = getPrimitiveKey(key);
var props = {};
props[primitiveKey] = value;
var predicates = {};
predicates[primitiveKey] = trueThunk;
define(cache, props, predicates);
return globalCache.has(key);
},
setIfMissingThenGet: function setIfMissingThenGet(key, valueThunk) {
if (globalCache.has(key)) {
return globalCache.get(key);
}
var item = valueThunk();
globalCache.set(key, item);
return item;
}
};
module.exports = globalCache;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(119)))
/***/ }),
/* 346 */
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var GLOBAL_CACHE_KEY = 'reactWithStylesInterfaceCSS';
var MAX_SPECIFICITY = 20;
exports.GLOBAL_CACHE_KEY = GLOBAL_CACHE_KEY;
exports.MAX_SPECIFICITY = MAX_SPECIFICITY;
/***/ }),
/* 347 */
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getClassName;
/**
* Construct a class name.
*
* namespace {String} Used to construct unique class names.
* styleName {String} Name identifying the specific style.
*
* Return the class name.
*/
function getClassName(namespace, styleName) {
var namespaceSegment = namespace.length > 0 ? String(namespace) + '__' : '';
return '' + namespaceSegment + String(styleName);
}
/***/ }),
/* 348 */
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
// This function takes an array of styles and separates them into styles that
// are handled by Aphrodite and inline styles.
function separateStyles(stylesArray) {
var classNames = [];
// Since determining if an Object is empty requires collecting all of its
// keys, and we want the best performance in this code because we are in the
// render path, we are going to do a little bookkeeping ourselves.
var hasInlineStyles = false;
var inlineStyles = {};
// This is run on potentially every node in the tree when rendering, where
// performance is critical. Normally we would prefer using `forEach`, but
// old-fashioned for loops are faster so that's what we have chosen here.
for (var i = 0; i < stylesArray.length; i++) {
// eslint-disable-line no-plusplus
var style = stylesArray[i];
// If this style is falsy, we just want to disregard it. This allows for
// syntax like:
//
// css(isFoo && styles.foo)
if (style) {
if (typeof style === 'string') {
classNames.push(style);
} else {
Object.assign(inlineStyles, style);
hasInlineStyles = true;
}
}
}
return {
classNames: classNames,
hasInlineStyles: hasInlineStyles,
inlineStyles: inlineStyles
};
}
exports['default'] = separateStyles;
/***/ }),
/* 349 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = registerInterfaceWithDefaultTheme;
var _ThemedStyleSheet = __webpack_require__(215);
var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
var _DefaultTheme = __webpack_require__(216);
var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function registerInterfaceWithDefaultTheme(reactWithStylesInterface) {
_ThemedStyleSheet2['default'].registerInterface(reactWithStylesInterface);
_ThemedStyleSheet2['default'].registerTheme(_DefaultTheme2['default']);
}
/***/ }),
/* 350 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(91);
var getPolyfill = __webpack_require__(218);
module.exports = function shimAssign() {
var polyfill = getPolyfill();
define(
Object,
{ assign: polyfill },
{ assign: function () { return Object.assign !== polyfill; } }
);
return polyfill;
};
/***/ }),
/* 351 */
/***/ (function(module, exports, __webpack_require__) {
var moment = __webpack_require__(43);
function isValidMoment(testMoment) {
if (typeof moment.isMoment === 'function' && !moment.isMoment(testMoment)) {
return false;
}
/* istanbul ignore else */
if (typeof testMoment.isValid === 'function') {
// moment 1.7.0+
return testMoment.isValid();
}
/* istanbul ignore next */
return !isNaN(testMoment);
}
module.exports = {
isValidMoment : isValidMoment,
};
/***/ }),
/* 352 */
/***/ (function(module, exports) {
var messages = {
invalidPredicate: '`predicate` must be a function',
invalidPropValidator: '`propValidator` must be a function',
requiredCore: 'is marked as required',
invalidTypeCore: 'Invalid input type',
predicateFailureCore: 'Failed to succeed with predicate',
anonymousMessage: '<>',
baseInvalidMessage: 'Invalid ',
};
function constructPropValidatorVariations(propValidator) {
if (typeof propValidator !== 'function') {
throw new Error(messages.invalidPropValidator);
}
var requiredPropValidator = propValidator.bind(null, false, null);
requiredPropValidator.isRequired = propValidator.bind(null, true, null);
requiredPropValidator.withPredicate = function predicateApplication(predicate) {
if (typeof predicate !== 'function') {
throw new Error(messages.invalidPredicate);
}
var basePropValidator = propValidator.bind(null, false, predicate);
basePropValidator.isRequired = propValidator.bind(null, true, predicate);
return basePropValidator;
};
return requiredPropValidator;
}
function createInvalidRequiredErrorMessage(propName, componentName, value) {
return new Error(
'The prop `' + propName + '` ' + messages.requiredCore +
' in `' + componentName + '`, but its value is `' + value + '`.'
);
}
var independentGuardianValue = -1;
function preValidationRequireCheck(isRequired, componentName, propFullName, propValue) {
var isPropValueUndefined = typeof propValue === 'undefined';
var isPropValueNull = propValue === null;
if (isRequired) {
if (isPropValueUndefined) {
return createInvalidRequiredErrorMessage(propFullName, componentName, 'undefined');
} else if (isPropValueNull) {
return createInvalidRequiredErrorMessage(propFullName, componentName, 'null');
}
}
if (isPropValueUndefined || isPropValueNull) {
return null;
}
return independentGuardianValue;
}
function createMomentChecker(type, typeValidator, validator, momentType) {
function propValidator(
isRequired, // Bound parameter to indicate with the propType is required
predicate, // Bound parameter to allow user to add dynamic validation
props,
propName,
componentName,
location,
propFullName
) {
var propValue = props[ propName ];
var propType = typeof propValue;
componentName = componentName || messages.anonymousMessage;
propFullName = propFullName || propName;
var preValidationRequireCheckValue = preValidationRequireCheck(
isRequired, componentName, propFullName, propValue
);
if (preValidationRequireCheckValue !== independentGuardianValue) {
return preValidationRequireCheckValue;
}
if (typeValidator && !typeValidator(propValue)) {
return new Error(
messages.invalidTypeCore + ': `' + propName + '` of type `' + propType + '` ' +
'supplied to `' + componentName + '`, expected `' + type + '`.'
);
}
if (!validator(propValue)) {
return new Error(
messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' +
'supplied to `' + componentName + '`, expected `' + momentType + '`.'
);
}
if (predicate && !predicate(propValue)) {
var predicateName = predicate.name || messages.anonymousMessage;
return new Error(
messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' +
'supplied to `' + componentName + '`. ' + messages.predicateFailureCore + ' `' +
predicateName + '`.'
);
}
return null;
}
return constructPropValidatorVariations(propValidator);
}
module.exports = {
constructPropValidatorVariations: constructPropValidatorVariations,
createMomentChecker: createMomentChecker,
messages: messages,
};
/***/ }),
/* 353 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function noop() {
return null;
}
noop.isRequired = noop;
function noopThunk() {
return noop;
}
module.exports = {
and: noopThunk,
between: noopThunk,
booleanSome: noopThunk,
childrenHavePropXorChildren: noopThunk,
childrenOf: noopThunk,
childrenOfType: noopThunk,
childrenSequenceOf: noopThunk,
componentWithName: noopThunk,
disallowedIf: noopThunk,
elementType: noopThunk,
empty: noopThunk,
explicitNull: noopThunk,
forbidExtraProps: Object,
integer: noopThunk,
keysOf: noopThunk,
mutuallyExclusiveProps: noopThunk,
mutuallyExclusiveTrueProps: noopThunk,
nChildren: noopThunk,
nonNegativeInteger: noop,
nonNegativeNumber: noopThunk,
numericString: noopThunk,
object: noopThunk,
or: noopThunk,
range: noopThunk,
ref: noopThunk,
requiredBy: noopThunk,
restrictedProp: noopThunk,
sequenceOf: noopThunk,
shape: noopThunk,
stringEndsWith: noopThunk,
stringStartsWith: noopThunk,
uniqueArray: noopThunk,
uniqueArrayOf: noopThunk,
valuesOf: noopThunk,
withShape: noopThunk
};
/***/ }),
/* 354 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(355);
/***/ }),
/* 355 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var ES2015 = __webpack_require__(356);
var assign = __webpack_require__(225);
var ES2016 = assign(assign({}, ES2015), {
// https://github.com/tc39/ecma262/pull/60
SameValueNonNumber: function SameValueNonNumber(x, y) {
if (typeof x === 'number' || typeof x !== typeof y) {
throw new TypeError('SameValueNonNumber requires two non-number values of the same type.');
}
return this.SameValue(x, y);
}
});
module.exports = ES2016;
/***/ }),
/* 356 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var has = __webpack_require__(81);
var toPrimitive = __webpack_require__(357);
var keys = __webpack_require__(172);
var GetIntrinsic = __webpack_require__(180);
var $TypeError = GetIntrinsic('%TypeError%');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $Array = GetIntrinsic('%Array%');
var $String = GetIntrinsic('%String%');
var $Object = GetIntrinsic('%Object%');
var $Number = GetIntrinsic('%Number%');
var $Symbol = GetIntrinsic('%Symbol%', true);
var $RegExp = GetIntrinsic('%RegExp%');
var hasSymbols = !!$Symbol;
var assertRecord = __webpack_require__(222);
var $isNaN = __webpack_require__(223);
var $isFinite = __webpack_require__(224);
var MAX_SAFE_INTEGER = $Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;
var assign = __webpack_require__(225);
var sign = __webpack_require__(226);
var mod = __webpack_require__(227);
var isPrimitive = __webpack_require__(359);
var parseInteger = parseInt;
var bind = __webpack_require__(110);
var arraySlice = bind.call(Function.call, $Array.prototype.slice);
var strSlice = bind.call(Function.call, $String.prototype.slice);
var isBinary = bind.call(Function.call, $RegExp.prototype.test, /^0b[01]+$/i);
var isOctal = bind.call(Function.call, $RegExp.prototype.test, /^0o[0-7]+$/i);
var regexExec = bind.call(Function.call, $RegExp.prototype.exec);
var nonWS = ['\u0085', '\u200b', '\ufffe'].join('');
var nonWSregex = new $RegExp('[' + nonWS + ']', 'g');
var hasNonWS = bind.call(Function.call, $RegExp.prototype.test, nonWSregex);
var invalidHexLiteral = /^[-+]0x[0-9a-f]+$/i;
var isInvalidHexLiteral = bind.call(Function.call, $RegExp.prototype.test, invalidHexLiteral);
var $charCodeAt = bind.call(Function.call, $String.prototype.charCodeAt);
var toStr = bind.call(Function.call, Object.prototype.toString);
var $NumberValueOf = bind.call(Function.call, GetIntrinsic('%NumberPrototype%').valueOf);
var $BooleanValueOf = bind.call(Function.call, GetIntrinsic('%BooleanPrototype%').valueOf);
var $StringValueOf = bind.call(Function.call, GetIntrinsic('%StringPrototype%').valueOf);
var $DateValueOf = bind.call(Function.call, GetIntrinsic('%DatePrototype%').valueOf);
var $floor = Math.floor;
var $abs = Math.abs;
var $ObjectCreate = Object.create;
var $gOPD = $Object.getOwnPropertyDescriptor;
var $isExtensible = $Object.isExtensible;
var $defineProperty = $Object.defineProperty;
// whitespace from: http://es5.github.io/#x15.5.4.20
// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324
var ws = [
'\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003',
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028',
'\u2029\uFEFF'
].join('');
var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g');
var replace = bind.call(Function.call, $String.prototype.replace);
var trim = function (value) {
return replace(value, trimRegex, '');
};
var ES5 = __webpack_require__(360);
var hasRegExpMatcher = __webpack_require__(362);
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-operations
var ES6 = assign(assign({}, ES5), {
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args
Call: function Call(F, V) {
var args = arguments.length > 2 ? arguments[2] : [];
if (!this.IsCallable(F)) {
throw new $TypeError(F + ' is not a function');
}
return F.apply(V, args);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive
ToPrimitive: toPrimitive,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toboolean
// ToBoolean: ES5.ToBoolean,
// https://ecma-international.org/ecma-262/6.0/#sec-tonumber
ToNumber: function ToNumber(argument) {
var value = isPrimitive(argument) ? argument : toPrimitive(argument, $Number);
if (typeof value === 'symbol') {
throw new $TypeError('Cannot convert a Symbol value to a number');
}
if (typeof value === 'string') {
if (isBinary(value)) {
return this.ToNumber(parseInteger(strSlice(value, 2), 2));
} else if (isOctal(value)) {
return this.ToNumber(parseInteger(strSlice(value, 2), 8));
} else if (hasNonWS(value) || isInvalidHexLiteral(value)) {
return NaN;
} else {
var trimmed = trim(value);
if (trimmed !== value) {
return this.ToNumber(trimmed);
}
}
}
return $Number(value);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tointeger
// ToInteger: ES5.ToNumber,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint32
// ToInt32: ES5.ToInt32,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32
// ToUint32: ES5.ToUint32,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint16
ToInt16: function ToInt16(argument) {
var int16bit = this.ToUint16(argument);
return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint16
// ToUint16: ES5.ToUint16,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint8
ToInt8: function ToInt8(argument) {
var int8bit = this.ToUint8(argument);
return int8bit >= 0x80 ? int8bit - 0x100 : int8bit;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8
ToUint8: function ToUint8(argument) {
var number = this.ToNumber(argument);
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }
var posInt = sign(number) * $floor($abs(number));
return mod(posInt, 0x100);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp
ToUint8Clamp: function ToUint8Clamp(argument) {
var number = this.ToNumber(argument);
if ($isNaN(number) || number <= 0) { return 0; }
if (number >= 0xFF) { return 0xFF; }
var f = $floor(argument);
if (f + 0.5 < number) { return f + 1; }
if (number < f + 0.5) { return f; }
if (f % 2 !== 0) { return f + 1; }
return f;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring
ToString: function ToString(argument) {
if (typeof argument === 'symbol') {
throw new $TypeError('Cannot convert a Symbol value to a string');
}
return $String(argument);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject
ToObject: function ToObject(value) {
this.RequireObjectCoercible(value);
return $Object(value);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey
ToPropertyKey: function ToPropertyKey(argument) {
var key = this.ToPrimitive(argument, $String);
return typeof key === 'symbol' ? key : this.ToString(key);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
ToLength: function ToLength(argument) {
var len = this.ToInteger(argument);
if (len <= 0) { return 0; } // includes converting -0 to +0
if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
return len;
},
// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring
CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) {
if (toStr(argument) !== '[object String]') {
throw new $TypeError('must be a string');
}
if (argument === '-0') { return -0; }
var n = this.ToNumber(argument);
if (this.SameValue(this.ToString(n), argument)) { return n; }
return void 0;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-requireobjectcoercible
RequireObjectCoercible: ES5.CheckObjectCoercible,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray
IsArray: $Array.isArray || function IsArray(argument) {
return toStr(argument) === '[object Array]';
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iscallable
// IsCallable: ES5.IsCallable,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor
IsConstructor: function IsConstructor(argument) {
return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument`
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o
IsExtensible: Object.preventExtensions
? function IsExtensible(obj) {
if (isPrimitive(obj)) {
return false;
}
return $isExtensible(obj);
}
: function isExtensible(obj) { return true; }, // eslint-disable-line no-unused-vars
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isinteger
IsInteger: function IsInteger(argument) {
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
return false;
}
var abs = $abs(argument);
return $floor(abs) === abs;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ispropertykey
IsPropertyKey: function IsPropertyKey(argument) {
return typeof argument === 'string' || typeof argument === 'symbol';
},
// https://ecma-international.org/ecma-262/6.0/#sec-isregexp
IsRegExp: function IsRegExp(argument) {
if (!argument || typeof argument !== 'object') {
return false;
}
if (hasSymbols) {
var isRegExp = argument[$Symbol.match];
if (typeof isRegExp !== 'undefined') {
return ES5.ToBoolean(isRegExp);
}
}
return hasRegExpMatcher(argument);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevalue
// SameValue: ES5.SameValue,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero
SameValueZero: function SameValueZero(x, y) {
return (x === y) || ($isNaN(x) && $isNaN(y));
},
/**
* 7.3.2 GetV (V, P)
* 1. Assert: IsPropertyKey(P) is true.
* 2. Let O be ToObject(V).
* 3. ReturnIfAbrupt(O).
* 4. Return O.[[Get]](P, V).
*/
GetV: function GetV(V, P) {
// 7.3.2.1
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
// 7.3.2.2-3
var O = this.ToObject(V);
// 7.3.2.4
return O[P];
},
/**
* 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod
* 1. Assert: IsPropertyKey(P) is true.
* 2. Let func be GetV(O, P).
* 3. ReturnIfAbrupt(func).
* 4. If func is either undefined or null, return undefined.
* 5. If IsCallable(func) is false, throw a TypeError exception.
* 6. Return func.
*/
GetMethod: function GetMethod(O, P) {
// 7.3.9.1
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
// 7.3.9.2
var func = this.GetV(O, P);
// 7.3.9.4
if (func == null) {
return void 0;
}
// 7.3.9.5
if (!this.IsCallable(func)) {
throw new $TypeError(P + 'is not a function');
}
// 7.3.9.6
return func;
},
/**
* 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p
* 1. Assert: Type(O) is Object.
* 2. Assert: IsPropertyKey(P) is true.
* 3. Return O.[[Get]](P, O).
*/
Get: function Get(O, P) {
// 7.3.1.1
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
// 7.3.1.2
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
// 7.3.1.3
return O[P];
},
Type: function Type(x) {
if (typeof x === 'symbol') {
return 'Symbol';
}
return ES5.Type(x);
},
// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor
SpeciesConstructor: function SpeciesConstructor(O, defaultConstructor) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
var C = O.constructor;
if (typeof C === 'undefined') {
return defaultConstructor;
}
if (this.Type(C) !== 'Object') {
throw new $TypeError('O.constructor is not an Object');
}
var S = hasSymbols && $Symbol.species ? C[$Symbol.species] : void 0;
if (S == null) {
return defaultConstructor;
}
if (this.IsConstructor(S)) {
return S;
}
throw new $TypeError('no constructor found');
},
// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor
CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) {
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) {
if (!has(Desc, '[[Value]]')) {
Desc['[[Value]]'] = void 0;
}
if (!has(Desc, '[[Writable]]')) {
Desc['[[Writable]]'] = false;
}
} else {
if (!has(Desc, '[[Get]]')) {
Desc['[[Get]]'] = void 0;
}
if (!has(Desc, '[[Set]]')) {
Desc['[[Set]]'] = void 0;
}
}
if (!has(Desc, '[[Enumerable]]')) {
Desc['[[Enumerable]]'] = false;
}
if (!has(Desc, '[[Configurable]]')) {
Desc['[[Configurable]]'] = false;
}
return Desc;
},
// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw
Set: function Set(O, P, V, Throw) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('P must be a Property Key');
}
if (this.Type(Throw) !== 'Boolean') {
throw new $TypeError('Throw must be a Boolean');
}
if (Throw) {
O[P] = V;
return true;
} else {
try {
O[P] = V;
} catch (e) {
return false;
}
}
},
// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty
HasOwnProperty: function HasOwnProperty(O, P) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('P must be a Property Key');
}
return has(O, P);
},
// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty
HasProperty: function HasProperty(O, P) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('P must be a Property Key');
}
return P in O;
},
// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable
IsConcatSpreadable: function IsConcatSpreadable(O) {
if (this.Type(O) !== 'Object') {
return false;
}
if (hasSymbols && typeof $Symbol.isConcatSpreadable === 'symbol') {
var spreadable = this.Get(O, Symbol.isConcatSpreadable);
if (typeof spreadable !== 'undefined') {
return this.ToBoolean(spreadable);
}
}
return this.IsArray(O);
},
// https://ecma-international.org/ecma-262/6.0/#sec-invoke
Invoke: function Invoke(O, P) {
if (!this.IsPropertyKey(P)) {
throw new $TypeError('P must be a Property Key');
}
var argumentsList = arraySlice(arguments, 2);
var func = this.GetV(O, P);
return this.Call(func, O, argumentsList);
},
// https://ecma-international.org/ecma-262/6.0/#sec-getiterator
GetIterator: function GetIterator(obj, method) {
if (!hasSymbols) {
throw new SyntaxError('ES.GetIterator depends on native iterator support.');
}
var actualMethod = method;
if (arguments.length < 2) {
actualMethod = this.GetMethod(obj, $Symbol.iterator);
}
var iterator = this.Call(actualMethod, obj);
if (this.Type(iterator) !== 'Object') {
throw new $TypeError('iterator must return an object');
}
return iterator;
},
// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext
IteratorNext: function IteratorNext(iterator, value) {
var result = this.Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]);
if (this.Type(result) !== 'Object') {
throw new $TypeError('iterator next must return an object');
}
return result;
},
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete
IteratorComplete: function IteratorComplete(iterResult) {
if (this.Type(iterResult) !== 'Object') {
throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
}
return this.ToBoolean(this.Get(iterResult, 'done'));
},
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue
IteratorValue: function IteratorValue(iterResult) {
if (this.Type(iterResult) !== 'Object') {
throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
}
return this.Get(iterResult, 'value');
},
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep
IteratorStep: function IteratorStep(iterator) {
var result = this.IteratorNext(iterator);
var done = this.IteratorComplete(result);
return done === true ? false : result;
},
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose
IteratorClose: function IteratorClose(iterator, completion) {
if (this.Type(iterator) !== 'Object') {
throw new $TypeError('Assertion failed: Type(iterator) is not Object');
}
if (!this.IsCallable(completion)) {
throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record');
}
var completionThunk = completion;
var iteratorReturn = this.GetMethod(iterator, 'return');
if (typeof iteratorReturn === 'undefined') {
return completionThunk();
}
var completionRecord;
try {
var innerResult = this.Call(iteratorReturn, iterator, []);
} catch (e) {
// if we hit here, then "e" is the innerResult completion that needs re-throwing
// if the completion is of type "throw", this will throw.
completionRecord = completionThunk();
completionThunk = null; // ensure it's not called twice.
// if not, then return the innerResult completion
throw e;
}
completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does
completionThunk = null; // ensure it's not called twice.
if (this.Type(innerResult) !== 'Object') {
throw new $TypeError('iterator .return must return an object');
}
return completionRecord;
},
// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject
CreateIterResultObject: function CreateIterResultObject(value, done) {
if (this.Type(done) !== 'Boolean') {
throw new $TypeError('Assertion failed: Type(done) is not Boolean');
}
return {
value: value,
done: done
};
},
// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec
RegExpExec: function RegExpExec(R, S) {
if (this.Type(R) !== 'Object') {
throw new $TypeError('R must be an Object');
}
if (this.Type(S) !== 'String') {
throw new $TypeError('S must be a String');
}
var exec = this.Get(R, 'exec');
if (this.IsCallable(exec)) {
var result = this.Call(exec, R, [S]);
if (result === null || this.Type(result) === 'Object') {
return result;
}
throw new $TypeError('"exec" method must return `null` or an Object');
}
return regexExec(R, S);
},
// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate
ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) {
if (!this.IsInteger(length) || length < 0) {
throw new $TypeError('Assertion failed: length must be an integer >= 0');
}
var len = length === 0 ? 0 : length;
var C;
var isArray = this.IsArray(originalArray);
if (isArray) {
C = this.Get(originalArray, 'constructor');
// TODO: figure out how to make a cross-realm normal Array, a same-realm Array
// if (this.IsConstructor(C)) {
// if C is another realm's Array, C = undefined
// Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
// }
if (this.Type(C) === 'Object' && hasSymbols && $Symbol.species) {
C = this.Get(C, $Symbol.species);
if (C === null) {
C = void 0;
}
}
}
if (typeof C === 'undefined') {
return $Array(len);
}
if (!this.IsConstructor(C)) {
throw new $TypeError('C must be a constructor');
}
return new C(len); // this.Construct(C, len);
},
CreateDataProperty: function CreateDataProperty(O, P, V) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var oldDesc = $gOPD(O, P);
var extensible = oldDesc || (typeof $isExtensible !== 'function' || $isExtensible(O));
var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable);
if (immutable || !extensible) {
return false;
}
var newDesc = {
configurable: true,
enumerable: true,
value: V,
writable: true
};
$defineProperty(O, P, newDesc);
return true;
},
// https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow
CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var success = this.CreateDataProperty(O, P, V);
if (!success) {
throw new $TypeError('unable to create data property');
}
return success;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate
ObjectCreate: function ObjectCreate(proto, internalSlotsList) {
if (proto !== null && this.Type(proto) !== 'Object') {
throw new $TypeError('Assertion failed: proto must be null or an object');
}
var slots = arguments.length < 2 ? [] : internalSlotsList;
if (slots.length > 0) {
throw new $SyntaxError('es-abstract does not yet support internal slots');
}
if (proto === null && !$ObjectCreate) {
throw new $SyntaxError('native Object.create support is required to create null objects');
}
return $ObjectCreate(proto);
},
// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex
AdvanceStringIndex: function AdvanceStringIndex(S, index, unicode) {
if (this.Type(S) !== 'String') {
throw new $TypeError('S must be a String');
}
if (!this.IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {
throw new $TypeError('Assertion failed: length must be an integer >= 0 and <= 2**53');
}
if (this.Type(unicode) !== 'Boolean') {
throw new $TypeError('Assertion failed: unicode must be a Boolean');
}
if (!unicode) {
return index + 1;
}
var length = S.length;
if ((index + 1) >= length) {
return index + 1;
}
var first = $charCodeAt(S, index);
if (first < 0xD800 || first > 0xDBFF) {
return index + 1;
}
var second = $charCodeAt(S, index + 1);
if (second < 0xDC00 || second > 0xDFFF) {
return index + 1;
}
return index + 2;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty
CreateMethodProperty: function CreateMethodProperty(O, P, V) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var newDesc = {
configurable: true,
enumerable: false,
value: V,
writable: true
};
return !!$defineProperty(O, P, newDesc);
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow
DefinePropertyOrThrow: function DefinePropertyOrThrow(O, P, desc) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
return !!$defineProperty(O, P, desc);
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow
DeletePropertyOrThrow: function DeletePropertyOrThrow(O, P) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var success = delete O[P];
if (!success) {
throw new TypeError('Attempt to delete property failed.');
}
return success;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames
EnumerableOwnNames: function EnumerableOwnNames(O) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
return keys(O);
},
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object
thisNumberValue: function thisNumberValue(value) {
if (this.Type(value) === 'Number') {
return value;
}
return $NumberValueOf(value);
},
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object
thisBooleanValue: function thisBooleanValue(value) {
if (this.Type(value) === 'Boolean') {
return value;
}
return $BooleanValueOf(value);
},
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object
thisStringValue: function thisStringValue(value) {
if (this.Type(value) === 'String') {
return value;
}
return $StringValueOf(value);
},
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object
thisTimeValue: function thisTimeValue(value) {
return $DateValueOf(value);
}
});
delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible
module.exports = ES6;
/***/ }),
/* 357 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(358);
/***/ }),
/* 358 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
var isPrimitive = __webpack_require__(221);
var isCallable = __webpack_require__(179);
var isDate = __webpack_require__(212);
var isSymbol = __webpack_require__(178);
var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {
if (typeof O === 'undefined' || O === null) {
throw new TypeError('Cannot call method on ' + O);
}
if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {
throw new TypeError('hint must be "string" or "number"');
}
var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
var method, result, i;
for (i = 0; i < methodNames.length; ++i) {
method = O[methodNames[i]];
if (isCallable(method)) {
result = method.call(O);
if (isPrimitive(result)) {
return result;
}
}
}
throw new TypeError('No default value');
};
var GetMethod = function GetMethod(O, P) {
var func = O[P];
if (func !== null && typeof func !== 'undefined') {
if (!isCallable(func)) {
throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');
}
return func;
}
return void 0;
};
// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive
module.exports = function ToPrimitive(input) {
if (isPrimitive(input)) {
return input;
}
var hint = 'default';
if (arguments.length > 1) {
if (arguments[1] === String) {
hint = 'string';
} else if (arguments[1] === Number) {
hint = 'number';
}
}
var exoticToPrim;
if (hasSymbols) {
if (Symbol.toPrimitive) {
exoticToPrim = GetMethod(input, Symbol.toPrimitive);
} else if (isSymbol(input)) {
exoticToPrim = Symbol.prototype.valueOf;
}
}
if (typeof exoticToPrim !== 'undefined') {
var result = exoticToPrim.call(input, hint);
if (isPrimitive(result)) {
return result;
}
throw new TypeError('unable to convert exotic object to primitive');
}
if (hint === 'default' && (isDate(input) || isSymbol(input))) {
hint = 'string';
}
return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);
};
/***/ }),
/* 359 */
/***/ (function(module, exports) {
module.exports = function isPrimitive(value) {
return value === null || (typeof value !== 'function' && typeof value !== 'object');
};
/***/ }),
/* 360 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(180);
var $Object = GetIntrinsic('%Object%');
var $TypeError = GetIntrinsic('%TypeError%');
var $String = GetIntrinsic('%String%');
var assertRecord = __webpack_require__(222);
var $isNaN = __webpack_require__(223);
var $isFinite = __webpack_require__(224);
var sign = __webpack_require__(226);
var mod = __webpack_require__(227);
var IsCallable = __webpack_require__(179);
var toPrimitive = __webpack_require__(361);
var has = __webpack_require__(81);
// https://es5.github.io/#x9
var ES5 = {
ToPrimitive: toPrimitive,
ToBoolean: function ToBoolean(value) {
return !!value;
},
ToNumber: function ToNumber(value) {
return +value; // eslint-disable-line no-implicit-coercion
},
ToInteger: function ToInteger(value) {
var number = this.ToNumber(value);
if ($isNaN(number)) { return 0; }
if (number === 0 || !$isFinite(number)) { return number; }
return sign(number) * Math.floor(Math.abs(number));
},
ToInt32: function ToInt32(x) {
return this.ToNumber(x) >> 0;
},
ToUint32: function ToUint32(x) {
return this.ToNumber(x) >>> 0;
},
ToUint16: function ToUint16(value) {
var number = this.ToNumber(value);
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }
var posInt = sign(number) * Math.floor(Math.abs(number));
return mod(posInt, 0x10000);
},
ToString: function ToString(value) {
return $String(value);
},
ToObject: function ToObject(value) {
this.CheckObjectCoercible(value);
return $Object(value);
},
CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) {
/* jshint eqnull:true */
if (value == null) {
throw new $TypeError(optMessage || 'Cannot call method on ' + value);
}
return value;
},
IsCallable: IsCallable,
SameValue: function SameValue(x, y) {
if (x === y) { // 0 === -0, but they are not identical.
if (x === 0) { return 1 / x === 1 / y; }
return true;
}
return $isNaN(x) && $isNaN(y);
},
// https://www.ecma-international.org/ecma-262/5.1/#sec-8
Type: function Type(x) {
if (x === null) {
return 'Null';
}
if (typeof x === 'undefined') {
return 'Undefined';
}
if (typeof x === 'function' || typeof x === 'object') {
return 'Object';
}
if (typeof x === 'number') {
return 'Number';
}
if (typeof x === 'boolean') {
return 'Boolean';
}
if (typeof x === 'string') {
return 'String';
}
},
// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
IsPropertyDescriptor: function IsPropertyDescriptor(Desc) {
if (this.Type(Desc) !== 'Object') {
return false;
}
var allowed = {
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Get]]': true,
'[[Set]]': true,
'[[Value]]': true,
'[[Writable]]': true
};
for (var key in Desc) { // eslint-disable-line
if (has(Desc, key) && !allowed[key]) {
return false;
}
}
var isData = has(Desc, '[[Value]]');
var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');
if (isData && IsAccessor) {
throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
}
return true;
},
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1
IsAccessorDescriptor: function IsAccessorDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
return false;
}
return true;
},
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2
IsDataDescriptor: function IsDataDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
return false;
}
return true;
},
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3
IsGenericDescriptor: function IsGenericDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) {
return true;
}
return false;
},
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4
FromPropertyDescriptor: function FromPropertyDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return Desc;
}
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
if (this.IsDataDescriptor(Desc)) {
return {
value: Desc['[[Value]]'],
writable: !!Desc['[[Writable]]'],
enumerable: !!Desc['[[Enumerable]]'],
configurable: !!Desc['[[Configurable]]']
};
} else if (this.IsAccessorDescriptor(Desc)) {
return {
get: Desc['[[Get]]'],
set: Desc['[[Set]]'],
enumerable: !!Desc['[[Enumerable]]'],
configurable: !!Desc['[[Configurable]]']
};
} else {
throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor');
}
},
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5
ToPropertyDescriptor: function ToPropertyDescriptor(Obj) {
if (this.Type(Obj) !== 'Object') {
throw new $TypeError('ToPropertyDescriptor requires an object');
}
var desc = {};
if (has(Obj, 'enumerable')) {
desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable);
}
if (has(Obj, 'configurable')) {
desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable);
}
if (has(Obj, 'value')) {
desc['[[Value]]'] = Obj.value;
}
if (has(Obj, 'writable')) {
desc['[[Writable]]'] = this.ToBoolean(Obj.writable);
}
if (has(Obj, 'get')) {
var getter = Obj.get;
if (typeof getter !== 'undefined' && !this.IsCallable(getter)) {
throw new TypeError('getter must be a function');
}
desc['[[Get]]'] = getter;
}
if (has(Obj, 'set')) {
var setter = Obj.set;
if (typeof setter !== 'undefined' && !this.IsCallable(setter)) {
throw new $TypeError('setter must be a function');
}
desc['[[Set]]'] = setter;
}
if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
}
return desc;
}
};
module.exports = ES5;
/***/ }),
/* 361 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toStr = Object.prototype.toString;
var isPrimitive = __webpack_require__(221);
var isCallable = __webpack_require__(179);
// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8
var ES5internalSlots = {
'[[DefaultValue]]': function (O) {
var actualHint;
if (arguments.length > 1) {
actualHint = arguments[1];
} else {
actualHint = toStr.call(O) === '[object Date]' ? String : Number;
}
if (actualHint === String || actualHint === Number) {
var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
var value, i;
for (i = 0; i < methods.length; ++i) {
if (isCallable(O[methods[i]])) {
value = O[methods[i]]();
if (isPrimitive(value)) {
return value;
}
}
}
throw new TypeError('No default value');
}
throw new TypeError('invalid [[DefaultValue]] hint supplied');
}
};
// http://ecma-international.org/ecma-262/5.1/#sec-9.1
module.exports = function ToPrimitive(input) {
if (isPrimitive(input)) {
return input;
}
if (arguments.length > 1) {
return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]);
}
return ES5internalSlots['[[DefaultValue]]'](input);
};
/***/ }),
/* 362 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var has = __webpack_require__(81);
var regexExec = RegExp.prototype.exec;
var gOPD = Object.getOwnPropertyDescriptor;
var tryRegexExecCall = function tryRegexExec(value) {
try {
var lastIndex = value.lastIndex;
value.lastIndex = 0;
regexExec.call(value);
return true;
} catch (e) {
return false;
} finally {
value.lastIndex = lastIndex;
}
};
var toStr = Object.prototype.toString;
var regexClass = '[object RegExp]';
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
module.exports = function isRegex(value) {
if (!value || typeof value !== 'object') {
return false;
}
if (!hasToStringTag) {
return toStr.call(value) === regexClass;
}
var descriptor = gOPD(value, 'lastIndex');
var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
if (!hasLastIndexDataProperty) {
return false;
}
return tryRegexExecCall(value);
};
/***/ }),
/* 363 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var getPolyfill = __webpack_require__(228);
var define = __webpack_require__(91);
module.exports = function shimValues() {
var polyfill = getPolyfill();
define(Object, { values: polyfill }, {
values: function testValues() {
return Object.values !== polyfill;
}
});
return polyfill;
};
/***/ }),
/* 364 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getVisibleDays;
var _moment = __webpack_require__(43);
var _moment2 = _interopRequireDefault(_moment);
var _toISOMonthString = __webpack_require__(182);
var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function getVisibleDays(month, numberOfMonths, enableOutsideDays, withoutTransitionMonths) {
if (!_moment2['default'].isMoment(month)) return {};
var visibleDaysByMonth = {};
var currentMonth = withoutTransitionMonths ? month.clone() : month.clone().subtract(1, 'month');
for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) {
var visibleDays = [];
// set utc offset to get correct dates in future (when timezone changes)
var baseDate = currentMonth.clone();
var firstOfMonth = baseDate.clone().startOf('month').hour(12);
var lastOfMonth = baseDate.clone().endOf('month').hour(12);
var currentDay = firstOfMonth.clone();
// days belonging to the previous month
if (enableOutsideDays) {
for (var j = 0; j < currentDay.weekday(); j += 1) {
var prevDay = currentDay.clone().subtract(j + 1, 'day');
visibleDays.unshift(prevDay);
}
}
while (currentDay < lastOfMonth) {
visibleDays.push(currentDay.clone());
currentDay.add(1, 'day');
}
if (enableOutsideDays) {
// weekday() returns the index of the day of the week according to the locale
// this means if the week starts on Monday, weekday() will return 0 for a Monday date, not 1
if (currentDay.weekday() !== 0) {
// days belonging to the next month
for (var k = currentDay.weekday(), count = 0; k < 7; k += 1, count += 1) {
var nextDay = currentDay.clone().add(count, 'day');
visibleDays.push(nextDay);
}
}
}
visibleDaysByMonth[(0, _toISOMonthString2['default'])(currentMonth)] = visibleDays;
currentMonth = currentMonth.clone().add(1, 'month');
}
return visibleDaysByMonth;
}
/***/ }),
/* 365 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PureDayPicker = exports.defaultProps = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _object = __webpack_require__(82);
var _object2 = _interopRequireDefault(_object);
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(33);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactAddonsShallowCompare = __webpack_require__(137);
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _airbnbPropTypes = __webpack_require__(75);
var _reactWithStyles = __webpack_require__(99);
var _moment = __webpack_require__(43);
var _moment2 = _interopRequireDefault(_moment);
var _throttle = __webpack_require__(372);
var _throttle2 = _interopRequireDefault(_throttle);
var _isTouchDevice = __webpack_require__(229);
var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
var _reactOutsideClickHandler = __webpack_require__(382);
var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler);
var _defaultPhrases = __webpack_require__(97);
var _getPhrasePropTypes = __webpack_require__(98);
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _CalendarMonthGrid = __webpack_require__(386);
var _CalendarMonthGrid2 = _interopRequireDefault(_CalendarMonthGrid);
var _DayPickerNavigation = __webpack_require__(396);
var _DayPickerNavigation2 = _interopRequireDefault(_DayPickerNavigation);
var _DayPickerKeyboardShortcuts = __webpack_require__(401);
var _DayPickerKeyboardShortcuts2 = _interopRequireDefault(_DayPickerKeyboardShortcuts);
var _getNumberOfCalendarMonthWeeks = __webpack_require__(404);
var _getNumberOfCalendarMonthWeeks2 = _interopRequireDefault(_getNumberOfCalendarMonthWeeks);
var _getCalendarMonthWidth = __webpack_require__(244);
var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
var _calculateDimension = __webpack_require__(243);
var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
var _getActiveElement = __webpack_require__(405);
var _getActiveElement2 = _interopRequireDefault(_getActiveElement);
var _isDayVisible = __webpack_require__(233);
var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
var _ModifiersShape = __webpack_require__(148);
var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
var _ScrollableOrientationShape = __webpack_require__(136);
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _DayOfWeekShape = __webpack_require__(147);
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _CalendarInfoPositionShape = __webpack_require__(235);
var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
var _constants = __webpack_require__(66);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var MONTH_PADDING = 23;
var PREV_TRANSITION = 'prev';
var NEXT_TRANSITION = 'next';
var MONTH_SELECTION_TRANSITION = 'month_selection';
var YEAR_SELECTION_TRANSITION = 'year_selection';
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
// calendar presentation props
enableOutsideDays: _propTypes2['default'].bool,
numberOfMonths: _propTypes2['default'].number,
orientation: _ScrollableOrientationShape2['default'],
withPortal: _propTypes2['default'].bool,
onOutsideClick: _propTypes2['default'].func,
hidden: _propTypes2['default'].bool,
initialVisibleMonth: _propTypes2['default'].func,
firstDayOfWeek: _DayOfWeekShape2['default'],
renderCalendarInfo: _propTypes2['default'].func,
calendarInfoPosition: _CalendarInfoPositionShape2['default'],
hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
daySize: _airbnbPropTypes.nonNegativeInteger,
isRTL: _propTypes2['default'].bool,
verticalHeight: _airbnbPropTypes.nonNegativeInteger,
noBorder: _propTypes2['default'].bool,
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
// navigation props
navPrev: _propTypes2['default'].node,
navNext: _propTypes2['default'].node,
noNavButtons: _propTypes2['default'].bool,
onPrevMonthClick: _propTypes2['default'].func,
onNextMonthClick: _propTypes2['default'].func,
onMonthChange: _propTypes2['default'].func,
onYearChange: _propTypes2['default'].func,
onMultiplyScrollableMonths: _propTypes2['default'].func, // VERTICAL_SCROLLABLE daypickers only
// month props
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
// day props
modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
onDayClick: _propTypes2['default'].func,
onDayMouseEnter: _propTypes2['default'].func,
onDayMouseLeave: _propTypes2['default'].func,
// accessibility props
isFocused: _propTypes2['default'].bool,
getFirstFocusableDay: _propTypes2['default'].func,
onBlur: _propTypes2['default'].func,
showKeyboardShortcuts: _propTypes2['default'].bool,
// internationalization
monthFormat: _propTypes2['default'].string,
weekDayFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string
}));
var defaultProps = exports.defaultProps = {
// calendar presentation props
enableOutsideDays: false,
numberOfMonths: 2,
orientation: _constants.HORIZONTAL_ORIENTATION,
withPortal: false,
onOutsideClick: function () {
function onOutsideClick() {}
return onOutsideClick;
}(),
hidden: false,
initialVisibleMonth: function () {
function initialVisibleMonth() {
return (0, _moment2['default'])();
}
return initialVisibleMonth;
}(),
firstDayOfWeek: null,
renderCalendarInfo: null,
calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
hideKeyboardShortcutsPanel: false,
daySize: _constants.DAY_SIZE,
isRTL: false,
verticalHeight: null,
noBorder: false,
transitionDuration: undefined,
verticalBorderSpacing: undefined,
horizontalMonthPadding: 13,
// navigation props
navPrev: null,
navNext: null,
noNavButtons: false,
onPrevMonthClick: function () {
function onPrevMonthClick() {}
return onPrevMonthClick;
}(),
onNextMonthClick: function () {
function onNextMonthClick() {}
return onNextMonthClick;
}(),
onMonthChange: function () {
function onMonthChange() {}
return onMonthChange;
}(),
onYearChange: function () {
function onYearChange() {}
return onYearChange;
}(),
onMultiplyScrollableMonths: function () {
function onMultiplyScrollableMonths() {}
return onMultiplyScrollableMonths;
}(),
// month props
renderMonthText: null,
renderMonthElement: null,
// day props
modifiers: {},
renderCalendarDay: undefined,
renderDayContents: null,
onDayClick: function () {
function onDayClick() {}
return onDayClick;
}(),
onDayMouseEnter: function () {
function onDayMouseEnter() {}
return onDayMouseEnter;
}(),
onDayMouseLeave: function () {
function onDayMouseLeave() {}
return onDayMouseLeave;
}(),
// accessibility props
isFocused: false,
getFirstFocusableDay: null,
onBlur: function () {
function onBlur() {}
return onBlur;
}(),
showKeyboardShortcuts: false,
// internationalization
monthFormat: 'MMMM YYYY',
weekDayFormat: 'dd',
phrases: _defaultPhrases.DayPickerPhrases,
dayAriaLabelFormat: undefined
};
var DayPicker = function (_React$Component) {
_inherits(DayPicker, _React$Component);
function DayPicker(props) {
_classCallCheck(this, DayPicker);
var _this = _possibleConstructorReturn(this, (DayPicker.__proto__ || Object.getPrototypeOf(DayPicker)).call(this, props));
var currentMonth = props.hidden ? (0, _moment2['default'])() : props.initialVisibleMonth();
var focusedDate = currentMonth.clone().startOf('month');
if (props.getFirstFocusableDay) {
focusedDate = props.getFirstFocusableDay(currentMonth);
}
var horizontalMonthPadding = props.horizontalMonthPadding;
var translationValue = props.isRTL && _this.isHorizontal() ? -(0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding) : 0;
_this.hasSetInitialVisibleMonth = !props.hidden;
_this.state = {
currentMonth: currentMonth,
monthTransition: null,
translationValue: translationValue,
scrollableMonthMultiple: 1,
calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding),
focusedDate: !props.hidden || props.isFocused ? focusedDate : null,
nextFocusedDate: null,
showKeyboardShortcuts: props.showKeyboardShortcuts,
onKeyboardShortcutsPanelClose: function () {
function onKeyboardShortcutsPanelClose() {}
return onKeyboardShortcutsPanelClose;
}(),
isTouchDevice: (0, _isTouchDevice2['default'])(),
withMouseInteractions: true,
calendarInfoWidth: 0,
monthTitleHeight: null,
hasSetHeight: false
};
_this.setCalendarMonthWeeks(currentMonth);
_this.calendarMonthGridHeight = 0;
_this.setCalendarInfoWidthTimeout = null;
_this.onKeyDown = _this.onKeyDown.bind(_this);
_this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 200, { trailing: false });
_this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
_this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
_this.onMonthChange = _this.onMonthChange.bind(_this);
_this.onYearChange = _this.onYearChange.bind(_this);
_this.multiplyScrollableMonths = _this.multiplyScrollableMonths.bind(_this);
_this.updateStateAfterMonthTransition = _this.updateStateAfterMonthTransition.bind(_this);
_this.openKeyboardShortcutsPanel = _this.openKeyboardShortcutsPanel.bind(_this);
_this.closeKeyboardShortcutsPanel = _this.closeKeyboardShortcutsPanel.bind(_this);
_this.setCalendarInfoRef = _this.setCalendarInfoRef.bind(_this);
_this.setContainerRef = _this.setContainerRef.bind(_this);
_this.setTransitionContainerRef = _this.setTransitionContainerRef.bind(_this);
_this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
return _this;
}
_createClass(DayPicker, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
var currentMonth = this.state.currentMonth;
if (this.calendarInfo) {
this.setState({
isTouchDevice: (0, _isTouchDevice2['default'])(),
calendarInfoWidth: (0, _calculateDimension2['default'])(this.calendarInfo, 'width', true, true)
});
} else {
this.setState({ isTouchDevice: (0, _isTouchDevice2['default'])() });
}
this.setCalendarMonthWeeks(currentMonth);
}
return componentDidMount;
}()
}, {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var hidden = nextProps.hidden,
isFocused = nextProps.isFocused,
showKeyboardShortcuts = nextProps.showKeyboardShortcuts,
onBlur = nextProps.onBlur,
renderMonthText = nextProps.renderMonthText,
horizontalMonthPadding = nextProps.horizontalMonthPadding;
var currentMonth = this.state.currentMonth;
if (!hidden) {
if (!this.hasSetInitialVisibleMonth) {
this.hasSetInitialVisibleMonth = true;
this.setState({
currentMonth: nextProps.initialVisibleMonth()
});
}
}
var _props = this.props,
daySize = _props.daySize,
prevIsFocused = _props.isFocused,
prevRenderMonthText = _props.renderMonthText;
if (nextProps.daySize !== daySize) {
this.setState({
calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(nextProps.daySize, horizontalMonthPadding)
});
}
if (isFocused !== prevIsFocused) {
if (isFocused) {
var focusedDate = this.getFocusedDay(currentMonth);
var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
if (nextProps.showKeyboardShortcuts) {
// the ? shortcut came from the input and we should return input there once it is close
onKeyboardShortcutsPanelClose = onBlur;
}
this.setState({
showKeyboardShortcuts: showKeyboardShortcuts,
onKeyboardShortcutsPanelClose: onKeyboardShortcutsPanelClose,
focusedDate: focusedDate,
withMouseInteractions: false
});
} else {
this.setState({ focusedDate: null });
}
}
if (renderMonthText !== prevRenderMonthText) {
this.setState({
monthTitleHeight: null
});
}
}
return componentWillReceiveProps;
}()
}, {
key: 'shouldComponentUpdate',
value: function () {
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
}
return shouldComponentUpdate;
}()
}, {
key: 'componentWillUpdate',
value: function () {
function componentWillUpdate() {
var _this2 = this;
var transitionDuration = this.props.transitionDuration;
// Calculating the dimensions trigger a DOM repaint which
// breaks the CSS transition.
// The setTimeout will wait until the transition ends.
if (this.calendarInfo) {
this.setCalendarInfoWidthTimeout = setTimeout(function () {
var calendarInfoWidth = _this2.state.calendarInfoWidth;
var calendarInfoPanelWidth = (0, _calculateDimension2['default'])(_this2.calendarInfo, 'width', true, true);
if (calendarInfoWidth !== calendarInfoPanelWidth) {
_this2.setState({
calendarInfoWidth: calendarInfoPanelWidth
});
}
}, transitionDuration);
}
}
return componentWillUpdate;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate(prevProps) {
var _props2 = this.props,
orientation = _props2.orientation,
daySize = _props2.daySize,
isFocused = _props2.isFocused,
numberOfMonths = _props2.numberOfMonths;
var _state = this.state,
focusedDate = _state.focusedDate,
monthTitleHeight = _state.monthTitleHeight;
if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) {
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
this.adjustDayPickerHeight(newMonthHeight);
}
if (!prevProps.isFocused && isFocused && !focusedDate) {
this.container.focus();
}
}
return componentDidUpdate;
}()
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
clearTimeout(this.setCalendarInfoWidthTimeout);
}
return componentWillUnmount;
}()
}, {
key: 'onKeyDown',
value: function () {
function onKeyDown(e) {
e.stopPropagation();
if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) {
this.throttledKeyDown(e);
}
}
return onKeyDown;
}()
}, {
key: 'onFinalKeyDown',
value: function () {
function onFinalKeyDown(e) {
this.setState({ withMouseInteractions: false });
var _props3 = this.props,
onBlur = _props3.onBlur,
isRTL = _props3.isRTL;
var _state2 = this.state,
focusedDate = _state2.focusedDate,
showKeyboardShortcuts = _state2.showKeyboardShortcuts;
if (!focusedDate) return;
var newFocusedDate = focusedDate.clone();
var didTransitionMonth = false;
// focus might be anywhere when the keyboard shortcuts panel is opened so we want to
// return it to wherever it was before when the panel was opened
var activeElement = (0, _getActiveElement2['default'])();
var onKeyboardShortcutsPanelClose = function () {
function onKeyboardShortcutsPanelClose() {
if (activeElement) activeElement.focus();
}
return onKeyboardShortcutsPanelClose;
}();
switch (e.key) {
case 'ArrowUp':
e.preventDefault();
newFocusedDate.subtract(1, 'week');
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
break;
case 'ArrowLeft':
e.preventDefault();
if (isRTL) {
newFocusedDate.add(1, 'day');
} else {
newFocusedDate.subtract(1, 'day');
}
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
break;
case 'Home':
e.preventDefault();
newFocusedDate.startOf('week');
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
break;
case 'PageUp':
e.preventDefault();
newFocusedDate.subtract(1, 'month');
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
break;
case 'ArrowDown':
e.preventDefault();
newFocusedDate.add(1, 'week');
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
break;
case 'ArrowRight':
e.preventDefault();
if (isRTL) {
newFocusedDate.subtract(1, 'day');
} else {
newFocusedDate.add(1, 'day');
}
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
break;
case 'End':
e.preventDefault();
newFocusedDate.endOf('week');
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
break;
case 'PageDown':
e.preventDefault();
newFocusedDate.add(1, 'month');
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
break;
case '?':
this.openKeyboardShortcutsPanel(onKeyboardShortcutsPanelClose);
break;
case 'Escape':
if (showKeyboardShortcuts) {
this.closeKeyboardShortcutsPanel();
} else {
onBlur();
}
break;
default:
break;
}
// If there was a month transition, do not update the focused date until the transition has
// completed. Otherwise, attempting to focus on a DOM node may interrupt the CSS animation. If
// didTransitionMonth is true, the focusedDate gets updated in #updateStateAfterMonthTransition
if (!didTransitionMonth) {
this.setState({
focusedDate: newFocusedDate
});
}
}
return onFinalKeyDown;
}()
}, {
key: 'onPrevMonthClick',
value: function () {
function onPrevMonthClick(nextFocusedDate, e) {
var _props4 = this.props,
daySize = _props4.daySize,
isRTL = _props4.isRTL,
numberOfMonths = _props4.numberOfMonths;
var _state3 = this.state,
calendarMonthWidth = _state3.calendarMonthWidth,
monthTitleHeight = _state3.monthTitleHeight;
if (e) e.preventDefault();
var translationValue = void 0;
if (this.isVertical()) {
var calendarMonthWeeksHeight = this.calendarMonthWeeks[0] * (daySize - 1);
translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1;
} else if (this.isHorizontal()) {
translationValue = calendarMonthWidth;
if (isRTL) {
translationValue = -2 * calendarMonthWidth;
}
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(0, numberOfMonths);
var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1;
this.adjustDayPickerHeight(newMonthHeight);
}
this.setState({
monthTransition: PREV_TRANSITION,
translationValue: translationValue,
focusedDate: null,
nextFocusedDate: nextFocusedDate
});
}
return onPrevMonthClick;
}()
}, {
key: 'onMonthChange',
value: function () {
function onMonthChange(currentMonth) {
this.setCalendarMonthWeeks(currentMonth);
this.calculateAndSetDayPickerHeight();
// Translation value is a hack to force an invisible transition that
// properly rerenders the CalendarMonthGrid
this.setState({
monthTransition: MONTH_SELECTION_TRANSITION,
translationValue: 0.00001,
focusedDate: null,
nextFocusedDate: currentMonth,
currentMonth: currentMonth
});
}
return onMonthChange;
}()
}, {
key: 'onYearChange',
value: function () {
function onYearChange(currentMonth) {
this.setCalendarMonthWeeks(currentMonth);
this.calculateAndSetDayPickerHeight();
// Translation value is a hack to force an invisible transition that
// properly rerenders the CalendarMonthGrid
this.setState({
monthTransition: YEAR_SELECTION_TRANSITION,
translationValue: 0.0001,
focusedDate: null,
nextFocusedDate: currentMonth,
currentMonth: currentMonth
});
}
return onYearChange;
}()
}, {
key: 'onNextMonthClick',
value: function () {
function onNextMonthClick(nextFocusedDate, e) {
var _props5 = this.props,
isRTL = _props5.isRTL,
numberOfMonths = _props5.numberOfMonths,
daySize = _props5.daySize;
var _state4 = this.state,
calendarMonthWidth = _state4.calendarMonthWidth,
monthTitleHeight = _state4.monthTitleHeight;
if (e) e.preventDefault();
var translationValue = void 0;
if (this.isVertical()) {
var firstVisibleMonthWeeks = this.calendarMonthWeeks[1];
var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1);
translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1);
}
if (this.isHorizontal()) {
translationValue = -calendarMonthWidth;
if (isRTL) {
translationValue = 0;
}
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(2, numberOfMonths + 2);
var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1;
this.adjustDayPickerHeight(newMonthHeight);
}
this.setState({
monthTransition: NEXT_TRANSITION,
translationValue: translationValue,
focusedDate: null,
nextFocusedDate: nextFocusedDate
});
}
return onNextMonthClick;
}()
}, {
key: 'getFirstDayOfWeek',
value: function () {
function getFirstDayOfWeek() {
var firstDayOfWeek = this.props.firstDayOfWeek;
if (firstDayOfWeek == null) {
return _moment2['default'].localeData().firstDayOfWeek();
}
return firstDayOfWeek;
}
return getFirstDayOfWeek;
}()
}, {
key: 'getFirstVisibleIndex',
value: function () {
function getFirstVisibleIndex() {
var orientation = this.props.orientation;
var monthTransition = this.state.monthTransition;
if (orientation === _constants.VERTICAL_SCROLLABLE) return 0;
var firstVisibleMonthIndex = 1;
if (monthTransition === PREV_TRANSITION) {
firstVisibleMonthIndex -= 1;
} else if (monthTransition === NEXT_TRANSITION) {
firstVisibleMonthIndex += 1;
}
return firstVisibleMonthIndex;
}
return getFirstVisibleIndex;
}()
}, {
key: 'getFocusedDay',
value: function () {
function getFocusedDay(newMonth) {
var _props6 = this.props,
getFirstFocusableDay = _props6.getFirstFocusableDay,
numberOfMonths = _props6.numberOfMonths;
var focusedDate = void 0;
if (getFirstFocusableDay) {
focusedDate = getFirstFocusableDay(newMonth);
}
if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) {
focusedDate = newMonth.clone().startOf('month');
}
return focusedDate;
}
return getFocusedDay;
}()
}, {
key: 'setMonthTitleHeight',
value: function () {
function setMonthTitleHeight(monthTitleHeight) {
var _this3 = this;
this.setState({
monthTitleHeight: monthTitleHeight
}, function () {
_this3.calculateAndSetDayPickerHeight();
});
}
return setMonthTitleHeight;
}()
}, {
key: 'setCalendarMonthWeeks',
value: function () {
function setCalendarMonthWeeks(currentMonth) {
var numberOfMonths = this.props.numberOfMonths;
this.calendarMonthWeeks = [];
var month = currentMonth.clone().subtract(1, 'months');
var firstDayOfWeek = this.getFirstDayOfWeek();
for (var i = 0; i < numberOfMonths + 2; i += 1) {
var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek);
this.calendarMonthWeeks.push(numberOfWeeks);
month = month.add(1, 'months');
}
}
return setCalendarMonthWeeks;
}()
}, {
key: 'setContainerRef',
value: function () {
function setContainerRef(ref) {
this.container = ref;
}
return setContainerRef;
}()
}, {
key: 'setCalendarInfoRef',
value: function () {
function setCalendarInfoRef(ref) {
this.calendarInfo = ref;
}
return setCalendarInfoRef;
}()
}, {
key: 'setTransitionContainerRef',
value: function () {
function setTransitionContainerRef(ref) {
this.transitionContainer = ref;
}
return setTransitionContainerRef;
}()
}, {
key: 'maybeTransitionNextMonth',
value: function () {
function maybeTransitionNextMonth(newFocusedDate) {
var numberOfMonths = this.props.numberOfMonths;
var _state5 = this.state,
currentMonth = _state5.currentMonth,
focusedDate = _state5.focusedDate;
var newFocusedDateMonth = newFocusedDate.month();
var focusedDateMonth = focusedDate.month();
var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
this.onNextMonthClick(newFocusedDate);
return true;
}
return false;
}
return maybeTransitionNextMonth;
}()
}, {
key: 'maybeTransitionPrevMonth',
value: function () {
function maybeTransitionPrevMonth(newFocusedDate) {
var numberOfMonths = this.props.numberOfMonths;
var _state6 = this.state,
currentMonth = _state6.currentMonth,
focusedDate = _state6.focusedDate;
var newFocusedDateMonth = newFocusedDate.month();
var focusedDateMonth = focusedDate.month();
var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
this.onPrevMonthClick(newFocusedDate);
return true;
}
return false;
}
return maybeTransitionPrevMonth;
}()
}, {
key: 'multiplyScrollableMonths',
value: function () {
function multiplyScrollableMonths(e) {
var onMultiplyScrollableMonths = this.props.onMultiplyScrollableMonths;
if (e) e.preventDefault();
if (onMultiplyScrollableMonths) onMultiplyScrollableMonths(e);
this.setState(function (_ref) {
var scrollableMonthMultiple = _ref.scrollableMonthMultiple;
return {
scrollableMonthMultiple: scrollableMonthMultiple + 1
};
});
}
return multiplyScrollableMonths;
}()
}, {
key: 'isHorizontal',
value: function () {
function isHorizontal() {
var orientation = this.props.orientation;
return orientation === _constants.HORIZONTAL_ORIENTATION;
}
return isHorizontal;
}()
}, {
key: 'isVertical',
value: function () {
function isVertical() {
var orientation = this.props.orientation;
return orientation === _constants.VERTICAL_ORIENTATION || orientation === _constants.VERTICAL_SCROLLABLE;
}
return isVertical;
}()
}, {
key: 'updateStateAfterMonthTransition',
value: function () {
function updateStateAfterMonthTransition() {
var _this4 = this;
var _props7 = this.props,
onPrevMonthClick = _props7.onPrevMonthClick,
onNextMonthClick = _props7.onNextMonthClick,
numberOfMonths = _props7.numberOfMonths,
onMonthChange = _props7.onMonthChange,
onYearChange = _props7.onYearChange,
isRTL = _props7.isRTL;
var _state7 = this.state,
currentMonth = _state7.currentMonth,
monthTransition = _state7.monthTransition,
focusedDate = _state7.focusedDate,
nextFocusedDate = _state7.nextFocusedDate,
withMouseInteractions = _state7.withMouseInteractions,
calendarMonthWidth = _state7.calendarMonthWidth;
if (!monthTransition) return;
var newMonth = currentMonth.clone();
var firstDayOfWeek = this.getFirstDayOfWeek();
if (monthTransition === PREV_TRANSITION) {
newMonth.subtract(1, 'month');
if (onPrevMonthClick) onPrevMonthClick(newMonth);
var newInvisibleMonth = newMonth.clone().subtract(1, 'month');
var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(newInvisibleMonth, firstDayOfWeek);
this.calendarMonthWeeks = [numberOfWeeks].concat(_toConsumableArray(this.calendarMonthWeeks.slice(0, -1)));
} else if (monthTransition === NEXT_TRANSITION) {
newMonth.add(1, 'month');
if (onNextMonthClick) onNextMonthClick(newMonth);
var _newInvisibleMonth = newMonth.clone().add(numberOfMonths, 'month');
var _numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(_newInvisibleMonth, firstDayOfWeek);
this.calendarMonthWeeks = [].concat(_toConsumableArray(this.calendarMonthWeeks.slice(1)), [_numberOfWeeks]);
} else if (monthTransition === MONTH_SELECTION_TRANSITION) {
if (onMonthChange) onMonthChange(newMonth);
} else if (monthTransition === YEAR_SELECTION_TRANSITION) {
if (onYearChange) onYearChange(newMonth);
}
var newFocusedDate = null;
if (nextFocusedDate) {
newFocusedDate = nextFocusedDate;
} else if (!focusedDate && !withMouseInteractions) {
newFocusedDate = this.getFocusedDay(newMonth);
}
this.setState({
currentMonth: newMonth,
monthTransition: null,
translationValue: isRTL && this.isHorizontal() ? -calendarMonthWidth : 0,
nextFocusedDate: null,
focusedDate: newFocusedDate
}, function () {
// we don't want to focus on the relevant calendar day after a month transition
// if the user is navigating around using a mouse
if (withMouseInteractions) {
var activeElement = (0, _getActiveElement2['default'])();
if (activeElement && activeElement !== document.body && _this4.container.contains(activeElement)) {
activeElement.blur();
}
}
});
}
return updateStateAfterMonthTransition;
}()
}, {
key: 'adjustDayPickerHeight',
value: function () {
function adjustDayPickerHeight(newMonthHeight) {
var _this5 = this;
var monthHeight = newMonthHeight + MONTH_PADDING;
if (monthHeight !== this.calendarMonthGridHeight) {
this.transitionContainer.style.height = String(monthHeight) + 'px';
if (!this.calendarMonthGridHeight) {
setTimeout(function () {
_this5.setState({ hasSetHeight: true });
}, 0);
}
this.calendarMonthGridHeight = monthHeight;
}
}
return adjustDayPickerHeight;
}()
}, {
key: 'calculateAndSetDayPickerHeight',
value: function () {
function calculateAndSetDayPickerHeight() {
var _props8 = this.props,
daySize = _props8.daySize,
numberOfMonths = _props8.numberOfMonths;
var monthTitleHeight = this.state.monthTitleHeight;
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
if (this.isHorizontal()) {
this.adjustDayPickerHeight(newMonthHeight);
}
}
return calculateAndSetDayPickerHeight;
}()
}, {
key: 'openKeyboardShortcutsPanel',
value: function () {
function openKeyboardShortcutsPanel(onCloseCallBack) {
this.setState({
showKeyboardShortcuts: true,
onKeyboardShortcutsPanelClose: onCloseCallBack
});
}
return openKeyboardShortcutsPanel;
}()
}, {
key: 'closeKeyboardShortcutsPanel',
value: function () {
function closeKeyboardShortcutsPanel() {
var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
if (onKeyboardShortcutsPanelClose) {
onKeyboardShortcutsPanelClose();
}
this.setState({
onKeyboardShortcutsPanelClose: null,
showKeyboardShortcuts: false
});
}
return closeKeyboardShortcutsPanel;
}()
}, {
key: 'renderNavigation',
value: function () {
function renderNavigation() {
var _this6 = this;
var _props9 = this.props,
navPrev = _props9.navPrev,
navNext = _props9.navNext,
noNavButtons = _props9.noNavButtons,
orientation = _props9.orientation,
phrases = _props9.phrases,
isRTL = _props9.isRTL;
if (noNavButtons) {
return null;
}
var onNextMonthClick = void 0;
if (orientation === _constants.VERTICAL_SCROLLABLE) {
onNextMonthClick = this.multiplyScrollableMonths;
} else {
onNextMonthClick = function () {
function onNextMonthClick(e) {
_this6.onNextMonthClick(null, e);
}
return onNextMonthClick;
}();
}
return _react2['default'].createElement(_DayPickerNavigation2['default'], {
onPrevMonthClick: function () {
function onPrevMonthClick(e) {
_this6.onPrevMonthClick(null, e);
}
return onPrevMonthClick;
}(),
onNextMonthClick: onNextMonthClick,
navPrev: navPrev,
navNext: navNext,
orientation: orientation,
phrases: phrases,
isRTL: isRTL
});
}
return renderNavigation;
}()
}, {
key: 'renderWeekHeader',
value: function () {
function renderWeekHeader(index) {
var _props10 = this.props,
daySize = _props10.daySize,
horizontalMonthPadding = _props10.horizontalMonthPadding,
orientation = _props10.orientation,
weekDayFormat = _props10.weekDayFormat,
styles = _props10.styles;
var calendarMonthWidth = this.state.calendarMonthWidth;
var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
var horizontalStyle = {
left: index * calendarMonthWidth
};
var verticalStyle = {
marginLeft: -calendarMonthWidth / 2
};
var weekHeaderStyle = {}; // no styles applied to the vertical-scrollable orientation
if (this.isHorizontal()) {
weekHeaderStyle = horizontalStyle;
} else if (this.isVertical() && !verticalScrollable) {
weekHeaderStyle = verticalStyle;
}
var firstDayOfWeek = this.getFirstDayOfWeek();
var header = [];
for (var i = 0; i < 7; i += 1) {
header.push(_react2['default'].createElement(
'li',
_extends({ key: i }, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_li, { width: daySize })),
_react2['default'].createElement(
'small',
null,
(0, _moment2['default'])().day((i + firstDayOfWeek) % 7).format(weekDayFormat)
)
));
}
return _react2['default'].createElement(
'div',
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader, this.isVertical() && styles.DayPicker_weekHeader__vertical, verticalScrollable && styles.DayPicker_weekHeader__verticalScrollable, weekHeaderStyle, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), {
key: 'week-' + String(index)
}),
_react2['default'].createElement(
'ul',
(0, _reactWithStyles.css)(styles.DayPicker_weekHeader_ul),
header
)
);
}
return renderWeekHeader;
}()
}, {
key: 'render',
value: function () {
function render() {
var _this7 = this;
var _state8 = this.state,
calendarMonthWidth = _state8.calendarMonthWidth,
currentMonth = _state8.currentMonth,
monthTransition = _state8.monthTransition,
translationValue = _state8.translationValue,
scrollableMonthMultiple = _state8.scrollableMonthMultiple,
focusedDate = _state8.focusedDate,
showKeyboardShortcuts = _state8.showKeyboardShortcuts,
isTouch = _state8.isTouchDevice,
hasSetHeight = _state8.hasSetHeight,
calendarInfoWidth = _state8.calendarInfoWidth,
monthTitleHeight = _state8.monthTitleHeight;
var _props11 = this.props,
enableOutsideDays = _props11.enableOutsideDays,
numberOfMonths = _props11.numberOfMonths,
orientation = _props11.orientation,
modifiers = _props11.modifiers,
withPortal = _props11.withPortal,
onDayClick = _props11.onDayClick,
onDayMouseEnter = _props11.onDayMouseEnter,
onDayMouseLeave = _props11.onDayMouseLeave,
firstDayOfWeek = _props11.firstDayOfWeek,
renderMonthText = _props11.renderMonthText,
renderCalendarDay = _props11.renderCalendarDay,
renderDayContents = _props11.renderDayContents,
renderCalendarInfo = _props11.renderCalendarInfo,
renderMonthElement = _props11.renderMonthElement,
calendarInfoPosition = _props11.calendarInfoPosition,
hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
onOutsideClick = _props11.onOutsideClick,
monthFormat = _props11.monthFormat,
daySize = _props11.daySize,
isFocused = _props11.isFocused,
isRTL = _props11.isRTL,
styles = _props11.styles,
theme = _props11.theme,
phrases = _props11.phrases,
verticalHeight = _props11.verticalHeight,
dayAriaLabelFormat = _props11.dayAriaLabelFormat,
noBorder = _props11.noBorder,
transitionDuration = _props11.transitionDuration,
verticalBorderSpacing = _props11.verticalBorderSpacing,
horizontalMonthPadding = _props11.horizontalMonthPadding;
var dayPickerHorizontalPadding = theme.reactDates.spacing.dayPickerHorizontalPadding;
var isHorizontal = this.isHorizontal();
var numOfWeekHeaders = this.isVertical() ? 1 : numberOfMonths;
var weekHeaders = [];
for (var i = 0; i < numOfWeekHeaders; i += 1) {
weekHeaders.push(this.renderWeekHeader(i));
}
var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
var height = void 0;
if (isHorizontal) {
height = this.calendarMonthGridHeight;
} else if (this.isVertical() && !verticalScrollable && !withPortal) {
// If the user doesn't set a desired height,
// we default back to this kind of made-up value that generally looks good
height = verticalHeight || 1.75 * calendarMonthWidth;
}
var isCalendarMonthGridAnimating = monthTransition !== null;
var shouldFocusDate = !isCalendarMonthGridAnimating && isFocused;
var keyboardShortcutButtonLocation = _DayPickerKeyboardShortcuts.BOTTOM_RIGHT;
if (this.isVertical()) {
keyboardShortcutButtonLocation = withPortal ? _DayPickerKeyboardShortcuts.TOP_LEFT : _DayPickerKeyboardShortcuts.TOP_RIGHT;
}
var shouldAnimateHeight = isHorizontal && hasSetHeight;
var calendarInfoPositionTop = calendarInfoPosition === _constants.INFO_POSITION_TOP;
var calendarInfoPositionBottom = calendarInfoPosition === _constants.INFO_POSITION_BOTTOM;
var calendarInfoPositionBefore = calendarInfoPosition === _constants.INFO_POSITION_BEFORE;
var calendarInfoPositionAfter = calendarInfoPosition === _constants.INFO_POSITION_AFTER;
var calendarInfoIsInline = calendarInfoPositionBefore || calendarInfoPositionAfter;
var calendarInfo = renderCalendarInfo && _react2['default'].createElement(
'div',
_extends({
ref: this.setCalendarInfoRef
}, (0, _reactWithStyles.css)(calendarInfoIsInline && styles.DayPicker_calendarInfo__horizontal)),
renderCalendarInfo()
);
var calendarInfoPanelWidth = renderCalendarInfo && calendarInfoIsInline ? calendarInfoWidth : 0;
var firstVisibleMonthIndex = this.getFirstVisibleIndex();
var wrapperHorizontalWidth = calendarMonthWidth * numberOfMonths + 2 * dayPickerHorizontalPadding;
// Adding `1px` because of whitespace between 2 inline-block
var fullHorizontalWidth = wrapperHorizontalWidth + calendarInfoPanelWidth + 1;
var transitionContainerStyle = {
width: isHorizontal && wrapperHorizontalWidth,
height: height
};
var dayPickerWrapperStyle = {
width: isHorizontal && wrapperHorizontalWidth
};
var dayPickerStyle = {
width: isHorizontal && fullHorizontalWidth,
// These values are to center the datepicker (approximately) on the page
marginLeft: isHorizontal && withPortal ? -fullHorizontalWidth / 2 : null,
marginTop: isHorizontal && withPortal ? -calendarMonthWidth / 2 : null
};
return _react2['default'].createElement(
'div',
_extends({
role: 'application',
'aria-label': phrases.calendarLabel
}, (0, _reactWithStyles.css)(styles.DayPicker, isHorizontal && styles.DayPicker__horizontal, verticalScrollable && styles.DayPicker__verticalScrollable, isHorizontal && withPortal && styles.DayPicker_portal__horizontal, this.isVertical() && withPortal && styles.DayPicker_portal__vertical, dayPickerStyle, !monthTitleHeight && styles.DayPicker__hidden, !noBorder && styles.DayPicker__withBorder)),
_react2['default'].createElement(
_reactOutsideClickHandler2['default'],
{ onOutsideClick: onOutsideClick },
(calendarInfoPositionTop || calendarInfoPositionBefore) && calendarInfo,
_react2['default'].createElement(
'div',
(0, _reactWithStyles.css)(dayPickerWrapperStyle, calendarInfoIsInline && isHorizontal && styles.DayPicker_wrapper__horizontal),
_react2['default'].createElement(
'div',
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeaders, isHorizontal && styles.DayPicker_weekHeaders__horizontal), {
'aria-hidden': 'true',
role: 'presentation'
}),
weekHeaders
),
_react2['default'].createElement(
'div',
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_focusRegion), {
ref: this.setContainerRef,
onClick: function () {
function onClick(e) {
e.stopPropagation();
}
return onClick;
}(),
onKeyDown: this.onKeyDown,
onMouseUp: function () {
function onMouseUp() {
_this7.setState({ withMouseInteractions: true });
}
return onMouseUp;
}(),
role: 'region',
tabIndex: -1
}),
!verticalScrollable && this.renderNavigation(),
_react2['default'].createElement(
'div',
_extends({}, (0, _reactWithStyles.css)(styles.DayPicker_transitionContainer, shouldAnimateHeight && styles.DayPicker_transitionContainer__horizontal, this.isVertical() && styles.DayPicker_transitionContainer__vertical, verticalScrollable && styles.DayPicker_transitionContainer__verticalScrollable, transitionContainerStyle), {
ref: this.setTransitionContainerRef
}),
_react2['default'].createElement(_CalendarMonthGrid2['default'], {
setMonthTitleHeight: !monthTitleHeight ? this.setMonthTitleHeight : undefined,
translationValue: translationValue,
enableOutsideDays: enableOutsideDays,
firstVisibleMonthIndex: firstVisibleMonthIndex,
initialMonth: currentMonth,
isAnimating: isCalendarMonthGridAnimating,
modifiers: modifiers,
orientation: orientation,
numberOfMonths: numberOfMonths * scrollableMonthMultiple,
onDayClick: onDayClick,
onDayMouseEnter: onDayMouseEnter,
onDayMouseLeave: onDayMouseLeave,
onMonthChange: this.onMonthChange,
onYearChange: this.onYearChange,
renderMonthText: renderMonthText,
renderCalendarDay: renderCalendarDay,
renderDayContents: renderDayContents,
renderMonthElement: renderMonthElement,
onMonthTransitionEnd: this.updateStateAfterMonthTransition,
monthFormat: monthFormat,
daySize: daySize,
firstDayOfWeek: firstDayOfWeek,
isFocused: shouldFocusDate,
focusedDate: focusedDate,
phrases: phrases,
isRTL: isRTL,
dayAriaLabelFormat: dayAriaLabelFormat,
transitionDuration: transitionDuration,
verticalBorderSpacing: verticalBorderSpacing,
horizontalMonthPadding: horizontalMonthPadding
}),
verticalScrollable && this.renderNavigation()
),
!isTouch && !hideKeyboardShortcutsPanel && _react2['default'].createElement(_DayPickerKeyboardShortcuts2['default'], {
block: this.isVertical() && !withPortal,
buttonLocation: keyboardShortcutButtonLocation,
showKeyboardShortcutsPanel: showKeyboardShortcuts,
openKeyboardShortcutsPanel: this.openKeyboardShortcutsPanel,
closeKeyboardShortcutsPanel: this.closeKeyboardShortcutsPanel,
phrases: phrases
})
)
),
(calendarInfoPositionBottom || calendarInfoPositionAfter) && calendarInfo
)
);
}
return render;
}()
}]);
return DayPicker;
}(_react2['default'].Component);
DayPicker.propTypes = propTypes;
DayPicker.defaultProps = defaultProps;
exports.PureDayPicker = DayPicker;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var _ref2$reactDates = _ref2.reactDates,
color = _ref2$reactDates.color,
font = _ref2$reactDates.font,
noScrollBarOnVerticalScrollable = _ref2$reactDates.noScrollBarOnVerticalScrollable,
spacing = _ref2$reactDates.spacing,
zIndex = _ref2$reactDates.zIndex;
return {
DayPicker: {
background: color.background,
position: 'relative',
textAlign: 'left'
},
DayPicker__horizontal: {
background: color.background
},
DayPicker__verticalScrollable: {
height: '100%'
},
DayPicker__hidden: {
visibility: 'hidden'
},
DayPicker__withBorder: {
boxShadow: '0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)',
borderRadius: 3
},
DayPicker_portal__horizontal: {
boxShadow: 'none',
position: 'absolute',
left: '50%',
top: '50%'
},
DayPicker_portal__vertical: {
position: 'initial'
},
DayPicker_focusRegion: {
outline: 'none'
},
DayPicker_calendarInfo__horizontal: {
display: 'inline-block',
verticalAlign: 'top'
},
DayPicker_wrapper__horizontal: {
display: 'inline-block',
verticalAlign: 'top'
},
DayPicker_weekHeaders: {
position: 'relative'
},
DayPicker_weekHeaders__horizontal: {
marginLeft: spacing.dayPickerHorizontalPadding
},
DayPicker_weekHeader: {
color: color.placeholderText,
position: 'absolute',
top: 62,
zIndex: zIndex + 2,
textAlign: 'left'
},
DayPicker_weekHeader__vertical: {
left: '50%'
},
DayPicker_weekHeader__verticalScrollable: {
top: 0,
display: 'table-row',
borderBottom: '1px solid ' + String(color.core.border),
background: color.background,
marginLeft: 0,
left: 0,
width: '100%',
textAlign: 'center'
},
DayPicker_weekHeader_ul: {
listStyle: 'none',
margin: '1px 0',
paddingLeft: 0,
paddingRight: 0,
fontSize: font.size
},
DayPicker_weekHeader_li: {
display: 'inline-block',
textAlign: 'center'
},
DayPicker_transitionContainer: {
position: 'relative',
overflow: 'hidden',
borderRadius: 3
},
DayPicker_transitionContainer__horizontal: {
transition: 'height 0.2s ease-in-out'
},
DayPicker_transitionContainer__vertical: {
width: '100%'
},
DayPicker_transitionContainer__verticalScrollable: (0, _object2['default'])({
paddingTop: 20,
height: '100%',
position: 'absolute',
top: 0,
bottom: 0,
right: 0,
left: 0,
overflowY: 'scroll'
}, noScrollBarOnVerticalScrollable && {
'-webkitOverflowScrolling': 'touch',
'::-webkit-scrollbar': {
'-webkit-appearance': 'none',
display: 'none'
}
})
};
})(DayPicker);
/***/ }),
/* 366 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @typechecks
*
*/
/*eslint-disable no-self-compare */
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
// Added the nonzero y check to make Flow happy, but it is redundant
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/**
* Performs equality by iterating through keys on an object and returning false
* when any key has values which are not strictly equal between the arguments.
* Returns true when the values of all keys are strictly equal.
*/
function shallowEqual(objA, objB) {
if (is(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
for (var i = 0; i < keysA.length; i++) {
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
module.exports = shallowEqual;
/***/ }),
/* 367 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var reactIs = __webpack_require__(368);
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
var REACT_STATICS = {
childContextTypes: true,
contextType: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromError: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var FORWARD_REF_STATICS = {
'$$typeof': true,
render: true,
defaultProps: true,
displayName: true,
propTypes: true
};
var MEMO_STATICS = {
'$$typeof': true,
compare: true,
defaultProps: true,
displayName: true,
propTypes: true,
type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
function getStatics(component) {
// React v16.11 and below
if (reactIs.isMemo(component)) {
return MEMO_STATICS;
} // React v16.12 and above
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
}
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') {
// don't hoist over string (html) components
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
}
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
var targetStatics = getStatics(targetComponent);
var sourceStatics = getStatics(sourceComponent);
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try {
// Avoid failures from read-only properties
defineProperty(targetComponent, key, descriptor);
} catch (e) {}
}
}
}
return targetComponent;
}
module.exports = hoistNonReactStatics;
/***/ }),
/* 368 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
if (true) {
module.exports = __webpack_require__(369);
} else {}
/***/ }),
/* 369 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/** @license React v16.8.6
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Object.defineProperty(exports,"__esModule",{value:!0});
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):
60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;
exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k};
exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f};
exports.isSuspense=function(a){return t(a)===p};
/***/ }),
/* 370 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var CHANNEL = exports.CHANNEL = '__direction__';
var DIRECTIONS = exports.DIRECTIONS = {
LTR: 'ltr',
RTL: 'rtl'
};
/***/ }),
/* 371 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(33);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
exports['default'] = _propTypes2['default'].shape({
getState: _propTypes2['default'].func,
setState: _propTypes2['default'].func,
subscribe: _propTypes2['default'].func
});
/***/ }),
/* 372 */
/***/ (function(module, exports, __webpack_require__) {
var debounce = __webpack_require__(373),
isObject = __webpack_require__(183);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide `options` to indicate whether `func`
* should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.throttle` and `_.debounce`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to throttle.
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=true]
* Specify invoking on the leading edge of the timeout.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
*
* // Avoid excessively updating the position while scrolling.
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
*
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
* jQuery(element).on('click', throttled);
*
* // Cancel the trailing throttled invocation.
* jQuery(window).on('popstate', throttled.cancel);
*/
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (isObject(options)) {
leading = 'leading' in options ? !!options.leading : leading;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
return debounce(func, wait, {
'leading': leading,
'maxWait': wait,
'trailing': trailing
});
}
module.exports = throttle;
/***/ }),
/* 373 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(183),
now = __webpack_require__(374),
toNumber = __webpack_require__(376);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
nativeMin = Math.min;
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
timeWaiting = wait - timeSinceLastCall;
return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
clearTimeout(timerId);
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
module.exports = debounce;
/***/ }),
/* 374 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(236);
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
var now = function() {
return root.Date.now();
};
module.exports = now;
/***/ }),
/* 375 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(119)))
/***/ }),
/* 376 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(183),
isSymbol = __webpack_require__(377);
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
module.exports = toNumber;
/***/ }),
/* 377 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(378),
isObjectLike = __webpack_require__(381);
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag);
}
module.exports = isSymbol;
/***/ }),
/* 378 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(237),
getRawTag = __webpack_require__(379),
objectToString = __webpack_require__(380);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
module.exports = baseGetTag;
/***/ }),
/* 379 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(237);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
module.exports = getRawTag;
/***/ }),
/* 380 */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
module.exports = objectToString;
/***/ }),
/* 381 */
/***/ (function(module, exports) {
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ }),
/* 382 */
/***/ (function(module, exports, __webpack_require__) {
// eslint-disable-next-line import/no-unresolved
module.exports = __webpack_require__(383);
/***/ }),
/* 383 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(33);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _airbnbPropTypes = __webpack_require__(75);
var _consolidatedEvents = __webpack_require__(238);
var _object = __webpack_require__(219);
var _object2 = _interopRequireDefault(_object);
var _document = __webpack_require__(384);
var _document2 = _interopRequireDefault(_document);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var DISPLAY = {
BLOCK: 'block',
FLEX: 'flex',
INLINE: 'inline',
INLINE_BLOCK: 'inline-block',
CONTENTS: 'contents'
};
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
children: _propTypes2['default'].node.isRequired,
onOutsideClick: _propTypes2['default'].func.isRequired,
disabled: _propTypes2['default'].bool,
useCapture: _propTypes2['default'].bool,
display: _propTypes2['default'].oneOf((0, _object2['default'])(DISPLAY))
});
var defaultProps = {
disabled: false,
// `useCapture` is set to true by default so that a `stopPropagation` in the
// children will not prevent all outside click handlers from firing - maja
useCapture: true,
display: DISPLAY.BLOCK
};
var OutsideClickHandler = function (_React$Component) {
_inherits(OutsideClickHandler, _React$Component);
function OutsideClickHandler() {
var _ref;
_classCallCheck(this, OutsideClickHandler);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, (_ref = OutsideClickHandler.__proto__ || Object.getPrototypeOf(OutsideClickHandler)).call.apply(_ref, [this].concat(args)));
_this.onMouseDown = _this.onMouseDown.bind(_this);
_this.onMouseUp = _this.onMouseUp.bind(_this);
_this.setChildNodeRef = _this.setChildNodeRef.bind(_this);
return _this;
}
_createClass(OutsideClickHandler, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
var _props = this.props,
disabled = _props.disabled,
useCapture = _props.useCapture;
if (!disabled) this.addMouseDownEventListener(useCapture);
}
return componentDidMount;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate(_ref2) {
var prevDisabled = _ref2.disabled;
var _props2 = this.props,
disabled = _props2.disabled,
useCapture = _props2.useCapture;
if (prevDisabled !== disabled) {
if (disabled) {
this.removeEventListeners();
} else {
this.addMouseDownEventListener(useCapture);
}
}
}
return componentDidUpdate;
}()
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
this.removeEventListeners();
}
return componentWillUnmount;
}()
// Use mousedown/mouseup to enforce that clicks remain outside the root's
// descendant tree, even when dragged. This should also get triggered on
// touch devices.
}, {
key: 'onMouseDown',
value: function () {
function onMouseDown(e) {
var useCapture = this.props.useCapture;
var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target);
if (!isDescendantOfRoot) {
if (this.removeMouseUp) {
this.removeMouseUp();
this.removeMouseUp = null;
}
this.removeMouseUp = (0, _consolidatedEvents.addEventListener)(document, 'mouseup', this.onMouseUp, { capture: useCapture });
}
}
return onMouseDown;
}()
// Use mousedown/mouseup to enforce that clicks remain outside the root's
// descendant tree, even when dragged. This should also get triggered on
// touch devices.
}, {
key: 'onMouseUp',
value: function () {
function onMouseUp(e) {
var onOutsideClick = this.props.onOutsideClick;
var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target);
if (this.removeMouseUp) {
this.removeMouseUp();
this.removeMouseUp = null;
}
if (!isDescendantOfRoot) {
onOutsideClick(e);
}
}
return onMouseUp;
}()
}, {
key: 'setChildNodeRef',
value: function () {
function setChildNodeRef(ref) {
this.childNode = ref;
}
return setChildNodeRef;
}()
}, {
key: 'addMouseDownEventListener',
value: function () {
function addMouseDownEventListener(useCapture) {
this.removeMouseDown = (0, _consolidatedEvents.addEventListener)(document, 'mousedown', this.onMouseDown, { capture: useCapture });
}
return addMouseDownEventListener;
}()
}, {
key: 'removeEventListeners',
value: function () {
function removeEventListeners() {
if (this.removeMouseDown) this.removeMouseDown();
if (this.removeMouseUp) this.removeMouseUp();
}
return removeEventListeners;
}()
}, {
key: 'render',
value: function () {
function render() {
var _props3 = this.props,
children = _props3.children,
display = _props3.display;
return _react2['default'].createElement(
'div',
{
ref: this.setChildNodeRef,
style: display !== DISPLAY.BLOCK && (0, _object2['default'])(DISPLAY).includes(display) ? { display: display } : undefined
},
children
);
}
return render;
}()
}]);
return OutsideClickHandler;
}(_react2['default'].Component);
exports['default'] = OutsideClickHandler;
OutsideClickHandler.propTypes = propTypes;
OutsideClickHandler.defaultProps = defaultProps;
/***/ }),
/* 384 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(91);
var implementation = __webpack_require__(239);
var getPolyfill = __webpack_require__(240);
var polyfill = getPolyfill();
var shim = __webpack_require__(385);
var boundContains = function contains(node, other) {
return polyfill.apply(node, [other]);
};
define(boundContains, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = boundContains;
/***/ }),
/* 385 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(91);
var getPolyfill = __webpack_require__(240);
module.exports = function shimContains() {
var polyfill = getPolyfill();
if (typeof document !== 'undefined') {
define(
document,
{ contains: polyfill },
{ contains: function () { return document.contains !== polyfill; } }
);
if (typeof Element !== 'undefined') {
define(
Element.prototype,
{ contains: polyfill },
{ contains: function () { return Element.prototype.contains !== polyfill; } }
);
}
}
return polyfill;
};
/***/ }),
/* 386 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _object = __webpack_require__(82);
var _object2 = _interopRequireDefault(_object);
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(33);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactAddonsShallowCompare = __webpack_require__(137);
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _reactMomentProptypes = __webpack_require__(135);
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(75);
var _reactWithStyles = __webpack_require__(99);
var _moment = __webpack_require__(43);
var _moment2 = _interopRequireDefault(_moment);
var _consolidatedEvents = __webpack_require__(238);
var _defaultPhrases = __webpack_require__(97);
var _getPhrasePropTypes = __webpack_require__(98);
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _CalendarMonth = __webpack_require__(387);
var _CalendarMonth2 = _interopRequireDefault(_CalendarMonth);
var _isTransitionEndSupported = __webpack_require__(392);
var _isTransitionEndSupported2 = _interopRequireDefault(_isTransitionEndSupported);
var _getTransformStyles = __webpack_require__(393);
var _getTransformStyles2 = _interopRequireDefault(_getTransformStyles);
var _getCalendarMonthWidth = __webpack_require__(244);
var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
var _toISOMonthString = __webpack_require__(182);
var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
var _isPrevMonth = __webpack_require__(394);
var _isPrevMonth2 = _interopRequireDefault(_isPrevMonth);
var _isNextMonth = __webpack_require__(395);
var _isNextMonth2 = _interopRequireDefault(_isNextMonth);
var _ModifiersShape = __webpack_require__(148);
var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
var _ScrollableOrientationShape = __webpack_require__(136);
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _DayOfWeekShape = __webpack_require__(147);
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _constants = __webpack_require__(66);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
enableOutsideDays: _propTypes2['default'].bool,
firstVisibleMonthIndex: _propTypes2['default'].number,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
initialMonth: _reactMomentProptypes2['default'].momentObj,
isAnimating: _propTypes2['default'].bool,
numberOfMonths: _propTypes2['default'].number,
modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
orientation: _ScrollableOrientationShape2['default'],
onDayClick: _propTypes2['default'].func,
onDayMouseEnter: _propTypes2['default'].func,
onDayMouseLeave: _propTypes2['default'].func,
onMonthTransitionEnd: _propTypes2['default'].func,
onMonthChange: _propTypes2['default'].func,
onYearChange: _propTypes2['default'].func,
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
translationValue: _propTypes2['default'].number,
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
daySize: _airbnbPropTypes.nonNegativeInteger,
focusedDate: _reactMomentProptypes2['default'].momentObj, // indicates focusable day
isFocused: _propTypes2['default'].bool, // indicates whether or not to move focus to focusable day
firstDayOfWeek: _DayOfWeekShape2['default'],
setMonthTitleHeight: _propTypes2['default'].func,
isRTL: _propTypes2['default'].bool,
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
// i18n
monthFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string
}));
var defaultProps = {
enableOutsideDays: false,
firstVisibleMonthIndex: 0,
horizontalMonthPadding: 13,
initialMonth: (0, _moment2['default'])(),
isAnimating: false,
numberOfMonths: 1,
modifiers: {},
orientation: _constants.HORIZONTAL_ORIENTATION,
onDayClick: function () {
function onDayClick() {}
return onDayClick;
}(),
onDayMouseEnter: function () {
function onDayMouseEnter() {}
return onDayMouseEnter;
}(),
onDayMouseLeave: function () {
function onDayMouseLeave() {}
return onDayMouseLeave;
}(),
onMonthChange: function () {
function onMonthChange() {}
return onMonthChange;
}(),
onYearChange: function () {
function onYearChange() {}
return onYearChange;
}(),
onMonthTransitionEnd: function () {
function onMonthTransitionEnd() {}
return onMonthTransitionEnd;
}(),
renderMonthText: null,
renderCalendarDay: undefined,
renderDayContents: null,
translationValue: null,
renderMonthElement: null,
daySize: _constants.DAY_SIZE,
focusedDate: null,
isFocused: false,
firstDayOfWeek: null,
setMonthTitleHeight: null,
isRTL: false,
transitionDuration: 200,
verticalBorderSpacing: undefined,
// i18n
monthFormat: 'MMMM YYYY', // english locale
phrases: _defaultPhrases.CalendarDayPhrases,
dayAriaLabelFormat: undefined
};
function getMonths(initialMonth, numberOfMonths, withoutTransitionMonths) {
var month = initialMonth.clone();
if (!withoutTransitionMonths) month = month.subtract(1, 'month');
var months = [];
for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) {
months.push(month);
month = month.clone().add(1, 'month');
}
return months;
}
var CalendarMonthGrid = function (_React$Component) {
_inherits(CalendarMonthGrid, _React$Component);
function CalendarMonthGrid(props) {
_classCallCheck(this, CalendarMonthGrid);
var _this = _possibleConstructorReturn(this, (CalendarMonthGrid.__proto__ || Object.getPrototypeOf(CalendarMonthGrid)).call(this, props));
var withoutTransitionMonths = props.orientation === _constants.VERTICAL_SCROLLABLE;
_this.state = {
months: getMonths(props.initialMonth, props.numberOfMonths, withoutTransitionMonths)
};
_this.isTransitionEndSupported = (0, _isTransitionEndSupported2['default'])();
_this.onTransitionEnd = _this.onTransitionEnd.bind(_this);
_this.setContainerRef = _this.setContainerRef.bind(_this);
_this.locale = _moment2['default'].locale();
_this.onMonthSelect = _this.onMonthSelect.bind(_this);
_this.onYearSelect = _this.onYearSelect.bind(_this);
return _this;
}
_createClass(CalendarMonthGrid, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
this.removeEventListener = (0, _consolidatedEvents.addEventListener)(this.container, 'transitionend', this.onTransitionEnd);
}
return componentDidMount;
}()
}, {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var _this2 = this;
var initialMonth = nextProps.initialMonth,
numberOfMonths = nextProps.numberOfMonths,
orientation = nextProps.orientation;
var months = this.state.months;
var _props = this.props,
prevInitialMonth = _props.initialMonth,
prevNumberOfMonths = _props.numberOfMonths;
var hasMonthChanged = !prevInitialMonth.isSame(initialMonth, 'month');
var hasNumberOfMonthsChanged = prevNumberOfMonths !== numberOfMonths;
var newMonths = months;
if (hasMonthChanged && !hasNumberOfMonthsChanged) {
if ((0, _isNextMonth2['default'])(prevInitialMonth, initialMonth)) {
newMonths = months.slice(1);
newMonths.push(months[months.length - 1].clone().add(1, 'month'));
} else if ((0, _isPrevMonth2['default'])(prevInitialMonth, initialMonth)) {
newMonths = months.slice(0, months.length - 1);
newMonths.unshift(months[0].clone().subtract(1, 'month'));
} else {
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
newMonths = getMonths(initialMonth, numberOfMonths, withoutTransitionMonths);
}
}
if (hasNumberOfMonthsChanged) {
var _withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
newMonths = getMonths(initialMonth, numberOfMonths, _withoutTransitionMonths);
}
var momentLocale = _moment2['default'].locale();
if (this.locale !== momentLocale) {
this.locale = momentLocale;
newMonths = newMonths.map(function (m) {
return m.locale(_this2.locale);
});
}
this.setState({
months: newMonths
});
}
return componentWillReceiveProps;
}()
}, {
key: 'shouldComponentUpdate',
value: function () {
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
}
return shouldComponentUpdate;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate() {
var _props2 = this.props,
isAnimating = _props2.isAnimating,
transitionDuration = _props2.transitionDuration,
onMonthTransitionEnd = _props2.onMonthTransitionEnd;
// For IE9, immediately call onMonthTransitionEnd instead of
// waiting for the animation to complete. Similarly, if transitionDuration
// is set to 0, also immediately invoke the onMonthTransitionEnd callback
if ((!this.isTransitionEndSupported || !transitionDuration) && isAnimating) {
onMonthTransitionEnd();
}
}
return componentDidUpdate;
}()
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
if (this.removeEventListener) this.removeEventListener();
}
return componentWillUnmount;
}()
}, {
key: 'onTransitionEnd',
value: function () {
function onTransitionEnd() {
var onMonthTransitionEnd = this.props.onMonthTransitionEnd;
onMonthTransitionEnd();
}
return onTransitionEnd;
}()
}, {
key: 'onMonthSelect',
value: function () {
function onMonthSelect(currentMonth, newMonthVal) {
var newMonth = currentMonth.clone();
var _props3 = this.props,
onMonthChange = _props3.onMonthChange,
orientation = _props3.orientation;
var months = this.state.months;
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var initialMonthSubtraction = months.indexOf(currentMonth);
if (!withoutTransitionMonths) {
initialMonthSubtraction -= 1;
}
newMonth.set('month', newMonthVal).subtract(initialMonthSubtraction, 'months');
onMonthChange(newMonth);
}
return onMonthSelect;
}()
}, {
key: 'onYearSelect',
value: function () {
function onYearSelect(currentMonth, newYearVal) {
var newMonth = currentMonth.clone();
var _props4 = this.props,
onYearChange = _props4.onYearChange,
orientation = _props4.orientation;
var months = this.state.months;
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var initialMonthSubtraction = months.indexOf(currentMonth);
if (!withoutTransitionMonths) {
initialMonthSubtraction -= 1;
}
newMonth.set('year', newYearVal).subtract(initialMonthSubtraction, 'months');
onYearChange(newMonth);
}
return onYearSelect;
}()
}, {
key: 'setContainerRef',
value: function () {
function setContainerRef(ref) {
this.container = ref;
}
return setContainerRef;
}()
}, {
key: 'render',
value: function () {
function render() {
var _this3 = this;
var _props5 = this.props,
enableOutsideDays = _props5.enableOutsideDays,
firstVisibleMonthIndex = _props5.firstVisibleMonthIndex,
horizontalMonthPadding = _props5.horizontalMonthPadding,
isAnimating = _props5.isAnimating,
modifiers = _props5.modifiers,
numberOfMonths = _props5.numberOfMonths,
monthFormat = _props5.monthFormat,
orientation = _props5.orientation,
translationValue = _props5.translationValue,
daySize = _props5.daySize,
onDayMouseEnter = _props5.onDayMouseEnter,
onDayMouseLeave = _props5.onDayMouseLeave,
onDayClick = _props5.onDayClick,
renderMonthText = _props5.renderMonthText,
renderCalendarDay = _props5.renderCalendarDay,
renderDayContents = _props5.renderDayContents,
renderMonthElement = _props5.renderMonthElement,
onMonthTransitionEnd = _props5.onMonthTransitionEnd,
firstDayOfWeek = _props5.firstDayOfWeek,
focusedDate = _props5.focusedDate,
isFocused = _props5.isFocused,
isRTL = _props5.isRTL,
styles = _props5.styles,
phrases = _props5.phrases,
dayAriaLabelFormat = _props5.dayAriaLabelFormat,
transitionDuration = _props5.transitionDuration,
verticalBorderSpacing = _props5.verticalBorderSpacing,
setMonthTitleHeight = _props5.setMonthTitleHeight;
var months = this.state.months;
var isVertical = orientation === _constants.VERTICAL_ORIENTATION;
var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION;
var calendarMonthWidth = (0, _getCalendarMonthWidth2['default'])(daySize, horizontalMonthPadding);
var width = isVertical || isVerticalScrollable ? calendarMonthWidth : (numberOfMonths + 2) * calendarMonthWidth;
var transformType = isVertical || isVerticalScrollable ? 'translateY' : 'translateX';
var transformValue = transformType + '(' + String(translationValue) + 'px)';
return _react2['default'].createElement(
'div',
_extends({}, (0, _reactWithStyles.css)(styles.CalendarMonthGrid, isHorizontal && styles.CalendarMonthGrid__horizontal, isVertical && styles.CalendarMonthGrid__vertical, isVerticalScrollable && styles.CalendarMonthGrid__vertical_scrollable, isAnimating && styles.CalendarMonthGrid__animating, isAnimating && transitionDuration && {
transition: 'transform ' + String(transitionDuration) + 'ms ease-in-out'
}, (0, _object2['default'])({}, (0, _getTransformStyles2['default'])(transformValue), {
width: width
})), {
ref: this.setContainerRef,
onTransitionEnd: onMonthTransitionEnd
}),
months.map(function (month, i) {
var isVisible = i >= firstVisibleMonthIndex && i < firstVisibleMonthIndex + numberOfMonths;
var hideForAnimation = i === 0 && !isVisible;
var showForAnimation = i === 0 && isAnimating && isVisible;
var monthString = (0, _toISOMonthString2['default'])(month);
return _react2['default'].createElement(
'div',
_extends({
key: monthString
}, (0, _reactWithStyles.css)(isHorizontal && styles.CalendarMonthGrid_month__horizontal, hideForAnimation && styles.CalendarMonthGrid_month__hideForAnimation, showForAnimation && !isVertical && !isRTL && {
position: 'absolute',
left: -calendarMonthWidth
}, showForAnimation && !isVertical && isRTL && {
position: 'absolute',
right: 0
}, showForAnimation && isVertical && {
position: 'absolute',
top: -translationValue
}, !isVisible && !isAnimating && styles.CalendarMonthGrid_month__hidden)),
_react2['default'].createElement(_CalendarMonth2['default'], {
month: month,
isVisible: isVisible,
enableOutsideDays: enableOutsideDays,
modifiers: modifiers[monthString],
monthFormat: monthFormat,
orientation: orientation,
onDayMouseEnter: onDayMouseEnter,
onDayMouseLeave: onDayMouseLeave,
onDayClick: onDayClick,
onMonthSelect: _this3.onMonthSelect,
onYearSelect: _this3.onYearSelect,
renderMonthText: renderMonthText,
renderCalendarDay: renderCalendarDay,
renderDayContents: renderDayContents,
renderMonthElement: renderMonthElement,
firstDayOfWeek: firstDayOfWeek,
daySize: daySize,
focusedDate: isVisible ? focusedDate : null,
isFocused: isFocused,
phrases: phrases,
setMonthTitleHeight: setMonthTitleHeight,
dayAriaLabelFormat: dayAriaLabelFormat,
verticalBorderSpacing: verticalBorderSpacing,
horizontalMonthPadding: horizontalMonthPadding
})
);
})
);
}
return render;
}()
}]);
return CalendarMonthGrid;
}(_react2['default'].Component);
CalendarMonthGrid.propTypes = propTypes;
CalendarMonthGrid.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) {
var _ref$reactDates = _ref.reactDates,
color = _ref$reactDates.color,
noScrollBarOnVerticalScrollable = _ref$reactDates.noScrollBarOnVerticalScrollable,
spacing = _ref$reactDates.spacing,
zIndex = _ref$reactDates.zIndex;
return {
CalendarMonthGrid: {
background: color.background,
textAlign: 'left',
zIndex: zIndex
},
CalendarMonthGrid__animating: {
zIndex: zIndex + 1
},
CalendarMonthGrid__horizontal: {
position: 'absolute',
left: spacing.dayPickerHorizontalPadding
},
CalendarMonthGrid__vertical: {
margin: '0 auto'
},
CalendarMonthGrid__vertical_scrollable: (0, _object2['default'])({
margin: '0 auto',
overflowY: 'scroll'
}, noScrollBarOnVerticalScrollable && {
'-webkitOverflowScrolling': 'touch',
'::-webkit-scrollbar': {
'-webkit-appearance': 'none',
display: 'none'
}
}),
CalendarMonthGrid_month__horizontal: {
display: 'inline-block',
verticalAlign: 'top',
minHeight: '100%'
},
CalendarMonthGrid_month__hideForAnimation: {
position: 'absolute',
zIndex: zIndex - 1,
opacity: 0,
pointerEvents: 'none'
},
CalendarMonthGrid_month__hidden: {
visibility: 'hidden'
}
};
})(CalendarMonthGrid);
/***/ }),
/* 387 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _object = __webpack_require__(82);
var _object2 = _interopRequireDefault(_object);
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(33);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactAddonsShallowCompare = __webpack_require__(137);
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _reactMomentProptypes = __webpack_require__(135);
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(75);
var _reactWithStyles = __webpack_require__(99);
var _moment = __webpack_require__(43);
var _moment2 = _interopRequireDefault(_moment);
var _defaultPhrases = __webpack_require__(97);
var _getPhrasePropTypes = __webpack_require__(98);
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _CalendarWeek = __webpack_require__(388);
var _CalendarWeek2 = _interopRequireDefault(_CalendarWeek);
var _CalendarDay = __webpack_require__(241);
var _CalendarDay2 = _interopRequireDefault(_CalendarDay);
var _calculateDimension = __webpack_require__(243);
var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
var _getCalendarMonthWeeks = __webpack_require__(391);
var _getCalendarMonthWeeks2 = _interopRequireDefault(_getCalendarMonthWeeks);
var _isSameDay = __webpack_require__(181);
var _isSameDay2 = _interopRequireDefault(_isSameDay);
var _toISODateString = __webpack_require__(234);
var _toISODateString2 = _interopRequireDefault(_toISODateString);
var _ModifiersShape = __webpack_require__(148);
var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
var _ScrollableOrientationShape = __webpack_require__(136);
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _DayOfWeekShape = __webpack_require__(147);
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _constants = __webpack_require__(66);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint react/no-array-index-key: 0 */
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
month: _reactMomentProptypes2['default'].momentObj,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
isVisible: _propTypes2['default'].bool,
enableOutsideDays: _propTypes2['default'].bool,
modifiers: _propTypes2['default'].objectOf(_ModifiersShape2['default']),
orientation: _ScrollableOrientationShape2['default'],
daySize: _airbnbPropTypes.nonNegativeInteger,
onDayClick: _propTypes2['default'].func,
onDayMouseEnter: _propTypes2['default'].func,
onDayMouseLeave: _propTypes2['default'].func,
onMonthSelect: _propTypes2['default'].func,
onYearSelect: _propTypes2['default'].func,
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
firstDayOfWeek: _DayOfWeekShape2['default'],
setMonthTitleHeight: _propTypes2['default'].func,
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
focusedDate: _reactMomentProptypes2['default'].momentObj, // indicates focusable day
isFocused: _propTypes2['default'].bool, // indicates whether or not to move focus to focusable day
// i18n
monthFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string
}));
var defaultProps = {
month: (0, _moment2['default'])(),
horizontalMonthPadding: 13,
isVisible: true,
enableOutsideDays: false,
modifiers: {},
orientation: _constants.HORIZONTAL_ORIENTATION,
daySize: _constants.DAY_SIZE,
onDayClick: function () {
function onDayClick() {}
return onDayClick;
}(),
onDayMouseEnter: function () {
function onDayMouseEnter() {}
return onDayMouseEnter;
}(),
onDayMouseLeave: function () {
function onDayMouseLeave() {}
return onDayMouseLeave;
}(),
onMonthSelect: function () {
function onMonthSelect() {}
return onMonthSelect;
}(),
onYearSelect: function () {
function onYearSelect() {}
return onYearSelect;
}(),
renderMonthText: null,
renderCalendarDay: function () {
function renderCalendarDay(props) {
return _react2['default'].createElement(_CalendarDay2['default'], props);
}
return renderCalendarDay;
}(),
renderDayContents: null,
renderMonthElement: null,
firstDayOfWeek: null,
setMonthTitleHeight: null,
focusedDate: null,
isFocused: false,
// i18n
monthFormat: 'MMMM YYYY', // english locale
phrases: _defaultPhrases.CalendarDayPhrases,
dayAriaLabelFormat: undefined,
verticalBorderSpacing: undefined
};
var CalendarMonth = function (_React$Component) {
_inherits(CalendarMonth, _React$Component);
function CalendarMonth(props) {
_classCallCheck(this, CalendarMonth);
var _this = _possibleConstructorReturn(this, (CalendarMonth.__proto__ || Object.getPrototypeOf(CalendarMonth)).call(this, props));
_this.state = {
weeks: (0, _getCalendarMonthWeeks2['default'])(props.month, props.enableOutsideDays, props.firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : props.firstDayOfWeek)
};
_this.setCaptionRef = _this.setCaptionRef.bind(_this);
_this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
return _this;
}
_createClass(CalendarMonth, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
this.setMonthTitleHeightTimeout = setTimeout(this.setMonthTitleHeight, 0);
}
return componentDidMount;
}()
}, {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var month = nextProps.month,
enableOutsideDays = nextProps.enableOutsideDays,
firstDayOfWeek = nextProps.firstDayOfWeek;
var _props = this.props,
prevMonth = _props.month,
prevEnableOutsideDays = _props.enableOutsideDays,
prevFirstDayOfWeek = _props.firstDayOfWeek;
if (!month.isSame(prevMonth) || enableOutsideDays !== prevEnableOutsideDays || firstDayOfWeek !== prevFirstDayOfWeek) {
this.setState({
weeks: (0, _getCalendarMonthWeeks2['default'])(month, enableOutsideDays, firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : firstDayOfWeek)
});
}
}
return componentWillReceiveProps;
}()
}, {
key: 'shouldComponentUpdate',
value: function () {
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
}
return shouldComponentUpdate;
}()
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
if (this.setMonthTitleHeightTimeout) {
clearTimeout(this.setMonthTitleHeightTimeout);
}
}
return componentWillUnmount;
}()
}, {
key: 'setMonthTitleHeight',
value: function () {
function setMonthTitleHeight() {
var setMonthTitleHeight = this.props.setMonthTitleHeight;
if (setMonthTitleHeight) {
var captionHeight = (0, _calculateDimension2['default'])(this.captionRef, 'height', true, true);
setMonthTitleHeight(captionHeight);
}
}
return setMonthTitleHeight;
}()
}, {
key: 'setCaptionRef',
value: function () {
function setCaptionRef(ref) {
this.captionRef = ref;
}
return setCaptionRef;
}()
}, {
key: 'render',
value: function () {
function render() {
var _props2 = this.props,
dayAriaLabelFormat = _props2.dayAriaLabelFormat,
daySize = _props2.daySize,
focusedDate = _props2.focusedDate,
horizontalMonthPadding = _props2.horizontalMonthPadding,
isFocused = _props2.isFocused,
isVisible = _props2.isVisible,
modifiers = _props2.modifiers,
month = _props2.month,
monthFormat = _props2.monthFormat,
onDayClick = _props2.onDayClick,
onDayMouseEnter = _props2.onDayMouseEnter,
onDayMouseLeave = _props2.onDayMouseLeave,
onMonthSelect = _props2.onMonthSelect,
onYearSelect = _props2.onYearSelect,
orientation = _props2.orientation,
phrases = _props2.phrases,
renderCalendarDay = _props2.renderCalendarDay,
renderDayContents = _props2.renderDayContents,
renderMonthElement = _props2.renderMonthElement,
renderMonthText = _props2.renderMonthText,
styles = _props2.styles,
verticalBorderSpacing = _props2.verticalBorderSpacing;
var weeks = this.state.weeks;
var monthTitle = renderMonthText ? renderMonthText(month) : month.format(monthFormat);
var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
return _react2['default'].createElement(
'div',
_extends({}, (0, _reactWithStyles.css)(styles.CalendarMonth, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), {
'data-visible': isVisible
}),
_react2['default'].createElement(
'div',
_extends({
ref: this.setCaptionRef
}, (0, _reactWithStyles.css)(styles.CalendarMonth_caption, verticalScrollable && styles.CalendarMonth_caption__verticalScrollable)),
renderMonthElement ? renderMonthElement({ month: month, onMonthSelect: onMonthSelect, onYearSelect: onYearSelect }) : _react2['default'].createElement(
'strong',
null,
monthTitle
)
),
_react2['default'].createElement(
'table',
_extends({}, (0, _reactWithStyles.css)(!verticalBorderSpacing && styles.CalendarMonth_table, verticalBorderSpacing && styles.CalendarMonth_verticalSpacing, verticalBorderSpacing && { borderSpacing: '0px ' + String(verticalBorderSpacing) + 'px' }), {
role: 'presentation'
}),
_react2['default'].createElement(
'tbody',
null,
weeks.map(function (week, i) {
return _react2['default'].createElement(
_CalendarWeek2['default'],
{ key: i },
week.map(function (day, dayOfWeek) {
return renderCalendarDay({
key: dayOfWeek,
day: day,
daySize: daySize,
isOutsideDay: !day || day.month() !== month.month(),
tabIndex: isVisible && (0, _isSameDay2['default'])(day, focusedDate) ? 0 : -1,
isFocused: isFocused,
onDayMouseEnter: onDayMouseEnter,
onDayMouseLeave: onDayMouseLeave,
onDayClick: onDayClick,
renderDayContents: renderDayContents,
phrases: phrases,
modifiers: modifiers[(0, _toISODateString2['default'])(day)],
ariaLabelFormat: dayAriaLabelFormat
});
})
);
})
)
)
);
}
return render;
}()
}]);
return CalendarMonth;
}(_react2['default'].Component);
CalendarMonth.propTypes = propTypes;
CalendarMonth.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) {
var _ref$reactDates = _ref.reactDates,
color = _ref$reactDates.color,
font = _ref$reactDates.font,
spacing = _ref$reactDates.spacing;
return {
CalendarMonth: {
background: color.background,
textAlign: 'center',
verticalAlign: 'top',
userSelect: 'none'
},
CalendarMonth_table: {
borderCollapse: 'collapse',
borderSpacing: 0
},
CalendarMonth_verticalSpacing: {
borderCollapse: 'separate'
},
CalendarMonth_caption: {
color: color.text,
fontSize: font.captionSize,
textAlign: 'center',
paddingTop: spacing.captionPaddingTop,
paddingBottom: spacing.captionPaddingBottom,
captionSide: 'initial'
},
CalendarMonth_caption__verticalScrollable: {
paddingTop: 12,
paddingBottom: 7
}
};
})(CalendarMonth);
/***/ }),
/* 388 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = CalendarWeek;
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
var _airbnbPropTypes = __webpack_require__(75);
var _CalendarDay = __webpack_require__(241);
var _CalendarDay2 = _interopRequireDefault(_CalendarDay);
var _CustomizableCalendarDay = __webpack_require__(390);
var _CustomizableCalendarDay2 = _interopRequireDefault(_CustomizableCalendarDay);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
children: (0, _airbnbPropTypes.or)([(0, _airbnbPropTypes.childrenOfType)(_CalendarDay2['default']), (0, _airbnbPropTypes.childrenOfType)(_CustomizableCalendarDay2['default'])]).isRequired
});
function CalendarWeek(_ref) {
var children = _ref.children;
return _react2['default'].createElement(
'tr',
null,
children
);
}
CalendarWeek.propTypes = propTypes;
/***/ }),
/* 389 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getPhrase;
function getPhrase(phrase, args) {
if (typeof phrase === 'string') return phrase;
if (typeof phrase === 'function') {
return phrase(args);
}
return '';
}
/***/ }),
/* 390 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PureCustomizableCalendarDay = exports.selectedStyles = exports.lastInRangeStyles = exports.selectedSpanStyles = exports.hoveredSpanStyles = exports.blockedOutOfRangeStyles = exports.blockedCalendarStyles = exports.blockedMinNightsStyles = exports.highlightedCalendarStyles = exports.outsideStyles = exports.defaultStyles = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _object = __webpack_require__(82);
var _object2 = _interopRequireDefault(_object);
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(33);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactAddonsShallowCompare = __webpack_require__(137);
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _reactMomentProptypes = __webpack_require__(135);
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(75);
var _reactWithStyles = __webpack_require__(99);
var _moment = __webpack_require__(43);
var _moment2 = _interopRequireDefault(_moment);
var _defaultPhrases = __webpack_require__(97);
var _getPhrasePropTypes = __webpack_require__(98);
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _getCalendarDaySettings = __webpack_require__(242);
var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings);
var _constants = __webpack_require__(66);
var _DefaultTheme = __webpack_require__(216);
var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var color = _DefaultTheme2['default'].reactDates.color;
function getStyles(stylesObj, isHovered) {
if (!stylesObj) return null;
var hover = stylesObj.hover;
if (isHovered && hover) {
return hover;
}
return stylesObj;
}
var DayStyleShape = _propTypes2['default'].shape({
background: _propTypes2['default'].string,
border: (0, _airbnbPropTypes.or)([_propTypes2['default'].string, _propTypes2['default'].number]),
color: _propTypes2['default'].string,
hover: _propTypes2['default'].shape({
background: _propTypes2['default'].string,
border: (0, _airbnbPropTypes.or)([_propTypes2['default'].string, _propTypes2['default'].number]),
color: _propTypes2['default'].string
})
});
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
day: _reactMomentProptypes2['default'].momentObj,
daySize: _airbnbPropTypes.nonNegativeInteger,
isOutsideDay: _propTypes2['default'].bool,
modifiers: _propTypes2['default'].instanceOf(Set),
isFocused: _propTypes2['default'].bool,
tabIndex: _propTypes2['default'].oneOf([0, -1]),
onDayClick: _propTypes2['default'].func,
onDayMouseEnter: _propTypes2['default'].func,
onDayMouseLeave: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
ariaLabelFormat: _propTypes2['default'].string,
// style overrides
defaultStyles: DayStyleShape,
outsideStyles: DayStyleShape,
todayStyles: DayStyleShape,
firstDayOfWeekStyles: DayStyleShape,
lastDayOfWeekStyles: DayStyleShape,
highlightedCalendarStyles: DayStyleShape,
blockedMinNightsStyles: DayStyleShape,
blockedCalendarStyles: DayStyleShape,
blockedOutOfRangeStyles: DayStyleShape,
hoveredSpanStyles: DayStyleShape,
selectedSpanStyles: DayStyleShape,
lastInRangeStyles: DayStyleShape,
selectedStyles: DayStyleShape,
selectedStartStyles: DayStyleShape,
selectedEndStyles: DayStyleShape,
afterHoveredStartStyles: DayStyleShape,
// internationalization
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases))
}));
var defaultStyles = exports.defaultStyles = {
border: '1px solid ' + String(color.core.borderLight),
color: color.text,
background: color.background,
hover: {
background: color.core.borderLight,
border: '1px double ' + String(color.core.borderLight),
color: 'inherit'
}
};
var outsideStyles = exports.outsideStyles = {
background: color.outside.backgroundColor,
border: 0,
color: color.outside.color
};
var highlightedCalendarStyles = exports.highlightedCalendarStyles = {
background: color.highlighted.backgroundColor,
color: color.highlighted.color,
hover: {
background: color.highlighted.backgroundColor_hover,
color: color.highlighted.color_active
}
};
var blockedMinNightsStyles = exports.blockedMinNightsStyles = {
background: color.minimumNights.backgroundColor,
border: '1px solid ' + String(color.minimumNights.borderColor),
color: color.minimumNights.color,
hover: {
background: color.minimumNights.backgroundColor_hover,
color: color.minimumNights.color_active
}
};
var blockedCalendarStyles = exports.blockedCalendarStyles = {
background: color.blocked_calendar.backgroundColor,
border: '1px solid ' + String(color.blocked_calendar.borderColor),
color: color.blocked_calendar.color,
hover: {
background: color.blocked_calendar.backgroundColor_hover,
border: '1px solid ' + String(color.blocked_calendar.borderColor),
color: color.blocked_calendar.color_active
}
};
var blockedOutOfRangeStyles = exports.blockedOutOfRangeStyles = {
background: color.blocked_out_of_range.backgroundColor,
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
color: color.blocked_out_of_range.color,
hover: {
background: color.blocked_out_of_range.backgroundColor_hover,
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
color: color.blocked_out_of_range.color_active
}
};
var hoveredSpanStyles = exports.hoveredSpanStyles = {
background: color.hoveredSpan.backgroundColor,
border: '1px solid ' + String(color.hoveredSpan.borderColor),
color: color.hoveredSpan.color,
hover: {
background: color.hoveredSpan.backgroundColor_hover,
border: '1px solid ' + String(color.hoveredSpan.borderColor),
color: color.hoveredSpan.color_active
}
};
var selectedSpanStyles = exports.selectedSpanStyles = {
background: color.selectedSpan.backgroundColor,
border: '1px solid ' + String(color.selectedSpan.borderColor),
color: color.selectedSpan.color,
hover: {
background: color.selectedSpan.backgroundColor_hover,
border: '1px solid ' + String(color.selectedSpan.borderColor),
color: color.selectedSpan.color_active
}
};
var lastInRangeStyles = exports.lastInRangeStyles = {
borderRight: color.core.primary
};
var selectedStyles = exports.selectedStyles = {
background: color.selected.backgroundColor,
border: '1px solid ' + String(color.selected.borderColor),
color: color.selected.color,
hover: {
background: color.selected.backgroundColor_hover,
border: '1px solid ' + String(color.selected.borderColor),
color: color.selected.color_active
}
};
var defaultProps = {
day: (0, _moment2['default'])(),
daySize: _constants.DAY_SIZE,
isOutsideDay: false,
modifiers: new Set(),
isFocused: false,
tabIndex: -1,
onDayClick: function () {
function onDayClick() {}
return onDayClick;
}(),
onDayMouseEnter: function () {
function onDayMouseEnter() {}
return onDayMouseEnter;
}(),
onDayMouseLeave: function () {
function onDayMouseLeave() {}
return onDayMouseLeave;
}(),
renderDayContents: null,
ariaLabelFormat: 'dddd, LL',
// style defaults
defaultStyles: defaultStyles,
outsideStyles: outsideStyles,
todayStyles: {},
highlightedCalendarStyles: highlightedCalendarStyles,
blockedMinNightsStyles: blockedMinNightsStyles,
blockedCalendarStyles: blockedCalendarStyles,
blockedOutOfRangeStyles: blockedOutOfRangeStyles,
hoveredSpanStyles: hoveredSpanStyles,
selectedSpanStyles: selectedSpanStyles,
lastInRangeStyles: lastInRangeStyles,
selectedStyles: selectedStyles,
selectedStartStyles: {},
selectedEndStyles: {},
afterHoveredStartStyles: {},
firstDayOfWeekStyles: {},
lastDayOfWeekStyles: {},
// internationalization
phrases: _defaultPhrases.CalendarDayPhrases
};
var CustomizableCalendarDay = function (_React$Component) {
_inherits(CustomizableCalendarDay, _React$Component);
function CustomizableCalendarDay() {
var _ref;
_classCallCheck(this, CustomizableCalendarDay);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, (_ref = CustomizableCalendarDay.__proto__ || Object.getPrototypeOf(CustomizableCalendarDay)).call.apply(_ref, [this].concat(args)));
_this.state = {
isHovered: false
};
_this.setButtonRef = _this.setButtonRef.bind(_this);
return _this;
}
_createClass(CustomizableCalendarDay, [{
key: 'shouldComponentUpdate',
value: function () {
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
}
return shouldComponentUpdate;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate(prevProps) {
var _props = this.props,
isFocused = _props.isFocused,
tabIndex = _props.tabIndex;
if (tabIndex === 0) {
if (isFocused || tabIndex !== prevProps.tabIndex) {
this.buttonRef.focus();
}
}
}
return componentDidUpdate;
}()
}, {
key: 'onDayClick',
value: function () {
function onDayClick(day, e) {
var onDayClick = this.props.onDayClick;
onDayClick(day, e);
}
return onDayClick;
}()
}, {
key: 'onDayMouseEnter',
value: function () {
function onDayMouseEnter(day, e) {
var onDayMouseEnter = this.props.onDayMouseEnter;
this.setState({ isHovered: true });
onDayMouseEnter(day, e);
}
return onDayMouseEnter;
}()
}, {
key: 'onDayMouseLeave',
value: function () {
function onDayMouseLeave(day, e) {
var onDayMouseLeave = this.props.onDayMouseLeave;
this.setState({ isHovered: false });
onDayMouseLeave(day, e);
}
return onDayMouseLeave;
}()
}, {
key: 'onKeyDown',
value: function () {
function onKeyDown(day, e) {
var onDayClick = this.props.onDayClick;
var key = e.key;
if (key === 'Enter' || key === ' ') {
onDayClick(day, e);
}
}
return onKeyDown;
}()
}, {
key: 'setButtonRef',
value: function () {
function setButtonRef(ref) {
this.buttonRef = ref;
}
return setButtonRef;
}()
}, {
key: 'render',
value: function () {
function render() {
var _this2 = this;
var _props2 = this.props,
day = _props2.day,
ariaLabelFormat = _props2.ariaLabelFormat,
daySize = _props2.daySize,
isOutsideDay = _props2.isOutsideDay,
modifiers = _props2.modifiers,
tabIndex = _props2.tabIndex,
renderDayContents = _props2.renderDayContents,
styles = _props2.styles,
phrases = _props2.phrases,
defaultStylesWithHover = _props2.defaultStyles,
outsideStylesWithHover = _props2.outsideStyles,
todayStylesWithHover = _props2.todayStyles,
firstDayOfWeekStylesWithHover = _props2.firstDayOfWeekStyles,
lastDayOfWeekStylesWithHover = _props2.lastDayOfWeekStyles,
highlightedCalendarStylesWithHover = _props2.highlightedCalendarStyles,
blockedMinNightsStylesWithHover = _props2.blockedMinNightsStyles,
blockedCalendarStylesWithHover = _props2.blockedCalendarStyles,
blockedOutOfRangeStylesWithHover = _props2.blockedOutOfRangeStyles,
hoveredSpanStylesWithHover = _props2.hoveredSpanStyles,
selectedSpanStylesWithHover = _props2.selectedSpanStyles,
lastInRangeStylesWithHover = _props2.lastInRangeStyles,
selectedStylesWithHover = _props2.selectedStyles,
selectedStartStylesWithHover = _props2.selectedStartStyles,
selectedEndStylesWithHover = _props2.selectedEndStyles,
afterHoveredStartStylesWithHover = _props2.afterHoveredStartStyles;
var isHovered = this.state.isHovered;
if (!day) return _react2['default'].createElement('td', null);
var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases),
daySizeStyles = _getCalendarDaySettin.daySizeStyles,
useDefaultCursor = _getCalendarDaySettin.useDefaultCursor,
selected = _getCalendarDaySettin.selected,
hoveredSpan = _getCalendarDaySettin.hoveredSpan,
isOutsideRange = _getCalendarDaySettin.isOutsideRange,
ariaLabel = _getCalendarDaySettin.ariaLabel;
return _react2['default'].createElement(
'td',
_extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, daySizeStyles, getStyles(defaultStylesWithHover, isHovered), isOutsideDay && getStyles(outsideStylesWithHover, isHovered), modifiers.has('today') && getStyles(todayStylesWithHover, isHovered), modifiers.has('first-day-of-week') && getStyles(firstDayOfWeekStylesWithHover, isHovered), modifiers.has('last-day-of-week') && getStyles(lastDayOfWeekStylesWithHover, isHovered), modifiers.has('highlighted-calendar') && getStyles(highlightedCalendarStylesWithHover, isHovered), modifiers.has('blocked-minimum-nights') && getStyles(blockedMinNightsStylesWithHover, isHovered), modifiers.has('blocked-calendar') && getStyles(blockedCalendarStylesWithHover, isHovered), hoveredSpan && getStyles(hoveredSpanStylesWithHover, isHovered), modifiers.has('after-hovered-start') && getStyles(afterHoveredStartStylesWithHover, isHovered), modifiers.has('selected-span') && getStyles(selectedSpanStylesWithHover, isHovered), modifiers.has('last-in-range') && getStyles(lastInRangeStylesWithHover, isHovered), selected && getStyles(selectedStylesWithHover, isHovered), modifiers.has('selected-start') && getStyles(selectedStartStylesWithHover, isHovered), modifiers.has('selected-end') && getStyles(selectedEndStylesWithHover, isHovered), isOutsideRange && getStyles(blockedOutOfRangeStylesWithHover, isHovered)), {
role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
, ref: this.setButtonRef,
'aria-label': ariaLabel,
onMouseEnter: function () {
function onMouseEnter(e) {
_this2.onDayMouseEnter(day, e);
}
return onMouseEnter;
}(),
onMouseLeave: function () {
function onMouseLeave(e) {
_this2.onDayMouseLeave(day, e);
}
return onMouseLeave;
}(),
onMouseUp: function () {
function onMouseUp(e) {
e.currentTarget.blur();
}
return onMouseUp;
}(),
onClick: function () {
function onClick(e) {
_this2.onDayClick(day, e);
}
return onClick;
}(),
onKeyDown: function () {
function onKeyDown(e) {
_this2.onKeyDown(day, e);
}
return onKeyDown;
}(),
tabIndex: tabIndex
}),
renderDayContents ? renderDayContents(day, modifiers) : day.format('D')
);
}
return render;
}()
}]);
return CustomizableCalendarDay;
}(_react2['default'].Component);
CustomizableCalendarDay.propTypes = propTypes;
CustomizableCalendarDay.defaultProps = defaultProps;
exports.PureCustomizableCalendarDay = CustomizableCalendarDay;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var font = _ref2.reactDates.font;
return {
CalendarDay: {
boxSizing: 'border-box',
cursor: 'pointer',
fontSize: font.size,
textAlign: 'center',
':active': {
outline: 0
}
},
CalendarDay__defaultCursor: {
cursor: 'default'
}
};
})(CustomizableCalendarDay);
/***/ }),
/* 391 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getCalendarMonthWeeks;
var _moment = __webpack_require__(43);
var _moment2 = _interopRequireDefault(_moment);
var _constants = __webpack_require__(66);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function getCalendarMonthWeeks(month, enableOutsideDays) {
var firstDayOfWeek = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _moment2['default'].localeData().firstDayOfWeek();
if (!_moment2['default'].isMoment(month) || !month.isValid()) {
throw new TypeError('`month` must be a valid moment object');
}
if (_constants.WEEKDAYS.indexOf(firstDayOfWeek) === -1) {
throw new TypeError('`firstDayOfWeek` must be an integer between 0 and 6');
}
// set utc offset to get correct dates in future (when timezone changes)
var firstOfMonth = month.clone().startOf('month').hour(12);
var lastOfMonth = month.clone().endOf('month').hour(12);
// calculate the exact first and last days to fill the entire matrix
// (considering days outside month)
var prevDays = (firstOfMonth.day() + 7 - firstDayOfWeek) % 7;
var nextDays = (firstDayOfWeek + 6 - lastOfMonth.day()) % 7;
var firstDay = firstOfMonth.clone().subtract(prevDays, 'day');
var lastDay = lastOfMonth.clone().add(nextDays, 'day');
var totalDays = lastDay.diff(firstDay, 'days') + 1;
var currentDay = firstDay.clone();
var weeksInMonth = [];
for (var i = 0; i < totalDays; i += 1) {
if (i % 7 === 0) {
weeksInMonth.push([]);
}
var day = null;
if (i >= prevDays && i < totalDays - nextDays || enableOutsideDays) {
day = currentDay.clone();
}
weeksInMonth[weeksInMonth.length - 1].push(day);
currentDay.add(1, 'day');
}
return weeksInMonth;
}
/***/ }),
/* 392 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isTransitionEndSupported;
function isTransitionEndSupported() {
return !!(typeof window !== 'undefined' && 'TransitionEvent' in window);
}
/***/ }),
/* 393 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getTransformStyles;
function getTransformStyles(transformValue) {
return {
transform: transformValue,
msTransform: transformValue,
MozTransform: transformValue,
WebkitTransform: transformValue
};
}
/***/ }),
/* 394 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isPrevMonth;
var _moment = __webpack_require__(43);
var _moment2 = _interopRequireDefault(_moment);
var _isSameMonth = __webpack_require__(245);
var _isSameMonth2 = _interopRequireDefault(_isSameMonth);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function isPrevMonth(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
return (0, _isSameMonth2['default'])(a.clone().subtract(1, 'month'), b);
}
/***/ }),
/* 395 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isNextMonth;
var _moment = __webpack_require__(43);
var _moment2 = _interopRequireDefault(_moment);
var _isSameMonth = __webpack_require__(245);
var _isSameMonth2 = _interopRequireDefault(_isSameMonth);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function isNextMonth(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
return (0, _isSameMonth2['default'])(a.clone().add(1, 'month'), b);
}
/***/ }),
/* 396 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _object = __webpack_require__(82);
var _object2 = _interopRequireDefault(_object);
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(33);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _airbnbPropTypes = __webpack_require__(75);
var _reactWithStyles = __webpack_require__(99);
var _defaultPhrases = __webpack_require__(97);
var _getPhrasePropTypes = __webpack_require__(98);
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _LeftArrow = __webpack_require__(397);
var _LeftArrow2 = _interopRequireDefault(_LeftArrow);
var _RightArrow = __webpack_require__(398);
var _RightArrow2 = _interopRequireDefault(_RightArrow);
var _ChevronUp = __webpack_require__(399);
var _ChevronUp2 = _interopRequireDefault(_ChevronUp);
var _ChevronDown = __webpack_require__(400);
var _ChevronDown2 = _interopRequireDefault(_ChevronDown);
var _ScrollableOrientationShape = __webpack_require__(136);
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _constants = __webpack_require__(66);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
navPrev: _propTypes2['default'].node,
navNext: _propTypes2['default'].node,
orientation: _ScrollableOrientationShape2['default'],
onPrevMonthClick: _propTypes2['default'].func,
onNextMonthClick: _propTypes2['default'].func,
// internationalization
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerNavigationPhrases)),
isRTL: _propTypes2['default'].bool
}));
var defaultProps = {
navPrev: null,
navNext: null,
orientation: _constants.HORIZONTAL_ORIENTATION,
onPrevMonthClick: function () {
function onPrevMonthClick() {}
return onPrevMonthClick;
}(),
onNextMonthClick: function () {
function onNextMonthClick() {}
return onNextMonthClick;
}(),
// internationalization
phrases: _defaultPhrases.DayPickerNavigationPhrases,
isRTL: false
};
function DayPickerNavigation(_ref) {
var navPrev = _ref.navPrev,
navNext = _ref.navNext,
onPrevMonthClick = _ref.onPrevMonthClick,
onNextMonthClick = _ref.onNextMonthClick,
orientation = _ref.orientation,
phrases = _ref.phrases,
isRTL = _ref.isRTL,
styles = _ref.styles;
var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION;
var isVertical = orientation !== _constants.HORIZONTAL_ORIENTATION;
var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
var navPrevIcon = navPrev;
var navNextIcon = navNext;
var isDefaultNavPrev = false;
var isDefaultNavNext = false;
if (!navPrevIcon) {
isDefaultNavPrev = true;
var Icon = isVertical ? _ChevronUp2['default'] : _LeftArrow2['default'];
if (isRTL && !isVertical) {
Icon = _RightArrow2['default'];
}
navPrevIcon = _react2['default'].createElement(Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical));
}
if (!navNextIcon) {
isDefaultNavNext = true;
var _Icon = isVertical ? _ChevronDown2['default'] : _RightArrow2['default'];
if (isRTL && !isVertical) {
_Icon = _LeftArrow2['default'];
}
navNextIcon = _react2['default'].createElement(_Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical));
}
var isDefaultNav = isVerticalScrollable ? isDefaultNavNext : isDefaultNavNext || isDefaultNavPrev;
return _react2['default'].createElement(
'div',
_reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation, isHorizontal && styles.DayPickerNavigation__horizontal].concat(_toConsumableArray(isVertical && [styles.DayPickerNavigation__vertical, isDefaultNav && styles.DayPickerNavigation__verticalDefault]), _toConsumableArray(isVerticalScrollable && [styles.DayPickerNavigation__verticalScrollable, isDefaultNav && styles.DayPickerNavigation__verticalScrollableDefault]))),
!isVerticalScrollable && _react2['default'].createElement(
'div',
_extends({
role: 'button',
tabIndex: '0'
}, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavPrev && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__horizontalDefault, !isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_prevButton__verticalDefault]))))), {
'aria-label': phrases.jumpToPrevMonth,
onClick: onPrevMonthClick,
onKeyUp: function () {
function onKeyUp(e) {
var key = e.key;
if (key === 'Enter' || key === ' ') onPrevMonthClick(e);
}
return onKeyUp;
}(),
onMouseUp: function () {
function onMouseUp(e) {
e.currentTarget.blur();
}
return onMouseUp;
}()
}),
navPrevIcon
),
_react2['default'].createElement(
'div',
_extends({
role: 'button',
tabIndex: '0'
}, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavNext && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__horizontalDefault, isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, !isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical, styles.DayPickerNavigation_nextButton__vertical].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_nextButton__verticalDefault, isVerticalScrollable && styles.DayPickerNavigation_nextButton__verticalScrollableDefault]))))), {
'aria-label': phrases.jumpToNextMonth,
onClick: onNextMonthClick,
onKeyUp: function () {
function onKeyUp(e) {
var key = e.key;
if (key === 'Enter' || key === ' ') onNextMonthClick(e);
}
return onKeyUp;
}(),
onMouseUp: function () {
function onMouseUp(e) {
e.currentTarget.blur();
}
return onMouseUp;
}()
}),
navNextIcon
)
);
}
DayPickerNavigation.propTypes = propTypes;
DayPickerNavigation.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var _ref2$reactDates = _ref2.reactDates,
color = _ref2$reactDates.color,
zIndex = _ref2$reactDates.zIndex;
return {
DayPickerNavigation: {
position: 'relative',
zIndex: zIndex + 2
},
DayPickerNavigation__horizontal: {
height: 0
},
DayPickerNavigation__vertical: {},
DayPickerNavigation__verticalScrollable: {},
DayPickerNavigation__verticalDefault: {
position: 'absolute',
width: '100%',
height: 52,
bottom: 0,
left: 0
},
DayPickerNavigation__verticalScrollableDefault: {
position: 'relative'
},
DayPickerNavigation_button: {
cursor: 'pointer',
userSelect: 'none',
border: 0,
padding: 0,
margin: 0
},
DayPickerNavigation_button__default: {
border: '1px solid ' + String(color.core.borderLight),
backgroundColor: color.background,
color: color.placeholderText,
':focus': {
border: '1px solid ' + String(color.core.borderMedium)
},
':hover': {
border: '1px solid ' + String(color.core.borderMedium)
},
':active': {
background: color.backgroundDark
}
},
DayPickerNavigation_button__horizontal: {},
DayPickerNavigation_button__horizontalDefault: {
position: 'absolute',
top: 18,
lineHeight: 0.78,
borderRadius: 3,
padding: '6px 9px'
},
DayPickerNavigation_leftButton__horizontalDefault: {
left: 22
},
DayPickerNavigation_rightButton__horizontalDefault: {
right: 22
},
DayPickerNavigation_button__vertical: {},
DayPickerNavigation_button__verticalDefault: {
padding: 5,
background: color.background,
boxShadow: '0 0 5px 2px rgba(0, 0, 0, 0.1)',
position: 'relative',
display: 'inline-block',
height: '100%',
width: '50%'
},
DayPickerNavigation_prevButton__verticalDefault: {},
DayPickerNavigation_nextButton__verticalDefault: {
borderLeft: 0
},
DayPickerNavigation_nextButton__verticalScrollableDefault: {
width: '100%'
},
DayPickerNavigation_svg__horizontal: {
height: 19,
width: 19,
fill: color.core.grayLight,
display: 'block'
},
DayPickerNavigation_svg__vertical: {
height: 42,
width: 42,
fill: color.text,
display: 'block'
}
};
})(DayPickerNavigation);
/***/ }),
/* 397 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var LeftArrow = function () {
function LeftArrow(props) {
return _react2['default'].createElement(
'svg',
props,
_react2['default'].createElement('path', {
d: 'M336.2 274.5l-210.1 210h805.4c13 0 23 10 23 23s-10 23-23 23H126.1l210.1 210.1c11 11 11 21 0 32-5 5-10 7-16 7s-11-2-16-7l-249.1-249c-11-11-11-21 0-32l249.1-249.1c21-21.1 53 10.9 32 32z'
})
);
}
return LeftArrow;
}();
LeftArrow.defaultProps = {
viewBox: '0 0 1000 1000'
};
exports['default'] = LeftArrow;
/***/ }),
/* 398 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var RightArrow = function () {
function RightArrow(props) {
return _react2['default'].createElement(
'svg',
props,
_react2['default'].createElement('path', {
d: 'M694.4 242.4l249.1 249.1c11 11 11 21 0 32L694.4 772.7c-5 5-10 7-16 7s-11-2-16-7c-11-11-11-21 0-32l210.1-210.1H67.1c-13 0-23-10-23-23s10-23 23-23h805.4L662.4 274.5c-21-21.1 11-53.1 32-32.1z'
})
);
}
return RightArrow;
}();
RightArrow.defaultProps = {
viewBox: '0 0 1000 1000'
};
exports['default'] = RightArrow;
/***/ }),
/* 399 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var ChevronUp = function () {
function ChevronUp(props) {
return _react2['default'].createElement(
'svg',
props,
_react2['default'].createElement('path', {
d: 'M32.1 712.6l453.2-452.2c11-11 21-11 32 0l453.2 452.2c4 5 6 10 6 16 0 13-10 23-22 23-7 0-12-2-16-7L501.3 308.5 64.1 744.7c-4 5-9 7-15 7-7 0-12-2-17-7-9-11-9-21 0-32.1z'
})
);
}
return ChevronUp;
}();
ChevronUp.defaultProps = {
viewBox: '0 0 1000 1000'
};
exports['default'] = ChevronUp;
/***/ }),
/* 400 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var ChevronDown = function () {
function ChevronDown(props) {
return _react2['default'].createElement(
'svg',
props,
_react2['default'].createElement('path', {
d: 'M967.5 288.5L514.3 740.7c-11 11-21 11-32 0L29.1 288.5c-4-5-6-11-6-16 0-13 10-23 23-23 6 0 11 2 15 7l437.2 436.2 437.2-436.2c4-5 9-7 16-7 6 0 11 2 16 7 9 10.9 9 21 0 32z'
})
);
}
return ChevronDown;
}();
ChevronDown.defaultProps = {
viewBox: '0 0 1000 1000'
};
exports['default'] = ChevronDown;
/***/ }),
/* 401 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BOTTOM_RIGHT = exports.TOP_RIGHT = exports.TOP_LEFT = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _object = __webpack_require__(82);
var _object2 = _interopRequireDefault(_object);
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(33);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _airbnbPropTypes = __webpack_require__(75);
var _reactWithStyles = __webpack_require__(99);
var _defaultPhrases = __webpack_require__(97);
var _getPhrasePropTypes = __webpack_require__(98);
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _KeyboardShortcutRow = __webpack_require__(402);
var _KeyboardShortcutRow2 = _interopRequireDefault(_KeyboardShortcutRow);
var _CloseButton = __webpack_require__(403);
var _CloseButton2 = _interopRequireDefault(_CloseButton);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var TOP_LEFT = exports.TOP_LEFT = 'top-left';
var TOP_RIGHT = exports.TOP_RIGHT = 'top-right';
var BOTTOM_RIGHT = exports.BOTTOM_RIGHT = 'bottom-right';
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
block: _propTypes2['default'].bool,
buttonLocation: _propTypes2['default'].oneOf([TOP_LEFT, TOP_RIGHT, BOTTOM_RIGHT]),
showKeyboardShortcutsPanel: _propTypes2['default'].bool,
openKeyboardShortcutsPanel: _propTypes2['default'].func,
closeKeyboardShortcutsPanel: _propTypes2['default'].func,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerKeyboardShortcutsPhrases))
}));
var defaultProps = {
block: false,
buttonLocation: BOTTOM_RIGHT,
showKeyboardShortcutsPanel: false,
openKeyboardShortcutsPanel: function () {
function openKeyboardShortcutsPanel() {}
return openKeyboardShortcutsPanel;
}(),
closeKeyboardShortcutsPanel: function () {
function closeKeyboardShortcutsPanel() {}
return closeKeyboardShortcutsPanel;
}(),
phrases: _defaultPhrases.DayPickerKeyboardShortcutsPhrases
};
function getKeyboardShortcuts(phrases) {
return [{
unicode: '↵',
label: phrases.enterKey,
action: phrases.selectFocusedDate
}, {
unicode: '←/→',
label: phrases.leftArrowRightArrow,
action: phrases.moveFocusByOneDay
}, {
unicode: '↑/↓',
label: phrases.upArrowDownArrow,
action: phrases.moveFocusByOneWeek
}, {
unicode: 'PgUp/PgDn',
label: phrases.pageUpPageDown,
action: phrases.moveFocusByOneMonth
}, {
unicode: 'Home/End',
label: phrases.homeEnd,
action: phrases.moveFocustoStartAndEndOfWeek
}, {
unicode: 'Esc',
label: phrases.escape,
action: phrases.returnFocusToInput
}, {
unicode: '?',
label: phrases.questionMark,
action: phrases.openThisPanel
}];
}
var DayPickerKeyboardShortcuts = function (_React$Component) {
_inherits(DayPickerKeyboardShortcuts, _React$Component);
function DayPickerKeyboardShortcuts() {
var _ref;
_classCallCheck(this, DayPickerKeyboardShortcuts);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, (_ref = DayPickerKeyboardShortcuts.__proto__ || Object.getPrototypeOf(DayPickerKeyboardShortcuts)).call.apply(_ref, [this].concat(args)));
var phrases = _this.props.phrases;
_this.keyboardShortcuts = getKeyboardShortcuts(phrases);
_this.onShowKeyboardShortcutsButtonClick = _this.onShowKeyboardShortcutsButtonClick.bind(_this);
_this.setShowKeyboardShortcutsButtonRef = _this.setShowKeyboardShortcutsButtonRef.bind(_this);
_this.setHideKeyboardShortcutsButtonRef = _this.setHideKeyboardShortcutsButtonRef.bind(_this);
_this.handleFocus = _this.handleFocus.bind(_this);
_this.onKeyDown = _this.onKeyDown.bind(_this);
return _this;
}
_createClass(DayPickerKeyboardShortcuts, [{
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var phrases = this.props.phrases;
if (nextProps.phrases !== phrases) {
this.keyboardShortcuts = getKeyboardShortcuts(nextProps.phrases);
}
}
return componentWillReceiveProps;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate() {
this.handleFocus();
}
return componentDidUpdate;
}()
}, {
key: 'onKeyDown',
value: function () {
function onKeyDown(e) {
e.stopPropagation();
var closeKeyboardShortcutsPanel = this.props.closeKeyboardShortcutsPanel;
// Because the close button is the only focusable element inside of the panel, this
// amounts to a very basic focus trap. The user can exit the panel by "pressing" the
// close button or hitting escape
switch (e.key) {
case 'Enter':
case ' ':
case 'Spacebar': // for older browsers
case 'Escape':
closeKeyboardShortcutsPanel();
break;
// do nothing - this allows the up and down arrows continue their
// default behavior of scrolling the content of the Keyboard Shortcuts Panel
// which is needed when only a single month is shown for instance.
case 'ArrowUp':
case 'ArrowDown':
break;
// completely block the rest of the keys that have functionality outside of this panel
case 'Tab':
case 'Home':
case 'End':
case 'PageUp':
case 'PageDown':
case 'ArrowLeft':
case 'ArrowRight':
e.preventDefault();
break;
default:
break;
}
}
return onKeyDown;
}()
}, {
key: 'onShowKeyboardShortcutsButtonClick',
value: function () {
function onShowKeyboardShortcutsButtonClick() {
var _this2 = this;
var openKeyboardShortcutsPanel = this.props.openKeyboardShortcutsPanel;
// we want to return focus to this button after closing the keyboard shortcuts panel
openKeyboardShortcutsPanel(function () {
_this2.showKeyboardShortcutsButton.focus();
});
}
return onShowKeyboardShortcutsButtonClick;
}()
}, {
key: 'setShowKeyboardShortcutsButtonRef',
value: function () {
function setShowKeyboardShortcutsButtonRef(ref) {
this.showKeyboardShortcutsButton = ref;
}
return setShowKeyboardShortcutsButtonRef;
}()
}, {
key: 'setHideKeyboardShortcutsButtonRef',
value: function () {
function setHideKeyboardShortcutsButtonRef(ref) {
this.hideKeyboardShortcutsButton = ref;
}
return setHideKeyboardShortcutsButtonRef;
}()
}, {
key: 'handleFocus',
value: function () {
function handleFocus() {
if (this.hideKeyboardShortcutsButton) {
// automatically move focus into the dialog by moving
// to the only interactive element, the hide button
this.hideKeyboardShortcutsButton.focus();
}
}
return handleFocus;
}()
}, {
key: 'render',
value: function () {
function render() {
var _this3 = this;
var _props = this.props,
block = _props.block,
buttonLocation = _props.buttonLocation,
showKeyboardShortcutsPanel = _props.showKeyboardShortcutsPanel,
closeKeyboardShortcutsPanel = _props.closeKeyboardShortcutsPanel,
styles = _props.styles,
phrases = _props.phrases;
var toggleButtonText = showKeyboardShortcutsPanel ? phrases.hideKeyboardShortcutsPanel : phrases.showKeyboardShortcutsPanel;
var bottomRight = buttonLocation === BOTTOM_RIGHT;
var topRight = buttonLocation === TOP_RIGHT;
var topLeft = buttonLocation === TOP_LEFT;
return _react2['default'].createElement(
'div',
null,
_react2['default'].createElement(
'button',
_extends({
ref: this.setShowKeyboardShortcutsButtonRef
}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_show, bottomRight && styles.DayPickerKeyboardShortcuts_show__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_show__topRight, topLeft && styles.DayPickerKeyboardShortcuts_show__topLeft), {
type: 'button',
'aria-label': toggleButtonText,
onClick: this.onShowKeyboardShortcutsButtonClick,
onKeyDown: function () {
function onKeyDown(e) {
if (e.key === 'Enter') {
e.preventDefault();
} else if (e.key === 'Space') {
_this3.onShowKeyboardShortcutsButtonClick(e);
}
}
return onKeyDown;
}(),
onMouseUp: function () {
function onMouseUp(e) {
e.currentTarget.blur();
}
return onMouseUp;
}()
}),
_react2['default'].createElement(
'span',
(0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_showSpan, bottomRight && styles.DayPickerKeyboardShortcuts_showSpan__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_showSpan__topRight, topLeft && styles.DayPickerKeyboardShortcuts_showSpan__topLeft),
'?'
)
),
showKeyboardShortcutsPanel && _react2['default'].createElement(
'div',
_extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_panel), {
role: 'dialog',
'aria-labelledby': 'DayPickerKeyboardShortcuts_title',
'aria-describedby': 'DayPickerKeyboardShortcuts_description'
}),
_react2['default'].createElement(
'div',
_extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_title), {
id: 'DayPickerKeyboardShortcuts_title'
}),
phrases.keyboardShortcuts
),
_react2['default'].createElement(
'button',
_extends({
ref: this.setHideKeyboardShortcutsButtonRef
}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_close), {
type: 'button',
tabIndex: '0',
'aria-label': phrases.hideKeyboardShortcutsPanel,
onClick: closeKeyboardShortcutsPanel,
onKeyDown: this.onKeyDown
}),
_react2['default'].createElement(_CloseButton2['default'], (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_closeSvg))
),
_react2['default'].createElement(
'ul',
_extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_list), {
id: 'DayPickerKeyboardShortcuts_description'
}),
this.keyboardShortcuts.map(function (_ref2) {
var unicode = _ref2.unicode,
label = _ref2.label,
action = _ref2.action;
return _react2['default'].createElement(_KeyboardShortcutRow2['default'], {
key: label,
unicode: unicode,
label: label,
action: action,
block: block
});
})
)
)
);
}
return render;
}()
}]);
return DayPickerKeyboardShortcuts;
}(_react2['default'].Component);
DayPickerKeyboardShortcuts.propTypes = propTypes;
DayPickerKeyboardShortcuts.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref3) {
var _ref3$reactDates = _ref3.reactDates,
color = _ref3$reactDates.color,
font = _ref3$reactDates.font,
zIndex = _ref3$reactDates.zIndex;
return {
DayPickerKeyboardShortcuts_buttonReset: {
background: 'none',
border: 0,
borderRadius: 0,
color: 'inherit',
font: 'inherit',
lineHeight: 'normal',
overflow: 'visible',
padding: 0,
cursor: 'pointer',
fontSize: font.size,
':active': {
outline: 'none'
}
},
DayPickerKeyboardShortcuts_show: {
width: 22,
position: 'absolute',
zIndex: zIndex + 2
},
DayPickerKeyboardShortcuts_show__bottomRight: {
borderTop: '26px solid transparent',
borderRight: '33px solid ' + String(color.core.primary),
bottom: 0,
right: 0,
':hover': {
borderRight: '33px solid ' + String(color.core.primary_dark)
}
},
DayPickerKeyboardShortcuts_show__topRight: {
borderBottom: '26px solid transparent',
borderRight: '33px solid ' + String(color.core.primary),
top: 0,
right: 0,
':hover': {
borderRight: '33px solid ' + String(color.core.primary_dark)
}
},
DayPickerKeyboardShortcuts_show__topLeft: {
borderBottom: '26px solid transparent',
borderLeft: '33px solid ' + String(color.core.primary),
top: 0,
left: 0,
':hover': {
borderLeft: '33px solid ' + String(color.core.primary_dark)
}
},
DayPickerKeyboardShortcuts_showSpan: {
color: color.core.white,
position: 'absolute'
},
DayPickerKeyboardShortcuts_showSpan__bottomRight: {
bottom: 0,
right: -28
},
DayPickerKeyboardShortcuts_showSpan__topRight: {
top: 1,
right: -28
},
DayPickerKeyboardShortcuts_showSpan__topLeft: {
top: 1,
left: -28
},
DayPickerKeyboardShortcuts_panel: {
overflow: 'auto',
background: color.background,
border: '1px solid ' + String(color.core.border),
borderRadius: 2,
position: 'absolute',
top: 0,
bottom: 0,
right: 0,
left: 0,
zIndex: zIndex + 2,
padding: 22,
margin: 33
},
DayPickerKeyboardShortcuts_title: {
fontSize: 16,
fontWeight: 'bold',
margin: 0
},
DayPickerKeyboardShortcuts_list: {
listStyle: 'none',
padding: 0,
fontSize: font.size
},
DayPickerKeyboardShortcuts_close: {
position: 'absolute',
right: 22,
top: 22,
zIndex: zIndex + 2,
':active': {
outline: 'none'
}
},
DayPickerKeyboardShortcuts_closeSvg: {
height: 15,
width: 15,
fill: color.core.grayLighter,
':hover': {
fill: color.core.grayLight
},
':focus': {
fill: color.core.grayLight
}
}
};
})(DayPickerKeyboardShortcuts);
/***/ }),
/* 402 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _object = __webpack_require__(82);
var _object2 = _interopRequireDefault(_object);
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(33);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _airbnbPropTypes = __webpack_require__(75);
var _reactWithStyles = __webpack_require__(99);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
unicode: _propTypes2['default'].string.isRequired,
label: _propTypes2['default'].string.isRequired,
action: _propTypes2['default'].string.isRequired,
block: _propTypes2['default'].bool
}));
var defaultProps = {
block: false
};
function KeyboardShortcutRow(_ref) {
var unicode = _ref.unicode,
label = _ref.label,
action = _ref.action,
block = _ref.block,
styles = _ref.styles;
return _react2['default'].createElement(
'li',
(0, _reactWithStyles.css)(styles.KeyboardShortcutRow, block && styles.KeyboardShortcutRow__block),
_react2['default'].createElement(
'div',
(0, _reactWithStyles.css)(styles.KeyboardShortcutRow_keyContainer, block && styles.KeyboardShortcutRow_keyContainer__block),
_react2['default'].createElement(
'span',
_extends({}, (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_key), {
role: 'img',
'aria-label': String(label) + ',' // add comma so screen readers will pause before reading action
}),
unicode
)
),
_react2['default'].createElement(
'div',
(0, _reactWithStyles.css)(styles.KeyboardShortcutRow_action),
action
)
);
}
KeyboardShortcutRow.propTypes = propTypes;
KeyboardShortcutRow.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var color = _ref2.reactDates.color;
return {
KeyboardShortcutRow: {
listStyle: 'none',
margin: '6px 0'
},
KeyboardShortcutRow__block: {
marginBottom: 16
},
KeyboardShortcutRow_keyContainer: {
display: 'inline-block',
whiteSpace: 'nowrap',
textAlign: 'right',
marginRight: 6
},
KeyboardShortcutRow_keyContainer__block: {
textAlign: 'left',
display: 'inline'
},
KeyboardShortcutRow_key: {
fontFamily: 'monospace',
fontSize: 12,
textTransform: 'uppercase',
background: color.core.grayLightest,
padding: '2px 6px'
},
KeyboardShortcutRow_action: {
display: 'inline',
wordBreak: 'break-word',
marginLeft: 8
}
};
})(KeyboardShortcutRow);
/***/ }),
/* 403 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(17);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var CloseButton = function () {
function CloseButton(props) {
return _react2['default'].createElement(
'svg',
props,
_react2['default'].createElement('path', {
fillRule: 'evenodd',
d: 'M11.53.47a.75.75 0 0 0-1.061 0l-4.47 4.47L1.529.47A.75.75 0 1 0 .468 1.531l4.47 4.47-4.47 4.47a.75.75 0 1 0 1.061 1.061l4.47-4.47 4.47 4.47a.75.75 0 1 0 1.061-1.061l-4.47-4.47 4.47-4.47a.75.75 0 0 0 0-1.061z'
})
);
}
return CloseButton;
}();
CloseButton.defaultProps = {
viewBox: '0 0 12 12'
};
exports['default'] = CloseButton;
/***/ }),
/* 404 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getNumberOfCalendarMonthWeeks;
var _moment = __webpack_require__(43);
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek) {
var weekDayDiff = firstDayOfMonth.day() - firstDayOfWeek;
return (weekDayDiff + 7) % 7;
}
function getNumberOfCalendarMonthWeeks(month) {
var firstDayOfWeek = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _moment2['default'].localeData().firstDayOfWeek();
var firstDayOfMonth = month.clone().startOf('month');
var numBlankDays = getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek);
return Math.ceil((numBlankDays + month.daysInMonth()) / 7);
}
/***/ }),
/* 405 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getActiveElement;
function getActiveElement() {
return typeof document !== 'undefined' && document.activeElement;
}
/***/ }),
/* 406 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
/**
* WordPress dependencies
*/
var external = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
d: "M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"
}));
/* harmony default export */ __webpack_exports__["a"] = (external);
/***/ }),
/* 407 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
/**
* WordPress dependencies
*/
var textColor = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "-2 -2 24 24"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
d: "M13.23 15h1.9L11 4H9L5 15h1.88l1.07-3h4.18zm-1.53-4.54H8.51L10 5.6z"
}));
/* harmony default export */ __webpack_exports__["a"] = (textColor);
/***/ }),
/* 408 */,
/* 409 */,
/* 410 */,
/* 411 */,
/* 412 */,
/* 413 */,
/* 414 */,
/* 415 */,
/* 416 */,
/* 417 */,
/* 418 */,
/* 419 */,
/* 420 */,
/* 421 */,
/* 422 */,
/* 423 */,
/* 424 */,
/* 425 */,
/* 426 */,
/* 427 */,
/* 428 */,
/* 429 */,
/* 430 */,
/* 431 */,
/* 432 */,
/* 433 */,
/* 434 */,
/* 435 */,
/* 436 */,
/* 437 */,
/* 438 */,
/* 439 */,
/* 440 */,
/* 441 */,
/* 442 */,
/* 443 */,
/* 444 */,
/* 445 */,
/* 446 */,
/* 447 */,
/* 448 */,
/* 449 */,
/* 450 */,
/* 451 */,
/* 452 */,
/* 453 */,
/* 454 */,
/* 455 */,
/* 456 */,
/* 457 */,
/* 458 */,
/* 459 */,
/* 460 */,
/* 461 */,
/* 462 */,
/* 463 */,
/* 464 */,
/* 465 */,
/* 466 */,
/* 467 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToolbarItem; });
/* unused harmony export useToolbarItem */
/* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(52);
/* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(92);
/* harmony import */ var _Composite_CompositeItem_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(124);
/* harmony import */ var _ToolbarState_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(158);
var useToolbarItem = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_1__[/* createHook */ "a"])({
name: "ToolbarItem",
compose: _Composite_CompositeItem_js__WEBPACK_IMPORTED_MODULE_4__[/* useCompositeItem */ "b"],
useState: _ToolbarState_js__WEBPACK_IMPORTED_MODULE_5__[/* useToolbarState */ "a"]
});
var ToolbarItem = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_0__[/* createComponent */ "a"])({
as: "button",
memo: true,
useHook: useToolbarItem
});
/***/ })
/******/ ]);