}, Object(external_wp_element_["createElement"])(box_control_styles_UnitControl, Object(esm_extends["a" /* default */])({
className: "component-box-control__unit-control",
isPressEnterToChange: true,
isResetValueOnUnitChange: false,
function Tooltip(_ref3) {
var children = _ref3.children,
if (!text) return children;
* Wrapping the children in a `<div />` as Tooltip as it attempts
* to render the <UnitControl />. Using a plain `<div />` appears to
* Originally discovered and referenced here:
* https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026
return Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], {
}, Object(external_wp_element_["createElement"])("div", null, children));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/utils.js
all: Object(external_wp_i18n_["__"])('All'),
top: Object(external_wp_i18n_["__"])('Top'),
bottom: Object(external_wp_i18n_["__"])('Bottom'),
left: Object(external_wp_i18n_["__"])('Left'),
right: Object(external_wp_i18n_["__"])('Right'),
mixed: Object(external_wp_i18n_["__"])('Mixed')
var DEFAULT_VISUALIZER_VALUES = {
* Gets an items with the most occurance within an array
* https://stackoverflow.com/a/20762713
* @param {Array<any>} arr Array of items to check.
* @return {any} The item with the most occurances.
return arr.sort(function (a, b) {
return arr.filter(function (v) {
}).length - arr.filter(function (v) {
* Gets the 'all' input value and unit from values data.
* @param {Object} values Box values.
* @return {string} A value + unit for the 'all' input.
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var parsedValues = Object.values(values).map(function (value) {
var allValues = parsedValues.map(function (value) {
var allUnits = parsedValues.map(function (value) {
var value = allValues.every(function (v) {
return v === allValues[0];
var unit = mode(allUnits);
* The isNumber check is important. On reset actions, the incoming value
* may be null or an empty string.
* Also, the value may also be zero (0), which is considered a valid unit value.
* isNumber() is more specific for these cases, rather than relying on a
var allValue = Object(external_lodash_["isNumber"])(value) ? "".concat(value).concat(unit) : null;
* Checks to determine if values are mixed.
* @param {Object} values Box values.
* @return {boolean} Whether values are mixed.
function isValuesMixed() {
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var allValue = getAllValue(values);
var isMixed = isNaN(parseFloat(allValue));
* Checks to determine if values are defined.
* @param {Object} values Box values.
* @return {boolean} Whether values are mixed.
function isValuesDefined(values) {
return values !== undefined && !Object(external_lodash_["isEmpty"])(Object.values(values).filter(Boolean));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/all-input-control.js
function all_input_control_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 all_input_control_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { all_input_control_ownKeys(Object(source), true).forEach(function (key) { Object(esm_defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { all_input_control_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function AllInputControl(_ref) {
var _ref$onChange = _ref.onChange,
onChange = _ref$onChange === void 0 ? external_lodash_["noop"] : _ref$onChange,
_ref$onFocus = _ref.onFocus,
onFocus = _ref$onFocus === void 0 ? external_lodash_["noop"] : _ref$onFocus,
_ref$onHoverOn = _ref.onHoverOn,
onHoverOn = _ref$onHoverOn === void 0 ? external_lodash_["noop"] : _ref$onHoverOn,
_ref$onHoverOff = _ref.onHoverOff,
onHoverOff = _ref$onHoverOff === void 0 ? external_lodash_["noop"] : _ref$onHoverOff,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["onChange", "onFocus", "onHoverOn", "onHoverOff", "values"]);
var allValue = getAllValue(values);
var hasValues = isValuesDefined(values);
var isMixed = hasValues && isValuesMixed(values);
var allPlaceholder = isMixed ? LABELS.mixed : null;
var handleOnFocus = function handleOnFocus(event) {
var handleOnChange = function handleOnChange(next) {
var nextValues = all_input_control_objectSpread({}, values);
nextValues.bottom = next;
var handleOnHoverOn = function handleOnHoverOn() {
var handleOnHoverOff = function handleOnHoverOff() {
return Object(external_wp_element_["createElement"])(BoxUnitControl, Object(esm_extends["a" /* default */])({}, props, {
onChange: handleOnChange,
onHoverOn: handleOnHoverOn,
onHoverOff: handleOnHoverOff,
placeholder: allPlaceholder
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/input-controls.js
function input_controls_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 input_controls_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { input_controls_ownKeys(Object(source), true).forEach(function (key) { Object(esm_defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { input_controls_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function BoxInputControls(_ref) {
var _ref$onChange = _ref.onChange,
onChange = _ref$onChange === void 0 ? external_lodash_["noop"] : _ref$onChange,
_ref$onFocus = _ref.onFocus,
onFocus = _ref$onFocus === void 0 ? external_lodash_["noop"] : _ref$onFocus,
_ref$onHoverOn = _ref.onHoverOn,
onHoverOn = _ref$onHoverOn === void 0 ? external_lodash_["noop"] : _ref$onHoverOn,
_ref$onHoverOff = _ref.onHoverOff,
onHoverOff = _ref$onHoverOff === void 0 ? external_lodash_["noop"] : _ref$onHoverOff,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["onChange", "onFocus", "onHoverOn", "onHoverOff", "values"]);
var createHandleOnFocus = function createHandleOnFocus(side) {
return function (event) {
var createHandleOnHoverOn = function createHandleOnHoverOn(side) {
onHoverOn(Object(esm_defineProperty["a" /* default */])({}, side, true));
var createHandleOnHoverOff = function createHandleOnHoverOff(side) {
onHoverOff(Object(esm_defineProperty["a" /* default */])({}, side, false));
var handleOnChange = function handleOnChange(nextValues) {
var createHandleOnChange = function createHandleOnChange(side) {
return function (next, _ref2) {
var altKey = event.altKey;
var nextValues = input_controls_objectSpread({}, values);
* Supports changing pair sides. For example, holding the ALT key
* when changing the TOP will also update BOTTOM.
nextValues.bottom = next;
handleOnChange(nextValues);
return Object(external_wp_element_["createElement"])(LayoutContainer, {
className: "component-box-control__input-controls-wrapper"
}, Object(external_wp_element_["createElement"])(Layout, {
className: "component-box-control__input-controls"
}, Object(external_wp_element_["createElement"])(BoxUnitControl, Object(esm_extends["a" /* default */])({}, props, {
onChange: createHandleOnChange('top'),
onFocus: createHandleOnFocus('top'),
onHoverOn: createHandleOnHoverOn('top'),
onHoverOff: createHandleOnHoverOff('top'),
})), Object(external_wp_element_["createElement"])(BoxUnitControl, Object(esm_extends["a" /* default */])({}, props, {
onChange: createHandleOnChange('right'),
onFocus: createHandleOnFocus('right'),
onHoverOn: createHandleOnHoverOn('right'),
onHoverOff: createHandleOnHoverOff('right'),
})), Object(external_wp_element_["createElement"])(BoxUnitControl, Object(esm_extends["a" /* default */])({}, props, {
onChange: createHandleOnChange('bottom'),
onFocus: createHandleOnFocus('bottom'),
onHoverOn: createHandleOnHoverOn('bottom'),
onHoverOff: createHandleOnHoverOff('bottom'),
})), Object(external_wp_element_["createElement"])(BoxUnitControl, Object(esm_extends["a" /* default */])({}, props, {
onChange: createHandleOnChange('left'),
onFocus: createHandleOnFocus('left'),
onHoverOn: createHandleOnHoverOn('left'),
onHoverOff: createHandleOnHoverOff('left'),
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-icon-styles.js
function box_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
var box_control_icon_styles_Root = styled_base_browser_esm("span", {
styles: "box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px;"
var Viewbox = styled_base_browser_esm("span", {
styles: "box-sizing:border-box;display:block;position:relative;width:100%;height:100%;"
var box_control_icon_styles_strokeFocus = function strokeFocus(_ref) {
var isFocused = _ref.isFocused;
return /*#__PURE__*/Object(core_browser_esm["b" /* css */])({
backgroundColor: 'currentColor',
opacity: isFocused ? 1 : 0.3
}, true ? "" : undefined);
var Stroke = styled_base_browser_esm("span", {
})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;", box_control_icon_styles_strokeFocus, ";" + ( true ? "" : undefined));
var VerticalStroke = /*#__PURE__*/styled_base_browser_esm(Stroke, {
styles: "bottom:3px;top:3px;width:2px;"
var HorizontalStroke = /*#__PURE__*/styled_base_browser_esm(Stroke, {
label: "HorizontalStroke"
styles: "height:2px;left:3px;right:3px;"
var TopStroke = /*#__PURE__*/styled_base_browser_esm(HorizontalStroke, {
var RightStroke = /*#__PURE__*/styled_base_browser_esm(VerticalStroke, {
var BottomStroke = /*#__PURE__*/styled_base_browser_esm(HorizontalStroke, {
var LeftStroke = /*#__PURE__*/styled_base_browser_esm(VerticalStroke, {
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/icon.js
function BoxControlIcon(_ref) {
var _ref$size = _ref.size,
size = _ref$size === void 0 ? 24 : _ref$size,
side = _ref$side === void 0 ? 'all' : _ref$side,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["size", "side"]);
var top = getSide(side, 'top');
var right = getSide(side, 'right');
var bottom = getSide(side, 'bottom');
var left = getSide(side, 'left'); // Simulates SVG Icon scaling
var scale = size / BASE_ICON_SIZE;
return Object(external_wp_element_["createElement"])(box_control_icon_styles_Root, Object(esm_extends["a" /* default */])({
transform: "scale(".concat(scale, ")")
}, props), Object(external_wp_element_["createElement"])(Viewbox, null, Object(external_wp_element_["createElement"])(TopStroke, {
}), Object(external_wp_element_["createElement"])(RightStroke, {
}), Object(external_wp_element_["createElement"])(BottomStroke, {
}), Object(external_wp_element_["createElement"])(LeftStroke, {
function getSide(side, value) {
return side === 'all' || side === value;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js
var library_link = __webpack_require__("Bpkj");
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js
var link_off = __webpack_require__("Mp0b");
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/linked-button.js