From ed32be5868fa500141116afdda520f36f8f735b4 Mon Sep 17 00:00:00 2001 From: Joro Stoyanov Date: Tue, 2 Mar 2021 15:13:19 +0200 Subject: [PATCH] Add bundles --- build/classic/core.css | 13 +- build/classic/core.js | 2 +- build/classic/core.min.css | 2 +- build/classic/core.min.js | 2 +- build/classic/metaboxes.js | 2 +- build/classic/metaboxes.min.js | 2 +- build/gutenberg/core.css | 13 +- build/gutenberg/core.js | 2 +- build/gutenberg/core.min.css | 2 +- build/gutenberg/core.min.js | 2 +- build/gutenberg/metaboxes.js | 2 +- build/gutenberg/metaboxes.min.js | 2 +- languages/carbon-fields-ui.pot | 212 +------------------------------ 13 files changed, 27 insertions(+), 231 deletions(-) diff --git a/build/classic/core.css b/build/classic/core.css index ebe383c23..4d010a4ae 100644 --- a/build/classic/core.css +++ b/build/classic/core.css @@ -39,8 +39,7 @@ flex-direction: row; border-color: #e2e4e7; border-style: solid; - border-width: 1px; - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07); } + border-width: 1px; } .cf-association__bar .cf-search-input { flex: 1 1 auto; } .cf-association__bar .cf-search-input__inner { @@ -63,7 +62,7 @@ font-size: 12px; color: #23282d; pointer-events: none; - margin-right: 5px; + margin-right: 10px; margin-left: 5px; } .cf-association__spinner { @@ -93,7 +92,6 @@ max-height: 160px; overflow-y: auto; } .cf-association__col.ui-sortable .cf-association__option-title { - overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } @@ -157,8 +155,8 @@ display: flex; align-items: center; justify-content: space-between; } - .cf-association__col:first-child .cf-association__option-actions { - min-width: 48px; } + .cf-association__option-actions button { + margin-left: 8px; } .cf-association__option-sort { margin-right: 4px; @@ -171,7 +169,8 @@ outline: none; color: #82878c; transition: color 0.1s linear; - cursor: pointer; } + cursor: pointer; + background: transparent; } .cf-association__option-action:focus { color: #82878c; box-shadow: none; } diff --git a/build/classic/core.js b/build/classic/core.js index bb7a2f1b3..c82e60c0b 100644 --- a/build/classic/core.js +++ b/build/classic/core.js @@ -3130,7 +3130,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(__webpack_provided_wp_dot_element) {/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! immer */ \"immer\");\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(immer__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var refract_callbag__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! refract-callbag */ \"refract-callbag\");\n/* harmony import */ var refract_callbag__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(refract_callbag__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! classnames */ \"classnames\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_17__);\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! callbag-basics */ \"callbag-basics\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(callbag_basics__WEBPACK_IMPORTED_MODULE_18__);\n/* harmony import */ var callbag_of__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! callbag-of */ \"./node_modules/callbag-of/dist/callbag-of.esm.js\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./style.scss */ \"./packages/core/fields/association/style.scss\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_20__);\n/* harmony import */ var _components_search_input__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../components/search-input */ \"./packages/core/components/search-input/index.js\");\n/* harmony import */ var _components_sortable__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../components/sortable */ \"./packages/core/components/sortable/index.js\");\n/* harmony import */ var _utils_api_fetch__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../utils/api-fetch */ \"./packages/core/utils/api-fetch.js\");\n\n\n\n\n\n\n\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * Internal dependencies.\n */\n\n\n\n\n\n\nvar AssociationField =\n/*#__PURE__*/\nfunction (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default()(AssociationField, _Component);\n\n function AssociationField() {\n var _getPrototypeOf2;\n\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, AssociationField);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, (_getPrototypeOf2 = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(AssociationField)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"selectedList\", Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"createRef\"])());\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"sourceList\", Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"createRef\"])());\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSourceListScroll\", function () {\n var _this$props = _this.props,\n fetchOptions = _this$props.fetchOptions,\n setState = _this$props.setState,\n options = _this$props.options,\n page = _this$props.page,\n queryTerm = _this$props.queryTerm;\n var sourceList = _this.sourceList.current;\n\n if (sourceList.offsetHeight + sourceList.scrollTop === sourceList.scrollHeight) {\n setState({\n page: page + 1\n });\n fetchOptions({\n type: 'append',\n options: options,\n queryTerm: queryTerm,\n page: page + 1\n });\n }\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSearchChange\", function (queryTerm) {\n var _this$props2 = _this.props,\n fetchOptions = _this$props2.fetchOptions,\n setState = _this$props2.setState;\n setState({\n page: 1,\n queryTerm: queryTerm\n });\n fetchOptions({\n type: 'replace',\n page: 1,\n queryTerm: queryTerm\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleAddItem\", function (option) {\n var _this$props3 = _this.props,\n field = _this$props3.field,\n id = _this$props3.id,\n value = _this$props3.value,\n onChange = _this$props3.onChange,\n setState = _this$props3.setState,\n selectedOptions = _this$props3.selectedOptions; // Don't do anything if the duplicates aren't allowed and\n // the item is already selected.\n\n if (!field.duplicates_allowed && option.disabled) {\n return;\n } // Don't do anything, because the maximum is reached.\n\n\n if (field.max > 0 && value.length >= field.max) {\n // eslint-disable-next-line no-alert\n alert(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Maximum number of items reached (%s items)', 'carbon-fields-ui'), Number(field.max)));\n return;\n }\n\n onChange(id, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(value).concat([Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"pick\"])(option, 'id', 'type', 'subtype')]));\n setState({\n selectedOptions: _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(selectedOptions).concat([option])\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleRemoveItem\", function (option) {\n var _this$props4 = _this.props,\n value = _this$props4.value,\n id = _this$props4.id,\n onChange = _this$props4.onChange,\n setState = _this$props4.setState,\n selectedOptions = _this$props4.selectedOptions;\n onChange(id, Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"without\"])(value, option));\n setState({\n selectedOptions: Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"without\"])(selectedOptions, option)\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSort\", function (items) {\n var _this$props5 = _this.props,\n id = _this$props5.id,\n onChange = _this$props5.onChange;\n onChange(id, items);\n });\n\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(AssociationField, [{\n key: \"componentDidMount\",\n\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n value: function componentDidMount() {\n var _this$props6 = this.props,\n fetchSelectedOptions = _this$props6.fetchSelectedOptions,\n field = _this$props6.field,\n value = _this$props6.value,\n setState = _this$props6.setState;\n setState({\n options: field.options.options,\n totalOptionsCount: field.options.total_options\n });\n\n if (value.length) {\n fetchSelectedOptions();\n }\n\n this.sourceList.current.addEventListener('scroll', this.handleSourceListScroll);\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.sourceList.current.removeEventListener('scroll', this.handleSourceListScroll);\n }\n /**\n * Handles the scroll event of the source list.\n *\n * @return {void}\n */\n\n }, {\n key: \"render\",\n\n /**\n * Render the component.\n *\n * @return {Object}\n */\n value: function render() {\n var _this2 = this;\n\n var _this$props7 = this.props,\n name = _this$props7.name,\n value = _this$props7.value,\n field = _this$props7.field,\n totalOptionsCount = _this$props7.totalOptionsCount,\n selectedOptions = _this$props7.selectedOptions,\n queryTerm = _this$props7.queryTerm,\n isLoading = _this$props7.isLoading;\n var options = this.props.options;\n\n if (!field.duplicates_allowed) {\n options = immer__WEBPACK_IMPORTED_MODULE_10___default()(options, function (draft) {\n draft.map(function (option) {\n option.disabled = !!Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"find\"])(value, function (selectedOption) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"isMatch\"])(selectedOption, {\n id: option.id,\n type: option.type,\n subtype: option.subtype\n });\n });\n return option;\n });\n });\n }\n\n return __webpack_provided_wp_dot_element.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"Fragment\"], null, __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__bar\"\n }, __webpack_provided_wp_dot_element.createElement(_components_search_input__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n value: queryTerm,\n onChange: this.handleSearchChange\n }), isLoading ? __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__spinner spinner is-active\"\n }) : '', __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__counter\"\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Showing %1$d of %2$d results', 'carbon-fields-ui'), Number(options.length), Number(totalOptionsCount)))), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__cols\"\n }, __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__col\",\n ref: this.sourceList\n }, options.map(function (option, index) {\n return __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_16___default()('cf-association__option', {\n 'cf-association__option--selected': option.disabled\n }),\n key: index\n }, option.thumbnail && __webpack_provided_wp_dot_element.createElement(\"img\", {\n className: \"cf-association__option-thumb\",\n src: option.thumbnail\n }), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__option-content\"\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-title\"\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-title-inner\"\n }, option.title)), __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-type\"\n }, option.type)), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__option-actions\"\n }, option.edit_link && __webpack_provided_wp_dot_element.createElement(\"a\", {\n className: \"cf-association__option-action cf-association__option-action--edit dashicons dashicons-edit\",\n href: option.edit_link.replace('&', '&', 'g'),\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }), !option.disabled && (field.max < 0 || value.length < field.max) && __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n className: \"cf-association__option-action dashicons dashicons-plus-alt\",\n onClick: function onClick() {\n return _this2.handleAddItem(option);\n }\n })));\n })), __webpack_provided_wp_dot_element.createElement(_components_sortable__WEBPACK_IMPORTED_MODULE_22__[\"default\"], {\n forwardedRef: this.selectedList,\n items: value,\n options: {\n axis: 'y',\n forceHelperSize: true,\n forcePlaceholderSize: true,\n scroll: true,\n handle: '.cf-association__option-sort'\n },\n onUpdate: this.handleSort\n }, __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__col\",\n ref: this.selectedList\n }, !!selectedOptions.length && value.map(function (option, index) {\n var optionData = selectedOptions.find(function (selectedOption) {\n return selectedOption.id === option.id && selectedOption.type === option.type && selectedOption.subtype === option.subtype;\n });\n return __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__option\",\n key: index\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-sort dashicons dashicons-menu\"\n }), optionData.thumbnail && __webpack_provided_wp_dot_element.createElement(\"img\", {\n className: \"cf-association__option-thumb\",\n src: optionData.thumbnail\n }), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__option-content\"\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-title\"\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-title-inner\"\n }, optionData.title)), __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-type\"\n }, optionData.type)), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__option-actions\"\n }, __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n className: \"cf-association__option-action dashicons dashicons-dismiss\",\n onClick: function onClick() {\n return _this2.handleRemoveItem(option);\n }\n })), __webpack_provided_wp_dot_element.createElement(\"input\", {\n type: \"hidden\",\n name: \"\".concat(name, \"[\").concat(index, \"]\"),\n value: \"\".concat(optionData.type, \":\").concat(optionData.subtype, \":\").concat(optionData.id),\n readOnly: true\n }));\n })))));\n }\n }]);\n\n return AssociationField;\n}(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"Component\"]);\n/**\n * The function that controls the stream of side-effects.\n *\n * @param {Object} component\n * @return {Object}\n */\n\n\nfunction aperture(component) {\n var actions = [{\n event: 'fetchOptionsEvent',\n prop: 'fetchOptions',\n type: 'FETCH_OPTIONS'\n }, {\n event: 'fetchSelectedOptionsEvent',\n prop: 'fetchSelectedOptions',\n type: 'FETCH_SELECTED_OPTIONS'\n }].map(function (actionData) {\n var _component$useEvent = component.useEvent(actionData.event),\n _component$useEvent2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_component$useEvent, 2),\n actionChannel$ = _component$useEvent2[0],\n action = _component$useEvent2[1];\n\n return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, actionData, {\n action: action,\n channel$: actionChannel$\n });\n });\n var combined$ = Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"pipe\"])(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"combine\"].apply(void 0, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(actions.map(function (_ref) {\n var action = _ref.action,\n prop = _ref.prop;\n return Object(callbag_of__WEBPACK_IMPORTED_MODULE_19__[\"default\"])({\n action: action,\n prop: prop\n });\n }))), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"map\"])(function (combinedActions) {\n return Object(refract_callbag__WEBPACK_IMPORTED_MODULE_15__[\"toProps\"])(combinedActions.reduce(function (acc, curr) {\n return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, acc, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()({}, curr.prop, curr.action));\n }, {}));\n }));\n return callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"merge\"].apply(void 0, [combined$].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(actions.map(function (_ref2) {\n var channel$ = _ref2.channel$,\n type = _ref2.type;\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"pipe\"])(channel$, Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"map\"])(function (payload) {\n return {\n type: type,\n payload: payload\n };\n }));\n }))));\n}\n/**\n * The function that causes the side effects.\n *\n * @param {Object} props\n * @return {Function}\n */\n\n\nfunction handler(props) {\n return function (effect) {\n var payload = effect.payload,\n type = effect.type;\n var setState = props.setState,\n selectedOptions = props.selectedOptions,\n hierarchyResolver = props.hierarchyResolver;\n\n switch (type) {\n case 'FETCH_OPTIONS':\n setState({\n isLoading: true\n }); // eslint-disable-next-line\n\n var request = window.jQuery.get(window.ajaxurl, {\n action: 'carbon_fields_fetch_association_options',\n term: payload.queryTerm,\n page: payload.page || 1,\n container_id: props.containerId,\n field_name: hierarchyResolver()\n }, null, 'json');\n /* eslint-disable-next-line no-alert */\n\n var errorHandler = function errorHandler() {\n return alert(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('An error occurred while trying to fetch association options.', 'carbon-fields-ui'));\n };\n\n request.done(function (response) {\n if (response && response.success) {\n setState({\n options: payload.type === 'replace' ? response.data.options : _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(payload.options).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(response.data.options)),\n totalOptionsCount: response.data.total_options\n });\n } else {\n errorHandler();\n }\n });\n request.fail(errorHandler);\n request.always(function () {\n setState({\n isLoading: false\n });\n });\n break;\n\n case 'FETCH_SELECTED_OPTIONS':\n Object(_utils_api_fetch__WEBPACK_IMPORTED_MODULE_23__[\"default\"])(\"\".concat(window.wpApiSettings.root, \"carbon-fields/v1/association/\"), 'get', {\n container_id: props.containerId,\n options: props.value.map(function (option) {\n return \"\".concat(option.id, \":\").concat(option.type, \":\").concat(option.subtype);\n }).join(';'),\n field_id: hierarchyResolver()\n }).then(function (response) {\n setState({\n selectedOptions: _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(selectedOptions).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(response))\n });\n });\n break;\n }\n };\n}\n\nvar applyWithState = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__[\"withState\"])({\n options: [],\n selectedOptions: [],\n totalOptionsCount: 0,\n queryTerm: '',\n page: 1,\n isLoading: false\n});\nvar applyWithEffects = Object(refract_callbag__WEBPACK_IMPORTED_MODULE_15__[\"withEffects\"])(aperture, {\n handler: handler\n});\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__[\"addFilter\"])('carbon-fields.association.validate', 'carbon-fields/core', function (field, value) {\n var min = field.min,\n required = field.required;\n\n if (required && Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"isEmpty\"])(value)) {\n return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('This field is required.', 'carbon-fields-ui');\n }\n\n if (min > 0 && value.length < min) {\n return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Minimum number of items not reached (%s items)', 'carbon-fields-ui'), [field.min]);\n }\n\n return null;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__[\"compose\"])(applyWithState, applyWithEffects)(AssociationField));\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\")))\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/core/fields/association/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(__webpack_provided_wp_dot_element) {/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! immer */ \"immer\");\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(immer__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var refract_callbag__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! refract-callbag */ \"refract-callbag\");\n/* harmony import */ var refract_callbag__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(refract_callbag__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! classnames */ \"classnames\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_17__);\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! callbag-basics */ \"callbag-basics\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(callbag_basics__WEBPACK_IMPORTED_MODULE_18__);\n/* harmony import */ var callbag_of__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! callbag-of */ \"./node_modules/callbag-of/dist/callbag-of.esm.js\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./style.scss */ \"./packages/core/fields/association/style.scss\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_20__);\n/* harmony import */ var _components_search_input__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../components/search-input */ \"./packages/core/components/search-input/index.js\");\n/* harmony import */ var _components_sortable__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../components/sortable */ \"./packages/core/components/sortable/index.js\");\n/* harmony import */ var _utils_api_fetch__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../utils/api-fetch */ \"./packages/core/utils/api-fetch.js\");\n\n\n\n\n\n\n\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * Internal dependencies.\n */\n\n\n\n\n\n\nvar AssociationField =\n/*#__PURE__*/\nfunction (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default()(AssociationField, _Component);\n\n function AssociationField() {\n var _getPrototypeOf2;\n\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, AssociationField);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, (_getPrototypeOf2 = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(AssociationField)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"selectedList\", Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"createRef\"])());\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"sourceList\", Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"createRef\"])());\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSourceListScroll\", function () {\n var _this$props = _this.props,\n fetchOptions = _this$props.fetchOptions,\n setState = _this$props.setState,\n options = _this$props.options,\n page = _this$props.page,\n queryTerm = _this$props.queryTerm;\n var sourceList = _this.sourceList.current;\n\n if (sourceList.offsetHeight + sourceList.scrollTop === sourceList.scrollHeight) {\n setState({\n page: page + 1\n });\n fetchOptions({\n type: 'append',\n options: options,\n queryTerm: queryTerm,\n page: page + 1\n });\n }\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSearchChange\", Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"debounce\"])(function (queryTerm) {\n var _this$props2 = _this.props,\n fetchOptions = _this$props2.fetchOptions,\n setState = _this$props2.setState;\n setState({\n page: 1,\n queryTerm: queryTerm\n });\n fetchOptions({\n type: 'replace',\n page: 1,\n queryTerm: queryTerm\n });\n }, 250));\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleAddItem\", function (option) {\n var _this$props3 = _this.props,\n field = _this$props3.field,\n id = _this$props3.id,\n value = _this$props3.value,\n onChange = _this$props3.onChange,\n setState = _this$props3.setState,\n selectedOptions = _this$props3.selectedOptions; // Don't do anything if the duplicates aren't allowed and\n // the item is already selected.\n\n if (!field.duplicates_allowed && option.disabled) {\n return;\n } // Don't do anything, because the maximum is reached.\n\n\n if (field.max > 0 && value.length >= field.max) {\n // eslint-disable-next-line no-alert\n alert(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Maximum number of items reached (%s items)', 'carbon-fields-ui'), Number(field.max)));\n return;\n }\n\n onChange(id, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(value).concat([Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"pick\"])(option, 'id', 'type', 'subtype')]));\n setState({\n selectedOptions: _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(selectedOptions).concat([option])\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleRemoveItem\", function (option) {\n var _this$props4 = _this.props,\n value = _this$props4.value,\n id = _this$props4.id,\n onChange = _this$props4.onChange,\n setState = _this$props4.setState,\n selectedOptions = _this$props4.selectedOptions;\n onChange(id, Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"without\"])(value, option));\n setState({\n selectedOptions: Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"without\"])(selectedOptions, option)\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSort\", function (items) {\n var _this$props5 = _this.props,\n id = _this$props5.id,\n onChange = _this$props5.onChange;\n onChange(id, items);\n });\n\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(AssociationField, [{\n key: \"componentDidMount\",\n\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n value: function componentDidMount() {\n var _this$props6 = this.props,\n fetchSelectedOptions = _this$props6.fetchSelectedOptions,\n field = _this$props6.field,\n value = _this$props6.value,\n setState = _this$props6.setState;\n setState({\n options: field.options.options,\n totalOptionsCount: field.options.total_options\n });\n\n if (value.length) {\n fetchSelectedOptions();\n }\n\n this.sourceList.current.addEventListener('scroll', this.handleSourceListScroll);\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.sourceList.current.removeEventListener('scroll', this.handleSourceListScroll);\n }\n /**\n * Handles the scroll event of the source list.\n *\n * @return {void}\n */\n\n }, {\n key: \"render\",\n\n /**\n * Render the component.\n *\n * @return {Object}\n */\n value: function render() {\n var _this2 = this;\n\n var _this$props7 = this.props,\n name = _this$props7.name,\n value = _this$props7.value,\n field = _this$props7.field,\n totalOptionsCount = _this$props7.totalOptionsCount,\n selectedOptions = _this$props7.selectedOptions,\n queryTerm = _this$props7.queryTerm,\n isLoading = _this$props7.isLoading;\n var options = this.props.options;\n\n if (!field.duplicates_allowed) {\n options = immer__WEBPACK_IMPORTED_MODULE_10___default()(options, function (draft) {\n draft.map(function (option) {\n option.disabled = !!Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"find\"])(value, function (selectedOption) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"isMatch\"])(selectedOption, {\n id: option.id,\n type: option.type,\n subtype: option.subtype\n });\n });\n return option;\n });\n });\n }\n\n return __webpack_provided_wp_dot_element.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"Fragment\"], null, __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__bar\"\n }, __webpack_provided_wp_dot_element.createElement(_components_search_input__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n value: queryTerm,\n onChange: this.handleSearchChange\n }), isLoading ? __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__spinner spinner is-active\"\n }) : '', __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__counter\"\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Showing %1$d of %2$d results', 'carbon-fields-ui'), Number(options.length), Number(totalOptionsCount)))), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__cols\"\n }, __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__col\",\n ref: this.sourceList\n }, options.map(function (option, index) {\n return __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_16___default()('cf-association__option', {\n 'cf-association__option--selected': option.disabled\n }),\n key: index\n }, option.thumbnail && __webpack_provided_wp_dot_element.createElement(\"img\", {\n className: \"cf-association__option-thumb\",\n src: option.thumbnail\n }), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__option-content\"\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-title\"\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-title-inner\"\n }, option.title)), __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-type\"\n }, option.type)), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__option-actions\"\n }, option.edit_link && __webpack_provided_wp_dot_element.createElement(\"a\", {\n className: \"cf-association__option-action cf-association__option-action--edit dashicons dashicons-edit\",\n href: option.edit_link.replace('&', '&', 'g'),\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }), !option.disabled && (field.max < 0 || value.length < field.max) && __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n className: \"cf-association__option-action dashicons dashicons-plus-alt\",\n onClick: function onClick() {\n return _this2.handleAddItem(option);\n }\n })));\n })), __webpack_provided_wp_dot_element.createElement(_components_sortable__WEBPACK_IMPORTED_MODULE_22__[\"default\"], {\n forwardedRef: this.selectedList,\n items: value,\n options: {\n axis: 'y',\n forceHelperSize: true,\n forcePlaceholderSize: true,\n scroll: true,\n handle: '.cf-association__option-sort'\n },\n onUpdate: this.handleSort\n }, __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__col\",\n ref: this.selectedList\n }, !!selectedOptions.length && value.map(function (option, index) {\n var optionData = selectedOptions.find(function (selectedOption) {\n return selectedOption.id === option.id && selectedOption.type === option.type && selectedOption.subtype === option.subtype;\n });\n return __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__option\",\n key: index\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-sort dashicons dashicons-menu\"\n }), optionData.thumbnail && __webpack_provided_wp_dot_element.createElement(\"img\", {\n className: \"cf-association__option-thumb\",\n src: optionData.thumbnail\n }), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__option-content\"\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-title\"\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-title-inner\"\n }, optionData.title)), __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-association__option-type\"\n }, optionData.type)), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-association__option-actions\"\n }, __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n className: \"cf-association__option-action dashicons dashicons-dismiss\",\n onClick: function onClick() {\n return _this2.handleRemoveItem(option);\n }\n })), __webpack_provided_wp_dot_element.createElement(\"input\", {\n type: \"hidden\",\n name: \"\".concat(name, \"[\").concat(index, \"]\"),\n value: \"\".concat(optionData.type, \":\").concat(optionData.subtype, \":\").concat(optionData.id),\n readOnly: true\n }));\n })))));\n }\n }]);\n\n return AssociationField;\n}(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"Component\"]);\n/**\n * The function that controls the stream of side-effects.\n *\n * @param {Object} component\n * @return {Object}\n */\n\n\nfunction aperture(component) {\n var actions = [{\n event: 'fetchOptionsEvent',\n prop: 'fetchOptions',\n type: 'FETCH_OPTIONS'\n }, {\n event: 'fetchSelectedOptionsEvent',\n prop: 'fetchSelectedOptions',\n type: 'FETCH_SELECTED_OPTIONS'\n }].map(function (actionData) {\n var _component$useEvent = component.useEvent(actionData.event),\n _component$useEvent2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_component$useEvent, 2),\n actionChannel$ = _component$useEvent2[0],\n action = _component$useEvent2[1];\n\n return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, actionData, {\n action: action,\n channel$: actionChannel$\n });\n });\n var combined$ = Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"pipe\"])(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"combine\"].apply(void 0, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(actions.map(function (_ref) {\n var action = _ref.action,\n prop = _ref.prop;\n return Object(callbag_of__WEBPACK_IMPORTED_MODULE_19__[\"default\"])({\n action: action,\n prop: prop\n });\n }))), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"map\"])(function (combinedActions) {\n return Object(refract_callbag__WEBPACK_IMPORTED_MODULE_15__[\"toProps\"])(combinedActions.reduce(function (acc, curr) {\n return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, acc, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()({}, curr.prop, curr.action));\n }, {}));\n }));\n return callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"merge\"].apply(void 0, [combined$].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(actions.map(function (_ref2) {\n var channel$ = _ref2.channel$,\n type = _ref2.type;\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"pipe\"])(channel$, Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"map\"])(function (payload) {\n return {\n type: type,\n payload: payload\n };\n }));\n }))));\n}\n/**\n * The function that causes the side effects.\n *\n * @param {Object} props\n * @return {Function}\n */\n\n\nfunction handler(props) {\n return function (effect) {\n var payload = effect.payload,\n type = effect.type;\n var setState = props.setState,\n selectedOptions = props.selectedOptions,\n hierarchyResolver = props.hierarchyResolver;\n\n switch (type) {\n case 'FETCH_OPTIONS':\n setState({\n isLoading: true\n }); // eslint-disable-next-line\n\n var request = window.jQuery.get(window.ajaxurl, {\n action: 'carbon_fields_fetch_association_options',\n term: payload.queryTerm,\n page: payload.page || 1,\n container_id: props.containerId,\n field_name: hierarchyResolver()\n }, null, 'json');\n /* eslint-disable-next-line no-alert */\n\n var errorHandler = function errorHandler() {\n return alert(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('An error occurred while trying to fetch association options.', 'carbon-fields-ui'));\n };\n\n request.done(function (response) {\n if (response && response.success) {\n setState({\n options: payload.type === 'replace' ? response.data.options : _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(payload.options).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(response.data.options)),\n totalOptionsCount: response.data.total_options\n });\n } else {\n errorHandler();\n }\n });\n request.fail(errorHandler);\n request.always(function () {\n setState({\n isLoading: false\n });\n });\n break;\n\n case 'FETCH_SELECTED_OPTIONS':\n Object(_utils_api_fetch__WEBPACK_IMPORTED_MODULE_23__[\"default\"])(\"\".concat(window.wpApiSettings.root, \"carbon-fields/v1/association/\"), 'get', {\n container_id: props.containerId,\n options: props.value.map(function (option) {\n return \"\".concat(option.id, \":\").concat(option.type, \":\").concat(option.subtype);\n }).join(';'),\n field_id: hierarchyResolver()\n }).then(function (response) {\n setState({\n selectedOptions: _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(selectedOptions).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(response))\n });\n });\n break;\n }\n };\n}\n\nvar applyWithState = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__[\"withState\"])({\n options: [],\n selectedOptions: [],\n totalOptionsCount: 0,\n queryTerm: '',\n page: 1,\n isLoading: false\n});\nvar applyWithEffects = Object(refract_callbag__WEBPACK_IMPORTED_MODULE_15__[\"withEffects\"])(aperture, {\n handler: handler\n});\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__[\"addFilter\"])('carbon-fields.association.validate', 'carbon-fields/core', function (field, value) {\n var min = field.min,\n required = field.required;\n\n if (required && Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"isEmpty\"])(value)) {\n return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('This field is required.', 'carbon-fields-ui');\n }\n\n if (min > 0 && value.length < min) {\n return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Minimum number of items not reached (%s items)', 'carbon-fields-ui'), [field.min]);\n }\n\n return null;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__[\"compose\"])(applyWithState, applyWithEffects)(AssociationField));\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\")))\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/core/fields/association/index.js?"); /***/ }), diff --git a/build/classic/core.min.css b/build/classic/core.min.css index fd45a6d4e..734fca81c 100644 --- a/build/classic/core.min.css +++ b/build/classic/core.min.css @@ -1 +1 @@ -.container-carbon_fields_container_word_settings{min-width:0;max-width:100%;width:100%}.cf-container .cf-field{max-width:100%}.cf-association__bar{position:relative;z-index:1;display:flex;justify-content:space-between;align-items:center;flex-direction:row;border:1px solid #e2e4e7;box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.cf-association__bar .cf-search-input{flex:1 1 auto}.cf-association__bar .cf-search-input__inner{border:0;box-shadow:none}.cf-association__bar .cf-search-input__inner:focus{border-color:none;box-shadow:none;outline:none}.cf-association__bar[focus-within]{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}.cf-association__bar:focus-within{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}.cf-association__counter{font-size:12px;color:#23282d;pointer-events:none;margin-right:5px;margin-left:5px}.cf-association__spinner{float:none;margin:0 0 0 5px}.cf-association__cols{background:#fff;position:relative;z-index:0;display:flex;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7}.cf-association__cols:before{position:absolute;top:0;left:50%;width:1px;height:100%;background-color:#e2e4e7;content:""}.cf-association__col{width:50%;max-height:160px;overflow-y:auto}.cf-association__col.ui-sortable .cf-association__option-title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.cf-association__option{display:flex;align-items:center;padding:4px 8px;height:32px;box-sizing:border-box}.cf-association__option--selected{background-color:#fbfbfc}.cf-association__option+.cf-association__option{border-top:1px solid #e2e4e7}.cf-association__option.ui-sortable-helper{border-top:0;background-color:#fbfbfc}.cf-association__option-thumb{flex:none;display:block;width:24px;height:24px;margin-right:8px}.cf-association__option-content{display:flex;align-items:center;justify-content:space-between;flex:1;min-width:0;margin-right:8px}.cf-association__option-title{flex:1;position:relative;margin-right:4px}.cf-association__option--selected .cf-association__option-title{color:#82878c}.cf-association__option-title-inner{position:absolute;top:0;left:0;width:100%;font-size:13px;line-height:1.4;color:#32373c;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.cf-association__option-type{font-size:9px;line-height:1;text-transform:uppercase;color:#82878c}.cf-association__option-actions{display:flex;align-items:center;justify-content:space-between}.cf-association__col:first-child .cf-association__option-actions{min-width:48px}.cf-association__option-sort{margin-right:4px;color:#82878c;cursor:move}.cf-association__option-action{padding:0;border:0;outline:none;color:#82878c;transition:color .1s linear;cursor:pointer}.cf-association__option-action:focus{color:#82878c;box-shadow:none}.cf-association__option-action:hover{color:#23282d}.cf-search-input{position:relative}.cf-search-input:before{position:absolute;top:50%;left:9px;margin-top:-10px}.postbox .cf-search-input:before{color:#32373c}.wp-block .cf-search-input:before{color:#555d66}.cf-search-input__inner{display:block;width:100%;margin:0}.block-editor .cf-field .cf-search-input__inner,.cf-container .cf-search-input__inner{padding-left:35px}.cf-container .cf-search-input__inner{padding-top:8px;padding-bottom:8px;border-color:#e2e4e7}.block-editor .cf-container .cf-search-input__inner,.edit-post-sidebar .cf-block__fields .cf-search-input__inner,.wp-block .cf-field .cf-search-input__inner{border-radius:0;border:0}.block-editor .cf-container .cf-search-input__inner:focus,.edit-post-sidebar .cf-block__fields .cf-search-input__inner:focus,.wp-block .cf-field .cf-search-input__inner:focus{box-shadow:none}.cf-field .cf-checkbox__input{margin-top:0}.cf-color__inner{display:flex;align-items:center}.cf-color__toggle{position:relative;overflow:hidden}.cf-color__toggle-text{margin-left:27px}.cf-color__preview{position:absolute;top:0;left:0;width:26px;height:100%;border-right:1px solid #ccc}.cf-color__toggle:active .cf-color__preview,.cf-color__toggle:hover .cf-color__preview{border-color:#999}.cf-color .cf-color__reset{margin-left:5px;text-decoration:none}.cf-color .cf-color__reset:focus{box-shadow:none}.cf-color__picker{position:absolute;z-index:9999}.cf-complex__groups{flex:1;position:relative}.cf-complex--tabbed-vertical>.cf-complex__groups{flex:0 0 80%}.cf-complex__group{box-sizing:border-box}.cf-complex--grid .cf-complex__group{position:relative;margin-bottom:12px}.cf-complex--grid .cf-complex__group:last-child{margin-bottom:0}.cf-complex__group-placeholder{position:relative}.cf-complex__group-placeholder:not(:last-child){margin-bottom:12px}.cf-complex__group-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%;border:1px dashed #e2e4e7;box-sizing:border-box;content:""}.cf-complex__group-head{position:relative;display:flex;border:1px solid #e2e4e7;border-bottom:0;background-color:#fbfbfc;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:600;line-height:1.4;color:#23282d;cursor:move;transition:border-color .1s linear}.cf-complex__group-head:hover{border-color:#82878c}.cf-complex__group-index{display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-right:1px solid #e2e4e7}.cf-complex__group-title{display:flex;align-items:center;padding:0 12px}.cf-complex__group-body{display:flex;flex-wrap:wrap;border:1px solid #e2e4e7;border-right-width:0;background-color:#fff}.cf-complex__group-body[hidden]{display:none}.cf-complex__actions{display:flex;align-items:center;margin-top:12px}.cf-complex__actions .cf-complex__toggler{margin-left:auto}.cf-complex__inserter{position:relative;display:inline-block}.cf-complex__tabs .cf-complex__inserter{height:36px}.cf-complex__tabs--tabbed-horizontal .cf-complex__inserter{width:36px;align-self:flex-end;margin-bottom:4px}.cf-complex__tabs--tabbed-vertical .cf-complex__inserter{display:block}.cf-complex__tabs .cf-complex__inserter-button{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border:1px solid #e2e4e7;border-radius:0;margin:0;background-color:#fbfbfc;box-shadow:none;font-size:18px;line-height:1;transition:background-color .1s linear}.cf-complex__tabs .cf-complex__inserter-button:active,.cf-complex__tabs .cf-complex__inserter-button:focus,.cf-complex__tabs .cf-complex__inserter-button:hover{border-color:#e2e4e7;background-color:#fff}.cf-complex__tabs .cf-complex__inserter-button:focus{box-shadow:none}.cf-complex__tabs .cf-complex__inserter-button:active{box-shadow:none;-webkit-transform:none;transform:none}.cf-complex__inserter-menu{position:absolute;top:50%;left:100%;min-width:180px;margin:0;-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%);z-index:1}.cf-complex__inserter-item{padding:8px 12px;margin:0;cursor:pointer;transition:color .1s linear}.cf-complex__group-actions{display:flex;align-items:center}.cf-complex__group-actions--grid{position:absolute;top:12px;right:12px}.cf-complex__group-actions--tabbed{justify-content:flex-end;padding:8px 12px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7;background-color:#fbfbfc}.cf-complex__group-action{display:inline-flex;padding:0;border:0;margin-left:12px;outline:none;background-color:transparent;color:#82878c;cursor:pointer;transition:color .1s linear}.cf-complex__group-action:first-child{margin-left:0}.cf-complex__group-action:hover{color:#23282d}.cf-complex__group-action-text{display:none}.cf-complex__tabs{position:relative;z-index:1}.cf-complex__tabs--tabbed-horizontal{display:inline-flex;margin-bottom:-5px}.cf-complex__tabs--tabbed-vertical{flex:0 0 20%;margin-right:-1px}.cf-complex__tabs-list{margin:0}.cf-complex__tabs--tabbed-horizontal .cf-complex__tabs-list{display:flex;flex-wrap:wrap}.cf-complex__tabs--tabbed-vertical .cf-complex__tabs-list{margin-bottom:-1px}.cf-complex__tabs-item{display:flex;align-items:center;padding:8px 12px;border:1px solid #e2e4e7;margin:0;background-color:#fbfbfc;font-size:12px;cursor:pointer;transition:background-color .1s linear,border-color .1s linear}.cf-complex__tabs-item:hover{background-color:#fff}.cf-complex__tabs-item--tabbed-horizontal{margin:0 4px 4px 0}.cf-complex__tabs-item--tabbed-vertical~.cf-complex__tabs-item--tabbed-vertical{border-top-width:0}.cf-complex__tabs-item--current{background-color:#fff}.cf-complex__tabs-item--tabbed-horizontal.cf-complex__tabs-item--current{border-bottom-color:#fff!important}.cf-complex__tabs-item--tabbed-vertical.cf-complex__tabs-item--current{border-right-color:#fff!important}.cf-complex__placeholder-label.cf-complex__placeholder-label{margin:8px 0 12px}.cf-container-term-meta .cf-complex__placeholder-label{font-style:normal;color:inherit}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08)}.flatpickr-calendar.inline,.flatpickr-calendar.open{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasTime .dayContainer,.flatpickr-calendar .hasWeeks .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:after,.flatpickr-calendar:before{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:after,.flatpickr-calendar.rightMost:before{left:auto;right:22px}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:after,.flatpickr-calendar.arrowTop:before{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:after,.flatpickr-calendar.arrowBottom:before{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9);height:28px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-next-month,.flatpickr-months .flatpickr-prev-month{text-decoration:none;cursor:pointer;position:absolute;top:0;line-height:16px;height:28px;padding:10px;z-index:3;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9)}.flatpickr-months .flatpickr-next-month.disabled,.flatpickr-months .flatpickr-prev-month.disabled{display:none}.flatpickr-months .flatpickr-next-month i,.flatpickr-months .flatpickr-prev-month i{position:relative}.flatpickr-months .flatpickr-next-month.flatpickr-prev-month,.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-next-month.flatpickr-next-month,.flatpickr-months .flatpickr-prev-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-next-month:hover,.flatpickr-months .flatpickr-prev-month:hover{color:#959ea9}.flatpickr-months .flatpickr-next-month:hover svg,.flatpickr-months .flatpickr-prev-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-next-month svg,.flatpickr-months .flatpickr-prev-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-next-month svg path,.flatpickr-months .flatpickr-prev-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,.1)}.numInputWrapper span:active{background:rgba(0,0,0,.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,.5)}.numInputWrapper:hover{background:rgba(0,0,0,.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:6.16px 0 0;line-height:1;height:28px;display:inline-block;text-align:center;-webkit-transform:translateZ(0);transform:translateZ(0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:baseline;vertical-align:initial}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,.5);background:transparent;pointer-events:none}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays,.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-weekdays .flatpickr-weekdaycontainer,span.flatpickr-weekday{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,.54);line-height:1;margin:0;text-align:center;display:block;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day.nextMonthDay:focus,.flatpickr-day.nextMonthDay:hover,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.today.inRange,.flatpickr-day:focus,.flatpickr-day:hover{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:focus,.flatpickr-day.today:hover{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.endRange,.flatpickr-day.endRange.inRange,.flatpickr-day.endRange.nextMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.endRange:focus,.flatpickr-day.endRange:hover,.flatpickr-day.selected,.flatpickr-day.selected.inRange,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.selected:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange,.flatpickr-day.startRange.inRange,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.startRange:focus,.flatpickr-day.startRange:hover{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.endRange.startRange,.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.endRange.endRange,.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.endRange.startRange.endRange,.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.disabled,.flatpickr-day.disabled:hover,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.nextMonthDay,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.prevMonthDay{color:rgba(57,57,57,.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.disabled,.flatpickr-day.disabled:hover{cursor:not-allowed;color:rgba(57,57,57,.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{display:inline-block;float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden}.flatpickr-innerContainer,.flatpickr-rContainer{-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-rContainer{display:inline-block;padding:0}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-am-pm,.flatpickr-time .flatpickr-time-separator{height:inherit;display:inline-block;float:left;line-height:inherit;color:#393939;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time .flatpickr-am-pm:focus,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time input:hover{background:#f3f3f3}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.cf-datetime__inner{display:flex;align-items:stretch;flex-wrap:wrap;margin-top:-5px}.cf-datetime__inner:before{display:none}.cf-datetime__input{flex:1;margin:5px 6px 0 0}.wp-core-ui .button.cf-datetime__button{margin-top:5px}.cf-datetime__button{flex:0 0 auto}.cf-field .cf-datetime__button{margin-bottom:0;box-shadow:none}.cf-file__inner{position:relative;display:flex;align-items:center;justify-content:center;width:130px;height:130px;border:1px dashed #b5bcc2;box-sizing:border-box}.cf-file__content{position:absolute;top:-1px;right:-1px;bottom:-1px;left:-1px;border:1px solid #b5bcc2}.cf-file__preview{position:absolute;top:0;left:0;bottom:28px;width:100%;overflow:hidden;background-color:#e2e4e7;box-shadow:inset 0 0 15px rgba(0,0,0,.1)}.cf-file__image{position:absolute;top:50%;left:50%;height:auto;max-width:100%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cf-file__name{position:absolute;bottom:0;left:0;right:0;padding:5px;border-top:1px solid #b5bcc2;overflow:hidden;background-color:#f3f4f5;white-space:nowrap;text-overflow:ellipsis}.cf-file__browse{position:relative}.cf-file__content~.cf-file__browse{margin-bottom:29px;visibility:hidden;opacity:0;transition:visibility .1s linear,opacity .1s linear}.cf-file__inner:hover .cf-file__content~.cf-file__browse{visibility:visible;opacity:1}.cf-file__remove{position:absolute;top:5px;right:5px;padding:0;border:0;outline:none;background-color:transparent;cursor:pointer;transition:opacity .1s linear}.cf-file__remove:hover{opacity:.8}.cf-file__remove:before{border-radius:50%;background-color:#191e23;color:#fff}.cf-map__search{position:relative;z-index:1}.cf-map__canvas{position:relative;z-index:0;height:300px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7;background-color:#f3f4f5}.cf-media-gallery__list{display:flex;flex-wrap:wrap;max-height:400px;padding:4px;margin:0;overflow-y:auto;list-style:none outside none}.cf-media-gallery__list:empty{display:none}.cf-media-gallery__actions{padding:8px}.cf-media-gallery__list:empty~.cf-media-gallery__actions{border-top-width:0}.cf-media-gallery__item{flex:0 0 100%;min-width:0;padding:4px;margin:0;box-sizing:border-box}@media (min-width:320px){.cf-media-gallery__item{flex-basis:50%}}@media (min-width:480px){.cf-media-gallery__item{flex-basis:33.3333%}}@media (min-width:640px){.cf-media-gallery__item{flex-basis:25%}}@media (min-width:768px){.cf-media-gallery__item{flex-basis:20%}}@media (min-width:1280px){.cf-media-gallery__item{flex-basis:16.66667%}}@media (min-width:1440px){.cf-media-gallery__item{flex-basis:12.5%}}@media (min-width:1680px){.cf-media-gallery__item{flex-basis:10%}}.cf-media-gallery__item-inner{position:relative;display:flex;flex-direction:column;height:100%}.cf-media-gallery__item-preview{position:relative;overflow:hidden;padding-top:100%;flex:1}.cf-media-gallery__item-thumb{min-width:100%;min-height:100%;max-width:150%;pointer-events:none}.cf-media-gallery__item-icon,.cf-media-gallery__item-thumb{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cf-media-gallery__item-icon{max-width:100%;max-height:50%}.cf-media-gallery__item-name{display:block;padding:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:move}.cf-media-gallery__item-remove{position:absolute;top:4px;right:4px;padding:0;border:0;outline:none;background-color:transparent;cursor:pointer}.cf-media-gallery__item-remove:before{border-radius:50%;background-color:#191e23;color:#fff;transition:color .1s linear}.cf-media-gallery__item-remove:hover:before{color:#b5bcc2}.cf-multiselect__control{min-height:0;border-color:#e2e4e7}.cf-multiselect__control:hover{border-color:#e2e4e7}.cf-multiselect__control--is-focused,.cf-multiselect__control--is-focused:hover{border-color:#00a0d2!important;box-shadow:none}.cf-multiselect__placeholder{color:#b5bcc2}.cf-multiselect__value-container{padding-left:4px;padding-right:4px}.cf-multiselect__multi-value{align-items:center;padding:5px 3px;margin:0;background-color:#e2e4e7}.cf-multiselect__multi-value+.cf-multiselect__multi-value{margin-left:5px}.cf-multiselect__multi-value__label{padding-left:3px;font-size:13px;line-height:1}.cf-multiselect__multi-value__remove{padding:0;margin-top:1px;cursor:pointer}.cf-multiselect__multi-value__remove:hover{background-color:transparent}.cf-multiselect__input input[id],.cf-multiselect__input input[id]:focus{box-shadow:none}.cf-multiselect__menu{z-index:9999}.cf-multiselect__option{padding:4px}.cf-multiselect__option--is-focused{background-color:#00a0d2;color:#fff}.cf-multiselect__indicator{padding:5px;cursor:pointer}.cf-oembed__preview{padding:12px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7}.cf-oembed__frame{display:block;width:100%;max-width:600px;margin:0 auto}.cf-radio__list{margin:0}.cf-radio-image .cf-radio__list{display:flex;flex-wrap:wrap}.cf-radio__list-item:last-child{margin-bottom:0}.cf-radio-image .cf-radio__list-item{flex:0 0 20%;position:relative;padding:4px}.cf-container-term-meta .cf-radio__label{display:inline}.cf-radio-image .cf-radio__label{display:inline-block}.cf-field .cf-radio__input{margin-top:0}.cf-radio-image .cf-radio__input{position:absolute;z-index:-1;top:50%;left:50%;width:0;height:0;margin:0;outline:0;opacity:0}.cf-radio-image__image{display:block;max-width:100%;padding:5px;box-sizing:border-box}.wp-block .cf-radio__list{list-style:none outside none}.cf-radio__list-item{box-sizing:border-box}.cf-container-term-meta .cf-radio__list-item{flex:0 0 20%}.cf-container-theme-options .cf-radio__list-item{flex:0 0 10%}.cf-radio-image__image{border:1px solid #e2e4e7}.cf-radio__input:checked~.cf-radio__label .cf-radio-image__image,.cf-radio__input:focus~.cf-radio__label .cf-radio-image__image{outline:4px solid #00a0d2}.cf-select__input{display:block;width:100%;margin:0}.cf-container-term-meta .cf-separator .cf-field__head{display:none}.cf-container-term-meta .cf-separator .cf-field__body{position:absolute;left:0}.cf-set__list{margin:0}.cf-set__list-item:last-child{margin-bottom:0}.cf-field .cf-set__input{margin-top:0}.cf-container-term-meta .cf-set__label{display:inline}.cf-text__input{display:block;width:100%!important;margin:0}.cf-textarea__input{display:block;width:100%!important;resize:vertical}.cf-field,.cf-field__body,.cf-field__head{box-sizing:border-box;flex:1 1 100%}@media (max-width:1024px){.cf-field{flex-basis:100%!important}}.cf-rich-text .cf-field__body{box-sizing:content-box}.cf-complex--tabbed-vertical>.cf-field__body{display:flex;align-items:flex-start}.cf-field__label{display:block}.cf-html .cf-field__label,.cf-separator .cf-field__label{display:none}.cf-field__asterisk{color:#dc3232}.cf-field__error{display:block;margin-top:4px;color:#dc3232} \ No newline at end of file +.container-carbon_fields_container_word_settings{min-width:0;max-width:100%;width:100%}.cf-container .cf-field{max-width:100%}.cf-association__bar{position:relative;z-index:1;display:flex;justify-content:space-between;align-items:center;flex-direction:row;border:1px solid #e2e4e7}.cf-association__bar .cf-search-input{flex:1 1 auto}.cf-association__bar .cf-search-input__inner{border:0;box-shadow:none}.cf-association__bar .cf-search-input__inner:focus{border-color:none;box-shadow:none;outline:none}.cf-association__bar[focus-within]{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}.cf-association__bar:focus-within{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}.cf-association__counter{font-size:12px;color:#23282d;pointer-events:none;margin-right:10px;margin-left:5px}.cf-association__spinner{float:none;margin:0 0 0 5px}.cf-association__cols{background:#fff;position:relative;z-index:0;display:flex;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7}.cf-association__cols:before{position:absolute;top:0;left:50%;width:1px;height:100%;background-color:#e2e4e7;content:""}.cf-association__col{width:50%;max-height:160px;overflow-y:auto}.cf-association__col.ui-sortable .cf-association__option-title{white-space:nowrap;text-overflow:ellipsis}.cf-association__option{display:flex;align-items:center;padding:4px 8px;height:32px;box-sizing:border-box}.cf-association__option--selected{background-color:#fbfbfc}.cf-association__option+.cf-association__option{border-top:1px solid #e2e4e7}.cf-association__option.ui-sortable-helper{border-top:0;background-color:#fbfbfc}.cf-association__option-thumb{flex:none;display:block;width:24px;height:24px;margin-right:8px}.cf-association__option-content{display:flex;align-items:center;justify-content:space-between;flex:1;min-width:0;margin-right:8px}.cf-association__option-title{flex:1;position:relative;margin-right:4px}.cf-association__option--selected .cf-association__option-title{color:#82878c}.cf-association__option-title-inner{position:absolute;top:0;left:0;width:100%;font-size:13px;line-height:1.4;color:#32373c;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.cf-association__option-type{font-size:9px;line-height:1;text-transform:uppercase;color:#82878c}.cf-association__option-actions{display:flex;align-items:center;justify-content:space-between}.cf-association__option-actions button{margin-left:8px}.cf-association__option-sort{margin-right:4px;color:#82878c;cursor:move}.cf-association__option-action{padding:0;border:0;outline:none;color:#82878c;transition:color .1s linear;cursor:pointer;background:transparent}.cf-association__option-action:focus{color:#82878c;box-shadow:none}.cf-association__option-action:hover{color:#23282d}.cf-search-input{position:relative}.cf-search-input:before{position:absolute;top:50%;left:9px;margin-top:-10px}.postbox .cf-search-input:before{color:#32373c}.wp-block .cf-search-input:before{color:#555d66}.cf-search-input__inner{display:block;width:100%;margin:0}.block-editor .cf-field .cf-search-input__inner,.cf-container .cf-search-input__inner{padding-left:35px}.cf-container .cf-search-input__inner{padding-top:8px;padding-bottom:8px;border-color:#e2e4e7}.block-editor .cf-container .cf-search-input__inner,.edit-post-sidebar .cf-block__fields .cf-search-input__inner,.wp-block .cf-field .cf-search-input__inner{border-radius:0;border:0}.block-editor .cf-container .cf-search-input__inner:focus,.edit-post-sidebar .cf-block__fields .cf-search-input__inner:focus,.wp-block .cf-field .cf-search-input__inner:focus{box-shadow:none}.cf-field .cf-checkbox__input{margin-top:0}.cf-color__inner{display:flex;align-items:center}.cf-color__toggle{position:relative;overflow:hidden}.cf-color__toggle-text{margin-left:27px}.cf-color__preview{position:absolute;top:0;left:0;width:26px;height:100%;border-right:1px solid #ccc}.cf-color__toggle:active .cf-color__preview,.cf-color__toggle:hover .cf-color__preview{border-color:#999}.cf-color .cf-color__reset{margin-left:5px;text-decoration:none}.cf-color .cf-color__reset:focus{box-shadow:none}.cf-color__picker{position:absolute;z-index:9999}.cf-complex__groups{flex:1;position:relative}.cf-complex--tabbed-vertical>.cf-complex__groups{flex:0 0 80%}.cf-complex__group{box-sizing:border-box}.cf-complex--grid .cf-complex__group{position:relative;margin-bottom:12px}.cf-complex--grid .cf-complex__group:last-child{margin-bottom:0}.cf-complex__group-placeholder{position:relative}.cf-complex__group-placeholder:not(:last-child){margin-bottom:12px}.cf-complex__group-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%;border:1px dashed #e2e4e7;box-sizing:border-box;content:""}.cf-complex__group-head{position:relative;display:flex;border:1px solid #e2e4e7;border-bottom:0;background-color:#fbfbfc;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:600;line-height:1.4;color:#23282d;cursor:move;transition:border-color .1s linear}.cf-complex__group-head:hover{border-color:#82878c}.cf-complex__group-index{display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-right:1px solid #e2e4e7}.cf-complex__group-title{display:flex;align-items:center;padding:0 12px}.cf-complex__group-body{display:flex;flex-wrap:wrap;border:1px solid #e2e4e7;border-right-width:0;background-color:#fff}.cf-complex__group-body[hidden]{display:none}.cf-complex__actions{display:flex;align-items:center;margin-top:12px}.cf-complex__actions .cf-complex__toggler{margin-left:auto}.cf-complex__inserter{position:relative;display:inline-block}.cf-complex__tabs .cf-complex__inserter{height:36px}.cf-complex__tabs--tabbed-horizontal .cf-complex__inserter{width:36px;align-self:flex-end;margin-bottom:4px}.cf-complex__tabs--tabbed-vertical .cf-complex__inserter{display:block}.cf-complex__tabs .cf-complex__inserter-button{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border:1px solid #e2e4e7;border-radius:0;margin:0;background-color:#fbfbfc;box-shadow:none;font-size:18px;line-height:1;transition:background-color .1s linear}.cf-complex__tabs .cf-complex__inserter-button:active,.cf-complex__tabs .cf-complex__inserter-button:focus,.cf-complex__tabs .cf-complex__inserter-button:hover{border-color:#e2e4e7;background-color:#fff}.cf-complex__tabs .cf-complex__inserter-button:focus{box-shadow:none}.cf-complex__tabs .cf-complex__inserter-button:active{box-shadow:none;-webkit-transform:none;transform:none}.cf-complex__inserter-menu{position:absolute;top:50%;left:100%;min-width:180px;margin:0;-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%);z-index:1}.cf-complex__inserter-item{padding:8px 12px;margin:0;cursor:pointer;transition:color .1s linear}.cf-complex__group-actions{display:flex;align-items:center}.cf-complex__group-actions--grid{position:absolute;top:12px;right:12px}.cf-complex__group-actions--tabbed{justify-content:flex-end;padding:8px 12px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7;background-color:#fbfbfc}.cf-complex__group-action{display:inline-flex;padding:0;border:0;margin-left:12px;outline:none;background-color:transparent;color:#82878c;cursor:pointer;transition:color .1s linear}.cf-complex__group-action:first-child{margin-left:0}.cf-complex__group-action:hover{color:#23282d}.cf-complex__group-action-text{display:none}.cf-complex__tabs{position:relative;z-index:1}.cf-complex__tabs--tabbed-horizontal{display:inline-flex;margin-bottom:-5px}.cf-complex__tabs--tabbed-vertical{flex:0 0 20%;margin-right:-1px}.cf-complex__tabs-list{margin:0}.cf-complex__tabs--tabbed-horizontal .cf-complex__tabs-list{display:flex;flex-wrap:wrap}.cf-complex__tabs--tabbed-vertical .cf-complex__tabs-list{margin-bottom:-1px}.cf-complex__tabs-item{display:flex;align-items:center;padding:8px 12px;border:1px solid #e2e4e7;margin:0;background-color:#fbfbfc;font-size:12px;cursor:pointer;transition:background-color .1s linear,border-color .1s linear}.cf-complex__tabs-item:hover{background-color:#fff}.cf-complex__tabs-item--tabbed-horizontal{margin:0 4px 4px 0}.cf-complex__tabs-item--tabbed-vertical~.cf-complex__tabs-item--tabbed-vertical{border-top-width:0}.cf-complex__tabs-item--current{background-color:#fff}.cf-complex__tabs-item--tabbed-horizontal.cf-complex__tabs-item--current{border-bottom-color:#fff!important}.cf-complex__tabs-item--tabbed-vertical.cf-complex__tabs-item--current{border-right-color:#fff!important}.cf-complex__placeholder-label.cf-complex__placeholder-label{margin:8px 0 12px}.cf-container-term-meta .cf-complex__placeholder-label{font-style:normal;color:inherit}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08)}.flatpickr-calendar.inline,.flatpickr-calendar.open{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasTime .dayContainer,.flatpickr-calendar .hasWeeks .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:after,.flatpickr-calendar:before{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:after,.flatpickr-calendar.rightMost:before{left:auto;right:22px}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:after,.flatpickr-calendar.arrowTop:before{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:after,.flatpickr-calendar.arrowBottom:before{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9);height:28px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-next-month,.flatpickr-months .flatpickr-prev-month{text-decoration:none;cursor:pointer;position:absolute;top:0;line-height:16px;height:28px;padding:10px;z-index:3;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9)}.flatpickr-months .flatpickr-next-month.disabled,.flatpickr-months .flatpickr-prev-month.disabled{display:none}.flatpickr-months .flatpickr-next-month i,.flatpickr-months .flatpickr-prev-month i{position:relative}.flatpickr-months .flatpickr-next-month.flatpickr-prev-month,.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-next-month.flatpickr-next-month,.flatpickr-months .flatpickr-prev-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-next-month:hover,.flatpickr-months .flatpickr-prev-month:hover{color:#959ea9}.flatpickr-months .flatpickr-next-month:hover svg,.flatpickr-months .flatpickr-prev-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-next-month svg,.flatpickr-months .flatpickr-prev-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-next-month svg path,.flatpickr-months .flatpickr-prev-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,.1)}.numInputWrapper span:active{background:rgba(0,0,0,.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,.5)}.numInputWrapper:hover{background:rgba(0,0,0,.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:6.16px 0 0;line-height:1;height:28px;display:inline-block;text-align:center;-webkit-transform:translateZ(0);transform:translateZ(0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:baseline;vertical-align:initial}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,.5);background:transparent;pointer-events:none}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays,.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-weekdays .flatpickr-weekdaycontainer,span.flatpickr-weekday{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,.54);line-height:1;margin:0;text-align:center;display:block;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day.nextMonthDay:focus,.flatpickr-day.nextMonthDay:hover,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.today.inRange,.flatpickr-day:focus,.flatpickr-day:hover{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:focus,.flatpickr-day.today:hover{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.endRange,.flatpickr-day.endRange.inRange,.flatpickr-day.endRange.nextMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.endRange:focus,.flatpickr-day.endRange:hover,.flatpickr-day.selected,.flatpickr-day.selected.inRange,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.selected:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange,.flatpickr-day.startRange.inRange,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.startRange:focus,.flatpickr-day.startRange:hover{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.endRange.startRange,.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.endRange.endRange,.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.endRange.startRange.endRange,.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.disabled,.flatpickr-day.disabled:hover,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.nextMonthDay,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.prevMonthDay{color:rgba(57,57,57,.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.disabled,.flatpickr-day.disabled:hover{cursor:not-allowed;color:rgba(57,57,57,.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{display:inline-block;float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden}.flatpickr-innerContainer,.flatpickr-rContainer{-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-rContainer{display:inline-block;padding:0}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-am-pm,.flatpickr-time .flatpickr-time-separator{height:inherit;display:inline-block;float:left;line-height:inherit;color:#393939;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time .flatpickr-am-pm:focus,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time input:hover{background:#f3f3f3}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.cf-datetime__inner{display:flex;align-items:stretch;flex-wrap:wrap;margin-top:-5px}.cf-datetime__inner:before{display:none}.cf-datetime__input{flex:1;margin:5px 6px 0 0}.wp-core-ui .button.cf-datetime__button{margin-top:5px}.cf-datetime__button{flex:0 0 auto}.cf-field .cf-datetime__button{margin-bottom:0;box-shadow:none}.cf-file__inner{position:relative;display:flex;align-items:center;justify-content:center;width:130px;height:130px;border:1px dashed #b5bcc2;box-sizing:border-box}.cf-file__content{position:absolute;top:-1px;right:-1px;bottom:-1px;left:-1px;border:1px solid #b5bcc2}.cf-file__preview{position:absolute;top:0;left:0;bottom:28px;width:100%;overflow:hidden;background-color:#e2e4e7;box-shadow:inset 0 0 15px rgba(0,0,0,.1)}.cf-file__image{position:absolute;top:50%;left:50%;height:auto;max-width:100%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cf-file__name{position:absolute;bottom:0;left:0;right:0;padding:5px;border-top:1px solid #b5bcc2;overflow:hidden;background-color:#f3f4f5;white-space:nowrap;text-overflow:ellipsis}.cf-file__browse{position:relative}.cf-file__content~.cf-file__browse{margin-bottom:29px;visibility:hidden;opacity:0;transition:visibility .1s linear,opacity .1s linear}.cf-file__inner:hover .cf-file__content~.cf-file__browse{visibility:visible;opacity:1}.cf-file__remove{position:absolute;top:5px;right:5px;padding:0;border:0;outline:none;background-color:transparent;cursor:pointer;transition:opacity .1s linear}.cf-file__remove:hover{opacity:.8}.cf-file__remove:before{border-radius:50%;background-color:#191e23;color:#fff}.cf-map__search{position:relative;z-index:1}.cf-map__canvas{position:relative;z-index:0;height:300px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7;background-color:#f3f4f5}.cf-media-gallery__list{display:flex;flex-wrap:wrap;max-height:400px;padding:4px;margin:0;overflow-y:auto;list-style:none outside none}.cf-media-gallery__list:empty{display:none}.cf-media-gallery__actions{padding:8px}.cf-media-gallery__list:empty~.cf-media-gallery__actions{border-top-width:0}.cf-media-gallery__item{flex:0 0 100%;min-width:0;padding:4px;margin:0;box-sizing:border-box}@media (min-width:320px){.cf-media-gallery__item{flex-basis:50%}}@media (min-width:480px){.cf-media-gallery__item{flex-basis:33.3333%}}@media (min-width:640px){.cf-media-gallery__item{flex-basis:25%}}@media (min-width:768px){.cf-media-gallery__item{flex-basis:20%}}@media (min-width:1280px){.cf-media-gallery__item{flex-basis:16.66667%}}@media (min-width:1440px){.cf-media-gallery__item{flex-basis:12.5%}}@media (min-width:1680px){.cf-media-gallery__item{flex-basis:10%}}.cf-media-gallery__item-inner{position:relative;display:flex;flex-direction:column;height:100%}.cf-media-gallery__item-preview{position:relative;overflow:hidden;padding-top:100%;flex:1}.cf-media-gallery__item-thumb{min-width:100%;min-height:100%;max-width:150%;pointer-events:none}.cf-media-gallery__item-icon,.cf-media-gallery__item-thumb{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cf-media-gallery__item-icon{max-width:100%;max-height:50%}.cf-media-gallery__item-name{display:block;padding:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:move}.cf-media-gallery__item-remove{position:absolute;top:4px;right:4px;padding:0;border:0;outline:none;background-color:transparent;cursor:pointer}.cf-media-gallery__item-remove:before{border-radius:50%;background-color:#191e23;color:#fff;transition:color .1s linear}.cf-media-gallery__item-remove:hover:before{color:#b5bcc2}.cf-multiselect__control{min-height:0;border-color:#e2e4e7}.cf-multiselect__control:hover{border-color:#e2e4e7}.cf-multiselect__control--is-focused,.cf-multiselect__control--is-focused:hover{border-color:#00a0d2!important;box-shadow:none}.cf-multiselect__placeholder{color:#b5bcc2}.cf-multiselect__value-container{padding-left:4px;padding-right:4px}.cf-multiselect__multi-value{align-items:center;padding:5px 3px;margin:0;background-color:#e2e4e7}.cf-multiselect__multi-value+.cf-multiselect__multi-value{margin-left:5px}.cf-multiselect__multi-value__label{padding-left:3px;font-size:13px;line-height:1}.cf-multiselect__multi-value__remove{padding:0;margin-top:1px;cursor:pointer}.cf-multiselect__multi-value__remove:hover{background-color:transparent}.cf-multiselect__input input[id],.cf-multiselect__input input[id]:focus{box-shadow:none}.cf-multiselect__menu{z-index:9999}.cf-multiselect__option{padding:4px}.cf-multiselect__option--is-focused{background-color:#00a0d2;color:#fff}.cf-multiselect__indicator{padding:5px;cursor:pointer}.cf-oembed__preview{padding:12px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7}.cf-oembed__frame{display:block;width:100%;max-width:600px;margin:0 auto}.cf-radio__list{margin:0}.cf-radio-image .cf-radio__list{display:flex;flex-wrap:wrap}.cf-radio__list-item:last-child{margin-bottom:0}.cf-radio-image .cf-radio__list-item{flex:0 0 20%;position:relative;padding:4px}.cf-container-term-meta .cf-radio__label{display:inline}.cf-radio-image .cf-radio__label{display:inline-block}.cf-field .cf-radio__input{margin-top:0}.cf-radio-image .cf-radio__input{position:absolute;z-index:-1;top:50%;left:50%;width:0;height:0;margin:0;outline:0;opacity:0}.cf-radio-image__image{display:block;max-width:100%;padding:5px;box-sizing:border-box}.wp-block .cf-radio__list{list-style:none outside none}.cf-radio__list-item{box-sizing:border-box}.cf-container-term-meta .cf-radio__list-item{flex:0 0 20%}.cf-container-theme-options .cf-radio__list-item{flex:0 0 10%}.cf-radio-image__image{border:1px solid #e2e4e7}.cf-radio__input:checked~.cf-radio__label .cf-radio-image__image,.cf-radio__input:focus~.cf-radio__label .cf-radio-image__image{outline:4px solid #00a0d2}.cf-select__input{display:block;width:100%;margin:0}.cf-container-term-meta .cf-separator .cf-field__head{display:none}.cf-container-term-meta .cf-separator .cf-field__body{position:absolute;left:0}.cf-set__list{margin:0}.cf-set__list-item:last-child{margin-bottom:0}.cf-field .cf-set__input{margin-top:0}.cf-container-term-meta .cf-set__label{display:inline}.cf-text__input{display:block;width:100%!important;margin:0}.cf-textarea__input{display:block;width:100%!important;resize:vertical}.cf-field,.cf-field__body,.cf-field__head{box-sizing:border-box;flex:1 1 100%}@media (max-width:1024px){.cf-field{flex-basis:100%!important}}.cf-rich-text .cf-field__body{box-sizing:content-box}.cf-complex--tabbed-vertical>.cf-field__body{display:flex;align-items:flex-start}.cf-field__label{display:block}.cf-html .cf-field__label,.cf-separator .cf-field__label{display:none}.cf-field__asterisk{color:#dc3232}.cf-field__error{display:block;margin-top:4px;color:#dc3232} \ No newline at end of file diff --git a/build/classic/core.min.js b/build/classic/core.min.js index a43904d4c..499df9cbd 100644 --- a/build/classic/core.min.js +++ b/build/classic/core.min.js @@ -1,4 +1,4 @@ -this.cf=this.cf||{},this.cf.core=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=324)}([function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){!function(){e.exports=this.cf.vendor.react}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/element"]}()},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){!function(){e.exports=this.cf.vendor.lodash}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/i18n"]}()},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n1?t-1:0),a=1;a2&&void 0!==arguments[2]?arguments[2]:null;return new Promise(function(o,i){var a=window.jQuery.ajax({url:e,type:t,data:n});a.done(function(e){o(e)}),a.fail(function(){i(Object(r.__)("An error occured.","carbon-fields-ui"))})})}},function(e,t,n){"use strict";var r=n(1),o=n(30);function i(e,t,n){return e===t||(e.correspondingElement?e.correspondingElement.classList.contains(n):e.classList.contains(n))}var a,u,s=function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}}),n=function(){};return window.addEventListener("testPassiveEventSupport",n,t),window.removeEventListener("testPassiveEventSupport",n,t),e}},c=(void 0===a&&(a=0),function(){return++a}),l={},f={},p=["touchstart","touchmove"];function d(e,t){var n=null;return-1!==p.indexOf(t)&&u&&(n={passive:!e.props.preventDefault}),n}t.a=function(e,t){var n,a;return a=n=function(n){var a,p;function h(e){var t;return(t=n.call(this,e)||this).__outsideClickHandler=function(e){if("function"!=typeof t.__clickOutsideHandlerProp){var n=t.getInstance();if("function"!=typeof n.props.handleClickOutside){if("function"!=typeof n.handleClickOutside)throw new Error("WrappedComponent lacks a handleClickOutside(event) function for processing outside click events.");n.handleClickOutside(e)}else n.props.handleClickOutside(e)}else t.__clickOutsideHandlerProp(e)},t.enableOnClickOutside=function(){if("undefined"!=typeof document&&!f[t._uid]){void 0===u&&(u=s()),f[t._uid]=!0;var e=t.props.eventTypes;e.forEach||(e=[e]),l[t._uid]=function(e){var n;t.props.disableOnClickOutside||null!==t.componentNode&&(t.props.preventDefault&&e.preventDefault(),t.props.stopPropagation&&e.stopPropagation(),t.props.excludeScrollbar&&(n=e,document.documentElement.clientWidth<=n.clientX||document.documentElement.clientHeight<=n.clientY)||function(e,t,n){if(e===t)return!0;for(;e.parentNode;){if(i(e,t,n))return!0;e=e.parentNode}return e}(e.target,t.componentNode,t.props.outsideClickIgnoreClass)===document&&t.__outsideClickHandler(e))},e.forEach(function(e){document.addEventListener(e,l[t._uid],d(t,e))})}},t.disableOnClickOutside=function(){delete f[t._uid];var e=l[t._uid];if(e&&"undefined"!=typeof document){var n=t.props.eventTypes;n.forEach||(n=[n]),n.forEach(function(n){return document.removeEventListener(n,e,d(t,n))}),delete l[t._uid]}},t.getRef=function(e){return t.instanceRef=e},t._uid=c(),t}p=n,(a=h).prototype=Object.create(p.prototype),a.prototype.constructor=a,a.__proto__=p;var m=h.prototype;return m.getInstance=function(){if(!e.prototype.isReactComponent)return this;var t=this.instanceRef;return t.getInstance?t.getInstance():t},m.componentDidMount=function(){if("undefined"!=typeof document&&document.createElement){var e=this.getInstance();if(t&&"function"==typeof t.handleClickOutside&&(this.__clickOutsideHandlerProp=t.handleClickOutside(e),"function"!=typeof this.__clickOutsideHandlerProp))throw new Error("WrappedComponent lacks a function for processing outside click events specified by the handleClickOutside config option.");this.componentNode=Object(o.findDOMNode)(this.getInstance()),this.enableOnClickOutside()}},m.componentDidUpdate=function(){this.componentNode=Object(o.findDOMNode)(this.getInstance())},m.componentWillUnmount=function(){this.disableOnClickOutside()},m.render=function(){var t=this.props,n=(t.excludeScrollbar,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["excludeScrollbar"]));return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(r.createElement)(e,n)},h}(r.Component),n.displayName="OnClickOutside("+(e.displayName||e.name||"Component")+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},a}},function(e,t,n){"use strict";var r=n(17),o=n.n(r),i=n(14),a=n(18),u=n(11),s=n(26),c=Object(a.withEffects)(function(e){var t=e.mount,n=e.unmount,r=e.useEvent("openMediaBrowserEvent"),i=o()(r,2),c=i[0],l=i[1];return Object(u.merge)(Object(u.pipe)(t,Object(u.map)(function(){return{type:"INIT"}})),Object(u.pipe)(n,Object(u.map)(function(){return{type:"DESTROY"}})),Object(u.pipe)(Object(s.a)({openMediaBrowser:l}),Object(u.map)(a.toProps)),Object(u.pipe)(c,Object(u.map)(function(e){return{type:"OPEN",payload:e}})))},{handler:function(e){var t=null;return function(n){switch(n.type){case"INIT":var r=e.onSelect,o=e.typeFilter;(t=wp.media({title:e.title,library:{type:o},button:{text:e.buttonLabel},multiple:e.multiple})).on("select",function(){var e=t.state().get("selection").toJSON();r(e)});break;case"OPEN":t&&t.open();break;case"DESTROY":t=null}}}});t.a=Object(i.compose)(c)(function(e){return(0,e.children)({openMediaBrowser:e.openMediaBrowser})})},function(e,t,n){var r=n(297),o=n(298),i=n(302);r(".__observe-resize__ { position: absolute; left: 0; top: -100%; width: 100%; height: 100%; margin: 1px 0 0; border: none; opacity: 0; visibility: hidden; pointer-events: none; }"),e.exports=function(e,t){if(o.ok(i(e),"observe-resize: el should be a valid DOM element"),o.equal(typeof t,"function","observe-resize: cb should be type function"),"object"==typeof window){var n=!1,r=document.createElement("iframe");return r.setAttribute("class","__observe-resize__"),e.appendChild(r),o.ok(r.contentWindow,"observe-resize: no contentWindow detected - cannot start observing"),r.contentWindow.onresize=function(){n||(n=!0,window.requestAnimationFrame(function(){n=!1,t(e)}))},function(){r.parentNode&&r.parentNode.removeChild(r)}}}},function(e,t,n){"use strict";(function(e){var r=n(15),o=n.n(r),i=n(6),a=n.n(i),u=n(7),s=n.n(u),c=n(8),l=n.n(c),f=n(9),p=n.n(f),d=n(10),h=n.n(d),m=n(0),g=n.n(m),v=n(3),b=n.n(v),y=n(2),x=(n(314),n(31)),w=function(t){function n(){var e,t;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0?this.renderOptions():e.createElement(x.a,null)}}]),n}(y.Component);t.a=w}).call(this,n(2))},function(e,t,n){"use strict";(function(e){var r=n(6),o=n.n(r),i=n(7),a=n.n(i),u=n(8),s=n.n(u),c=n(9),l=n.n(c),f=n(10),p=n.n(f),d=n(0),h=n.n(d),m=n(3),g=n.n(m),v=n(55),b=function(t){function n(){var e,t;o()(this,n);for(var r=arguments.length,i=new Array(r),a=0;a1?t.setState(function(e){return{menuVisible:!e.menuVisible}}):r(n[0])}),g()(h()(h()(t)),"handleItemClick",function(e){t.setState({menuVisible:!1}),t.props.onSelect(e)}),t}return p()(n,t),a()(n,[{key:"render",value:function(){var t=this,n=this.props,r=n.buttonText,o=n.groups;return e.createElement("div",{className:"cf-complex__inserter"},e.createElement("button",{type:"button",className:"button cf-complex__inserter-button",onClick:this.handleAddClick},r),o.length>1&&e.createElement("ul",{className:"cf-complex__inserter-menu",hidden:!this.state.menuVisible},o.map(function(n,r){return e.createElement("li",{className:"cf-complex__inserter-item",key:r,onClick:function(){return t.handleItemClick(n)}},n.label)})))}}]),n}(n(2).Component);t.a=Object(v.a)(b)}).call(this,n(2))},function(e,t,n){"use strict";var r=u(n(306)),o=u(n(311)),i=u(n(117)),a=u(n(114));function u(e){return e&&e.__esModule?e:{default:e}}e.exports={Transition:a.default,TransitionGroup:i.default,ReplaceTransition:o.default,CSSTransition:r.default}},function(e,t,n){"use strict";(function(e){var r=n(15),o=n.n(r),i=n(6),a=n.n(i),u=n(7),s=n.n(u),c=n(8),l=n.n(c),f=n(9),p=n.n(f),d=n(10),h=n.n(d),m=n(0),g=n.n(m),v=n(3),b=n.n(v),y=n(2),x=(n(320),function(t){function n(){var e,t;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(81),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,u=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=u}).call(this,n(64)(e))},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(87)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(44),o=n(191),i=n(192),a=n(193),u=n(194),s=n(195);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=u,c.prototype.set=s,e.exports=c},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(33)(n(24),"Map");e.exports=r},function(e,t,n){var r=n(200),o=n(207),i=n(209),a=n(210),u=n(211);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t0?e.createElement("select",{id:n,name:r,value:a,className:"cf-select__input",onChange:this.handleChange},o.options.map(function(t){return e.createElement("option",{key:t.value,value:t.value},t.label)})):e.createElement(y.a,null)}}]),n}(v.Component);t.a=x}).call(this,n(2))},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return a});var r=n(2),o=Object(r.createContext)(!1),i=o.Provider,a=o.Consumer},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(37))},function(e,t,n){var r=n(173),o=n(42);e.exports=function(e,t){return e&&r(e,t,o)}},function(e,t,n){var r=n(175),o=n(84),i=n(23),a=n(63),u=n(85),s=n(86),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),f=!n&&!l&&a(e),p=!n&&!l&&!f&&s(e),d=n||l||f||p,h=d?r(e.length,String):[],m=h.length;for(var g in e)!t&&!c.call(e,g)||d&&("length"==g||f&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||u(g,m))||h.push(g);return h}},function(e,t,n){var r=n(176),o=n(27),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!u.call(e,"callee")};e.exports=s},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&el))return!1;var p=s.get(e);if(p&&s.get(t))return p==t;var d=-1,h=!0,m=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++d=t||n<0||g&&e-h>=l}function x(){var e=o();if(y(e))return w(e);p=setTimeout(x,function(e){var n=t-(e-d);return g?u(n,l-(e-h)):n}(e))}function w(e){return p=void 0,v&&s?b(e):(s=c=void 0,f)}function E(){var e=o(),n=y(e);if(s=arguments,c=this,d=e,n){if(void 0===p)return function(e){return h=e,p=setTimeout(x,t),m?b(e):f}(d);if(g)return clearTimeout(p),p=setTimeout(x,t),b(d)}return void 0===p&&(p=setTimeout(x,t)),f}return t=i(t)||0,r(n)&&(m=!!n.leading,l=(g="maxWait"in n)?a(i(n.maxWait)||0,t):l,v="trailing"in n?!!n.trailing:v),E.cancel=function(){void 0!==p&&clearTimeout(p),h=0,s=d=c=p=void 0},E.flush=function(){return void 0===p?f:w(o())},E}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.red=void 0;var r=i(n(285)),o=i(n(287));function i(e){return e&&e.__esModule?e:{default:e}}t.default={simpleCheckForValidColor:function(e){var t=0,n=0;return(0,r.default)(["r","g","b","a","h","s","l","v"],function(r){e[r]&&(t+=1,isNaN(e[r])||(n+=1),"s"===r||"l"===r)&&/^\d+%$/.test(e[r])&&(n+=1)}),t===n&&e},toState:function(e,t){var n=e.hex?(0,o.default)(e.hex):(0,o.default)(e),r=n.toHsl(),i=n.toHsv(),a=n.toRgb(),u=n.toHex();return 0===r.s&&(r.h=t||0,i.h=t||0),{hsl:r,hex:"000000"===u&&0===a.a?"transparent":"#"+u,rgb:a,hsv:i,oldHue:e.h||t||r.h,source:e.source}},isValidHex:function(e){var t="#"===String(e).charAt(0)?1:0;return e.length!==4+t&&e.length<7+t&&(0,o.default)(e).isValid()},getContrastingColor:function(e){if(!e)return"#fff";var t=this.toState(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000":"#fff"}},t.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,c=[],l=!1,f=-1;function p(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=u(p);l=!0;for(var t=c.length;t;){for(s=c,c=[];++f1)for(var n=1;n=0||(o[n]=e[n]);return o}(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(e,r);var i=o.default.Children.only(n);return o.default.cloneElement(i,r)},r}(o.default.Component);function d(){}p.contextTypes={transitionGroup:r.object},p.childContextTypes={transitionGroup:function(){}},p.propTypes={},p.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:d,onEntering:d,onEntered:d,onExit:d,onExiting:d,onExited:d},p.UNMOUNTED=0,p.EXITED=1,p.ENTERING=2,p.ENTERED=3,p.EXITING=4;var h=(0,a.polyfill)(p);t.default=h},function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,u=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?u="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(u="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==u){var s=e.displayName||e.name,c="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+s+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==u?"\n "+u:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var l=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;l.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",function(){return a}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},function(e,t,n){"use strict";t.__esModule=!0,t.transitionTimeout=function(e){var t="transition"+e+"Timeout",n="transition"+e;return function(e){if(e[n]){if(null==e[t])return new Error(t+" wasn't supplied to CSSTransitionGroup: this can cause unreliable animations and won't be supported in a future version of React. See https://fb.me/react-animation-transition-group-timeout for more information.");if("number"!=typeof e[t])return new Error(t+" must be a number (in milliseconds)")}return null}},t.classNamesShape=t.timeoutsShape=void 0;var r,o=(r=n(21))&&r.__esModule?r:{default:r},i=o.default.oneOfType([o.default.number,o.default.shape({enter:o.default.number,exit:o.default.number}).isRequired]);t.timeoutsShape=i;var a=o.default.oneOfType([o.default.string,o.default.shape({enter:o.default.string,exit:o.default.string,active:o.default.string}),o.default.shape({enter:o.default.string,enterDone:o.default.string,enterActive:o.default.string,exit:o.default.string,exitDone:o.default.string,exitActive:o.default.string})]);t.classNamesShape=a},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=u(n(21)),o=u(n(1)),i=n(115),a=n(312);function u(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,["component","childFactory"]),i=l(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?i:o.default.createElement(t,r,i)},r}(o.default.Component);f.childContextTypes={transitionGroup:r.default.object.isRequired},f.propTypes={},f.defaultProps={component:"div",childFactory:function(e){return e}};var p=(0,i.polyfill)(f);t.default=p,e.exports=t.default},function(e,t,n){"use strict";(function(e){var r=n(16),o=n.n(r),i=n(20),a=n.n(i),u=n(14),s=n(22),c=n(4),l=(n(321),n(149)),f=n(35);t.a=Object(u.compose)(Object(s.withSelect)(function(e,t){var n=e("carbon-fields/core"),r=n.getValidationError,o=n.isFieldVisible;return{error:r(t.id),hidden:!o(t.id)}}),Object(f.a)("carbon-fields.field-wrapper"))(function(t){var n=t.id,r=t.field,i=t.error,u=t.hidden,s=t.className,f=t.children,p=r.width?{flexBasis:"".concat(r.width,"%")}:null,d=["cf-field","cf-".concat(Object(c.kebabCase)(r.type)),{"cf-field--has-width":!!r.width,"cf-field--invalid":!!i},s].concat(o()(r.classes));return r.hidden?null:e.createElement("div",{className:a()(d),style:p,hidden:u},e.createElement("div",{className:"cf-field__head"},r.label&&e.createElement("label",{className:"cf-field__label",htmlFor:n},r.label,r.required&&e.createElement("span",{className:"cf-field__asterisk"},"*"))),!u&&e.createElement("div",{className:"cf-field__body"},f),u&&e.createElement(l.a,{className:"cf-field__body"},f),r.help_text&&e.createElement("em",{className:"cf-field__help",dangerouslySetInnerHTML:{__html:r.help_text}}),i&&e.createElement("span",{className:"cf-field__error"},i))})}).call(this,n(2))},function(e,t,n){"use strict";(function(e){var r=n(13),o=n.n(r),i=n(17),a=n.n(i),u=n(16),s=n.n(u),c=n(6),l=n.n(c),f=n(7),p=n.n(f),d=n(8),h=n.n(d),m=n(9),g=n.n(m),v=n(10),b=n.n(v),y=n(0),x=n.n(y),w=n(3),E=n.n(w),C=n(38),O=n.n(C),_=n(5),k=n(2),S=n(14),j=n(19),A=n(18),D=n(20),T=n.n(D),M=n(4),N=n(11),F=n(26),P=(n(161),n(39)),I=n(36),L=n(54),R=function(t){function n(){var e,t;l()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0&&i.length>=r.max?alert(Object(_.sprintf)(Object(_.__)("Maximum number of items reached (%s items)","carbon-fields-ui"),Number(r.max))):(a(o,s()(i).concat([Object(M.pick)(e,"id","type","subtype")])),u({selectedOptions:s()(c).concat([e])})))}),E()(x()(x()(t)),"handleRemoveItem",function(e){var n=t.props,r=n.value,o=n.id,i=n.onChange,a=n.setState,u=n.selectedOptions;i(o,Object(M.without)(r,e)),a({selectedOptions:Object(M.without)(u,e)})}),E()(x()(x()(t)),"handleSort",function(e){var n=t.props,r=n.id;(0,n.onChange)(r,e)}),t}return b()(n,t),p()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.fetchSelectedOptions,n=e.field,r=e.value;(0,e.setState)({options:n.options.options,totalOptionsCount:n.options.total_options}),r.length&&t(),this.sourceList.current.addEventListener("scroll",this.handleSourceListScroll)}},{key:"componentWillUnmount",value:function(){this.sourceList.current.removeEventListener("scroll",this.handleSourceListScroll)}},{key:"render",value:function(){var t=this,n=this.props,r=n.name,o=n.value,i=n.field,a=n.totalOptionsCount,u=n.selectedOptions,s=n.queryTerm,c=n.isLoading,l=this.props.options;return i.duplicates_allowed||(l=O()(l,function(e){e.map(function(e){return e.disabled=!!Object(M.find)(o,function(t){return Object(M.isMatch)(t,{id:e.id,type:e.type,subtype:e.subtype})}),e})})),e.createElement(k.Fragment,null,e.createElement("div",{className:"cf-association__bar"},e.createElement(P.a,{value:s,onChange:this.handleSearchChange}),c?e.createElement("span",{className:"cf-association__spinner spinner is-active"}):"",e.createElement("span",{className:"cf-association__counter"},Object(_.sprintf)(Object(_.__)("Showing %1$d of %2$d results","carbon-fields-ui"),Number(l.length),Number(a)))),e.createElement("div",{className:"cf-association__cols"},e.createElement("div",{className:"cf-association__col",ref:this.sourceList},l.map(function(n,r){return e.createElement("div",{className:T()("cf-association__option",{"cf-association__option--selected":n.disabled}),key:r},n.thumbnail&&e.createElement("img",{className:"cf-association__option-thumb",src:n.thumbnail}),e.createElement("div",{className:"cf-association__option-content"},e.createElement("span",{className:"cf-association__option-title"},e.createElement("span",{className:"cf-association__option-title-inner"},n.title)),e.createElement("span",{className:"cf-association__option-type"},n.type)),e.createElement("div",{className:"cf-association__option-actions"},n.edit_link&&e.createElement("a",{className:"cf-association__option-action cf-association__option-action--edit dashicons dashicons-edit",href:n.edit_link.replace("&","&","g"),target:"_blank",rel:"noopener noreferrer"}),!n.disabled&&(i.max<0||o.length0&&t.length=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){"use strict";(function(e){var r=n(15),o=n.n(r),i=n(6),a=n.n(i),u=n(7),s=n.n(u),c=n(8),l=n.n(c),f=n(9),p=n.n(f),d=n(10),h=n.n(d),m=n(0),g=n.n(m),v=n(3),b=n.n(v),y=n(2),x=(n(164),function(t){function n(){var e,t;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0?u-1:1;t.setState({currentTab:Object(k.get)(r,"".concat(s,".").concat(o),null)})}i(a)}),E()(x()(x()(t)),"handleToggleAllClick",function(){var e=t.props,n=e.allGroupsAreCollapsed;(0,e.onToggleAllGroups)(!n)}),E()(x()(x()(t)),"handleGroupsSortStart",function(e,n){var r=t.props,o=r.value,i=r.groupIdKey,a=n.item.index(),u=Object(k.get)(o,"".concat(a,".").concat(i),null);t.setState({currentDraggedGroup:u})}),E()(x()(x()(t)),"handleGroupsSortUpdate",function(e){var n=t.props,r=n.id;(0,n.onChange)(r,e)}),E()(x()(x()(t)),"handleGroupsSortStop",function(){t.setState({currentDraggedGroup:null})}),E()(x()(x()(t)),"handleTabsChange",function(e){t.setState({currentTab:e})}),t}return b()(n,t),p()(n,[{key:"findGroup",value:function(e){var t=this.props,n=t.value,r=t.groupIdKey;return Object(k.find)(n,[r,e])}},{key:"getAvailableGroups",value:function(e){var t=this.props,n=t.field,r=t.value;if(n.duplicate_groups_allowed)return n.groups;var o=r.map(function(t){return t[e]});return n.groups.filter(function(e){var t=e.name;return-1===o.indexOf(t)})}},{key:"getGroupLabels",value:function(){var e=this.props,t=e.field;return e.groupValues.map(function(e,n){var r=s()(e,2),o=r[0],i=r[1],u=Object(k.find)(t.groups,["name",o]);if(!u)return"N/A";if(!Object(k.isString)(u.label_template))return u.label;try{return Object(k.template)(u.label_template)(a()({$_index:n},i))||u.label}catch(e){return console.error(Object(_.sprintf)(Object(_.__)("Couldn't create the label of group - %s","carbon-fields-ui"),e.message)),"N/A"}})}},{key:"render",value:function(){var t=this,n=this.state,r=n.currentDraggedGroup,i=n.currentTab,a=this.props,u=a.value,s=a.field,c=a.groupIdKey,l=a.groupFilterKey,f=a.allGroupsAreCollapsed,p=a.onGroupSetup,d=a.onGroupFieldSetup,h=a.onToggleGroup,m=this.getAvailableGroups(l),g=this.getGroupLabels(),v=u.map(function(e,t){return{id:e[c],label:g[t]}});return e.createElement(O.Fragment,null,this.isTabbed&&!!u.length&&e.createElement(S.a,{items:u,forwardedRef:this.tabsList,options:{axis:"tabbed-vertical"===s.layout?"y":"x",forcePlaceholderSize:!0},onUpdate:this.handleGroupsSortUpdate},e.createElement(j.a,{ref:this.tabsList,items:v,current:i,layout:s.layout,onChange:this.handleTabsChange},!!m.length&&!this.isMaximumReached&&e.createElement(A.a,{buttonText:"+",groups:m,onSelect:this.handleAddGroup}))),!u.length&&e.createElement(T.a,{label:Object(_.__)("There are no entries yet.","carbon-fields-ui")},e.createElement(A.a,{buttonText:this.inserterButtonText,groups:m,onSelect:this.handleAddGroup})),!!u.length&&e.createElement(S.a,{items:u,options:{helper:"clone",handle:".cf-complex__group-head",placeholder:"cf-complex__group-placeholder",forceHelperSize:!0,forcePlaceholderSize:!0},forwardedRef:this.groupsList,onStart:this.handleGroupsSortStart,onUpdate:this.handleGroupsSortUpdate,onStop:this.handleGroupsSortStop},e.createElement("div",{className:"cf-complex__groups",ref:this.groupsList},u.map(function(n,a){return e.createElement(D.a,o()({key:"".concat(n[l],"-").concat(a)},p(n,{index:a,label:g[a],dragged:n[c]===r,tabbed:t.isTabbed,hidden:t.isTabbed&&n[c]!==i,allowClone:s.duplicate_groups_allowed&&!t.isMaximumReached,onFieldSetup:d,onClone:t.handleCloneGroup,onRemove:t.handleRemoveGroup,onToggle:h})))}))),!this.isTabbed&&!!u.length&&e.createElement("div",{className:"cf-complex__actions"},!!m.length&&!this.isMaximumReached&&e.createElement(A.a,{buttonText:this.inserterButtonText,groups:m,onSelect:this.handleAddGroup}),e.createElement("button",{type:"button",className:"button cf-complex__toggler",onClick:this.handleToggleAllClick},f?Object(_.__)("Expand All","carbon-fields-ui"):Object(_.__)("Collapse All","carbon-fields-ui"))))}},{key:"isTabbed",get:function(){return this.props.field.layout.indexOf("tabbed")>-1}},{key:"isMaximumReached",get:function(){var e=this.props,t=e.field,n=e.value;return t.max>0&&n.length>=t.max}},{key:"inserterButtonText",get:function(){var e=this.props.field;return Object(_.sprintf)(Object(_.__)("Add %s","carbon-fields-ui"),e.labels.singular_name)}}]),n}(O.Component);Object(C.addFilter)("carbon-fields.field-wrapper","carbon-fields/core",function(t){return function(n){var r=n.field;return"complex"!==r.type?e.createElement(t,n):e.createElement(t,o()({className:"cf-complex--".concat(r.layout)},n))}}),Object(C.addFilter)("carbon-fields.complex.validate","carbon-fields/core",function(e,t){var n=e.min,r=e.labels;if(e.required&&Object(k.isEmpty)(t))return Object(_.__)("This field is required.","carbon-fields-ui");if(n>0&&t.length=0;i--){var a=o[i],u=n[a];u!==r[a]&&(-1===l.indexOf(a)||Array.isArray(u)||(u=[u]),this.flatpickr.set(a,u))}e.hasOwnProperty("value")&&e.value!==this.props.value&&this.flatpickr.setDate(e.value,!1)}},{key:"componentDidMount",value:function(){var e=this,t=r({onClose:function(){e.node.blur&&e.node.blur()}},this.props.options);l.forEach(function(n){e.props[n]&&(t[n]=e.props[n])}),this.flatpickr=new s.default(this.node,t),this.props.hasOwnProperty("value")&&this.flatpickr.setDate(this.props.value,!1)}},{key:"componentWillUnmount",value:function(){this.flatpickr.destroy()}},{key:"render",value:function(){var e=this,t=this.props,n=t.options,o=t.defaultValue,i=(t.value,t.children),u=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["options","defaultValue","value","children"]);return l.forEach(function(e){delete u[e]}),n.wrap?a.default.createElement("div",r({},u,{ref:function(t){e.node=t}}),i):a.default.createElement("input",r({},u,{defaultValue:o,ref:function(t){e.node=t}}))}}]),t}();f.propTypes={defaultValue:u.default.string,options:u.default.object,onChange:u.default.func,onOpen:u.default.func,onClose:u.default.func,onMonthChange:u.default.func,onYearChange:u.default.func,onReady:u.default.func,onValueUpdate:u.default.func,onDayCreate:u.default.func,value:u.default.oneOfType([u.default.string,u.default.array,u.default.object,u.default.number]),children:u.default.node},f.defaultProps={options:{}},t.default=f},function(e,t,n){"use strict";(function(e){var r=n(15),o=n.n(r),i=n(6),a=n.n(i),u=n(7),s=n.n(u),c=n(8),l=n.n(c),f=n(9),p=n.n(f),d=n(10),h=n.n(d),m=function(t){function n(){return a()(this,n),l()(this,p()(n).apply(this,arguments))}return h()(n,t),s()(n,[{key:"render",value:function(){var t=this.props,n=t.name,r=t.value,i=t.field;return e.createElement("input",o()({type:"hidden",name:n,value:r,className:"hidden-text"},i.attributes))}}]),n}(n(2).Component);t.a=m}).call(this,n(2))},function(e,t,n){"use strict";(function(e){var r=n(2);t.a=function(t){var n=t.field;return e.createElement(r.RawHTML,{className:"cf-html__content"},n.html)}}).call(this,n(2))},function(e,t,n){"use strict";(function(e){var r=n(17),o=n.n(r),i=n(13),a=n.n(i),u=n(6),s=n.n(u),c=n(7),l=n.n(c),f=n(8),p=n.n(f),d=n(9),h=n.n(d),m=n(10),g=n.n(m),v=n(0),b=n.n(v),y=n(3),x=n.n(y),w=n(26),E=n(2),C=n(5),O=n(18),_=n(4),k=n(11),S=(n(296),n(39)),j=n(133),A=function(t){function n(){var e,t;s()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0?e.createElement(b.a,{id:n,name:r,value:this.filterValues(o),options:i.options,delimiter:i.valueDelimiter,onChange:this.handleChange,className:"cf-multiselect__select",classNamePrefix:"cf-multiselect",isMulti:!0}):e.createElement(y.a,null)}}]),n}(v.Component);t.a=x}).call(this,n(2))},function(e,t,n){(function(t){for(var r=n(305),o="undefined"==typeof window?t:window,i=["moz","webkit"],a="AnimationFrame",u=o["request"+a],s=o["cancel"+a]||o["cancelRequest"+a],c=0;!u&&c=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(this.props,[]);return function(e){l.forEach(function(t){return delete e[t]})}(o),o.className=this.props.inputClassName,o.id=this.state.inputId,o.style=n,a.default.createElement("div",{className:this.props.className,style:t},this.renderStyles(),a.default.createElement("input",r({},o,{ref:this.inputRef})),a.default.createElement("div",{ref:this.sizerRef,style:c},e),this.props.placeholder?a.default.createElement("div",{ref:this.placeHolderSizerRef,style:c},this.props.placeholder):null)}}]),t}();h.propTypes={className:u.default.string,defaultValue:u.default.any,extraWidth:u.default.oneOfType([u.default.number,u.default.string]),id:u.default.string,injectStyles:u.default.bool,inputClassName:u.default.string,inputRef:u.default.func,inputStyle:u.default.object,minWidth:u.default.oneOfType([u.default.number,u.default.string]),onAutosize:u.default.func,onChange:u.default.func,placeholder:u.default.string,placeholderIsMinWidth:u.default.bool,style:u.default.object,value:u.default.any},h.defaultProps={minWidth:1,injectStyles:!0},t.default=h},function(e,t,n){"use strict";(function(e){var r=n(17),o=n.n(r),i=n(6),a=n.n(i),u=n(7),s=n.n(u),c=n(8),l=n.n(c),f=n(9),p=n.n(f),d=n(10),h=n.n(d),m=n(0),g=n.n(m),v=n(3),b=n.n(v),y=n(2),x=n(14),w=n(5),E=n(18),C=n(11),O=n(26),_=n(4),k=n(141),S=n.n(k),j=(n(313),n(39)),A=n(142),D=function(t){function n(){var e,t;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0&&(clearInterval(n),e.handleSearch(t))},100)}},{key:"render",value:function(){var t=this.props,n=t.id,r=t.name,o=t.value,i=t.embedCode,a=t.embedType,u=t.provider;return e.createElement("div",{ref:this.node},e.createElement(j.a,{id:n,value:o,onChange:this.handleChange}),i?e.createElement(A.a,{html:i,type:a,provider:u}):null,e.createElement("input",{type:"hidden",name:r,value:o,readOnly:!0}))}}]),n}(y.Component),T=Object(x.withState)({embedCode:"",embedType:"",provider:"",error:"",isLoading:!1}),M=Object(E.withEffects)(function(e){var t=e.useEvent("fetchEmbedCode"),n=o()(t,2),r=n[0],i=n[1],a=Object(C.pipe)(Object(O.a)({onFetchEmbedCode:i}),Object(C.map)(E.toProps)),u=Object(C.pipe)(r,Object(C.map)(function(e){return{type:"FETCH_EMBED_CODE",payload:e}}));return Object(C.merge)(a,u)},{handler:function(e){return function(t){var n=t.payload;switch(t.type){case"FETCH_EMBED_CODE":var r=S.a.get(window.wpApiSettings.root+"oembed/1.0/proxy",{url:n,_wpnonce:window.wpApiSettings.nonce});r.done(function(t){e.setState({embedCode:t.html,embedType:t.type,provider:t.provider_name,isLoading:!1})}),r.fail(function(){alert(Object(w.__)("An error occurred while trying to fetch oembed preview.","carbon-fields-ui")),e.setState({error:Object(w.__)("Not Found","carbon-fields-ui"),isLoading:!1})})}}}});t.a=Object(x.compose)(T,M)(D)}).call(this,n(2))},function(e,t,n){var r; +this.cf=this.cf||{},this.cf.core=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=324)}([function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){!function(){e.exports=this.cf.vendor.react}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/element"]}()},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){!function(){e.exports=this.cf.vendor.lodash}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/i18n"]}()},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n1?t-1:0),a=1;a2&&void 0!==arguments[2]?arguments[2]:null;return new Promise(function(o,i){var a=window.jQuery.ajax({url:e,type:t,data:n});a.done(function(e){o(e)}),a.fail(function(){i(Object(r.__)("An error occured.","carbon-fields-ui"))})})}},function(e,t,n){"use strict";var r=n(1),o=n(30);function i(e,t,n){return e===t||(e.correspondingElement?e.correspondingElement.classList.contains(n):e.classList.contains(n))}var a,u,s=function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}}),n=function(){};return window.addEventListener("testPassiveEventSupport",n,t),window.removeEventListener("testPassiveEventSupport",n,t),e}},c=(void 0===a&&(a=0),function(){return++a}),l={},f={},p=["touchstart","touchmove"];function d(e,t){var n=null;return-1!==p.indexOf(t)&&u&&(n={passive:!e.props.preventDefault}),n}t.a=function(e,t){var n,a;return a=n=function(n){var a,p;function h(e){var t;return(t=n.call(this,e)||this).__outsideClickHandler=function(e){if("function"!=typeof t.__clickOutsideHandlerProp){var n=t.getInstance();if("function"!=typeof n.props.handleClickOutside){if("function"!=typeof n.handleClickOutside)throw new Error("WrappedComponent lacks a handleClickOutside(event) function for processing outside click events.");n.handleClickOutside(e)}else n.props.handleClickOutside(e)}else t.__clickOutsideHandlerProp(e)},t.enableOnClickOutside=function(){if("undefined"!=typeof document&&!f[t._uid]){void 0===u&&(u=s()),f[t._uid]=!0;var e=t.props.eventTypes;e.forEach||(e=[e]),l[t._uid]=function(e){var n;t.props.disableOnClickOutside||null!==t.componentNode&&(t.props.preventDefault&&e.preventDefault(),t.props.stopPropagation&&e.stopPropagation(),t.props.excludeScrollbar&&(n=e,document.documentElement.clientWidth<=n.clientX||document.documentElement.clientHeight<=n.clientY)||function(e,t,n){if(e===t)return!0;for(;e.parentNode;){if(i(e,t,n))return!0;e=e.parentNode}return e}(e.target,t.componentNode,t.props.outsideClickIgnoreClass)===document&&t.__outsideClickHandler(e))},e.forEach(function(e){document.addEventListener(e,l[t._uid],d(t,e))})}},t.disableOnClickOutside=function(){delete f[t._uid];var e=l[t._uid];if(e&&"undefined"!=typeof document){var n=t.props.eventTypes;n.forEach||(n=[n]),n.forEach(function(n){return document.removeEventListener(n,e,d(t,n))}),delete l[t._uid]}},t.getRef=function(e){return t.instanceRef=e},t._uid=c(),t}p=n,(a=h).prototype=Object.create(p.prototype),a.prototype.constructor=a,a.__proto__=p;var m=h.prototype;return m.getInstance=function(){if(!e.prototype.isReactComponent)return this;var t=this.instanceRef;return t.getInstance?t.getInstance():t},m.componentDidMount=function(){if("undefined"!=typeof document&&document.createElement){var e=this.getInstance();if(t&&"function"==typeof t.handleClickOutside&&(this.__clickOutsideHandlerProp=t.handleClickOutside(e),"function"!=typeof this.__clickOutsideHandlerProp))throw new Error("WrappedComponent lacks a function for processing outside click events specified by the handleClickOutside config option.");this.componentNode=Object(o.findDOMNode)(this.getInstance()),this.enableOnClickOutside()}},m.componentDidUpdate=function(){this.componentNode=Object(o.findDOMNode)(this.getInstance())},m.componentWillUnmount=function(){this.disableOnClickOutside()},m.render=function(){var t=this.props,n=(t.excludeScrollbar,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["excludeScrollbar"]));return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(r.createElement)(e,n)},h}(r.Component),n.displayName="OnClickOutside("+(e.displayName||e.name||"Component")+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},a}},function(e,t,n){"use strict";var r=n(17),o=n.n(r),i=n(14),a=n(18),u=n(11),s=n(26),c=Object(a.withEffects)(function(e){var t=e.mount,n=e.unmount,r=e.useEvent("openMediaBrowserEvent"),i=o()(r,2),c=i[0],l=i[1];return Object(u.merge)(Object(u.pipe)(t,Object(u.map)(function(){return{type:"INIT"}})),Object(u.pipe)(n,Object(u.map)(function(){return{type:"DESTROY"}})),Object(u.pipe)(Object(s.a)({openMediaBrowser:l}),Object(u.map)(a.toProps)),Object(u.pipe)(c,Object(u.map)(function(e){return{type:"OPEN",payload:e}})))},{handler:function(e){var t=null;return function(n){switch(n.type){case"INIT":var r=e.onSelect,o=e.typeFilter;(t=wp.media({title:e.title,library:{type:o},button:{text:e.buttonLabel},multiple:e.multiple})).on("select",function(){var e=t.state().get("selection").toJSON();r(e)});break;case"OPEN":t&&t.open();break;case"DESTROY":t=null}}}});t.a=Object(i.compose)(c)(function(e){return(0,e.children)({openMediaBrowser:e.openMediaBrowser})})},function(e,t,n){var r=n(297),o=n(298),i=n(302);r(".__observe-resize__ { position: absolute; left: 0; top: -100%; width: 100%; height: 100%; margin: 1px 0 0; border: none; opacity: 0; visibility: hidden; pointer-events: none; }"),e.exports=function(e,t){if(o.ok(i(e),"observe-resize: el should be a valid DOM element"),o.equal(typeof t,"function","observe-resize: cb should be type function"),"object"==typeof window){var n=!1,r=document.createElement("iframe");return r.setAttribute("class","__observe-resize__"),e.appendChild(r),o.ok(r.contentWindow,"observe-resize: no contentWindow detected - cannot start observing"),r.contentWindow.onresize=function(){n||(n=!0,window.requestAnimationFrame(function(){n=!1,t(e)}))},function(){r.parentNode&&r.parentNode.removeChild(r)}}}},function(e,t,n){"use strict";(function(e){var r=n(15),o=n.n(r),i=n(6),a=n.n(i),u=n(7),s=n.n(u),c=n(8),l=n.n(c),f=n(9),p=n.n(f),d=n(10),h=n.n(d),m=n(0),g=n.n(m),v=n(3),b=n.n(v),y=n(2),x=(n(314),n(31)),w=function(t){function n(){var e,t;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0?this.renderOptions():e.createElement(x.a,null)}}]),n}(y.Component);t.a=w}).call(this,n(2))},function(e,t,n){"use strict";(function(e){var r=n(6),o=n.n(r),i=n(7),a=n.n(i),u=n(8),s=n.n(u),c=n(9),l=n.n(c),f=n(10),p=n.n(f),d=n(0),h=n.n(d),m=n(3),g=n.n(m),v=n(55),b=function(t){function n(){var e,t;o()(this,n);for(var r=arguments.length,i=new Array(r),a=0;a1?t.setState(function(e){return{menuVisible:!e.menuVisible}}):r(n[0])}),g()(h()(h()(t)),"handleItemClick",function(e){t.setState({menuVisible:!1}),t.props.onSelect(e)}),t}return p()(n,t),a()(n,[{key:"render",value:function(){var t=this,n=this.props,r=n.buttonText,o=n.groups;return e.createElement("div",{className:"cf-complex__inserter"},e.createElement("button",{type:"button",className:"button cf-complex__inserter-button",onClick:this.handleAddClick},r),o.length>1&&e.createElement("ul",{className:"cf-complex__inserter-menu",hidden:!this.state.menuVisible},o.map(function(n,r){return e.createElement("li",{className:"cf-complex__inserter-item",key:r,onClick:function(){return t.handleItemClick(n)}},n.label)})))}}]),n}(n(2).Component);t.a=Object(v.a)(b)}).call(this,n(2))},function(e,t,n){"use strict";var r=u(n(306)),o=u(n(311)),i=u(n(117)),a=u(n(114));function u(e){return e&&e.__esModule?e:{default:e}}e.exports={Transition:a.default,TransitionGroup:i.default,ReplaceTransition:o.default,CSSTransition:r.default}},function(e,t,n){"use strict";(function(e){var r=n(15),o=n.n(r),i=n(6),a=n.n(i),u=n(7),s=n.n(u),c=n(8),l=n.n(c),f=n(9),p=n.n(f),d=n(10),h=n.n(d),m=n(0),g=n.n(m),v=n(3),b=n.n(v),y=n(2),x=(n(320),function(t){function n(){var e,t;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(81),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,u=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=u}).call(this,n(64)(e))},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(87)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(44),o=n(191),i=n(192),a=n(193),u=n(194),s=n(195);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=u,c.prototype.set=s,e.exports=c},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(33)(n(24),"Map");e.exports=r},function(e,t,n){var r=n(200),o=n(207),i=n(209),a=n(210),u=n(211);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t0?e.createElement("select",{id:n,name:r,value:a,className:"cf-select__input",onChange:this.handleChange},o.options.map(function(t){return e.createElement("option",{key:t.value,value:t.value},t.label)})):e.createElement(y.a,null)}}]),n}(v.Component);t.a=x}).call(this,n(2))},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return a});var r=n(2),o=Object(r.createContext)(!1),i=o.Provider,a=o.Consumer},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(37))},function(e,t,n){var r=n(173),o=n(42);e.exports=function(e,t){return e&&r(e,t,o)}},function(e,t,n){var r=n(175),o=n(84),i=n(23),a=n(63),u=n(85),s=n(86),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),f=!n&&!l&&a(e),p=!n&&!l&&!f&&s(e),d=n||l||f||p,h=d?r(e.length,String):[],m=h.length;for(var g in e)!t&&!c.call(e,g)||d&&("length"==g||f&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||u(g,m))||h.push(g);return h}},function(e,t,n){var r=n(176),o=n(27),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!u.call(e,"callee")};e.exports=s},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&el))return!1;var p=s.get(e);if(p&&s.get(t))return p==t;var d=-1,h=!0,m=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++d=t||n<0||g&&e-h>=l}function x(){var e=o();if(y(e))return w(e);p=setTimeout(x,function(e){var n=t-(e-d);return g?u(n,l-(e-h)):n}(e))}function w(e){return p=void 0,v&&s?b(e):(s=c=void 0,f)}function E(){var e=o(),n=y(e);if(s=arguments,c=this,d=e,n){if(void 0===p)return function(e){return h=e,p=setTimeout(x,t),m?b(e):f}(d);if(g)return clearTimeout(p),p=setTimeout(x,t),b(d)}return void 0===p&&(p=setTimeout(x,t)),f}return t=i(t)||0,r(n)&&(m=!!n.leading,l=(g="maxWait"in n)?a(i(n.maxWait)||0,t):l,v="trailing"in n?!!n.trailing:v),E.cancel=function(){void 0!==p&&clearTimeout(p),h=0,s=d=c=p=void 0},E.flush=function(){return void 0===p?f:w(o())},E}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.red=void 0;var r=i(n(285)),o=i(n(287));function i(e){return e&&e.__esModule?e:{default:e}}t.default={simpleCheckForValidColor:function(e){var t=0,n=0;return(0,r.default)(["r","g","b","a","h","s","l","v"],function(r){e[r]&&(t+=1,isNaN(e[r])||(n+=1),"s"===r||"l"===r)&&/^\d+%$/.test(e[r])&&(n+=1)}),t===n&&e},toState:function(e,t){var n=e.hex?(0,o.default)(e.hex):(0,o.default)(e),r=n.toHsl(),i=n.toHsv(),a=n.toRgb(),u=n.toHex();return 0===r.s&&(r.h=t||0,i.h=t||0),{hsl:r,hex:"000000"===u&&0===a.a?"transparent":"#"+u,rgb:a,hsv:i,oldHue:e.h||t||r.h,source:e.source}},isValidHex:function(e){var t="#"===String(e).charAt(0)?1:0;return e.length!==4+t&&e.length<7+t&&(0,o.default)(e).isValid()},getContrastingColor:function(e){if(!e)return"#fff";var t=this.toState(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000":"#fff"}},t.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,c=[],l=!1,f=-1;function p(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=u(p);l=!0;for(var t=c.length;t;){for(s=c,c=[];++f1)for(var n=1;n=0||(o[n]=e[n]);return o}(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(e,r);var i=o.default.Children.only(n);return o.default.cloneElement(i,r)},r}(o.default.Component);function d(){}p.contextTypes={transitionGroup:r.object},p.childContextTypes={transitionGroup:function(){}},p.propTypes={},p.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:d,onEntering:d,onEntered:d,onExit:d,onExiting:d,onExited:d},p.UNMOUNTED=0,p.EXITED=1,p.ENTERING=2,p.ENTERED=3,p.EXITING=4;var h=(0,a.polyfill)(p);t.default=h},function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,u=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?u="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(u="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==u){var s=e.displayName||e.name,c="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+s+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==u?"\n "+u:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var l=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;l.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",function(){return a}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},function(e,t,n){"use strict";t.__esModule=!0,t.transitionTimeout=function(e){var t="transition"+e+"Timeout",n="transition"+e;return function(e){if(e[n]){if(null==e[t])return new Error(t+" wasn't supplied to CSSTransitionGroup: this can cause unreliable animations and won't be supported in a future version of React. See https://fb.me/react-animation-transition-group-timeout for more information.");if("number"!=typeof e[t])return new Error(t+" must be a number (in milliseconds)")}return null}},t.classNamesShape=t.timeoutsShape=void 0;var r,o=(r=n(21))&&r.__esModule?r:{default:r},i=o.default.oneOfType([o.default.number,o.default.shape({enter:o.default.number,exit:o.default.number}).isRequired]);t.timeoutsShape=i;var a=o.default.oneOfType([o.default.string,o.default.shape({enter:o.default.string,exit:o.default.string,active:o.default.string}),o.default.shape({enter:o.default.string,enterDone:o.default.string,enterActive:o.default.string,exit:o.default.string,exitDone:o.default.string,exitActive:o.default.string})]);t.classNamesShape=a},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=u(n(21)),o=u(n(1)),i=n(115),a=n(312);function u(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,["component","childFactory"]),i=l(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?i:o.default.createElement(t,r,i)},r}(o.default.Component);f.childContextTypes={transitionGroup:r.default.object.isRequired},f.propTypes={},f.defaultProps={component:"div",childFactory:function(e){return e}};var p=(0,i.polyfill)(f);t.default=p,e.exports=t.default},function(e,t,n){"use strict";(function(e){var r=n(16),o=n.n(r),i=n(20),a=n.n(i),u=n(14),s=n(22),c=n(4),l=(n(321),n(149)),f=n(35);t.a=Object(u.compose)(Object(s.withSelect)(function(e,t){var n=e("carbon-fields/core"),r=n.getValidationError,o=n.isFieldVisible;return{error:r(t.id),hidden:!o(t.id)}}),Object(f.a)("carbon-fields.field-wrapper"))(function(t){var n=t.id,r=t.field,i=t.error,u=t.hidden,s=t.className,f=t.children,p=r.width?{flexBasis:"".concat(r.width,"%")}:null,d=["cf-field","cf-".concat(Object(c.kebabCase)(r.type)),{"cf-field--has-width":!!r.width,"cf-field--invalid":!!i},s].concat(o()(r.classes));return r.hidden?null:e.createElement("div",{className:a()(d),style:p,hidden:u},e.createElement("div",{className:"cf-field__head"},r.label&&e.createElement("label",{className:"cf-field__label",htmlFor:n},r.label,r.required&&e.createElement("span",{className:"cf-field__asterisk"},"*"))),!u&&e.createElement("div",{className:"cf-field__body"},f),u&&e.createElement(l.a,{className:"cf-field__body"},f),r.help_text&&e.createElement("em",{className:"cf-field__help",dangerouslySetInnerHTML:{__html:r.help_text}}),i&&e.createElement("span",{className:"cf-field__error"},i))})}).call(this,n(2))},function(e,t,n){"use strict";(function(e){var r=n(13),o=n.n(r),i=n(17),a=n.n(i),u=n(16),s=n.n(u),c=n(6),l=n.n(c),f=n(7),p=n.n(f),d=n(8),h=n.n(d),m=n(9),g=n.n(m),v=n(10),b=n.n(v),y=n(0),x=n.n(y),w=n(3),E=n.n(w),C=n(38),O=n.n(C),_=n(5),k=n(2),S=n(14),j=n(19),A=n(18),D=n(20),T=n.n(D),M=n(4),N=n(11),F=n(26),P=(n(161),n(39)),I=n(36),L=n(54),R=function(t){function n(){var e,t;l()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0&&i.length>=r.max?alert(Object(_.sprintf)(Object(_.__)("Maximum number of items reached (%s items)","carbon-fields-ui"),Number(r.max))):(a(o,s()(i).concat([Object(M.pick)(e,"id","type","subtype")])),u({selectedOptions:s()(c).concat([e])})))}),E()(x()(x()(t)),"handleRemoveItem",function(e){var n=t.props,r=n.value,o=n.id,i=n.onChange,a=n.setState,u=n.selectedOptions;i(o,Object(M.without)(r,e)),a({selectedOptions:Object(M.without)(u,e)})}),E()(x()(x()(t)),"handleSort",function(e){var n=t.props,r=n.id;(0,n.onChange)(r,e)}),t}return b()(n,t),p()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.fetchSelectedOptions,n=e.field,r=e.value;(0,e.setState)({options:n.options.options,totalOptionsCount:n.options.total_options}),r.length&&t(),this.sourceList.current.addEventListener("scroll",this.handleSourceListScroll)}},{key:"componentWillUnmount",value:function(){this.sourceList.current.removeEventListener("scroll",this.handleSourceListScroll)}},{key:"render",value:function(){var t=this,n=this.props,r=n.name,o=n.value,i=n.field,a=n.totalOptionsCount,u=n.selectedOptions,s=n.queryTerm,c=n.isLoading,l=this.props.options;return i.duplicates_allowed||(l=O()(l,function(e){e.map(function(e){return e.disabled=!!Object(M.find)(o,function(t){return Object(M.isMatch)(t,{id:e.id,type:e.type,subtype:e.subtype})}),e})})),e.createElement(k.Fragment,null,e.createElement("div",{className:"cf-association__bar"},e.createElement(P.a,{value:s,onChange:this.handleSearchChange}),c?e.createElement("span",{className:"cf-association__spinner spinner is-active"}):"",e.createElement("span",{className:"cf-association__counter"},Object(_.sprintf)(Object(_.__)("Showing %1$d of %2$d results","carbon-fields-ui"),Number(l.length),Number(a)))),e.createElement("div",{className:"cf-association__cols"},e.createElement("div",{className:"cf-association__col",ref:this.sourceList},l.map(function(n,r){return e.createElement("div",{className:T()("cf-association__option",{"cf-association__option--selected":n.disabled}),key:r},n.thumbnail&&e.createElement("img",{className:"cf-association__option-thumb",src:n.thumbnail}),e.createElement("div",{className:"cf-association__option-content"},e.createElement("span",{className:"cf-association__option-title"},e.createElement("span",{className:"cf-association__option-title-inner"},n.title)),e.createElement("span",{className:"cf-association__option-type"},n.type)),e.createElement("div",{className:"cf-association__option-actions"},n.edit_link&&e.createElement("a",{className:"cf-association__option-action cf-association__option-action--edit dashicons dashicons-edit",href:n.edit_link.replace("&","&","g"),target:"_blank",rel:"noopener noreferrer"}),!n.disabled&&(i.max<0||o.length0&&t.length=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){"use strict";(function(e){var r=n(15),o=n.n(r),i=n(6),a=n.n(i),u=n(7),s=n.n(u),c=n(8),l=n.n(c),f=n(9),p=n.n(f),d=n(10),h=n.n(d),m=n(0),g=n.n(m),v=n(3),b=n.n(v),y=n(2),x=(n(164),function(t){function n(){var e,t;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0?u-1:1;t.setState({currentTab:Object(k.get)(r,"".concat(s,".").concat(o),null)})}i(a)}),E()(x()(x()(t)),"handleToggleAllClick",function(){var e=t.props,n=e.allGroupsAreCollapsed;(0,e.onToggleAllGroups)(!n)}),E()(x()(x()(t)),"handleGroupsSortStart",function(e,n){var r=t.props,o=r.value,i=r.groupIdKey,a=n.item.index(),u=Object(k.get)(o,"".concat(a,".").concat(i),null);t.setState({currentDraggedGroup:u})}),E()(x()(x()(t)),"handleGroupsSortUpdate",function(e){var n=t.props,r=n.id;(0,n.onChange)(r,e)}),E()(x()(x()(t)),"handleGroupsSortStop",function(){t.setState({currentDraggedGroup:null})}),E()(x()(x()(t)),"handleTabsChange",function(e){t.setState({currentTab:e})}),t}return b()(n,t),p()(n,[{key:"findGroup",value:function(e){var t=this.props,n=t.value,r=t.groupIdKey;return Object(k.find)(n,[r,e])}},{key:"getAvailableGroups",value:function(e){var t=this.props,n=t.field,r=t.value;if(n.duplicate_groups_allowed)return n.groups;var o=r.map(function(t){return t[e]});return n.groups.filter(function(e){var t=e.name;return-1===o.indexOf(t)})}},{key:"getGroupLabels",value:function(){var e=this.props,t=e.field;return e.groupValues.map(function(e,n){var r=s()(e,2),o=r[0],i=r[1],u=Object(k.find)(t.groups,["name",o]);if(!u)return"N/A";if(!Object(k.isString)(u.label_template))return u.label;try{return Object(k.template)(u.label_template)(a()({$_index:n},i))||u.label}catch(e){return console.error(Object(_.sprintf)(Object(_.__)("Couldn't create the label of group - %s","carbon-fields-ui"),e.message)),"N/A"}})}},{key:"render",value:function(){var t=this,n=this.state,r=n.currentDraggedGroup,i=n.currentTab,a=this.props,u=a.value,s=a.field,c=a.groupIdKey,l=a.groupFilterKey,f=a.allGroupsAreCollapsed,p=a.onGroupSetup,d=a.onGroupFieldSetup,h=a.onToggleGroup,m=this.getAvailableGroups(l),g=this.getGroupLabels(),v=u.map(function(e,t){return{id:e[c],label:g[t]}});return e.createElement(O.Fragment,null,this.isTabbed&&!!u.length&&e.createElement(S.a,{items:u,forwardedRef:this.tabsList,options:{axis:"tabbed-vertical"===s.layout?"y":"x",forcePlaceholderSize:!0},onUpdate:this.handleGroupsSortUpdate},e.createElement(j.a,{ref:this.tabsList,items:v,current:i,layout:s.layout,onChange:this.handleTabsChange},!!m.length&&!this.isMaximumReached&&e.createElement(A.a,{buttonText:"+",groups:m,onSelect:this.handleAddGroup}))),!u.length&&e.createElement(T.a,{label:Object(_.__)("There are no entries yet.","carbon-fields-ui")},e.createElement(A.a,{buttonText:this.inserterButtonText,groups:m,onSelect:this.handleAddGroup})),!!u.length&&e.createElement(S.a,{items:u,options:{helper:"clone",handle:".cf-complex__group-head",placeholder:"cf-complex__group-placeholder",forceHelperSize:!0,forcePlaceholderSize:!0},forwardedRef:this.groupsList,onStart:this.handleGroupsSortStart,onUpdate:this.handleGroupsSortUpdate,onStop:this.handleGroupsSortStop},e.createElement("div",{className:"cf-complex__groups",ref:this.groupsList},u.map(function(n,a){return e.createElement(D.a,o()({key:"".concat(n[l],"-").concat(a)},p(n,{index:a,label:g[a],dragged:n[c]===r,tabbed:t.isTabbed,hidden:t.isTabbed&&n[c]!==i,allowClone:s.duplicate_groups_allowed&&!t.isMaximumReached,onFieldSetup:d,onClone:t.handleCloneGroup,onRemove:t.handleRemoveGroup,onToggle:h})))}))),!this.isTabbed&&!!u.length&&e.createElement("div",{className:"cf-complex__actions"},!!m.length&&!this.isMaximumReached&&e.createElement(A.a,{buttonText:this.inserterButtonText,groups:m,onSelect:this.handleAddGroup}),e.createElement("button",{type:"button",className:"button cf-complex__toggler",onClick:this.handleToggleAllClick},f?Object(_.__)("Expand All","carbon-fields-ui"):Object(_.__)("Collapse All","carbon-fields-ui"))))}},{key:"isTabbed",get:function(){return this.props.field.layout.indexOf("tabbed")>-1}},{key:"isMaximumReached",get:function(){var e=this.props,t=e.field,n=e.value;return t.max>0&&n.length>=t.max}},{key:"inserterButtonText",get:function(){var e=this.props.field;return Object(_.sprintf)(Object(_.__)("Add %s","carbon-fields-ui"),e.labels.singular_name)}}]),n}(O.Component);Object(C.addFilter)("carbon-fields.field-wrapper","carbon-fields/core",function(t){return function(n){var r=n.field;return"complex"!==r.type?e.createElement(t,n):e.createElement(t,o()({className:"cf-complex--".concat(r.layout)},n))}}),Object(C.addFilter)("carbon-fields.complex.validate","carbon-fields/core",function(e,t){var n=e.min,r=e.labels;if(e.required&&Object(k.isEmpty)(t))return Object(_.__)("This field is required.","carbon-fields-ui");if(n>0&&t.length=0;i--){var a=o[i],u=n[a];u!==r[a]&&(-1===l.indexOf(a)||Array.isArray(u)||(u=[u]),this.flatpickr.set(a,u))}e.hasOwnProperty("value")&&e.value!==this.props.value&&this.flatpickr.setDate(e.value,!1)}},{key:"componentDidMount",value:function(){var e=this,t=r({onClose:function(){e.node.blur&&e.node.blur()}},this.props.options);l.forEach(function(n){e.props[n]&&(t[n]=e.props[n])}),this.flatpickr=new s.default(this.node,t),this.props.hasOwnProperty("value")&&this.flatpickr.setDate(this.props.value,!1)}},{key:"componentWillUnmount",value:function(){this.flatpickr.destroy()}},{key:"render",value:function(){var e=this,t=this.props,n=t.options,o=t.defaultValue,i=(t.value,t.children),u=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["options","defaultValue","value","children"]);return l.forEach(function(e){delete u[e]}),n.wrap?a.default.createElement("div",r({},u,{ref:function(t){e.node=t}}),i):a.default.createElement("input",r({},u,{defaultValue:o,ref:function(t){e.node=t}}))}}]),t}();f.propTypes={defaultValue:u.default.string,options:u.default.object,onChange:u.default.func,onOpen:u.default.func,onClose:u.default.func,onMonthChange:u.default.func,onYearChange:u.default.func,onReady:u.default.func,onValueUpdate:u.default.func,onDayCreate:u.default.func,value:u.default.oneOfType([u.default.string,u.default.array,u.default.object,u.default.number]),children:u.default.node},f.defaultProps={options:{}},t.default=f},function(e,t,n){"use strict";(function(e){var r=n(15),o=n.n(r),i=n(6),a=n.n(i),u=n(7),s=n.n(u),c=n(8),l=n.n(c),f=n(9),p=n.n(f),d=n(10),h=n.n(d),m=function(t){function n(){return a()(this,n),l()(this,p()(n).apply(this,arguments))}return h()(n,t),s()(n,[{key:"render",value:function(){var t=this.props,n=t.name,r=t.value,i=t.field;return e.createElement("input",o()({type:"hidden",name:n,value:r,className:"hidden-text"},i.attributes))}}]),n}(n(2).Component);t.a=m}).call(this,n(2))},function(e,t,n){"use strict";(function(e){var r=n(2);t.a=function(t){var n=t.field;return e.createElement(r.RawHTML,{className:"cf-html__content"},n.html)}}).call(this,n(2))},function(e,t,n){"use strict";(function(e){var r=n(17),o=n.n(r),i=n(13),a=n.n(i),u=n(6),s=n.n(u),c=n(7),l=n.n(c),f=n(8),p=n.n(f),d=n(9),h=n.n(d),m=n(10),g=n.n(m),v=n(0),b=n.n(v),y=n(3),x=n.n(y),w=n(26),E=n(2),C=n(5),O=n(18),_=n(4),k=n(11),S=(n(296),n(39)),j=n(133),A=function(t){function n(){var e,t;s()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0?e.createElement(b.a,{id:n,name:r,value:this.filterValues(o),options:i.options,delimiter:i.valueDelimiter,onChange:this.handleChange,className:"cf-multiselect__select",classNamePrefix:"cf-multiselect",isMulti:!0}):e.createElement(y.a,null)}}]),n}(v.Component);t.a=x}).call(this,n(2))},function(e,t,n){(function(t){for(var r=n(305),o="undefined"==typeof window?t:window,i=["moz","webkit"],a="AnimationFrame",u=o["request"+a],s=o["cancel"+a]||o["cancelRequest"+a],c=0;!u&&c=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(this.props,[]);return function(e){l.forEach(function(t){return delete e[t]})}(o),o.className=this.props.inputClassName,o.id=this.state.inputId,o.style=n,a.default.createElement("div",{className:this.props.className,style:t},this.renderStyles(),a.default.createElement("input",r({},o,{ref:this.inputRef})),a.default.createElement("div",{ref:this.sizerRef,style:c},e),this.props.placeholder?a.default.createElement("div",{ref:this.placeHolderSizerRef,style:c},this.props.placeholder):null)}}]),t}();h.propTypes={className:u.default.string,defaultValue:u.default.any,extraWidth:u.default.oneOfType([u.default.number,u.default.string]),id:u.default.string,injectStyles:u.default.bool,inputClassName:u.default.string,inputRef:u.default.func,inputStyle:u.default.object,minWidth:u.default.oneOfType([u.default.number,u.default.string]),onAutosize:u.default.func,onChange:u.default.func,placeholder:u.default.string,placeholderIsMinWidth:u.default.bool,style:u.default.object,value:u.default.any},h.defaultProps={minWidth:1,injectStyles:!0},t.default=h},function(e,t,n){"use strict";(function(e){var r=n(17),o=n.n(r),i=n(6),a=n.n(i),u=n(7),s=n.n(u),c=n(8),l=n.n(c),f=n(9),p=n.n(f),d=n(10),h=n.n(d),m=n(0),g=n.n(m),v=n(3),b=n.n(v),y=n(2),x=n(14),w=n(5),E=n(18),C=n(11),O=n(26),_=n(4),k=n(141),S=n.n(k),j=(n(313),n(39)),A=n(142),D=function(t){function n(){var e,t;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0&&(clearInterval(n),e.handleSearch(t))},100)}},{key:"render",value:function(){var t=this.props,n=t.id,r=t.name,o=t.value,i=t.embedCode,a=t.embedType,u=t.provider;return e.createElement("div",{ref:this.node},e.createElement(j.a,{id:n,value:o,onChange:this.handleChange}),i?e.createElement(A.a,{html:i,type:a,provider:u}):null,e.createElement("input",{type:"hidden",name:r,value:o,readOnly:!0}))}}]),n}(y.Component),T=Object(x.withState)({embedCode:"",embedType:"",provider:"",error:"",isLoading:!1}),M=Object(E.withEffects)(function(e){var t=e.useEvent("fetchEmbedCode"),n=o()(t,2),r=n[0],i=n[1],a=Object(C.pipe)(Object(O.a)({onFetchEmbedCode:i}),Object(C.map)(E.toProps)),u=Object(C.pipe)(r,Object(C.map)(function(e){return{type:"FETCH_EMBED_CODE",payload:e}}));return Object(C.merge)(a,u)},{handler:function(e){return function(t){var n=t.payload;switch(t.type){case"FETCH_EMBED_CODE":var r=S.a.get(window.wpApiSettings.root+"oembed/1.0/proxy",{url:n,_wpnonce:window.wpApiSettings.nonce});r.done(function(t){e.setState({embedCode:t.html,embedType:t.type,provider:t.provider_name,isLoading:!1})}),r.fail(function(){alert(Object(w.__)("An error occurred while trying to fetch oembed preview.","carbon-fields-ui")),e.setState({error:Object(w.__)("Not Found","carbon-fields-ui"),isLoading:!1})})}}}});t.a=Object(x.compose)(T,M)(D)}).call(this,n(2))},function(e,t,n){var r; /*! * jQuery JavaScript Library v3.4.1 * https://jquery.com/ diff --git a/build/classic/metaboxes.js b/build/classic/metaboxes.js index d17ac143e..346dee86e 100644 --- a/build/classic/metaboxes.js +++ b/build/classic/metaboxes.js @@ -977,7 +977,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./packages/metaboxes/monitors/conditional-display/conditions/base.js\");\n\n\n/**\n * Internal dependencies.\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n /**\n * @inheritdoc\n */\n isFulfiled: function isFulfiled(definition, values) {\n definition = _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, definition); // In Gutenberg for the \"Default\" template is used an empty string.\n\n if (definition.value === 'default') {\n definition.value = '';\n }\n\n return _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isFulfiled(definition, values);\n }\n}));\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/metaboxes/monitors/conditional-display/conditions/post-template.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base */ \"./packages/metaboxes/monitors/conditional-display/conditions/base.js\");\n\n\n/**\n * External dependencies.\n */\n\n/**\n * Internal dependencies.\n */\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, _base__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n /**\n * @inheritdoc\n */\n isFulfiled: function isFulfiled(definition, values) {\n definition = _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, definition); // In Gutenberg for the \"Default\" template is used an empty string.\n\n if (definition.value === 'default') {\n definition.value = '';\n } else if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(definition.value)) {\n var defaultIndex = definition.value.indexOf('default');\n\n if (defaultIndex !== -1) {\n definition.value[defaultIndex] = '';\n }\n }\n\n return _base__WEBPACK_IMPORTED_MODULE_2__[\"default\"].isFulfiled(definition, values);\n }\n}));\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/metaboxes/monitors/conditional-display/conditions/post-template.js?"); /***/ }), diff --git a/build/classic/metaboxes.min.js b/build/classic/metaboxes.min.js index 02cec6988..0a12e7876 100644 --- a/build/classic/metaboxes.min.js +++ b/build/classic/metaboxes.min.js @@ -1 +1 @@ -this.cf=this.cf||{},this.cf.metaboxes=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=67)}([function(e,t){!function(){e.exports=this.cf.vendor.lodash}()},function(e,t){!function(){e.exports=this.cf.vendor["callbag-basics"]}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/hooks"]}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/data"]}()},function(e,t){!function(){e.exports=this.cf.core}()},function(e,t,n){var r=n(9);e.exports=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:function(){for(var e=arguments.length,t=new Array(e),n=0;nt=>(n,r)=>{if(0!==n)return;let o;t(0,(t,n)=>{0===t?(o=n,r(t,n)):1===t?e(n)?r(t,n):o(1):r(t,n)})})},function(e,t){e.exports=(e=>(t,n)=>{if(0!==t)return;if("function"!=typeof e)return n(0,()=>{}),void n(2);let r,o;const i=e=>{(r=r||2===e)&&"function"==typeof o&&o()};n(0,i),o=e((e,t)=>{r||0===e||(n(e,t),i(e))})})},function(e,t,n){"use strict";(function(e){var r=n(17),o=n.n(r),i=n(26),c=n.n(i),a=n(27),u=n.n(a),s=n(28),l=n.n(s),d=n(29),f=n.n(d),p=n(30),b=n.n(p),m=n(7),v=n.n(m),O=n(9),j=n.n(O),g=n(32),y=n.n(g),h=n(8),_=n(0),E=n(4),w=(n(66),n(31)),x=function(t){function n(){var t,r;c()(this,n);for(var o=arguments.length,i=new Array(o),a=0;at=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=!1;for(r(0,(t,n)=>{a&&1===t&&(i=[1,n]),2===t&&(c=!0,e.length=0),o&&o(t,n)});0!==e.length;)1===e.length&&(a=!0),r(1,e.shift());c||t(0,(e,t)=>{if(0===e)return o=t,a=!1,void(i&&(o(...i),i=null));r(e,t)})},m=n(15),v=n(4);function O(e){var t=parseInt(e.value,10);return!isNaN(t)&&t>=0?t:0}function j(e){var t=0;if(e.className){var n=e.className.match(/^level-(\d+)/);n&&(t=parseInt(n[1],10)+1)}return t}function g(e){for(var t=[],n=e,r=j(e);r>0&&n;)if(j(n)===r){var o=parseInt(n.value,10);o>0&&t.unshift(o),n=n.previousSibling,r--}else n=n.previousSibling;return t}var y={post_ancestors:[],post_parent_id:0,post_level:1};function h(e){var t=e.options[e.selectedIndex];return{post_ancestors:g(t),post_parent_id:O(t),post_level:j(t)+1}}Object(u.addFilter)("carbon-fields.conditional-display-post-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent_id");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return h(e.target)}),b(h(e))):Object(p.a)(y)}),Object(u.addFilter)("carbon-fields.conditional-display-post-parent.gutenberg","carbon-fields/metaboxes",function(){var e=Object(o.select)("core"),t=e.getPostType,n=e.getEntityRecords;return Object(l.pipe)(Object(l.combine)(Object(v.fromSelector)(Object(o.select)("core/editor").getCurrentPostId),Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"type"),Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"parent")),Object(m.a)(s.isEqual),Object(l.map)(function(e){var r=f()(e,3),o=r[0],i=r[1],c=r[2];if(c=parseInt(c,10),isNaN(c))return y;var a=t(i);if(!Object(s.get)(a,["hierarchical"],!1))return y;var u=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=Object(s.find)(n,["id",t]);return o?(r.unshift(o.id),o.parent?e(o.parent,n,r):r):r}(c,n("postType",i,{per_page:-1,exclude:o,parent_exclude:o,orderby:"menu_order",order:"asc"})||[]);return{post_ancestors:u,post_parent_id:c,post_level:u.length+1}}))});var _=n(35),E=n.n(_),w=(e,t,n)=>E()(n=>{let r=n.target;for(;r!==e;){if(r.matches(t))return!0;r=r.parentElement}return!1})(((e,t,n)=>(r,o)=>{if(0!==r)return;let i=!1;const c=e=>{o(1,e)};o(0,r=>{2===r&&(i=!0,e.removeEventListener(t,c,n))}),i||e.addEventListener(t,c,n)})(e,n)),x={post_format:"standard"};function S(e){var t=e.value;return"0"===t&&(t="standard"),{post_format:t}}Object(u.addFilter)("carbon-fields.conditional-display-post-format.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("div#post-formats-select");return e?Object(l.pipe)(w(e,"input.post-format","change"),Object(l.map)(function(e){return S(e.target)}),b(S(e.querySelector("input.post-format:checked")))):Object(p.a)(x)}),Object(u.addFilter)("carbon-fields.conditional-display-post-format.gutenberg","carbon-fields/metaboxes",function(){return Object(l.pipe)(Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"format"),Object(m.a)(),Object(l.filter)(Boolean),Object(l.map)(function(e){return{post_format:e}}),b(x))});var I={post_template:""};function F(e){var t=e.value;return"default"===t&&(t=""),{post_template:t}}Object(u.addFilter)("carbon-fields.conditional-display-post-template.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#page_template");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return F(e.target)}),b(F(e))):Object(p.a)(I)}),Object(u.addFilter)("carbon-fields.conditional-display-post-template.gutenberg","carbon-fields/metaboxes",function(){return Object(l.pipe)(Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"template"),Object(m.a)(),Object(l.filter)(s.isString),Object(l.map)(function(e){return{post_template:e}}),b(I))});var T=n(5),C=n.n(T),A=n(9),D=n.n(A),N=n(17),k=n.n(N);function G(e,t){e["original_".concat(t)]=e[t],e[t]=function(){var n=new Event("change"),r=window.jQuery(arguments.length<=0?void 0:arguments[0]).closest(".postbox").find("textarea.the-tags").get(0),o=e["original_".concat(t)].apply(e,arguments);return r.dispatchEvent(n),o}}window.tagBox&&(G(window.tagBox,"parseTags"),G(window.tagBox,"flushTags")),Object(u.addFilter)("carbon-fields.conditional-display-post-term.classic","carbon-fields/metaboxes",function(){return Object(l.pipe)(l.merge.apply(void 0,k()((e=document.querySelectorAll('div[id^="taxonomy-"]'),k()(e).map(function(e){var t=e.id.replace("taxonomy-","");return Object(l.pipe)(w(e.querySelector("#".concat(t,"checklist")),'input[type="checkbox"]',"change"),Object(l.scan)(function(e,n){var r=n.target;return a()(e,function(e){var n=parseInt(r.value,10);r.checked?e[t].push(n):Object(s.pull)(e[t],n)})},D()({},t,[])),b(function(e){var t=document.querySelectorAll("#".concat(e,'checklist input[type="checkbox"]:checked'));return k()(t).reduce(function(t,n){var r=parseInt(n.value,10);return t[e].push(r),t},D()({},e,[]))}(t)))}))).concat(k()(function(){var e=document.querySelectorAll('div[id^="tagsdiv-"]');return k()(e).map(function(e){var t=e.id.replace("tagsdiv-","");return Object(l.pipe)(Object(l.fromEvent)(e.querySelector("textarea.the-tags"),"change"),Object(l.map)(function(e){var n=e.target;return D()({},t,n.value?n.value.split(window.tagsSuggestL10n.tagDelimiter):[])}),b(function(e){var t=document.querySelector("#tagsdiv-".concat(e," textarea.the-tags")),n=t.value?t.value.split(window.tagsSuggestL10n.tagDelimiter):[];return D()({},e,n)}(t)))})}()))),Object(l.scan)(function(e,t){return{post_term:C()({},e.post_term,t)}},{post_term:{}}));var e}),Object(u.addFilter)("carbon-fields.conditional-display-post-term.gutenberg","carbon-fields/metaboxes",function(){var e=Object(o.select)("core").getTaxonomies,t=Object(o.select)("core/editor").getEditedPostAttribute;return Object(l.pipe)(Object(v.fromSelector)(e,{per_page:-1}),Object(l.filter)(Boolean),Object(l.map)(function(e){var n=e.map(function(e){return[e.slug,t(e.rest_base)||[]]});return{post_term:Object(s.fromPairs)(n)}}))});var P={term_ancestors:[],term_parent:0,term_level:1};function L(e){var t=e.options[e.selectedIndex];return{term_ancestors:g(t),term_parent:O(t),term_level:j(t)+1}}Object(u.addFilter)("carbon-fields.conditional-display-term-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return L(e.target)}),b(L(e))):Object(p.a)(P)});var R={user_role:""};function B(e){return{user_role:e.value}}Object(u.addFilter)("carbon-fields.conditional-display-user-role.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#role");if(!e){var t=document.querySelector("fieldset[data-profile-role]");return t?Object(p.a)({user_role:t.dataset.profileRole}):Object(p.a)(R)}return Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return B(e.target)}),b(B(e)))});var V=n(6),U=n(22),q={operators:[],isOperatorSupported:function(e){return this.operators.indexOf(e)>-1},evaluate:function(){return!1}},M={comparers:[C()({},q,{operators:["=","!="],evaluate:function(e,t,n){switch(t){case"=":return e==n;case"!=":return e!=n;default:return!1}}}),C()({},q,{operators:["IN","NOT IN"],evaluate:function(e,t,n){switch(t){case"IN":return n.indexOf(e)>-1;case"NOT IN":return-1===n.indexOf(e);default:return!1}}}),C()({},q,{operators:[">",">=","<","<="],evaluate:function(e,t,n){switch(t){case">":return e>n;case">=":return e>=n;case"<":return e0;case"NOT IN":return 0===Object(s.intersection)(e,n).length;default:return!1}}}),H=C()({},M,{comparers:[K,z],getEnvironmentValue:function(e,t){return Object(s.get)(t,"post_ancestors",[])}}),J=C()({},M,{isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(s.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(s.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)}}),X=C()({},M,{comparers:[K,z],isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(s.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(s.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)},getEnvironmentValue:function(e,t){return Object(s.get)(t,"term_ancestors",[])}}),Y={boolean:Q,post_term:W,post_ancestor_id:H,post_parent_id:M,post_level:M,post_format:M,post_template:$,term_level:M,term_parent:J,term_ancestor:X,user_role:M},Z=Object(o.withSelect)(function(e){return{containers:e("carbon-fields/metaboxes").getContainers()}}),ee=Object(i.withEffects)(function(e,t){var n=t.context,r=Object(u.applyFilters)("carbon-fields.conditional-display-post-parent.".concat(n)),o=Object(u.applyFilters)("carbon-fields.conditional-display-post-format.".concat(n)),i=Object(u.applyFilters)("carbon-fields.conditional-display-post-template.".concat(n)),c=Object(u.applyFilters)("carbon-fields.conditional-display-post-term.".concat(n)),d=Object(u.applyFilters)("carbon-fields.conditional-display-term-parent.".concat(n)),f=Object(u.applyFilters)("carbon-fields.conditional-display-user-role.".concat(n));return Object(l.pipe)(Object(l.merge)(r,o,i,c,d,f),Object(l.scan)(function(e,t){return a()(e,function(e){Object(s.assign)(e,t)})}))},{handler:function(e){var t=e.containers,n=e.context;return function(e){Object(s.map)(t,function(t,n){return[n,function e(t,n,r){var o=t.map(function(t){if(t.relation)return e(t.conditions,n,t.relation);var r=Object(s.get)(Y,t.type);return r?r.isFulfiled(t,n):(console.error(Object(V.sprintf)(Object(V.__)('Unsupported container condition - "%1$s".',"carbon-fields-ui"),t.type)),!1)});switch(r){case"AND":return o.every(Boolean);case"OR":return o.some(Boolean);default:return console.error(Object(V.sprintf)(Object(V.__)('Unsupported container condition relation used - "%1$s".',"carbon-fields-ui"),r)),!1}}(t.conditions.conditions,e,t.conditions.relation)]}).forEach(function(e){var r=f()(e,2),o=r[0],i=r[1],c=document.getElementById(o),a=document.querySelector(".container-".concat(o)),u=!!a.dataset.mounted;c&&(c.hidden=!i),a&&(i&&!u&&Object(U.b)(t[o],n),!i&&u&&(delete a.dataset.mounted,a._reactRootContainer.unmount()))})}}});t.a=Object(r.compose)(Z,ee)(function(){return null})},function(e,t,n){"use strict";var r=n(14),o=n.n(r),i=n(3),c=n(8),a=n(0),u=n(13),s=n(1);function l(e){return decodeURIComponent((e+"").replace(/%(?![\da-f]{2})/gi,function(){return"%25"}).replace(/\+/g,"%20"))}var d=n(20),f=n(23),p=n(22),b=n(18);t.a=Object(u.withEffects)(function(){return Object(s.merge)(Object(s.pipe)(Object(f.a)(function(e){return window.jQuery(document).on("widget-added widget-updated",e)},function(e){return window.jQuery(document).off("widget-added widget-updated",e)},function(e,t){return{event:e,$widget:t}}),Object(s.filter)(function(e){return e.$widget[0].id.indexOf(b.b)>-1}),Object(s.map)(function(e){return{type:"WIDGET_CREATED_OR_UPDATED",payload:e}})),Object(s.pipe)(Object(f.a)(function(e){return window.jQuery(document).on("ajaxSend",e)},function(e){return window.jQuery(document).off("ajaxSend",e)},function(e,t,n,r){return{event:e,xhr:t,options:n,data:r}}),Object(s.filter)(function(e){var t=e.options;return Object(a.startsWith)(t.data,b.a)}),Object(s.map)(function(e){return{type:"WIDGET_BEIGN_UPDATED_OR_DELETED",payload:e}})))},{handler:function(){return function(e){var t=Object(i.select)("carbon-fields/metaboxes").getContainerById,n=Object(i.dispatch)("carbon-fields/metaboxes"),r=n.addContainer,u=n.removeContainer,s=n.addFields,f=n.removeFields;switch(e.type){case"WIDGET_CREATED_OR_UPDATED":var m=e.payload,v=m.event,O=m.$widget,j=Object(a.flow)(l,JSON.parse)(O.find("[data-json]").data("json")),g=[];if(j.fields=j.fields.map(function(e){return Object(d.a)(e,j,g)}),s(g),r(j),Object(p.b)(j,"classic"),window.cf.config.pagenow===b.c&&"widget-added"===v.type){var y=O.find('[name="widget-id"]').val();O.find('[name="savewidget"]').show().end().find(".widget-content:first").off("keydown","input").off("change input propertychange",":input"),wp.customize.Widgets.getWidgetFormControlForWidget(y).liveUpdateMode=!1}break;case"WIDGET_BEIGN_UPDATED_OR_DELETED":var h=e.payload.options.data.match(/widget-id=(.+?)&/),E=o()(h,2)[1],w="".concat(b.a).concat(E),x=t(w);Object(c.unmountComponentAtNode)(document.querySelector(".container-".concat(w)));var S=_.map(x.fields,"id");u(w),f(S)}}}})(function(){return null})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){"use strict";(function(e){var t=n(26),r=n.n(t),o=n(27),i=n.n(o),c=n(28),a=n.n(c),u=n(29),s=n.n(u),l=n(30),d=n.n(l),f=n(7),p=n.n(f),b=n(9),m=n.n(b),v=n(10),O=n.n(v),j=n(8),g=n(2),y=n(11),h=n(3),_=n(0),E=n(4),w=(n(47),n(31)),x=n(20),S=function(e){function t(){var e,n;r()(this,t);for(var o=arguments.length,i=new Array(o),c=0;c-1&&t.data.indexOf("add-tag")>-1&&!n.documentElement.querySelector("wp_error")}))},{handler:function(e){return function(){var t=o.a.map(e.container.fields,"id"),n=Object(l.a)(o.a.get(window.cf,"preloaded.containers",[])),r=n.containers,i=n.fields,a=o.a.find(r,["id",e.id]),u=o.a.filter(i,["container_id",e.id]),s=Object(c.dispatch)("carbon-fields/metaboxes"),d=s.updateState,f=s.removeFields;d(o.a.keyBy([a],"id"),o.a.keyBy(u,"id")),f(t)}}}))},function(e,t,n){"use strict";var r=n(2),o=n(13),i=n(1);n(63),Object(r.addFilter)("carbon-fields.theme_options.classic","carbon-fields/metaboxes",Object(o.withEffects)(function(){return Object(i.pipe)(Object(i.fromEvent)(window,"scroll"),Object(i.map)(function(){return window.jQuery(window).scrollTop()}))},{handler:function(){return function(e){var t=window.jQuery(".carbon-box:first"),n=window.jQuery("#postbox-container-1"),r=window.jQuery("#wpadminbar").height()+10,o=t.offset().top-r;o>0&&n.toggleClass("fixed",e>=o).css("top",r)}}}))},function(e,t,n){},function(e,t,n){"use strict";n(65)},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"setupState",function(){return j}),n.d(r,"updateState",function(){return g}),n.d(r,"updateFieldValue",function(){return y}),n.d(r,"addFields",function(){return h}),n.d(r,"cloneFields",function(){return _}),n.d(r,"removeFields",function(){return E}),n.d(r,"addContainer",function(){return w}),n.d(r,"removeContainer",function(){return x}),n.d(r,"receiveSidebar",function(){return S}),n.d(r,"lockSaving",function(){return I}),n.d(r,"unlockSaving",function(){return F});var o={};n.r(o),n.d(o,"getContainers",function(){return T}),n.d(o,"getContainerById",function(){return C}),n.d(o,"getFields",function(){return A}),n.d(o,"getFieldsByContainerId",function(){return D}),n.d(o,"getFieldById",function(){return N}),n.d(o,"isSavingLocked",function(){return k}),n.d(o,"isDirty",function(){return G}),n.d(o,"getComplexGroupValues",function(){return P});var i=n(6),c=n(2),a=n(3),u=n(0),s=n(9),l=n.n(s),d=n(5),f=n.n(d),p=n(10),b=n.n(p),m=n(4);function v(e,t,n){var r=t[e];return"complex"===r.type&&r.value.forEach(function(e){n=e.fields.reduce(function(e,n){return v(n.id,t,e)},n)}),n.concat(e)}var O=Object(a.combineReducers)({containers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.containers;case"UPDATE_STATE":return b()(e,function(e){Object(u.values)(t.payload.containers).forEach(function(t){e[t.id]=t})});case"ADD_CONTAINER":return b()(e,function(e){e[t.payload.id]=t.payload});case"REMOVE_CONTAINER":return Object(u.omit)(e,t.payload);default:return e}},fields:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.fields;case"UPDATE_STATE":return b()(e,function(e){Object(u.values)(t.payload.fields).forEach(function(t){e[t.id]=t})});case"UPDATE_FIELD_VALUE":return b()(e,function(n){var r=t.payload,o=r.fieldId,i=r.value,c=r.fieldsToRemove;n[o].value=i,c.reduce(function(t,n){return v(n,e,t)},[]).forEach(function(e){Object(u.unset)(n,e)})});case"ADD_FIELDS":return b()(e,function(e){t.payload.fields.forEach(function(t){e[t.id]=t})});case"CLONE_FIELDS":return b()(e,function(e){var n=t.payload,r=n.originFieldIds,o=n.cloneFieldIds,i=r.reduce(function(t,n,r){return function e(t,n,r,o){var i=Object(u.cloneDeep)(r[t]);return i.id=n,"complex"===i.type&&i.value.forEach(function(t){t.id=Object(m.uniqueId)(),o=t.fields.reduce(function(t,n){var o=n.id,i=Object(m.uniqueId)();return n.id=i,e(o,i,r,t)},o)}),o.concat(i)}(n,o[r],e,t)},[]);Object(u.assign)(e,Object(u.keyBy)(i,"id"))});case"REMOVE_FIELDS":var n=t.payload.fieldIds.reduce(function(t,n){return v(n,e,t)},[]);return Object(u.omit)(e,n);case"RECEIVE_SIDEBAR":return b()(e,function(e){Object(u.forEach)(e,function(e){"sidebar"===e.type&&e.options.unshift(t.payload)})});default:return e}},savingLock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_SAVING":return f()({},e,l()({},t.payload.lockName,!0));case"UNLOCK_SAVING":return Object(u.omit)(e,[t.payload.lockName]);default:return e}},isDirty:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"UPDATE_FIELD_VALUE":return!0;default:return e}}});function j(e,t){return{type:"SETUP_STATE",payload:{containers:e,fields:t}}}function g(e,t){return{type:"UPDATE_STATE",payload:{containers:e,fields:t}}}function y(e,t){return{type:"UPDATE_FIELD_VALUE",payload:{fieldId:e,value:t,fieldsToRemove:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]}}}function h(e){return{type:"ADD_FIELDS",payload:{fields:e}}}function _(e,t){return{type:"CLONE_FIELDS",payload:{originFieldIds:e,cloneFieldIds:t}}}function E(e){return{type:"REMOVE_FIELDS",payload:{fieldIds:e}}}function w(e){return{type:"ADD_CONTAINER",payload:e}}function x(e){return{type:"REMOVE_CONTAINER",payload:e}}function S(e){return{type:"RECEIVE_SIDEBAR",payload:e}}function I(e){return{type:"LOCK_SAVING",payload:{lockName:e}}}function F(e){return{type:"UNLOCK_SAVING",payload:{lockName:e}}}function T(e){return e.containers}function C(e,t){return e.containers[t]}function A(e){return e.fields}function D(e,t){return Object(u.filter)(e.fields,["container_id",t])}function N(e,t){return e.fields[t]}function k(e){return Object.keys(e.savingLock).length>0}function G(e){return e.isDirty}function P(e,t){var n=Object(u.pick)(A(e),t);return n=Object(u.mapKeys)(n,function(e){return e.base_name.replace(/\-/g,"_")}),Object(u.mapValues)(n,function(e){return e.value})}var L=n(24);Object(a.registerStore)("carbon-fields/metaboxes",{reducer:O,actions:r,selectors:o});var R=Object(L.a)(Object(u.get)(window.cf,"preloaded.containers",[])),B=R.containers,V=R.fields;Object(a.dispatch)("carbon-fields/metaboxes").setupState(Object(u.keyBy)(B,"id"),Object(u.keyBy)(V,"id"));var U=n(11),q=n(25),M=n(14),Q=n.n(M),K=n(12);const W={};var $=n(15),z=n(1);function H(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return void 0===e?[]:Object(u.pick)(t,Object(u.difference)(Object(u.map)(e.fields,"id"),n))}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(u.map)(e,function(e){return[e.id,"".concat(Object(u.repeat)("parent.",t)).concat(e.base_name)]})}var X=Object(m.withConditionalLogic)(function(e,t){var n=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId;return Object(z.pipe)(Object(z.merge)(Object(K.a)(n(e.containerId)),Object(m.fromSelector)(n,e.containerId)),(e=>t=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=W;t(0,(t,n)=>{if(0===t)return o=n,e(0,(e,t)=>{if(0!==e)return 1===e?(a=void 0,i(2),o(2),void(c&&r(2))):void(2===e&&(i=null,a=t,null!=t&&(o(2),c&&r(e,t))));(i=t)(1)}),c=!0,r(0,(e,t)=>{a===W&&(2===e&&i&&i(2),o(e,t))}),void(a!==W&&r(2,a));2===t&&i(2),a===W&&r(t,n)})})(t.unmount),Object($.a)(u.isEqual))},function(e,t){t=Object(u.keyBy)(t,"id");var n=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),r=[];if(Object(u.some)(n.fields,["id",e.id]))r=J(r=H(n,t,[e.id]));else{var o=e.name.replace(new RegExp("^".concat(window.cf.config.compactInputKey,"\\[(.+?)\\]")),"$1"),i=Object(u.find)(t,function(t){return t.container_id===e.containerId&&Object(u.startsWith)(o,t.name)}),c=o.split(/\[|\]/g);c.shift(),(c=c.filter(function(e){return""!==e})).pop();var s=c.reduce(function(e,t){return isNaN(t)?e+1:e},0);r=J(r=H(n,t,[i.id]),s+1);for(var l="".concat(i.id,".value");c.length>0;){var d=c.shift(),f=!isNaN(d),p=!f;if(f){l="".concat(l,"[").concat(d,"]");var b=H(Object(u.get)(t,l),t,[e.id]);r=r.concat(J(b,s)),l="".concat(l,".fields")}if(p){var m=Object(u.find)(Object(u.get)(t,l),["name",d]);l="".concat(m.id,".value"),s--}}}return r=r.map(function(e){var n=Q()(e,2),r=n[0];return[n[1],Object(u.get)(t,"".concat(r,".value"))]}),Object(u.fromPairs)(r)}),Y=n(21);function Z(e,t){return Object(u.find)(e,function(e){return e.name===t})}Object(c.addFilter)("carbon-fields.association.metabox","carbon-fields/metaboxes",Object(m.withProps)(function(e){return{hierarchyResolver:function(){for(var t,n,r,o,i=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId(e.containerId),c=(t=e.name,n=window.cf.config,r=n.compactInput,o=n.compactInputKey,r&&0===t.indexOf(o)?t.replace(new RegExp("^".concat(o,"\\[(.+?)\\]")),"$1"):t).split(/\[|\]/g),s=Z(i,(c=c.filter(function(e){return""!==e})).shift()),l=i.indexOf(s),d=s.base_name;c.length>0;){var f=c.shift(),p=!isNaN(f),b=f===e.field.base_name,m=!p&&!b;if(p&&(l="".concat(l,".value.").concat(f,".name"),d="".concat(d,"[").concat(f,"]:").concat(Object(u.get)(i,l),"/")),m){var v=Z(Object(u.get)(i,l.replace(/\.name$/,".fields")),f),O=Object(u.find)(i,["id",v.id]);l=i.indexOf(O),d="".concat(d).concat(O.base_name)}b&&(d="".concat(d).concat(f))}return d}}})),n(44),n(49),n(50),n(51),n(52),n(53),n(55),Object(c.addFilter)("carbon-fields.sidebar.metabox","carbon-fields/metaboxes",Object(a.withDispatch)(function(e){return{onAdded:e("carbon-fields/metaboxes").receiveSidebar}})),Object(c.addFilter)("carbon-fields.field-edit.metabox","carbon-fields/metaboxes",Object(U.compose)(q.a,X,Object(a.withDispatch)(function(e){if(Object(Y.a)()){var t=e("core/editor");return{lockSaving:t.lockPostSaving,unlockSaving:t.unlockPostSaving}}var n=e("carbon-fields/metaboxes");return{lockSaving:n.lockSaving,unlockSaving:n.unlockSaving}}),m.withValidation));var ee=n(33),te=n(22),ne=n(19);n.d(t,"registerContainerType",function(){return ne.b}),n.d(t,"getContainerType",function(){return ne.a}),Object(i.setLocaleData)(window.cf.config.locale,"carbon-fields-ui");var re=Object(Y.a)()?"gutenberg":"classic";Object(c.addAction)("carbon-fields.init","carbon-fields/metaboxes",function(){Object(te.a)(re),Object(ee.a)(re)})},function(e,t,n){"use strict";var r=n(11),o=n(2),i=n(4),c=n(3),a=Object(r.createHigherOrderComponent)(function(e){return Object(c.withSelect)(function(e,t){var n=t.id;return{container:e("carbon-fields/metaboxes").getContainerById(n)}})(e)},"withContainer");Object(o.addFilter)("carbon-fields.register-container-type","carbon-fields/metaboxes",function(e,t,n){return Object(r.compose)(a,Object(i.withFilters)("carbon-fields.".concat(e,".").concat(t)))(n)})}]); \ No newline at end of file +this.cf=this.cf||{},this.cf.metaboxes=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=67)}([function(e,t){!function(){e.exports=this.cf.vendor.lodash}()},function(e,t){!function(){e.exports=this.cf.vendor["callbag-basics"]}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/hooks"]}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/data"]}()},function(e,t){!function(){e.exports=this.cf.core}()},function(e,t,n){var r=n(9);e.exports=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:function(){for(var e=arguments.length,t=new Array(e),n=0;nt=>(n,r)=>{if(0!==n)return;let o;t(0,(t,n)=>{0===t?(o=n,r(t,n)):1===t?e(n)?r(t,n):o(1):r(t,n)})})},function(e,t){e.exports=(e=>(t,n)=>{if(0!==t)return;if("function"!=typeof e)return n(0,()=>{}),void n(2);let r,o;const i=e=>{(r=r||2===e)&&"function"==typeof o&&o()};n(0,i),o=e((e,t)=>{r||0===e||(n(e,t),i(e))})})},function(e,t,n){"use strict";(function(e){var r=n(17),o=n.n(r),i=n(26),c=n.n(i),a=n(27),u=n.n(a),s=n(28),l=n.n(s),d=n(29),f=n.n(d),p=n(30),b=n.n(p),m=n(7),v=n.n(m),O=n(9),j=n.n(O),g=n(32),y=n.n(g),h=n(8),_=n(0),E=n(4),w=(n(66),n(31)),x=function(t){function n(){var t,r;c()(this,n);for(var o=arguments.length,i=new Array(o),a=0;at=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=!1;for(r(0,(t,n)=>{a&&1===t&&(i=[1,n]),2===t&&(c=!0,e.length=0),o&&o(t,n)});0!==e.length;)1===e.length&&(a=!0),r(1,e.shift());c||t(0,(e,t)=>{if(0===e)return o=t,a=!1,void(i&&(o(...i),i=null));r(e,t)})},m=n(15),v=n(4);function O(e){var t=parseInt(e.value,10);return!isNaN(t)&&t>=0?t:0}function j(e){var t=0;if(e.className){var n=e.className.match(/^level-(\d+)/);n&&(t=parseInt(n[1],10)+1)}return t}function g(e){for(var t=[],n=e,r=j(e);r>0&&n;)if(j(n)===r){var o=parseInt(n.value,10);o>0&&t.unshift(o),n=n.previousSibling,r--}else n=n.previousSibling;return t}var y={post_ancestors:[],post_parent_id:0,post_level:1};function h(e){var t=e.options[e.selectedIndex];return{post_ancestors:g(t),post_parent_id:O(t),post_level:j(t)+1}}Object(u.addFilter)("carbon-fields.conditional-display-post-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent_id");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return h(e.target)}),b(h(e))):Object(p.a)(y)}),Object(u.addFilter)("carbon-fields.conditional-display-post-parent.gutenberg","carbon-fields/metaboxes",function(){var e=Object(o.select)("core"),t=e.getPostType,n=e.getEntityRecords;return Object(l.pipe)(Object(l.combine)(Object(v.fromSelector)(Object(o.select)("core/editor").getCurrentPostId),Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"type"),Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"parent")),Object(m.a)(s.isEqual),Object(l.map)(function(e){var r=f()(e,3),o=r[0],i=r[1],c=r[2];if(c=parseInt(c,10),isNaN(c))return y;var a=t(i);if(!Object(s.get)(a,["hierarchical"],!1))return y;var u=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=Object(s.find)(n,["id",t]);return o?(r.unshift(o.id),o.parent?e(o.parent,n,r):r):r}(c,n("postType",i,{per_page:-1,exclude:o,parent_exclude:o,orderby:"menu_order",order:"asc"})||[]);return{post_ancestors:u,post_parent_id:c,post_level:u.length+1}}))});var _=n(35),E=n.n(_),w=(e,t,n)=>E()(n=>{let r=n.target;for(;r!==e;){if(r.matches(t))return!0;r=r.parentElement}return!1})(((e,t,n)=>(r,o)=>{if(0!==r)return;let i=!1;const c=e=>{o(1,e)};o(0,r=>{2===r&&(i=!0,e.removeEventListener(t,c,n))}),i||e.addEventListener(t,c,n)})(e,n)),x={post_format:"standard"};function S(e){var t=e.value;return"0"===t&&(t="standard"),{post_format:t}}Object(u.addFilter)("carbon-fields.conditional-display-post-format.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("div#post-formats-select");return e?Object(l.pipe)(w(e,"input.post-format","change"),Object(l.map)(function(e){return S(e.target)}),b(S(e.querySelector("input.post-format:checked")))):Object(p.a)(x)}),Object(u.addFilter)("carbon-fields.conditional-display-post-format.gutenberg","carbon-fields/metaboxes",function(){return Object(l.pipe)(Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"format"),Object(m.a)(),Object(l.filter)(Boolean),Object(l.map)(function(e){return{post_format:e}}),b(x))});var I={post_template:""};function F(e){var t=e.value;return"default"===t&&(t=""),{post_template:t}}Object(u.addFilter)("carbon-fields.conditional-display-post-template.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#page_template");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return F(e.target)}),b(F(e))):Object(p.a)(I)}),Object(u.addFilter)("carbon-fields.conditional-display-post-template.gutenberg","carbon-fields/metaboxes",function(){return Object(l.pipe)(Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"template"),Object(m.a)(),Object(l.filter)(s.isString),Object(l.map)(function(e){return{post_template:e}}),b(I))});var T=n(5),C=n.n(T),A=n(9),D=n.n(A),N=n(17),k=n.n(N);function G(e,t){e["original_".concat(t)]=e[t],e[t]=function(){var n=new Event("change"),r=window.jQuery(arguments.length<=0?void 0:arguments[0]).closest(".postbox").find("textarea.the-tags").get(0),o=e["original_".concat(t)].apply(e,arguments);return r.dispatchEvent(n),o}}window.tagBox&&(G(window.tagBox,"parseTags"),G(window.tagBox,"flushTags")),Object(u.addFilter)("carbon-fields.conditional-display-post-term.classic","carbon-fields/metaboxes",function(){return Object(l.pipe)(l.merge.apply(void 0,k()((e=document.querySelectorAll('div[id^="taxonomy-"]'),k()(e).map(function(e){var t=e.id.replace("taxonomy-","");return Object(l.pipe)(w(e.querySelector("#".concat(t,"checklist")),'input[type="checkbox"]',"change"),Object(l.scan)(function(e,n){var r=n.target;return a()(e,function(e){var n=parseInt(r.value,10);r.checked?e[t].push(n):Object(s.pull)(e[t],n)})},D()({},t,[])),b(function(e){var t=document.querySelectorAll("#".concat(e,'checklist input[type="checkbox"]:checked'));return k()(t).reduce(function(t,n){var r=parseInt(n.value,10);return t[e].push(r),t},D()({},e,[]))}(t)))}))).concat(k()(function(){var e=document.querySelectorAll('div[id^="tagsdiv-"]');return k()(e).map(function(e){var t=e.id.replace("tagsdiv-","");return Object(l.pipe)(Object(l.fromEvent)(e.querySelector("textarea.the-tags"),"change"),Object(l.map)(function(e){var n=e.target;return D()({},t,n.value?n.value.split(window.tagsSuggestL10n.tagDelimiter):[])}),b(function(e){var t=document.querySelector("#tagsdiv-".concat(e," textarea.the-tags")),n=t.value?t.value.split(window.tagsSuggestL10n.tagDelimiter):[];return D()({},e,n)}(t)))})}()))),Object(l.scan)(function(e,t){return{post_term:C()({},e.post_term,t)}},{post_term:{}}));var e}),Object(u.addFilter)("carbon-fields.conditional-display-post-term.gutenberg","carbon-fields/metaboxes",function(){var e=Object(o.select)("core").getTaxonomies,t=Object(o.select)("core/editor").getEditedPostAttribute;return Object(l.pipe)(Object(v.fromSelector)(e,{per_page:-1}),Object(l.filter)(Boolean),Object(l.map)(function(e){var n=e.map(function(e){return[e.slug,t(e.rest_base)||[]]});return{post_term:Object(s.fromPairs)(n)}}))});var P={term_ancestors:[],term_parent:0,term_level:1};function L(e){var t=e.options[e.selectedIndex];return{term_ancestors:g(t),term_parent:O(t),term_level:j(t)+1}}Object(u.addFilter)("carbon-fields.conditional-display-term-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return L(e.target)}),b(L(e))):Object(p.a)(P)});var R={user_role:""};function B(e){return{user_role:e.value}}Object(u.addFilter)("carbon-fields.conditional-display-user-role.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#role");if(!e){var t=document.querySelector("fieldset[data-profile-role]");return t?Object(p.a)({user_role:t.dataset.profileRole}):Object(p.a)(R)}return Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return B(e.target)}),b(B(e)))});var V=n(6),U=n(22),q={operators:[],isOperatorSupported:function(e){return this.operators.indexOf(e)>-1},evaluate:function(){return!1}},M={comparers:[C()({},q,{operators:["=","!="],evaluate:function(e,t,n){switch(t){case"=":return e==n;case"!=":return e!=n;default:return!1}}}),C()({},q,{operators:["IN","NOT IN"],evaluate:function(e,t,n){switch(t){case"IN":return n.indexOf(e)>-1;case"NOT IN":return-1===n.indexOf(e);default:return!1}}}),C()({},q,{operators:[">",">=","<","<="],evaluate:function(e,t,n){switch(t){case">":return e>n;case">=":return e>=n;case"<":return e0;case"NOT IN":return 0===Object(s.intersection)(e,n).length;default:return!1}}}),H=C()({},M,{comparers:[K,z],getEnvironmentValue:function(e,t){return Object(s.get)(t,"post_ancestors",[])}}),J=C()({},M,{isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(s.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(s.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)}}),X=C()({},M,{comparers:[K,z],isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(s.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(s.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)},getEnvironmentValue:function(e,t){return Object(s.get)(t,"term_ancestors",[])}}),Y={boolean:Q,post_term:W,post_ancestor_id:H,post_parent_id:M,post_level:M,post_format:M,post_template:$,term_level:M,term_parent:J,term_ancestor:X,user_role:M},Z=Object(o.withSelect)(function(e){return{containers:e("carbon-fields/metaboxes").getContainers()}}),ee=Object(i.withEffects)(function(e,t){var n=t.context,r=Object(u.applyFilters)("carbon-fields.conditional-display-post-parent.".concat(n)),o=Object(u.applyFilters)("carbon-fields.conditional-display-post-format.".concat(n)),i=Object(u.applyFilters)("carbon-fields.conditional-display-post-template.".concat(n)),c=Object(u.applyFilters)("carbon-fields.conditional-display-post-term.".concat(n)),d=Object(u.applyFilters)("carbon-fields.conditional-display-term-parent.".concat(n)),f=Object(u.applyFilters)("carbon-fields.conditional-display-user-role.".concat(n));return Object(l.pipe)(Object(l.merge)(r,o,i,c,d,f),Object(l.scan)(function(e,t){return a()(e,function(e){Object(s.assign)(e,t)})}))},{handler:function(e){var t=e.containers,n=e.context;return function(e){Object(s.map)(t,function(t,n){return[n,function e(t,n,r){var o=t.map(function(t){if(t.relation)return e(t.conditions,n,t.relation);var r=Object(s.get)(Y,t.type);return r?r.isFulfiled(t,n):(console.error(Object(V.sprintf)(Object(V.__)('Unsupported container condition - "%1$s".',"carbon-fields-ui"),t.type)),!1)});switch(r){case"AND":return o.every(Boolean);case"OR":return o.some(Boolean);default:return console.error(Object(V.sprintf)(Object(V.__)('Unsupported container condition relation used - "%1$s".',"carbon-fields-ui"),r)),!1}}(t.conditions.conditions,e,t.conditions.relation)]}).forEach(function(e){var r=f()(e,2),o=r[0],i=r[1],c=document.getElementById(o),a=document.querySelector(".container-".concat(o)),u=!!a.dataset.mounted;c&&(c.hidden=!i),a&&(i&&!u&&Object(U.b)(t[o],n),!i&&u&&(delete a.dataset.mounted,a._reactRootContainer.unmount()))})}}});t.a=Object(r.compose)(Z,ee)(function(){return null})},function(e,t,n){"use strict";var r=n(14),o=n.n(r),i=n(3),c=n(8),a=n(0),u=n(13),s=n(1);function l(e){return decodeURIComponent((e+"").replace(/%(?![\da-f]{2})/gi,function(){return"%25"}).replace(/\+/g,"%20"))}var d=n(20),f=n(23),p=n(22),b=n(18);t.a=Object(u.withEffects)(function(){return Object(s.merge)(Object(s.pipe)(Object(f.a)(function(e){return window.jQuery(document).on("widget-added widget-updated",e)},function(e){return window.jQuery(document).off("widget-added widget-updated",e)},function(e,t){return{event:e,$widget:t}}),Object(s.filter)(function(e){return e.$widget[0].id.indexOf(b.b)>-1}),Object(s.map)(function(e){return{type:"WIDGET_CREATED_OR_UPDATED",payload:e}})),Object(s.pipe)(Object(f.a)(function(e){return window.jQuery(document).on("ajaxSend",e)},function(e){return window.jQuery(document).off("ajaxSend",e)},function(e,t,n,r){return{event:e,xhr:t,options:n,data:r}}),Object(s.filter)(function(e){var t=e.options;return Object(a.startsWith)(t.data,b.a)}),Object(s.map)(function(e){return{type:"WIDGET_BEIGN_UPDATED_OR_DELETED",payload:e}})))},{handler:function(){return function(e){var t=Object(i.select)("carbon-fields/metaboxes").getContainerById,n=Object(i.dispatch)("carbon-fields/metaboxes"),r=n.addContainer,u=n.removeContainer,s=n.addFields,f=n.removeFields;switch(e.type){case"WIDGET_CREATED_OR_UPDATED":var m=e.payload,v=m.event,O=m.$widget,j=Object(a.flow)(l,JSON.parse)(O.find("[data-json]").data("json")),g=[];if(j.fields=j.fields.map(function(e){return Object(d.a)(e,j,g)}),s(g),r(j),Object(p.b)(j,"classic"),window.cf.config.pagenow===b.c&&"widget-added"===v.type){var y=O.find('[name="widget-id"]').val();O.find('[name="savewidget"]').show().end().find(".widget-content:first").off("keydown","input").off("change input propertychange",":input"),wp.customize.Widgets.getWidgetFormControlForWidget(y).liveUpdateMode=!1}break;case"WIDGET_BEIGN_UPDATED_OR_DELETED":var h=e.payload.options.data.match(/widget-id=(.+?)&/),E=o()(h,2)[1],w="".concat(b.a).concat(E),x=t(w);Object(c.unmountComponentAtNode)(document.querySelector(".container-".concat(w)));var S=_.map(x.fields,"id");u(w),f(S)}}}})(function(){return null})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){"use strict";(function(e){var t=n(26),r=n.n(t),o=n(27),i=n.n(o),c=n(28),a=n.n(c),u=n(29),s=n.n(u),l=n(30),d=n.n(l),f=n(7),p=n.n(f),b=n(9),m=n.n(b),v=n(10),O=n.n(v),j=n(8),g=n(2),y=n(11),h=n(3),_=n(0),E=n(4),w=(n(47),n(31)),x=n(20),S=function(e){function t(){var e,n;r()(this,t);for(var o=arguments.length,i=new Array(o),c=0;c-1&&t.data.indexOf("add-tag")>-1&&!n.documentElement.querySelector("wp_error")}))},{handler:function(e){return function(){var t=o.a.map(e.container.fields,"id"),n=Object(l.a)(o.a.get(window.cf,"preloaded.containers",[])),r=n.containers,i=n.fields,a=o.a.find(r,["id",e.id]),u=o.a.filter(i,["container_id",e.id]),s=Object(c.dispatch)("carbon-fields/metaboxes"),d=s.updateState,f=s.removeFields;d(o.a.keyBy([a],"id"),o.a.keyBy(u,"id")),f(t)}}}))},function(e,t,n){"use strict";var r=n(2),o=n(13),i=n(1);n(63),Object(r.addFilter)("carbon-fields.theme_options.classic","carbon-fields/metaboxes",Object(o.withEffects)(function(){return Object(i.pipe)(Object(i.fromEvent)(window,"scroll"),Object(i.map)(function(){return window.jQuery(window).scrollTop()}))},{handler:function(){return function(e){var t=window.jQuery(".carbon-box:first"),n=window.jQuery("#postbox-container-1"),r=window.jQuery("#wpadminbar").height()+10,o=t.offset().top-r;o>0&&n.toggleClass("fixed",e>=o).css("top",r)}}}))},function(e,t,n){},function(e,t,n){"use strict";n(65)},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"setupState",function(){return j}),n.d(r,"updateState",function(){return g}),n.d(r,"updateFieldValue",function(){return y}),n.d(r,"addFields",function(){return h}),n.d(r,"cloneFields",function(){return _}),n.d(r,"removeFields",function(){return E}),n.d(r,"addContainer",function(){return w}),n.d(r,"removeContainer",function(){return x}),n.d(r,"receiveSidebar",function(){return S}),n.d(r,"lockSaving",function(){return I}),n.d(r,"unlockSaving",function(){return F});var o={};n.r(o),n.d(o,"getContainers",function(){return T}),n.d(o,"getContainerById",function(){return C}),n.d(o,"getFields",function(){return A}),n.d(o,"getFieldsByContainerId",function(){return D}),n.d(o,"getFieldById",function(){return N}),n.d(o,"isSavingLocked",function(){return k}),n.d(o,"isDirty",function(){return G}),n.d(o,"getComplexGroupValues",function(){return P});var i=n(6),c=n(2),a=n(3),u=n(0),s=n(9),l=n.n(s),d=n(5),f=n.n(d),p=n(10),b=n.n(p),m=n(4);function v(e,t,n){var r=t[e];return"complex"===r.type&&r.value.forEach(function(e){n=e.fields.reduce(function(e,n){return v(n.id,t,e)},n)}),n.concat(e)}var O=Object(a.combineReducers)({containers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.containers;case"UPDATE_STATE":return b()(e,function(e){Object(u.values)(t.payload.containers).forEach(function(t){e[t.id]=t})});case"ADD_CONTAINER":return b()(e,function(e){e[t.payload.id]=t.payload});case"REMOVE_CONTAINER":return Object(u.omit)(e,t.payload);default:return e}},fields:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.fields;case"UPDATE_STATE":return b()(e,function(e){Object(u.values)(t.payload.fields).forEach(function(t){e[t.id]=t})});case"UPDATE_FIELD_VALUE":return b()(e,function(n){var r=t.payload,o=r.fieldId,i=r.value,c=r.fieldsToRemove;n[o].value=i,c.reduce(function(t,n){return v(n,e,t)},[]).forEach(function(e){Object(u.unset)(n,e)})});case"ADD_FIELDS":return b()(e,function(e){t.payload.fields.forEach(function(t){e[t.id]=t})});case"CLONE_FIELDS":return b()(e,function(e){var n=t.payload,r=n.originFieldIds,o=n.cloneFieldIds,i=r.reduce(function(t,n,r){return function e(t,n,r,o){var i=Object(u.cloneDeep)(r[t]);return i.id=n,"complex"===i.type&&i.value.forEach(function(t){t.id=Object(m.uniqueId)(),o=t.fields.reduce(function(t,n){var o=n.id,i=Object(m.uniqueId)();return n.id=i,e(o,i,r,t)},o)}),o.concat(i)}(n,o[r],e,t)},[]);Object(u.assign)(e,Object(u.keyBy)(i,"id"))});case"REMOVE_FIELDS":var n=t.payload.fieldIds.reduce(function(t,n){return v(n,e,t)},[]);return Object(u.omit)(e,n);case"RECEIVE_SIDEBAR":return b()(e,function(e){Object(u.forEach)(e,function(e){"sidebar"===e.type&&e.options.unshift(t.payload)})});default:return e}},savingLock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_SAVING":return f()({},e,l()({},t.payload.lockName,!0));case"UNLOCK_SAVING":return Object(u.omit)(e,[t.payload.lockName]);default:return e}},isDirty:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"UPDATE_FIELD_VALUE":return!0;default:return e}}});function j(e,t){return{type:"SETUP_STATE",payload:{containers:e,fields:t}}}function g(e,t){return{type:"UPDATE_STATE",payload:{containers:e,fields:t}}}function y(e,t){return{type:"UPDATE_FIELD_VALUE",payload:{fieldId:e,value:t,fieldsToRemove:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]}}}function h(e){return{type:"ADD_FIELDS",payload:{fields:e}}}function _(e,t){return{type:"CLONE_FIELDS",payload:{originFieldIds:e,cloneFieldIds:t}}}function E(e){return{type:"REMOVE_FIELDS",payload:{fieldIds:e}}}function w(e){return{type:"ADD_CONTAINER",payload:e}}function x(e){return{type:"REMOVE_CONTAINER",payload:e}}function S(e){return{type:"RECEIVE_SIDEBAR",payload:e}}function I(e){return{type:"LOCK_SAVING",payload:{lockName:e}}}function F(e){return{type:"UNLOCK_SAVING",payload:{lockName:e}}}function T(e){return e.containers}function C(e,t){return e.containers[t]}function A(e){return e.fields}function D(e,t){return Object(u.filter)(e.fields,["container_id",t])}function N(e,t){return e.fields[t]}function k(e){return Object.keys(e.savingLock).length>0}function G(e){return e.isDirty}function P(e,t){var n=Object(u.pick)(A(e),t);return n=Object(u.mapKeys)(n,function(e){return e.base_name.replace(/\-/g,"_")}),Object(u.mapValues)(n,function(e){return e.value})}var L=n(24);Object(a.registerStore)("carbon-fields/metaboxes",{reducer:O,actions:r,selectors:o});var R=Object(L.a)(Object(u.get)(window.cf,"preloaded.containers",[])),B=R.containers,V=R.fields;Object(a.dispatch)("carbon-fields/metaboxes").setupState(Object(u.keyBy)(B,"id"),Object(u.keyBy)(V,"id"));var U=n(11),q=n(25),M=n(14),Q=n.n(M),K=n(12);const W={};var $=n(15),z=n(1);function H(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return void 0===e?[]:Object(u.pick)(t,Object(u.difference)(Object(u.map)(e.fields,"id"),n))}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(u.map)(e,function(e){return[e.id,"".concat(Object(u.repeat)("parent.",t)).concat(e.base_name)]})}var X=Object(m.withConditionalLogic)(function(e,t){var n=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId;return Object(z.pipe)(Object(z.merge)(Object(K.a)(n(e.containerId)),Object(m.fromSelector)(n,e.containerId)),(e=>t=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=W;t(0,(t,n)=>{if(0===t)return o=n,e(0,(e,t)=>{if(0!==e)return 1===e?(a=void 0,i(2),o(2),void(c&&r(2))):void(2===e&&(i=null,a=t,null!=t&&(o(2),c&&r(e,t))));(i=t)(1)}),c=!0,r(0,(e,t)=>{a===W&&(2===e&&i&&i(2),o(e,t))}),void(a!==W&&r(2,a));2===t&&i(2),a===W&&r(t,n)})})(t.unmount),Object($.a)(u.isEqual))},function(e,t){t=Object(u.keyBy)(t,"id");var n=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),r=[];if(Object(u.some)(n.fields,["id",e.id]))r=J(r=H(n,t,[e.id]));else{var o=e.name.replace(new RegExp("^".concat(window.cf.config.compactInputKey,"\\[(.+?)\\]")),"$1"),i=Object(u.find)(t,function(t){return t.container_id===e.containerId&&Object(u.startsWith)(o,t.name)}),c=o.split(/\[|\]/g);c.shift(),(c=c.filter(function(e){return""!==e})).pop();var s=c.reduce(function(e,t){return isNaN(t)?e+1:e},0);r=J(r=H(n,t,[i.id]),s+1);for(var l="".concat(i.id,".value");c.length>0;){var d=c.shift(),f=!isNaN(d),p=!f;if(f){l="".concat(l,"[").concat(d,"]");var b=H(Object(u.get)(t,l),t,[e.id]);r=r.concat(J(b,s)),l="".concat(l,".fields")}if(p){var m=Object(u.find)(Object(u.get)(t,l),["name",d]);l="".concat(m.id,".value"),s--}}}return r=r.map(function(e){var n=Q()(e,2),r=n[0];return[n[1],Object(u.get)(t,"".concat(r,".value"))]}),Object(u.fromPairs)(r)}),Y=n(21);function Z(e,t){return Object(u.find)(e,function(e){return e.name===t})}Object(c.addFilter)("carbon-fields.association.metabox","carbon-fields/metaboxes",Object(m.withProps)(function(e){return{hierarchyResolver:function(){for(var t,n,r,o,i=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId(e.containerId),c=(t=e.name,n=window.cf.config,r=n.compactInput,o=n.compactInputKey,r&&0===t.indexOf(o)?t.replace(new RegExp("^".concat(o,"\\[(.+?)\\]")),"$1"):t).split(/\[|\]/g),s=Z(i,(c=c.filter(function(e){return""!==e})).shift()),l=i.indexOf(s),d=s.base_name;c.length>0;){var f=c.shift(),p=!isNaN(f),b=f===e.field.base_name,m=!p&&!b;if(p&&(l="".concat(l,".value.").concat(f,".name"),d="".concat(d,"[").concat(f,"]:").concat(Object(u.get)(i,l),"/")),m){var v=Z(Object(u.get)(i,l.replace(/\.name$/,".fields")),f),O=Object(u.find)(i,["id",v.id]);l=i.indexOf(O),d="".concat(d).concat(O.base_name)}b&&(d="".concat(d).concat(f))}return d}}})),n(44),n(49),n(50),n(51),n(52),n(53),n(55),Object(c.addFilter)("carbon-fields.sidebar.metabox","carbon-fields/metaboxes",Object(a.withDispatch)(function(e){return{onAdded:e("carbon-fields/metaboxes").receiveSidebar}})),Object(c.addFilter)("carbon-fields.field-edit.metabox","carbon-fields/metaboxes",Object(U.compose)(q.a,X,Object(a.withDispatch)(function(e){if(Object(Y.a)()){var t=e("core/editor");return{lockSaving:t.lockPostSaving,unlockSaving:t.unlockPostSaving}}var n=e("carbon-fields/metaboxes");return{lockSaving:n.lockSaving,unlockSaving:n.unlockSaving}}),m.withValidation));var ee=n(33),te=n(22),ne=n(19);n.d(t,"registerContainerType",function(){return ne.b}),n.d(t,"getContainerType",function(){return ne.a}),Object(i.setLocaleData)(window.cf.config.locale,"carbon-fields-ui");var re=Object(Y.a)()?"gutenberg":"classic";Object(c.addAction)("carbon-fields.init","carbon-fields/metaboxes",function(){Object(te.a)(re),Object(ee.a)(re)})},function(e,t,n){"use strict";var r=n(11),o=n(2),i=n(4),c=n(3),a=Object(r.createHigherOrderComponent)(function(e){return Object(c.withSelect)(function(e,t){var n=t.id;return{container:e("carbon-fields/metaboxes").getContainerById(n)}})(e)},"withContainer");Object(o.addFilter)("carbon-fields.register-container-type","carbon-fields/metaboxes",function(e,t,n){return Object(r.compose)(a,Object(i.withFilters)("carbon-fields.".concat(e,".").concat(t)))(n)})}]); \ No newline at end of file diff --git a/build/gutenberg/core.css b/build/gutenberg/core.css index ebe383c23..4d010a4ae 100644 --- a/build/gutenberg/core.css +++ b/build/gutenberg/core.css @@ -39,8 +39,7 @@ flex-direction: row; border-color: #e2e4e7; border-style: solid; - border-width: 1px; - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07); } + border-width: 1px; } .cf-association__bar .cf-search-input { flex: 1 1 auto; } .cf-association__bar .cf-search-input__inner { @@ -63,7 +62,7 @@ font-size: 12px; color: #23282d; pointer-events: none; - margin-right: 5px; + margin-right: 10px; margin-left: 5px; } .cf-association__spinner { @@ -93,7 +92,6 @@ max-height: 160px; overflow-y: auto; } .cf-association__col.ui-sortable .cf-association__option-title { - overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } @@ -157,8 +155,8 @@ display: flex; align-items: center; justify-content: space-between; } - .cf-association__col:first-child .cf-association__option-actions { - min-width: 48px; } + .cf-association__option-actions button { + margin-left: 8px; } .cf-association__option-sort { margin-right: 4px; @@ -171,7 +169,8 @@ outline: none; color: #82878c; transition: color 0.1s linear; - cursor: pointer; } + cursor: pointer; + background: transparent; } .cf-association__option-action:focus { color: #82878c; box-shadow: none; } diff --git a/build/gutenberg/core.js b/build/gutenberg/core.js index 9a1f85e01..e360f8ebf 100644 --- a/build/gutenberg/core.js +++ b/build/gutenberg/core.js @@ -3130,7 +3130,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! immer */ \"immer\");\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(immer__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var refract_callbag__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! refract-callbag */ \"refract-callbag\");\n/* harmony import */ var refract_callbag__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(refract_callbag__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! classnames */ \"classnames\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_17__);\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! callbag-basics */ \"callbag-basics\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(callbag_basics__WEBPACK_IMPORTED_MODULE_18__);\n/* harmony import */ var callbag_of__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! callbag-of */ \"./node_modules/callbag-of/dist/callbag-of.esm.js\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./style.scss */ \"./packages/core/fields/association/style.scss\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_20__);\n/* harmony import */ var _components_search_input__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../components/search-input */ \"./packages/core/components/search-input/index.js\");\n/* harmony import */ var _components_sortable__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../components/sortable */ \"./packages/core/components/sortable/index.js\");\n/* harmony import */ var _utils_api_fetch__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../utils/api-fetch */ \"./packages/core/utils/api-fetch.js\");\n\n\n\n\n\n\n\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * Internal dependencies.\n */\n\n\n\n\n\n\nvar AssociationField =\n/*#__PURE__*/\nfunction (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default()(AssociationField, _Component);\n\n function AssociationField() {\n var _getPrototypeOf2;\n\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, AssociationField);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, (_getPrototypeOf2 = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(AssociationField)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"selectedList\", Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"createRef\"])());\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"sourceList\", Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"createRef\"])());\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSourceListScroll\", function () {\n var _this$props = _this.props,\n fetchOptions = _this$props.fetchOptions,\n setState = _this$props.setState,\n options = _this$props.options,\n page = _this$props.page,\n queryTerm = _this$props.queryTerm;\n var sourceList = _this.sourceList.current;\n\n if (sourceList.offsetHeight + sourceList.scrollTop === sourceList.scrollHeight) {\n setState({\n page: page + 1\n });\n fetchOptions({\n type: 'append',\n options: options,\n queryTerm: queryTerm,\n page: page + 1\n });\n }\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSearchChange\", function (queryTerm) {\n var _this$props2 = _this.props,\n fetchOptions = _this$props2.fetchOptions,\n setState = _this$props2.setState;\n setState({\n page: 1,\n queryTerm: queryTerm\n });\n fetchOptions({\n type: 'replace',\n page: 1,\n queryTerm: queryTerm\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleAddItem\", function (option) {\n var _this$props3 = _this.props,\n field = _this$props3.field,\n id = _this$props3.id,\n value = _this$props3.value,\n onChange = _this$props3.onChange,\n setState = _this$props3.setState,\n selectedOptions = _this$props3.selectedOptions; // Don't do anything if the duplicates aren't allowed and\n // the item is already selected.\n\n if (!field.duplicates_allowed && option.disabled) {\n return;\n } // Don't do anything, because the maximum is reached.\n\n\n if (field.max > 0 && value.length >= field.max) {\n // eslint-disable-next-line no-alert\n alert(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Maximum number of items reached (%s items)', 'carbon-fields-ui'), Number(field.max)));\n return;\n }\n\n onChange(id, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(value).concat([Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"pick\"])(option, 'id', 'type', 'subtype')]));\n setState({\n selectedOptions: _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(selectedOptions).concat([option])\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleRemoveItem\", function (option) {\n var _this$props4 = _this.props,\n value = _this$props4.value,\n id = _this$props4.id,\n onChange = _this$props4.onChange,\n setState = _this$props4.setState,\n selectedOptions = _this$props4.selectedOptions;\n onChange(id, Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"without\"])(value, option));\n setState({\n selectedOptions: Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"without\"])(selectedOptions, option)\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSort\", function (items) {\n var _this$props5 = _this.props,\n id = _this$props5.id,\n onChange = _this$props5.onChange;\n onChange(id, items);\n });\n\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(AssociationField, [{\n key: \"componentDidMount\",\n\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n value: function componentDidMount() {\n var _this$props6 = this.props,\n fetchSelectedOptions = _this$props6.fetchSelectedOptions,\n field = _this$props6.field,\n value = _this$props6.value,\n setState = _this$props6.setState;\n setState({\n options: field.options.options,\n totalOptionsCount: field.options.total_options\n });\n\n if (value.length) {\n fetchSelectedOptions();\n }\n\n this.sourceList.current.addEventListener('scroll', this.handleSourceListScroll);\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.sourceList.current.removeEventListener('scroll', this.handleSourceListScroll);\n }\n /**\n * Handles the scroll event of the source list.\n *\n * @return {void}\n */\n\n }, {\n key: \"render\",\n\n /**\n * Render the component.\n *\n * @return {Object}\n */\n value: function render() {\n var _this2 = this;\n\n var _this$props7 = this.props,\n name = _this$props7.name,\n value = _this$props7.value,\n field = _this$props7.field,\n totalOptionsCount = _this$props7.totalOptionsCount,\n selectedOptions = _this$props7.selectedOptions,\n queryTerm = _this$props7.queryTerm,\n isLoading = _this$props7.isLoading;\n var options = this.props.options;\n\n if (!field.duplicates_allowed) {\n options = immer__WEBPACK_IMPORTED_MODULE_10___default()(options, function (draft) {\n draft.map(function (option) {\n option.disabled = !!Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"find\"])(value, function (selectedOption) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"isMatch\"])(selectedOption, {\n id: option.id,\n type: option.type,\n subtype: option.subtype\n });\n });\n return option;\n });\n });\n }\n\n return wp.element.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"Fragment\"], null, wp.element.createElement(\"div\", {\n className: \"cf-association__bar\"\n }, wp.element.createElement(_components_search_input__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n value: queryTerm,\n onChange: this.handleSearchChange\n }), isLoading ? wp.element.createElement(\"span\", {\n className: \"cf-association__spinner spinner is-active\"\n }) : '', wp.element.createElement(\"span\", {\n className: \"cf-association__counter\"\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Showing %1$d of %2$d results', 'carbon-fields-ui'), Number(options.length), Number(totalOptionsCount)))), wp.element.createElement(\"div\", {\n className: \"cf-association__cols\"\n }, wp.element.createElement(\"div\", {\n className: \"cf-association__col\",\n ref: this.sourceList\n }, options.map(function (option, index) {\n return wp.element.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_16___default()('cf-association__option', {\n 'cf-association__option--selected': option.disabled\n }),\n key: index\n }, option.thumbnail && wp.element.createElement(\"img\", {\n className: \"cf-association__option-thumb\",\n src: option.thumbnail\n }), wp.element.createElement(\"div\", {\n className: \"cf-association__option-content\"\n }, wp.element.createElement(\"span\", {\n className: \"cf-association__option-title\"\n }, wp.element.createElement(\"span\", {\n className: \"cf-association__option-title-inner\"\n }, option.title)), wp.element.createElement(\"span\", {\n className: \"cf-association__option-type\"\n }, option.type)), wp.element.createElement(\"div\", {\n className: \"cf-association__option-actions\"\n }, option.edit_link && wp.element.createElement(\"a\", {\n className: \"cf-association__option-action cf-association__option-action--edit dashicons dashicons-edit\",\n href: option.edit_link.replace('&', '&', 'g'),\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }), !option.disabled && (field.max < 0 || value.length < field.max) && wp.element.createElement(\"button\", {\n type: \"button\",\n className: \"cf-association__option-action dashicons dashicons-plus-alt\",\n onClick: function onClick() {\n return _this2.handleAddItem(option);\n }\n })));\n })), wp.element.createElement(_components_sortable__WEBPACK_IMPORTED_MODULE_22__[\"default\"], {\n forwardedRef: this.selectedList,\n items: value,\n options: {\n axis: 'y',\n forceHelperSize: true,\n forcePlaceholderSize: true,\n scroll: true,\n handle: '.cf-association__option-sort'\n },\n onUpdate: this.handleSort\n }, wp.element.createElement(\"div\", {\n className: \"cf-association__col\",\n ref: this.selectedList\n }, !!selectedOptions.length && value.map(function (option, index) {\n var optionData = selectedOptions.find(function (selectedOption) {\n return selectedOption.id === option.id && selectedOption.type === option.type && selectedOption.subtype === option.subtype;\n });\n return wp.element.createElement(\"div\", {\n className: \"cf-association__option\",\n key: index\n }, wp.element.createElement(\"span\", {\n className: \"cf-association__option-sort dashicons dashicons-menu\"\n }), optionData.thumbnail && wp.element.createElement(\"img\", {\n className: \"cf-association__option-thumb\",\n src: optionData.thumbnail\n }), wp.element.createElement(\"div\", {\n className: \"cf-association__option-content\"\n }, wp.element.createElement(\"span\", {\n className: \"cf-association__option-title\"\n }, wp.element.createElement(\"span\", {\n className: \"cf-association__option-title-inner\"\n }, optionData.title)), wp.element.createElement(\"span\", {\n className: \"cf-association__option-type\"\n }, optionData.type)), wp.element.createElement(\"div\", {\n className: \"cf-association__option-actions\"\n }, wp.element.createElement(\"button\", {\n type: \"button\",\n className: \"cf-association__option-action dashicons dashicons-dismiss\",\n onClick: function onClick() {\n return _this2.handleRemoveItem(option);\n }\n })), wp.element.createElement(\"input\", {\n type: \"hidden\",\n name: \"\".concat(name, \"[\").concat(index, \"]\"),\n value: \"\".concat(optionData.type, \":\").concat(optionData.subtype, \":\").concat(optionData.id),\n readOnly: true\n }));\n })))));\n }\n }]);\n\n return AssociationField;\n}(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"Component\"]);\n/**\n * The function that controls the stream of side-effects.\n *\n * @param {Object} component\n * @return {Object}\n */\n\n\nfunction aperture(component) {\n var actions = [{\n event: 'fetchOptionsEvent',\n prop: 'fetchOptions',\n type: 'FETCH_OPTIONS'\n }, {\n event: 'fetchSelectedOptionsEvent',\n prop: 'fetchSelectedOptions',\n type: 'FETCH_SELECTED_OPTIONS'\n }].map(function (actionData) {\n var _component$useEvent = component.useEvent(actionData.event),\n _component$useEvent2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_component$useEvent, 2),\n actionChannel$ = _component$useEvent2[0],\n action = _component$useEvent2[1];\n\n return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, actionData, {\n action: action,\n channel$: actionChannel$\n });\n });\n var combined$ = Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"pipe\"])(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"combine\"].apply(void 0, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(actions.map(function (_ref) {\n var action = _ref.action,\n prop = _ref.prop;\n return Object(callbag_of__WEBPACK_IMPORTED_MODULE_19__[\"default\"])({\n action: action,\n prop: prop\n });\n }))), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"map\"])(function (combinedActions) {\n return Object(refract_callbag__WEBPACK_IMPORTED_MODULE_15__[\"toProps\"])(combinedActions.reduce(function (acc, curr) {\n return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, acc, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()({}, curr.prop, curr.action));\n }, {}));\n }));\n return callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"merge\"].apply(void 0, [combined$].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(actions.map(function (_ref2) {\n var channel$ = _ref2.channel$,\n type = _ref2.type;\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"pipe\"])(channel$, Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"map\"])(function (payload) {\n return {\n type: type,\n payload: payload\n };\n }));\n }))));\n}\n/**\n * The function that causes the side effects.\n *\n * @param {Object} props\n * @return {Function}\n */\n\n\nfunction handler(props) {\n return function (effect) {\n var payload = effect.payload,\n type = effect.type;\n var setState = props.setState,\n selectedOptions = props.selectedOptions,\n hierarchyResolver = props.hierarchyResolver;\n\n switch (type) {\n case 'FETCH_OPTIONS':\n setState({\n isLoading: true\n }); // eslint-disable-next-line\n\n var request = window.jQuery.get(window.ajaxurl, {\n action: 'carbon_fields_fetch_association_options',\n term: payload.queryTerm,\n page: payload.page || 1,\n container_id: props.containerId,\n field_name: hierarchyResolver()\n }, null, 'json');\n /* eslint-disable-next-line no-alert */\n\n var errorHandler = function errorHandler() {\n return alert(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('An error occurred while trying to fetch association options.', 'carbon-fields-ui'));\n };\n\n request.done(function (response) {\n if (response && response.success) {\n setState({\n options: payload.type === 'replace' ? response.data.options : _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(payload.options).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(response.data.options)),\n totalOptionsCount: response.data.total_options\n });\n } else {\n errorHandler();\n }\n });\n request.fail(errorHandler);\n request.always(function () {\n setState({\n isLoading: false\n });\n });\n break;\n\n case 'FETCH_SELECTED_OPTIONS':\n Object(_utils_api_fetch__WEBPACK_IMPORTED_MODULE_23__[\"default\"])(\"\".concat(window.wpApiSettings.root, \"carbon-fields/v1/association/\"), 'get', {\n container_id: props.containerId,\n options: props.value.map(function (option) {\n return \"\".concat(option.id, \":\").concat(option.type, \":\").concat(option.subtype);\n }).join(';'),\n field_id: hierarchyResolver()\n }).then(function (response) {\n setState({\n selectedOptions: _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(selectedOptions).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(response))\n });\n });\n break;\n }\n };\n}\n\nvar applyWithState = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__[\"withState\"])({\n options: [],\n selectedOptions: [],\n totalOptionsCount: 0,\n queryTerm: '',\n page: 1,\n isLoading: false\n});\nvar applyWithEffects = Object(refract_callbag__WEBPACK_IMPORTED_MODULE_15__[\"withEffects\"])(aperture, {\n handler: handler\n});\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__[\"addFilter\"])('carbon-fields.association.validate', 'carbon-fields/core', function (field, value) {\n var min = field.min,\n required = field.required;\n\n if (required && Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"isEmpty\"])(value)) {\n return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('This field is required.', 'carbon-fields-ui');\n }\n\n if (min > 0 && value.length < min) {\n return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Minimum number of items not reached (%s items)', 'carbon-fields-ui'), [field.min]);\n }\n\n return null;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__[\"compose\"])(applyWithState, applyWithEffects)(AssociationField));\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/core/fields/association/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! immer */ \"immer\");\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(immer__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var refract_callbag__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! refract-callbag */ \"refract-callbag\");\n/* harmony import */ var refract_callbag__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(refract_callbag__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! classnames */ \"classnames\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_17__);\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! callbag-basics */ \"callbag-basics\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(callbag_basics__WEBPACK_IMPORTED_MODULE_18__);\n/* harmony import */ var callbag_of__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! callbag-of */ \"./node_modules/callbag-of/dist/callbag-of.esm.js\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./style.scss */ \"./packages/core/fields/association/style.scss\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_20__);\n/* harmony import */ var _components_search_input__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../components/search-input */ \"./packages/core/components/search-input/index.js\");\n/* harmony import */ var _components_sortable__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../components/sortable */ \"./packages/core/components/sortable/index.js\");\n/* harmony import */ var _utils_api_fetch__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../utils/api-fetch */ \"./packages/core/utils/api-fetch.js\");\n\n\n\n\n\n\n\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * Internal dependencies.\n */\n\n\n\n\n\n\nvar AssociationField =\n/*#__PURE__*/\nfunction (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default()(AssociationField, _Component);\n\n function AssociationField() {\n var _getPrototypeOf2;\n\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, AssociationField);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, (_getPrototypeOf2 = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(AssociationField)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"selectedList\", Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"createRef\"])());\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"sourceList\", Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"createRef\"])());\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSourceListScroll\", function () {\n var _this$props = _this.props,\n fetchOptions = _this$props.fetchOptions,\n setState = _this$props.setState,\n options = _this$props.options,\n page = _this$props.page,\n queryTerm = _this$props.queryTerm;\n var sourceList = _this.sourceList.current;\n\n if (sourceList.offsetHeight + sourceList.scrollTop === sourceList.scrollHeight) {\n setState({\n page: page + 1\n });\n fetchOptions({\n type: 'append',\n options: options,\n queryTerm: queryTerm,\n page: page + 1\n });\n }\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSearchChange\", Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"debounce\"])(function (queryTerm) {\n var _this$props2 = _this.props,\n fetchOptions = _this$props2.fetchOptions,\n setState = _this$props2.setState;\n setState({\n page: 1,\n queryTerm: queryTerm\n });\n fetchOptions({\n type: 'replace',\n page: 1,\n queryTerm: queryTerm\n });\n }, 250));\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleAddItem\", function (option) {\n var _this$props3 = _this.props,\n field = _this$props3.field,\n id = _this$props3.id,\n value = _this$props3.value,\n onChange = _this$props3.onChange,\n setState = _this$props3.setState,\n selectedOptions = _this$props3.selectedOptions; // Don't do anything if the duplicates aren't allowed and\n // the item is already selected.\n\n if (!field.duplicates_allowed && option.disabled) {\n return;\n } // Don't do anything, because the maximum is reached.\n\n\n if (field.max > 0 && value.length >= field.max) {\n // eslint-disable-next-line no-alert\n alert(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Maximum number of items reached (%s items)', 'carbon-fields-ui'), Number(field.max)));\n return;\n }\n\n onChange(id, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(value).concat([Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"pick\"])(option, 'id', 'type', 'subtype')]));\n setState({\n selectedOptions: _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(selectedOptions).concat([option])\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleRemoveItem\", function (option) {\n var _this$props4 = _this.props,\n value = _this$props4.value,\n id = _this$props4.id,\n onChange = _this$props4.onChange,\n setState = _this$props4.setState,\n selectedOptions = _this$props4.selectedOptions;\n onChange(id, Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"without\"])(value, option));\n setState({\n selectedOptions: Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"without\"])(selectedOptions, option)\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8___default()(_this)), \"handleSort\", function (items) {\n var _this$props5 = _this.props,\n id = _this$props5.id,\n onChange = _this$props5.onChange;\n onChange(id, items);\n });\n\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(AssociationField, [{\n key: \"componentDidMount\",\n\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n value: function componentDidMount() {\n var _this$props6 = this.props,\n fetchSelectedOptions = _this$props6.fetchSelectedOptions,\n field = _this$props6.field,\n value = _this$props6.value,\n setState = _this$props6.setState;\n setState({\n options: field.options.options,\n totalOptionsCount: field.options.total_options\n });\n\n if (value.length) {\n fetchSelectedOptions();\n }\n\n this.sourceList.current.addEventListener('scroll', this.handleSourceListScroll);\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.sourceList.current.removeEventListener('scroll', this.handleSourceListScroll);\n }\n /**\n * Handles the scroll event of the source list.\n *\n * @return {void}\n */\n\n }, {\n key: \"render\",\n\n /**\n * Render the component.\n *\n * @return {Object}\n */\n value: function render() {\n var _this2 = this;\n\n var _this$props7 = this.props,\n name = _this$props7.name,\n value = _this$props7.value,\n field = _this$props7.field,\n totalOptionsCount = _this$props7.totalOptionsCount,\n selectedOptions = _this$props7.selectedOptions,\n queryTerm = _this$props7.queryTerm,\n isLoading = _this$props7.isLoading;\n var options = this.props.options;\n\n if (!field.duplicates_allowed) {\n options = immer__WEBPACK_IMPORTED_MODULE_10___default()(options, function (draft) {\n draft.map(function (option) {\n option.disabled = !!Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"find\"])(value, function (selectedOption) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"isMatch\"])(selectedOption, {\n id: option.id,\n type: option.type,\n subtype: option.subtype\n });\n });\n return option;\n });\n });\n }\n\n return wp.element.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"Fragment\"], null, wp.element.createElement(\"div\", {\n className: \"cf-association__bar\"\n }, wp.element.createElement(_components_search_input__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n value: queryTerm,\n onChange: this.handleSearchChange\n }), isLoading ? wp.element.createElement(\"span\", {\n className: \"cf-association__spinner spinner is-active\"\n }) : '', wp.element.createElement(\"span\", {\n className: \"cf-association__counter\"\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Showing %1$d of %2$d results', 'carbon-fields-ui'), Number(options.length), Number(totalOptionsCount)))), wp.element.createElement(\"div\", {\n className: \"cf-association__cols\"\n }, wp.element.createElement(\"div\", {\n className: \"cf-association__col\",\n ref: this.sourceList\n }, options.map(function (option, index) {\n return wp.element.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_16___default()('cf-association__option', {\n 'cf-association__option--selected': option.disabled\n }),\n key: index\n }, option.thumbnail && wp.element.createElement(\"img\", {\n className: \"cf-association__option-thumb\",\n src: option.thumbnail\n }), wp.element.createElement(\"div\", {\n className: \"cf-association__option-content\"\n }, wp.element.createElement(\"span\", {\n className: \"cf-association__option-title\"\n }, wp.element.createElement(\"span\", {\n className: \"cf-association__option-title-inner\"\n }, option.title)), wp.element.createElement(\"span\", {\n className: \"cf-association__option-type\"\n }, option.type)), wp.element.createElement(\"div\", {\n className: \"cf-association__option-actions\"\n }, option.edit_link && wp.element.createElement(\"a\", {\n className: \"cf-association__option-action cf-association__option-action--edit dashicons dashicons-edit\",\n href: option.edit_link.replace('&', '&', 'g'),\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }), !option.disabled && (field.max < 0 || value.length < field.max) && wp.element.createElement(\"button\", {\n type: \"button\",\n className: \"cf-association__option-action dashicons dashicons-plus-alt\",\n onClick: function onClick() {\n return _this2.handleAddItem(option);\n }\n })));\n })), wp.element.createElement(_components_sortable__WEBPACK_IMPORTED_MODULE_22__[\"default\"], {\n forwardedRef: this.selectedList,\n items: value,\n options: {\n axis: 'y',\n forceHelperSize: true,\n forcePlaceholderSize: true,\n scroll: true,\n handle: '.cf-association__option-sort'\n },\n onUpdate: this.handleSort\n }, wp.element.createElement(\"div\", {\n className: \"cf-association__col\",\n ref: this.selectedList\n }, !!selectedOptions.length && value.map(function (option, index) {\n var optionData = selectedOptions.find(function (selectedOption) {\n return selectedOption.id === option.id && selectedOption.type === option.type && selectedOption.subtype === option.subtype;\n });\n return wp.element.createElement(\"div\", {\n className: \"cf-association__option\",\n key: index\n }, wp.element.createElement(\"span\", {\n className: \"cf-association__option-sort dashicons dashicons-menu\"\n }), optionData.thumbnail && wp.element.createElement(\"img\", {\n className: \"cf-association__option-thumb\",\n src: optionData.thumbnail\n }), wp.element.createElement(\"div\", {\n className: \"cf-association__option-content\"\n }, wp.element.createElement(\"span\", {\n className: \"cf-association__option-title\"\n }, wp.element.createElement(\"span\", {\n className: \"cf-association__option-title-inner\"\n }, optionData.title)), wp.element.createElement(\"span\", {\n className: \"cf-association__option-type\"\n }, optionData.type)), wp.element.createElement(\"div\", {\n className: \"cf-association__option-actions\"\n }, wp.element.createElement(\"button\", {\n type: \"button\",\n className: \"cf-association__option-action dashicons dashicons-dismiss\",\n onClick: function onClick() {\n return _this2.handleRemoveItem(option);\n }\n })), wp.element.createElement(\"input\", {\n type: \"hidden\",\n name: \"\".concat(name, \"[\").concat(index, \"]\"),\n value: \"\".concat(optionData.type, \":\").concat(optionData.subtype, \":\").concat(optionData.id),\n readOnly: true\n }));\n })))));\n }\n }]);\n\n return AssociationField;\n}(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__[\"Component\"]);\n/**\n * The function that controls the stream of side-effects.\n *\n * @param {Object} component\n * @return {Object}\n */\n\n\nfunction aperture(component) {\n var actions = [{\n event: 'fetchOptionsEvent',\n prop: 'fetchOptions',\n type: 'FETCH_OPTIONS'\n }, {\n event: 'fetchSelectedOptionsEvent',\n prop: 'fetchSelectedOptions',\n type: 'FETCH_SELECTED_OPTIONS'\n }].map(function (actionData) {\n var _component$useEvent = component.useEvent(actionData.event),\n _component$useEvent2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_component$useEvent, 2),\n actionChannel$ = _component$useEvent2[0],\n action = _component$useEvent2[1];\n\n return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, actionData, {\n action: action,\n channel$: actionChannel$\n });\n });\n var combined$ = Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"pipe\"])(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"combine\"].apply(void 0, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(actions.map(function (_ref) {\n var action = _ref.action,\n prop = _ref.prop;\n return Object(callbag_of__WEBPACK_IMPORTED_MODULE_19__[\"default\"])({\n action: action,\n prop: prop\n });\n }))), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"map\"])(function (combinedActions) {\n return Object(refract_callbag__WEBPACK_IMPORTED_MODULE_15__[\"toProps\"])(combinedActions.reduce(function (acc, curr) {\n return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, acc, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default()({}, curr.prop, curr.action));\n }, {}));\n }));\n return callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"merge\"].apply(void 0, [combined$].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(actions.map(function (_ref2) {\n var channel$ = _ref2.channel$,\n type = _ref2.type;\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"pipe\"])(channel$, Object(callbag_basics__WEBPACK_IMPORTED_MODULE_18__[\"map\"])(function (payload) {\n return {\n type: type,\n payload: payload\n };\n }));\n }))));\n}\n/**\n * The function that causes the side effects.\n *\n * @param {Object} props\n * @return {Function}\n */\n\n\nfunction handler(props) {\n return function (effect) {\n var payload = effect.payload,\n type = effect.type;\n var setState = props.setState,\n selectedOptions = props.selectedOptions,\n hierarchyResolver = props.hierarchyResolver;\n\n switch (type) {\n case 'FETCH_OPTIONS':\n setState({\n isLoading: true\n }); // eslint-disable-next-line\n\n var request = window.jQuery.get(window.ajaxurl, {\n action: 'carbon_fields_fetch_association_options',\n term: payload.queryTerm,\n page: payload.page || 1,\n container_id: props.containerId,\n field_name: hierarchyResolver()\n }, null, 'json');\n /* eslint-disable-next-line no-alert */\n\n var errorHandler = function errorHandler() {\n return alert(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('An error occurred while trying to fetch association options.', 'carbon-fields-ui'));\n };\n\n request.done(function (response) {\n if (response && response.success) {\n setState({\n options: payload.type === 'replace' ? response.data.options : _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(payload.options).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(response.data.options)),\n totalOptionsCount: response.data.total_options\n });\n } else {\n errorHandler();\n }\n });\n request.fail(errorHandler);\n request.always(function () {\n setState({\n isLoading: false\n });\n });\n break;\n\n case 'FETCH_SELECTED_OPTIONS':\n Object(_utils_api_fetch__WEBPACK_IMPORTED_MODULE_23__[\"default\"])(\"\".concat(window.wpApiSettings.root, \"carbon-fields/v1/association/\"), 'get', {\n container_id: props.containerId,\n options: props.value.map(function (option) {\n return \"\".concat(option.id, \":\").concat(option.type, \":\").concat(option.subtype);\n }).join(';'),\n field_id: hierarchyResolver()\n }).then(function (response) {\n setState({\n selectedOptions: _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(selectedOptions).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(response))\n });\n });\n break;\n }\n };\n}\n\nvar applyWithState = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__[\"withState\"])({\n options: [],\n selectedOptions: [],\n totalOptionsCount: 0,\n queryTerm: '',\n page: 1,\n isLoading: false\n});\nvar applyWithEffects = Object(refract_callbag__WEBPACK_IMPORTED_MODULE_15__[\"withEffects\"])(aperture, {\n handler: handler\n});\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_14__[\"addFilter\"])('carbon-fields.association.validate', 'carbon-fields/core', function (field, value) {\n var min = field.min,\n required = field.required;\n\n if (required && Object(lodash__WEBPACK_IMPORTED_MODULE_17__[\"isEmpty\"])(value)) {\n return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('This field is required.', 'carbon-fields-ui');\n }\n\n if (min > 0 && value.length < min) {\n return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"sprintf\"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__[\"__\"])('Minimum number of items not reached (%s items)', 'carbon-fields-ui'), [field.min]);\n }\n\n return null;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__[\"compose\"])(applyWithState, applyWithEffects)(AssociationField));\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/core/fields/association/index.js?"); /***/ }), diff --git a/build/gutenberg/core.min.css b/build/gutenberg/core.min.css index fd45a6d4e..734fca81c 100644 --- a/build/gutenberg/core.min.css +++ b/build/gutenberg/core.min.css @@ -1 +1 @@ -.container-carbon_fields_container_word_settings{min-width:0;max-width:100%;width:100%}.cf-container .cf-field{max-width:100%}.cf-association__bar{position:relative;z-index:1;display:flex;justify-content:space-between;align-items:center;flex-direction:row;border:1px solid #e2e4e7;box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.cf-association__bar .cf-search-input{flex:1 1 auto}.cf-association__bar .cf-search-input__inner{border:0;box-shadow:none}.cf-association__bar .cf-search-input__inner:focus{border-color:none;box-shadow:none;outline:none}.cf-association__bar[focus-within]{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}.cf-association__bar:focus-within{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}.cf-association__counter{font-size:12px;color:#23282d;pointer-events:none;margin-right:5px;margin-left:5px}.cf-association__spinner{float:none;margin:0 0 0 5px}.cf-association__cols{background:#fff;position:relative;z-index:0;display:flex;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7}.cf-association__cols:before{position:absolute;top:0;left:50%;width:1px;height:100%;background-color:#e2e4e7;content:""}.cf-association__col{width:50%;max-height:160px;overflow-y:auto}.cf-association__col.ui-sortable .cf-association__option-title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.cf-association__option{display:flex;align-items:center;padding:4px 8px;height:32px;box-sizing:border-box}.cf-association__option--selected{background-color:#fbfbfc}.cf-association__option+.cf-association__option{border-top:1px solid #e2e4e7}.cf-association__option.ui-sortable-helper{border-top:0;background-color:#fbfbfc}.cf-association__option-thumb{flex:none;display:block;width:24px;height:24px;margin-right:8px}.cf-association__option-content{display:flex;align-items:center;justify-content:space-between;flex:1;min-width:0;margin-right:8px}.cf-association__option-title{flex:1;position:relative;margin-right:4px}.cf-association__option--selected .cf-association__option-title{color:#82878c}.cf-association__option-title-inner{position:absolute;top:0;left:0;width:100%;font-size:13px;line-height:1.4;color:#32373c;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.cf-association__option-type{font-size:9px;line-height:1;text-transform:uppercase;color:#82878c}.cf-association__option-actions{display:flex;align-items:center;justify-content:space-between}.cf-association__col:first-child .cf-association__option-actions{min-width:48px}.cf-association__option-sort{margin-right:4px;color:#82878c;cursor:move}.cf-association__option-action{padding:0;border:0;outline:none;color:#82878c;transition:color .1s linear;cursor:pointer}.cf-association__option-action:focus{color:#82878c;box-shadow:none}.cf-association__option-action:hover{color:#23282d}.cf-search-input{position:relative}.cf-search-input:before{position:absolute;top:50%;left:9px;margin-top:-10px}.postbox .cf-search-input:before{color:#32373c}.wp-block .cf-search-input:before{color:#555d66}.cf-search-input__inner{display:block;width:100%;margin:0}.block-editor .cf-field .cf-search-input__inner,.cf-container .cf-search-input__inner{padding-left:35px}.cf-container .cf-search-input__inner{padding-top:8px;padding-bottom:8px;border-color:#e2e4e7}.block-editor .cf-container .cf-search-input__inner,.edit-post-sidebar .cf-block__fields .cf-search-input__inner,.wp-block .cf-field .cf-search-input__inner{border-radius:0;border:0}.block-editor .cf-container .cf-search-input__inner:focus,.edit-post-sidebar .cf-block__fields .cf-search-input__inner:focus,.wp-block .cf-field .cf-search-input__inner:focus{box-shadow:none}.cf-field .cf-checkbox__input{margin-top:0}.cf-color__inner{display:flex;align-items:center}.cf-color__toggle{position:relative;overflow:hidden}.cf-color__toggle-text{margin-left:27px}.cf-color__preview{position:absolute;top:0;left:0;width:26px;height:100%;border-right:1px solid #ccc}.cf-color__toggle:active .cf-color__preview,.cf-color__toggle:hover .cf-color__preview{border-color:#999}.cf-color .cf-color__reset{margin-left:5px;text-decoration:none}.cf-color .cf-color__reset:focus{box-shadow:none}.cf-color__picker{position:absolute;z-index:9999}.cf-complex__groups{flex:1;position:relative}.cf-complex--tabbed-vertical>.cf-complex__groups{flex:0 0 80%}.cf-complex__group{box-sizing:border-box}.cf-complex--grid .cf-complex__group{position:relative;margin-bottom:12px}.cf-complex--grid .cf-complex__group:last-child{margin-bottom:0}.cf-complex__group-placeholder{position:relative}.cf-complex__group-placeholder:not(:last-child){margin-bottom:12px}.cf-complex__group-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%;border:1px dashed #e2e4e7;box-sizing:border-box;content:""}.cf-complex__group-head{position:relative;display:flex;border:1px solid #e2e4e7;border-bottom:0;background-color:#fbfbfc;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:600;line-height:1.4;color:#23282d;cursor:move;transition:border-color .1s linear}.cf-complex__group-head:hover{border-color:#82878c}.cf-complex__group-index{display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-right:1px solid #e2e4e7}.cf-complex__group-title{display:flex;align-items:center;padding:0 12px}.cf-complex__group-body{display:flex;flex-wrap:wrap;border:1px solid #e2e4e7;border-right-width:0;background-color:#fff}.cf-complex__group-body[hidden]{display:none}.cf-complex__actions{display:flex;align-items:center;margin-top:12px}.cf-complex__actions .cf-complex__toggler{margin-left:auto}.cf-complex__inserter{position:relative;display:inline-block}.cf-complex__tabs .cf-complex__inserter{height:36px}.cf-complex__tabs--tabbed-horizontal .cf-complex__inserter{width:36px;align-self:flex-end;margin-bottom:4px}.cf-complex__tabs--tabbed-vertical .cf-complex__inserter{display:block}.cf-complex__tabs .cf-complex__inserter-button{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border:1px solid #e2e4e7;border-radius:0;margin:0;background-color:#fbfbfc;box-shadow:none;font-size:18px;line-height:1;transition:background-color .1s linear}.cf-complex__tabs .cf-complex__inserter-button:active,.cf-complex__tabs .cf-complex__inserter-button:focus,.cf-complex__tabs .cf-complex__inserter-button:hover{border-color:#e2e4e7;background-color:#fff}.cf-complex__tabs .cf-complex__inserter-button:focus{box-shadow:none}.cf-complex__tabs .cf-complex__inserter-button:active{box-shadow:none;-webkit-transform:none;transform:none}.cf-complex__inserter-menu{position:absolute;top:50%;left:100%;min-width:180px;margin:0;-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%);z-index:1}.cf-complex__inserter-item{padding:8px 12px;margin:0;cursor:pointer;transition:color .1s linear}.cf-complex__group-actions{display:flex;align-items:center}.cf-complex__group-actions--grid{position:absolute;top:12px;right:12px}.cf-complex__group-actions--tabbed{justify-content:flex-end;padding:8px 12px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7;background-color:#fbfbfc}.cf-complex__group-action{display:inline-flex;padding:0;border:0;margin-left:12px;outline:none;background-color:transparent;color:#82878c;cursor:pointer;transition:color .1s linear}.cf-complex__group-action:first-child{margin-left:0}.cf-complex__group-action:hover{color:#23282d}.cf-complex__group-action-text{display:none}.cf-complex__tabs{position:relative;z-index:1}.cf-complex__tabs--tabbed-horizontal{display:inline-flex;margin-bottom:-5px}.cf-complex__tabs--tabbed-vertical{flex:0 0 20%;margin-right:-1px}.cf-complex__tabs-list{margin:0}.cf-complex__tabs--tabbed-horizontal .cf-complex__tabs-list{display:flex;flex-wrap:wrap}.cf-complex__tabs--tabbed-vertical .cf-complex__tabs-list{margin-bottom:-1px}.cf-complex__tabs-item{display:flex;align-items:center;padding:8px 12px;border:1px solid #e2e4e7;margin:0;background-color:#fbfbfc;font-size:12px;cursor:pointer;transition:background-color .1s linear,border-color .1s linear}.cf-complex__tabs-item:hover{background-color:#fff}.cf-complex__tabs-item--tabbed-horizontal{margin:0 4px 4px 0}.cf-complex__tabs-item--tabbed-vertical~.cf-complex__tabs-item--tabbed-vertical{border-top-width:0}.cf-complex__tabs-item--current{background-color:#fff}.cf-complex__tabs-item--tabbed-horizontal.cf-complex__tabs-item--current{border-bottom-color:#fff!important}.cf-complex__tabs-item--tabbed-vertical.cf-complex__tabs-item--current{border-right-color:#fff!important}.cf-complex__placeholder-label.cf-complex__placeholder-label{margin:8px 0 12px}.cf-container-term-meta .cf-complex__placeholder-label{font-style:normal;color:inherit}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08)}.flatpickr-calendar.inline,.flatpickr-calendar.open{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasTime .dayContainer,.flatpickr-calendar .hasWeeks .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:after,.flatpickr-calendar:before{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:after,.flatpickr-calendar.rightMost:before{left:auto;right:22px}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:after,.flatpickr-calendar.arrowTop:before{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:after,.flatpickr-calendar.arrowBottom:before{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9);height:28px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-next-month,.flatpickr-months .flatpickr-prev-month{text-decoration:none;cursor:pointer;position:absolute;top:0;line-height:16px;height:28px;padding:10px;z-index:3;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9)}.flatpickr-months .flatpickr-next-month.disabled,.flatpickr-months .flatpickr-prev-month.disabled{display:none}.flatpickr-months .flatpickr-next-month i,.flatpickr-months .flatpickr-prev-month i{position:relative}.flatpickr-months .flatpickr-next-month.flatpickr-prev-month,.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-next-month.flatpickr-next-month,.flatpickr-months .flatpickr-prev-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-next-month:hover,.flatpickr-months .flatpickr-prev-month:hover{color:#959ea9}.flatpickr-months .flatpickr-next-month:hover svg,.flatpickr-months .flatpickr-prev-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-next-month svg,.flatpickr-months .flatpickr-prev-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-next-month svg path,.flatpickr-months .flatpickr-prev-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,.1)}.numInputWrapper span:active{background:rgba(0,0,0,.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,.5)}.numInputWrapper:hover{background:rgba(0,0,0,.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:6.16px 0 0;line-height:1;height:28px;display:inline-block;text-align:center;-webkit-transform:translateZ(0);transform:translateZ(0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:baseline;vertical-align:initial}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,.5);background:transparent;pointer-events:none}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays,.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-weekdays .flatpickr-weekdaycontainer,span.flatpickr-weekday{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,.54);line-height:1;margin:0;text-align:center;display:block;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day.nextMonthDay:focus,.flatpickr-day.nextMonthDay:hover,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.today.inRange,.flatpickr-day:focus,.flatpickr-day:hover{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:focus,.flatpickr-day.today:hover{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.endRange,.flatpickr-day.endRange.inRange,.flatpickr-day.endRange.nextMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.endRange:focus,.flatpickr-day.endRange:hover,.flatpickr-day.selected,.flatpickr-day.selected.inRange,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.selected:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange,.flatpickr-day.startRange.inRange,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.startRange:focus,.flatpickr-day.startRange:hover{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.endRange.startRange,.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.endRange.endRange,.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.endRange.startRange.endRange,.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.disabled,.flatpickr-day.disabled:hover,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.nextMonthDay,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.prevMonthDay{color:rgba(57,57,57,.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.disabled,.flatpickr-day.disabled:hover{cursor:not-allowed;color:rgba(57,57,57,.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{display:inline-block;float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden}.flatpickr-innerContainer,.flatpickr-rContainer{-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-rContainer{display:inline-block;padding:0}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-am-pm,.flatpickr-time .flatpickr-time-separator{height:inherit;display:inline-block;float:left;line-height:inherit;color:#393939;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time .flatpickr-am-pm:focus,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time input:hover{background:#f3f3f3}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.cf-datetime__inner{display:flex;align-items:stretch;flex-wrap:wrap;margin-top:-5px}.cf-datetime__inner:before{display:none}.cf-datetime__input{flex:1;margin:5px 6px 0 0}.wp-core-ui .button.cf-datetime__button{margin-top:5px}.cf-datetime__button{flex:0 0 auto}.cf-field .cf-datetime__button{margin-bottom:0;box-shadow:none}.cf-file__inner{position:relative;display:flex;align-items:center;justify-content:center;width:130px;height:130px;border:1px dashed #b5bcc2;box-sizing:border-box}.cf-file__content{position:absolute;top:-1px;right:-1px;bottom:-1px;left:-1px;border:1px solid #b5bcc2}.cf-file__preview{position:absolute;top:0;left:0;bottom:28px;width:100%;overflow:hidden;background-color:#e2e4e7;box-shadow:inset 0 0 15px rgba(0,0,0,.1)}.cf-file__image{position:absolute;top:50%;left:50%;height:auto;max-width:100%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cf-file__name{position:absolute;bottom:0;left:0;right:0;padding:5px;border-top:1px solid #b5bcc2;overflow:hidden;background-color:#f3f4f5;white-space:nowrap;text-overflow:ellipsis}.cf-file__browse{position:relative}.cf-file__content~.cf-file__browse{margin-bottom:29px;visibility:hidden;opacity:0;transition:visibility .1s linear,opacity .1s linear}.cf-file__inner:hover .cf-file__content~.cf-file__browse{visibility:visible;opacity:1}.cf-file__remove{position:absolute;top:5px;right:5px;padding:0;border:0;outline:none;background-color:transparent;cursor:pointer;transition:opacity .1s linear}.cf-file__remove:hover{opacity:.8}.cf-file__remove:before{border-radius:50%;background-color:#191e23;color:#fff}.cf-map__search{position:relative;z-index:1}.cf-map__canvas{position:relative;z-index:0;height:300px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7;background-color:#f3f4f5}.cf-media-gallery__list{display:flex;flex-wrap:wrap;max-height:400px;padding:4px;margin:0;overflow-y:auto;list-style:none outside none}.cf-media-gallery__list:empty{display:none}.cf-media-gallery__actions{padding:8px}.cf-media-gallery__list:empty~.cf-media-gallery__actions{border-top-width:0}.cf-media-gallery__item{flex:0 0 100%;min-width:0;padding:4px;margin:0;box-sizing:border-box}@media (min-width:320px){.cf-media-gallery__item{flex-basis:50%}}@media (min-width:480px){.cf-media-gallery__item{flex-basis:33.3333%}}@media (min-width:640px){.cf-media-gallery__item{flex-basis:25%}}@media (min-width:768px){.cf-media-gallery__item{flex-basis:20%}}@media (min-width:1280px){.cf-media-gallery__item{flex-basis:16.66667%}}@media (min-width:1440px){.cf-media-gallery__item{flex-basis:12.5%}}@media (min-width:1680px){.cf-media-gallery__item{flex-basis:10%}}.cf-media-gallery__item-inner{position:relative;display:flex;flex-direction:column;height:100%}.cf-media-gallery__item-preview{position:relative;overflow:hidden;padding-top:100%;flex:1}.cf-media-gallery__item-thumb{min-width:100%;min-height:100%;max-width:150%;pointer-events:none}.cf-media-gallery__item-icon,.cf-media-gallery__item-thumb{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cf-media-gallery__item-icon{max-width:100%;max-height:50%}.cf-media-gallery__item-name{display:block;padding:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:move}.cf-media-gallery__item-remove{position:absolute;top:4px;right:4px;padding:0;border:0;outline:none;background-color:transparent;cursor:pointer}.cf-media-gallery__item-remove:before{border-radius:50%;background-color:#191e23;color:#fff;transition:color .1s linear}.cf-media-gallery__item-remove:hover:before{color:#b5bcc2}.cf-multiselect__control{min-height:0;border-color:#e2e4e7}.cf-multiselect__control:hover{border-color:#e2e4e7}.cf-multiselect__control--is-focused,.cf-multiselect__control--is-focused:hover{border-color:#00a0d2!important;box-shadow:none}.cf-multiselect__placeholder{color:#b5bcc2}.cf-multiselect__value-container{padding-left:4px;padding-right:4px}.cf-multiselect__multi-value{align-items:center;padding:5px 3px;margin:0;background-color:#e2e4e7}.cf-multiselect__multi-value+.cf-multiselect__multi-value{margin-left:5px}.cf-multiselect__multi-value__label{padding-left:3px;font-size:13px;line-height:1}.cf-multiselect__multi-value__remove{padding:0;margin-top:1px;cursor:pointer}.cf-multiselect__multi-value__remove:hover{background-color:transparent}.cf-multiselect__input input[id],.cf-multiselect__input input[id]:focus{box-shadow:none}.cf-multiselect__menu{z-index:9999}.cf-multiselect__option{padding:4px}.cf-multiselect__option--is-focused{background-color:#00a0d2;color:#fff}.cf-multiselect__indicator{padding:5px;cursor:pointer}.cf-oembed__preview{padding:12px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7}.cf-oembed__frame{display:block;width:100%;max-width:600px;margin:0 auto}.cf-radio__list{margin:0}.cf-radio-image .cf-radio__list{display:flex;flex-wrap:wrap}.cf-radio__list-item:last-child{margin-bottom:0}.cf-radio-image .cf-radio__list-item{flex:0 0 20%;position:relative;padding:4px}.cf-container-term-meta .cf-radio__label{display:inline}.cf-radio-image .cf-radio__label{display:inline-block}.cf-field .cf-radio__input{margin-top:0}.cf-radio-image .cf-radio__input{position:absolute;z-index:-1;top:50%;left:50%;width:0;height:0;margin:0;outline:0;opacity:0}.cf-radio-image__image{display:block;max-width:100%;padding:5px;box-sizing:border-box}.wp-block .cf-radio__list{list-style:none outside none}.cf-radio__list-item{box-sizing:border-box}.cf-container-term-meta .cf-radio__list-item{flex:0 0 20%}.cf-container-theme-options .cf-radio__list-item{flex:0 0 10%}.cf-radio-image__image{border:1px solid #e2e4e7}.cf-radio__input:checked~.cf-radio__label .cf-radio-image__image,.cf-radio__input:focus~.cf-radio__label .cf-radio-image__image{outline:4px solid #00a0d2}.cf-select__input{display:block;width:100%;margin:0}.cf-container-term-meta .cf-separator .cf-field__head{display:none}.cf-container-term-meta .cf-separator .cf-field__body{position:absolute;left:0}.cf-set__list{margin:0}.cf-set__list-item:last-child{margin-bottom:0}.cf-field .cf-set__input{margin-top:0}.cf-container-term-meta .cf-set__label{display:inline}.cf-text__input{display:block;width:100%!important;margin:0}.cf-textarea__input{display:block;width:100%!important;resize:vertical}.cf-field,.cf-field__body,.cf-field__head{box-sizing:border-box;flex:1 1 100%}@media (max-width:1024px){.cf-field{flex-basis:100%!important}}.cf-rich-text .cf-field__body{box-sizing:content-box}.cf-complex--tabbed-vertical>.cf-field__body{display:flex;align-items:flex-start}.cf-field__label{display:block}.cf-html .cf-field__label,.cf-separator .cf-field__label{display:none}.cf-field__asterisk{color:#dc3232}.cf-field__error{display:block;margin-top:4px;color:#dc3232} \ No newline at end of file +.container-carbon_fields_container_word_settings{min-width:0;max-width:100%;width:100%}.cf-container .cf-field{max-width:100%}.cf-association__bar{position:relative;z-index:1;display:flex;justify-content:space-between;align-items:center;flex-direction:row;border:1px solid #e2e4e7}.cf-association__bar .cf-search-input{flex:1 1 auto}.cf-association__bar .cf-search-input__inner{border:0;box-shadow:none}.cf-association__bar .cf-search-input__inner:focus{border-color:none;box-shadow:none;outline:none}.cf-association__bar[focus-within]{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}.cf-association__bar:focus-within{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8);outline:2px solid transparent}.cf-association__counter{font-size:12px;color:#23282d;pointer-events:none;margin-right:10px;margin-left:5px}.cf-association__spinner{float:none;margin:0 0 0 5px}.cf-association__cols{background:#fff;position:relative;z-index:0;display:flex;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7}.cf-association__cols:before{position:absolute;top:0;left:50%;width:1px;height:100%;background-color:#e2e4e7;content:""}.cf-association__col{width:50%;max-height:160px;overflow-y:auto}.cf-association__col.ui-sortable .cf-association__option-title{white-space:nowrap;text-overflow:ellipsis}.cf-association__option{display:flex;align-items:center;padding:4px 8px;height:32px;box-sizing:border-box}.cf-association__option--selected{background-color:#fbfbfc}.cf-association__option+.cf-association__option{border-top:1px solid #e2e4e7}.cf-association__option.ui-sortable-helper{border-top:0;background-color:#fbfbfc}.cf-association__option-thumb{flex:none;display:block;width:24px;height:24px;margin-right:8px}.cf-association__option-content{display:flex;align-items:center;justify-content:space-between;flex:1;min-width:0;margin-right:8px}.cf-association__option-title{flex:1;position:relative;margin-right:4px}.cf-association__option--selected .cf-association__option-title{color:#82878c}.cf-association__option-title-inner{position:absolute;top:0;left:0;width:100%;font-size:13px;line-height:1.4;color:#32373c;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.cf-association__option-type{font-size:9px;line-height:1;text-transform:uppercase;color:#82878c}.cf-association__option-actions{display:flex;align-items:center;justify-content:space-between}.cf-association__option-actions button{margin-left:8px}.cf-association__option-sort{margin-right:4px;color:#82878c;cursor:move}.cf-association__option-action{padding:0;border:0;outline:none;color:#82878c;transition:color .1s linear;cursor:pointer;background:transparent}.cf-association__option-action:focus{color:#82878c;box-shadow:none}.cf-association__option-action:hover{color:#23282d}.cf-search-input{position:relative}.cf-search-input:before{position:absolute;top:50%;left:9px;margin-top:-10px}.postbox .cf-search-input:before{color:#32373c}.wp-block .cf-search-input:before{color:#555d66}.cf-search-input__inner{display:block;width:100%;margin:0}.block-editor .cf-field .cf-search-input__inner,.cf-container .cf-search-input__inner{padding-left:35px}.cf-container .cf-search-input__inner{padding-top:8px;padding-bottom:8px;border-color:#e2e4e7}.block-editor .cf-container .cf-search-input__inner,.edit-post-sidebar .cf-block__fields .cf-search-input__inner,.wp-block .cf-field .cf-search-input__inner{border-radius:0;border:0}.block-editor .cf-container .cf-search-input__inner:focus,.edit-post-sidebar .cf-block__fields .cf-search-input__inner:focus,.wp-block .cf-field .cf-search-input__inner:focus{box-shadow:none}.cf-field .cf-checkbox__input{margin-top:0}.cf-color__inner{display:flex;align-items:center}.cf-color__toggle{position:relative;overflow:hidden}.cf-color__toggle-text{margin-left:27px}.cf-color__preview{position:absolute;top:0;left:0;width:26px;height:100%;border-right:1px solid #ccc}.cf-color__toggle:active .cf-color__preview,.cf-color__toggle:hover .cf-color__preview{border-color:#999}.cf-color .cf-color__reset{margin-left:5px;text-decoration:none}.cf-color .cf-color__reset:focus{box-shadow:none}.cf-color__picker{position:absolute;z-index:9999}.cf-complex__groups{flex:1;position:relative}.cf-complex--tabbed-vertical>.cf-complex__groups{flex:0 0 80%}.cf-complex__group{box-sizing:border-box}.cf-complex--grid .cf-complex__group{position:relative;margin-bottom:12px}.cf-complex--grid .cf-complex__group:last-child{margin-bottom:0}.cf-complex__group-placeholder{position:relative}.cf-complex__group-placeholder:not(:last-child){margin-bottom:12px}.cf-complex__group-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%;border:1px dashed #e2e4e7;box-sizing:border-box;content:""}.cf-complex__group-head{position:relative;display:flex;border:1px solid #e2e4e7;border-bottom:0;background-color:#fbfbfc;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:600;line-height:1.4;color:#23282d;cursor:move;transition:border-color .1s linear}.cf-complex__group-head:hover{border-color:#82878c}.cf-complex__group-index{display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-right:1px solid #e2e4e7}.cf-complex__group-title{display:flex;align-items:center;padding:0 12px}.cf-complex__group-body{display:flex;flex-wrap:wrap;border:1px solid #e2e4e7;border-right-width:0;background-color:#fff}.cf-complex__group-body[hidden]{display:none}.cf-complex__actions{display:flex;align-items:center;margin-top:12px}.cf-complex__actions .cf-complex__toggler{margin-left:auto}.cf-complex__inserter{position:relative;display:inline-block}.cf-complex__tabs .cf-complex__inserter{height:36px}.cf-complex__tabs--tabbed-horizontal .cf-complex__inserter{width:36px;align-self:flex-end;margin-bottom:4px}.cf-complex__tabs--tabbed-vertical .cf-complex__inserter{display:block}.cf-complex__tabs .cf-complex__inserter-button{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border:1px solid #e2e4e7;border-radius:0;margin:0;background-color:#fbfbfc;box-shadow:none;font-size:18px;line-height:1;transition:background-color .1s linear}.cf-complex__tabs .cf-complex__inserter-button:active,.cf-complex__tabs .cf-complex__inserter-button:focus,.cf-complex__tabs .cf-complex__inserter-button:hover{border-color:#e2e4e7;background-color:#fff}.cf-complex__tabs .cf-complex__inserter-button:focus{box-shadow:none}.cf-complex__tabs .cf-complex__inserter-button:active{box-shadow:none;-webkit-transform:none;transform:none}.cf-complex__inserter-menu{position:absolute;top:50%;left:100%;min-width:180px;margin:0;-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%);z-index:1}.cf-complex__inserter-item{padding:8px 12px;margin:0;cursor:pointer;transition:color .1s linear}.cf-complex__group-actions{display:flex;align-items:center}.cf-complex__group-actions--grid{position:absolute;top:12px;right:12px}.cf-complex__group-actions--tabbed{justify-content:flex-end;padding:8px 12px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7;background-color:#fbfbfc}.cf-complex__group-action{display:inline-flex;padding:0;border:0;margin-left:12px;outline:none;background-color:transparent;color:#82878c;cursor:pointer;transition:color .1s linear}.cf-complex__group-action:first-child{margin-left:0}.cf-complex__group-action:hover{color:#23282d}.cf-complex__group-action-text{display:none}.cf-complex__tabs{position:relative;z-index:1}.cf-complex__tabs--tabbed-horizontal{display:inline-flex;margin-bottom:-5px}.cf-complex__tabs--tabbed-vertical{flex:0 0 20%;margin-right:-1px}.cf-complex__tabs-list{margin:0}.cf-complex__tabs--tabbed-horizontal .cf-complex__tabs-list{display:flex;flex-wrap:wrap}.cf-complex__tabs--tabbed-vertical .cf-complex__tabs-list{margin-bottom:-1px}.cf-complex__tabs-item{display:flex;align-items:center;padding:8px 12px;border:1px solid #e2e4e7;margin:0;background-color:#fbfbfc;font-size:12px;cursor:pointer;transition:background-color .1s linear,border-color .1s linear}.cf-complex__tabs-item:hover{background-color:#fff}.cf-complex__tabs-item--tabbed-horizontal{margin:0 4px 4px 0}.cf-complex__tabs-item--tabbed-vertical~.cf-complex__tabs-item--tabbed-vertical{border-top-width:0}.cf-complex__tabs-item--current{background-color:#fff}.cf-complex__tabs-item--tabbed-horizontal.cf-complex__tabs-item--current{border-bottom-color:#fff!important}.cf-complex__tabs-item--tabbed-vertical.cf-complex__tabs-item--current{border-right-color:#fff!important}.cf-complex__placeholder-label.cf-complex__placeholder-label{margin:8px 0 12px}.cf-container-term-meta .cf-complex__placeholder-label{font-style:normal;color:inherit}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08)}.flatpickr-calendar.inline,.flatpickr-calendar.open{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasTime .dayContainer,.flatpickr-calendar .hasWeeks .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:after,.flatpickr-calendar:before{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:after,.flatpickr-calendar.rightMost:before{left:auto;right:22px}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:after,.flatpickr-calendar.arrowTop:before{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:after,.flatpickr-calendar.arrowBottom:before{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9);height:28px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-next-month,.flatpickr-months .flatpickr-prev-month{text-decoration:none;cursor:pointer;position:absolute;top:0;line-height:16px;height:28px;padding:10px;z-index:3;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9)}.flatpickr-months .flatpickr-next-month.disabled,.flatpickr-months .flatpickr-prev-month.disabled{display:none}.flatpickr-months .flatpickr-next-month i,.flatpickr-months .flatpickr-prev-month i{position:relative}.flatpickr-months .flatpickr-next-month.flatpickr-prev-month,.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-next-month.flatpickr-next-month,.flatpickr-months .flatpickr-prev-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-next-month:hover,.flatpickr-months .flatpickr-prev-month:hover{color:#959ea9}.flatpickr-months .flatpickr-next-month:hover svg,.flatpickr-months .flatpickr-prev-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-next-month svg,.flatpickr-months .flatpickr-prev-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-next-month svg path,.flatpickr-months .flatpickr-prev-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,.1)}.numInputWrapper span:active{background:rgba(0,0,0,.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,.5)}.numInputWrapper:hover{background:rgba(0,0,0,.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:6.16px 0 0;line-height:1;height:28px;display:inline-block;text-align:center;-webkit-transform:translateZ(0);transform:translateZ(0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:baseline;vertical-align:initial}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,.5);background:transparent;pointer-events:none}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays,.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-weekdays .flatpickr-weekdaycontainer,span.flatpickr-weekday{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,.54);line-height:1;margin:0;text-align:center;display:block;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day.nextMonthDay:focus,.flatpickr-day.nextMonthDay:hover,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.today.inRange,.flatpickr-day:focus,.flatpickr-day:hover{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:focus,.flatpickr-day.today:hover{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.endRange,.flatpickr-day.endRange.inRange,.flatpickr-day.endRange.nextMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.endRange:focus,.flatpickr-day.endRange:hover,.flatpickr-day.selected,.flatpickr-day.selected.inRange,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.selected:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange,.flatpickr-day.startRange.inRange,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.startRange:focus,.flatpickr-day.startRange:hover{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.endRange.startRange,.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.endRange.endRange,.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.endRange.startRange.endRange,.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.disabled,.flatpickr-day.disabled:hover,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.nextMonthDay,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.prevMonthDay{color:rgba(57,57,57,.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.disabled,.flatpickr-day.disabled:hover{cursor:not-allowed;color:rgba(57,57,57,.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{display:inline-block;float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden}.flatpickr-innerContainer,.flatpickr-rContainer{-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-rContainer{display:inline-block;padding:0}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-am-pm,.flatpickr-time .flatpickr-time-separator{height:inherit;display:inline-block;float:left;line-height:inherit;color:#393939;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time .flatpickr-am-pm:focus,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time input:hover{background:#f3f3f3}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.cf-datetime__inner{display:flex;align-items:stretch;flex-wrap:wrap;margin-top:-5px}.cf-datetime__inner:before{display:none}.cf-datetime__input{flex:1;margin:5px 6px 0 0}.wp-core-ui .button.cf-datetime__button{margin-top:5px}.cf-datetime__button{flex:0 0 auto}.cf-field .cf-datetime__button{margin-bottom:0;box-shadow:none}.cf-file__inner{position:relative;display:flex;align-items:center;justify-content:center;width:130px;height:130px;border:1px dashed #b5bcc2;box-sizing:border-box}.cf-file__content{position:absolute;top:-1px;right:-1px;bottom:-1px;left:-1px;border:1px solid #b5bcc2}.cf-file__preview{position:absolute;top:0;left:0;bottom:28px;width:100%;overflow:hidden;background-color:#e2e4e7;box-shadow:inset 0 0 15px rgba(0,0,0,.1)}.cf-file__image{position:absolute;top:50%;left:50%;height:auto;max-width:100%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cf-file__name{position:absolute;bottom:0;left:0;right:0;padding:5px;border-top:1px solid #b5bcc2;overflow:hidden;background-color:#f3f4f5;white-space:nowrap;text-overflow:ellipsis}.cf-file__browse{position:relative}.cf-file__content~.cf-file__browse{margin-bottom:29px;visibility:hidden;opacity:0;transition:visibility .1s linear,opacity .1s linear}.cf-file__inner:hover .cf-file__content~.cf-file__browse{visibility:visible;opacity:1}.cf-file__remove{position:absolute;top:5px;right:5px;padding:0;border:0;outline:none;background-color:transparent;cursor:pointer;transition:opacity .1s linear}.cf-file__remove:hover{opacity:.8}.cf-file__remove:before{border-radius:50%;background-color:#191e23;color:#fff}.cf-map__search{position:relative;z-index:1}.cf-map__canvas{position:relative;z-index:0;height:300px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7;background-color:#f3f4f5}.cf-media-gallery__list{display:flex;flex-wrap:wrap;max-height:400px;padding:4px;margin:0;overflow-y:auto;list-style:none outside none}.cf-media-gallery__list:empty{display:none}.cf-media-gallery__actions{padding:8px}.cf-media-gallery__list:empty~.cf-media-gallery__actions{border-top-width:0}.cf-media-gallery__item{flex:0 0 100%;min-width:0;padding:4px;margin:0;box-sizing:border-box}@media (min-width:320px){.cf-media-gallery__item{flex-basis:50%}}@media (min-width:480px){.cf-media-gallery__item{flex-basis:33.3333%}}@media (min-width:640px){.cf-media-gallery__item{flex-basis:25%}}@media (min-width:768px){.cf-media-gallery__item{flex-basis:20%}}@media (min-width:1280px){.cf-media-gallery__item{flex-basis:16.66667%}}@media (min-width:1440px){.cf-media-gallery__item{flex-basis:12.5%}}@media (min-width:1680px){.cf-media-gallery__item{flex-basis:10%}}.cf-media-gallery__item-inner{position:relative;display:flex;flex-direction:column;height:100%}.cf-media-gallery__item-preview{position:relative;overflow:hidden;padding-top:100%;flex:1}.cf-media-gallery__item-thumb{min-width:100%;min-height:100%;max-width:150%;pointer-events:none}.cf-media-gallery__item-icon,.cf-media-gallery__item-thumb{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cf-media-gallery__item-icon{max-width:100%;max-height:50%}.cf-media-gallery__item-name{display:block;padding:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:move}.cf-media-gallery__item-remove{position:absolute;top:4px;right:4px;padding:0;border:0;outline:none;background-color:transparent;cursor:pointer}.cf-media-gallery__item-remove:before{border-radius:50%;background-color:#191e23;color:#fff;transition:color .1s linear}.cf-media-gallery__item-remove:hover:before{color:#b5bcc2}.cf-multiselect__control{min-height:0;border-color:#e2e4e7}.cf-multiselect__control:hover{border-color:#e2e4e7}.cf-multiselect__control--is-focused,.cf-multiselect__control--is-focused:hover{border-color:#00a0d2!important;box-shadow:none}.cf-multiselect__placeholder{color:#b5bcc2}.cf-multiselect__value-container{padding-left:4px;padding-right:4px}.cf-multiselect__multi-value{align-items:center;padding:5px 3px;margin:0;background-color:#e2e4e7}.cf-multiselect__multi-value+.cf-multiselect__multi-value{margin-left:5px}.cf-multiselect__multi-value__label{padding-left:3px;font-size:13px;line-height:1}.cf-multiselect__multi-value__remove{padding:0;margin-top:1px;cursor:pointer}.cf-multiselect__multi-value__remove:hover{background-color:transparent}.cf-multiselect__input input[id],.cf-multiselect__input input[id]:focus{box-shadow:none}.cf-multiselect__menu{z-index:9999}.cf-multiselect__option{padding:4px}.cf-multiselect__option--is-focused{background-color:#00a0d2;color:#fff}.cf-multiselect__indicator{padding:5px;cursor:pointer}.cf-oembed__preview{padding:12px;border:1px solid #e2e4e7;border-top:0 solid #e2e4e7}.cf-oembed__frame{display:block;width:100%;max-width:600px;margin:0 auto}.cf-radio__list{margin:0}.cf-radio-image .cf-radio__list{display:flex;flex-wrap:wrap}.cf-radio__list-item:last-child{margin-bottom:0}.cf-radio-image .cf-radio__list-item{flex:0 0 20%;position:relative;padding:4px}.cf-container-term-meta .cf-radio__label{display:inline}.cf-radio-image .cf-radio__label{display:inline-block}.cf-field .cf-radio__input{margin-top:0}.cf-radio-image .cf-radio__input{position:absolute;z-index:-1;top:50%;left:50%;width:0;height:0;margin:0;outline:0;opacity:0}.cf-radio-image__image{display:block;max-width:100%;padding:5px;box-sizing:border-box}.wp-block .cf-radio__list{list-style:none outside none}.cf-radio__list-item{box-sizing:border-box}.cf-container-term-meta .cf-radio__list-item{flex:0 0 20%}.cf-container-theme-options .cf-radio__list-item{flex:0 0 10%}.cf-radio-image__image{border:1px solid #e2e4e7}.cf-radio__input:checked~.cf-radio__label .cf-radio-image__image,.cf-radio__input:focus~.cf-radio__label .cf-radio-image__image{outline:4px solid #00a0d2}.cf-select__input{display:block;width:100%;margin:0}.cf-container-term-meta .cf-separator .cf-field__head{display:none}.cf-container-term-meta .cf-separator .cf-field__body{position:absolute;left:0}.cf-set__list{margin:0}.cf-set__list-item:last-child{margin-bottom:0}.cf-field .cf-set__input{margin-top:0}.cf-container-term-meta .cf-set__label{display:inline}.cf-text__input{display:block;width:100%!important;margin:0}.cf-textarea__input{display:block;width:100%!important;resize:vertical}.cf-field,.cf-field__body,.cf-field__head{box-sizing:border-box;flex:1 1 100%}@media (max-width:1024px){.cf-field{flex-basis:100%!important}}.cf-rich-text .cf-field__body{box-sizing:content-box}.cf-complex--tabbed-vertical>.cf-field__body{display:flex;align-items:flex-start}.cf-field__label{display:block}.cf-html .cf-field__label,.cf-separator .cf-field__label{display:none}.cf-field__asterisk{color:#dc3232}.cf-field__error{display:block;margin-top:4px;color:#dc3232} \ No newline at end of file diff --git a/build/gutenberg/core.min.js b/build/gutenberg/core.min.js index a40f91c37..fc725ceec 100644 --- a/build/gutenberg/core.min.js +++ b/build/gutenberg/core.min.js @@ -44,4 +44,4 @@ e.exports=function(){"use strict";var e=function(e){return("0"+e).slice(-2)},t=f * @author Feross Aboukhadijeh * @license MIT */ -function r(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o=0;l--)if(c[l]!==f[l])return!1;for(l=c.length-1;l>=0;l--)if(!b(e[s=c[l]],t[s],n,r))return!1;return!0}(e,t,n,a))}return n?e===t:e==t}function y(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function x(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&g(o,n,"Missing expected exception"+r);var a="string"==typeof r,u=!e&&o&&!n;if((!e&&i.isError(o)&&a&&w(o,n)||u)&&g(o,n,"Got unwanted exception"+r),e&&o&&n&&!w(o,n)||!e&&o)throw o}f.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=h(m(this.actual),128)+" "+this.operator+" "+h(m(this.expected),128),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,o=d(t),i=r.indexOf("\n"+o);if(i>=0){var a=r.indexOf("\n",i+1);r=r.substring(a+1)}this.stack=r}}},i.inherits(f.AssertionError,Error),f.fail=g,f.ok=v,f.equal=function(e,t,n){e!=t&&g(e,t,n,"==",f.equal)},f.notEqual=function(e,t,n){e==t&&g(e,t,n,"!=",f.notEqual)},f.deepEqual=function(e,t,n){b(e,t,!1)||g(e,t,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,n){b(e,t,!0)||g(e,t,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,n){b(e,t,!1)&&g(e,t,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,n,r){b(t,n,!0)&&g(t,n,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,n){e!==t&&g(e,t,n,"===",f.strictEqual)},f.notStrictEqual=function(e,t,n){e===t&&g(e,t,n,"!==",f.notStrictEqual)},f.throws=function(e,t,n){x(!0,e,t,n)},f.doesNotThrow=function(e,t,n){x(!1,e,t,n)},f.ifError=function(e){if(e)throw e};var E=Object.keys||function(e){var t=[];for(var n in e)a.call(e,n)&&t.push(n);return t}}).call(this,n(31))},function(e,t,n){(function(e,r){var o=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],n=0;n=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),s=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),c(r,e,r.depth)}function s(e,t){var n=u.styles[t];return n?"["+u.colors[n][0]+"m"+e+"["+u.colors[n][1]+"m":e}function l(e,t){return e}function c(e,n,r){if(e.customInspect&&n&&C(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return v(o)||(o=c(e,o,r)),o}var i=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(v(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return g(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,n);if(i)return i;var a=Object.keys(n),u=function(e){var t={};return a.forEach(function(e,n){t[e]=!0}),t}();if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),E(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(C(n)){var s=n.name?": "+n.name:"";return e.stylize("[Function"+s+"]","special")}if(y(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(x(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return f(n)}var l,w="",O=!1,_=["{","}"];return d(n)&&(O=!0,_=["[","]"]),C(n)&&(w=" [Function"+(n.name?": "+n.name:"")+"]"),y(n)&&(w=" "+RegExp.prototype.toString.call(n)),x(n)&&(w=" "+Date.prototype.toUTCString.call(n)),E(n)&&(w=" "+f(n)),0!==a.length||O&&0!=n.length?r<0?y(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),l=O?function(e,t,n,r,o){for(var i=[],a=0,u=t.length;a60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(l,w,_)):_[0]+w+_[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,o,i){var a,u,s;if((s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?u=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(u=e.stylize("[Setter]","special")),S(r,o)||(a="["+o+"]"),u||(e.seen.indexOf(s.value)<0?(u=m(n)?c(e,s.value,null):c(e,s.value,n-1)).indexOf("\n")>-1&&(u=i?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n")):u=e.stylize("[Circular]","special")),b(a)){if(i&&o.match(/^\d+$/))return u;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function d(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function b(e){return void 0===e}function y(e){return w(e)&&"[object RegExp]"===O(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===O(e)}function E(e){return w(e)&&("[object Error]"===O(e)||e instanceof Error)}function C(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function _(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(b(i)&&(i=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!a[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){var n=r.pid;a[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else a[e]=function(){};return a[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=h,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=y,t.isObject=w,t.isDate=x,t.isError=E,t.isFunction=C,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(255);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(n=[_((e=new Date).getHours()),_(e.getMinutes()),_(e.getSeconds())].join(":"),[e.getDate(),k[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(256),t._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,n(31),n(94))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){e.exports=function(e){return!(!e||"object"!=typeof e)&&("object"==typeof window&&"object"==typeof window.Node?e instanceof window.Node:"number"==typeof e.nodeType&&"string"==typeof e.nodeName)}},function(e,t,n){},function(e,t,n){},function(e,t,n){(function(t){(function(){var n,r,o,i,a,u;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,i=(n=function(){var e;return 1e9*(e=r())[0]+e[1]})(),u=1e9*t.uptime(),a=i-u):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(this,n(94))},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}t.default=e}(n(21));var r=u(n(262)),o=u(n(265)),i=u(n(1)),a=u(n(95));function u(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,["children","in"]),a=r.default.Children.toArray(t),u=a[0],s=a[1];return delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,r.default.createElement(i.default,o,n?r.default.cloneElement(u,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.default.cloneElement(s,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},a}(r.default.Component);u.propTypes={};var s=u;t.default=s,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.getChildMapping=o,t.mergeChildMappings=i,t.getInitialChildMapping=function(e,t){return o(e.children,function(n){return(0,r.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:a(n,"appear",e),enter:a(n,"enter",e),exit:a(n,"exit",e)})})},t.getNextChildMapping=function(e,t,n){var u=o(e.children),s=i(t,u);return Object.keys(s).forEach(function(o){var i=s[o];if((0,r.isValidElement)(i)){var l=o in t,c=o in u,f=t[o],p=(0,r.isValidElement)(f)&&!f.props.in;!c||l&&!p?c||!l||p?c&&l&&(0,r.isValidElement)(f)&&(s[o]=(0,r.cloneElement)(i,{onExited:n.bind(null,i),in:f.props.in,exit:a(i,"exit",e),enter:a(i,"enter",e)})):s[o]=(0,r.cloneElement)(i,{in:!1}):s[o]=(0,r.cloneElement)(i,{onExited:n.bind(null,i),in:!0,exit:a(i,"exit",e),enter:a(i,"enter",e)})}}),s};var r=n(1);function o(e,t){var n=Object.create(null);return e&&r.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&(0,r.isValidElement)(e)?t(e):e}(e)}),n}function i(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),i=[];for(var a in e)a in t?i.length&&(o[a]=i,i=[]):i.push(a);var u={};for(var s in t){if(o[s])for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"MARK_AS_VALID":return Object(p.omit)(e,[t.payload.fieldId]);case"MARK_AS_INVALID":var n=t.payload,r=n.fieldId,o=n.error;return f()({},e,l()({},r,o));default:return e}},hiddenFields:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_FIELD":return-1===e.indexOf(t.payload.fieldId)?e:Object(p.without)(e,t.payload.fieldId);case"HIDE_FIELD":return e.indexOf(t.payload.fieldId)>-1?e:e.concat(t.payload.fieldId);default:return e}}});function h(e){return{type:"MARK_AS_VALID",payload:{fieldId:e}}}function m(e,t){return{type:"MARK_AS_INVALID",payload:{fieldId:e,error:t}}}function g(e){return{type:"SHOW_FIELD",payload:{fieldId:e}}}function v(e){return{type:"HIDE_FIELD",payload:{fieldId:e}}}function b(e,t){return e.validation[t]||null}function y(e,t){return-1===e.hiddenFields.indexOf(t)}Object(u.registerStore)("carbon-fields/core",{reducer:d,actions:r,selectors:o});var w=n(16),x=n.n(w),E=n(14),C=n(6),O=n.n(C),_=n(7),k=n.n(_),S=n(8),j=n.n(S),A=n(9),D=n.n(A),T=n(10),M=n.n(T),N=n(0),F=n.n(N),P=n(3),I=16;function L(e){return Object(E.createHigherOrderComponent)(function(t){return function(n){function r(n){var o;return O()(this,r),(o=j()(this,D()(r).call(this,n))).onHooksUpdated=o.onHooksUpdated.bind(F()(F()(o))),o.Component=Object(a.applyFilters)(e,t),o.namespace=Object(p.uniqueId)("core/with-filters/component-"),o.throttledForceUpdate=Object(p.debounce)(function(){o.Component=Object(a.applyFilters)(e,t),o.forceUpdate()},I),Object(a.addAction)("hookRemoved",o.namespace,o.onHooksUpdated),Object(a.addAction)("hookAdded",o.namespace,o.onHooksUpdated),o}return M()(r,n),k()(r,[{key:"componentWillUnmount",value:function(){this.throttledForceUpdate.cancel(),Object(a.removeAction)("hookRemoved",this.namespace),Object(a.removeAction)("hookAdded",this.namespace)}},{key:"onHooksUpdated",value:function(t){t===e&&this.throttledForceUpdate()}},{key:"render",value:function(){return wp.element.createElement(this.Component,this.props)}}]),r}(P.Component)},"withFilters")}function R(e,t){var n,r=Object(p.startCase)(e),o={};return n={},l()(n,"register".concat(r,"Type"),function(n,u){return Object(p.isString)(n)?o[n]?(console.error(Object(i.sprintf)(Object(i.__)("%1$s %2$s is already registered.","carbon-fields-ui"),r,n)),!1):u&&Object(p.isFunction)(u)?(o[n]=t.reduce(function(t,r){return f()({},t,l()({},r,Object(a.applyFilters)("carbon-fields.register-".concat(e,"-type"),n,r,u)))},{}),!0):(console.error(Object(i.__)('The "component" param must be a function.',"carbon-fields-ui")),!1):(console.error(Object(i.sprintf)(Object(i.__)("%1$s type must be a string.","carbon-fields-ui"),r)),!1)}),l()(n,"get".concat(r,"Type"),function(e,n){if(t.includes(n)){if(o[e])return o[e][n];console.error(Object(i.sprintf)(Object(i.__)("%s %s isn't registered.","carbon-fields-ui"),r,e))}else console.error(Object(i.sprintf)(Object(i.__)("The provided context isn't a valid one. Must be one of - %s .","carbon-fields-ui"),t.join(", ")))}),n}var H=R("field",["metabox","block"]),B=H.registerFieldType,V=H.getFieldType,U=n(17),W=n.n(U),z=n(32),q=n.n(z),Y=n(18),$=n(20),G=n.n($),X=n(11),K=function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:null;return new Promise(function(r,o){var a=window.jQuery.ajax({url:e,type:t,data:n});a.done(function(e){r(e)}),a.fail(function(){o(Object(i.__)("An error occured.","carbon-fields-ui"))})})},ae=function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),a=0;a0&&a.length>=r.max?alert(Object(i.sprintf)(Object(i.__)("Maximum number of items reached (%s items)","carbon-fields-ui"),Number(r.max))):(u(o,x()(a).concat([Object(p.pick)(e,"id","type","subtype")])),s({selectedOptions:x()(l).concat([e])})))}),l()(F()(F()(n)),"handleRemoveItem",function(e){var t=n.props,r=t.value,o=t.id,i=t.onChange,a=t.setState,u=t.selectedOptions;i(o,Object(p.without)(r,e)),a({selectedOptions:Object(p.without)(u,e)})}),l()(F()(F()(n)),"handleSort",function(e){var t=n.props,r=t.id;(0,t.onChange)(r,e)}),n}return M()(t,e),k()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.fetchSelectedOptions,n=e.field,r=e.value;(0,e.setState)({options:n.options.options,totalOptionsCount:n.options.total_options}),r.length&&t(),this.sourceList.current.addEventListener("scroll",this.handleSourceListScroll)}},{key:"componentWillUnmount",value:function(){this.sourceList.current.removeEventListener("scroll",this.handleSourceListScroll)}},{key:"render",value:function(){var e=this,t=this.props,n=t.name,r=t.value,o=t.field,a=t.totalOptionsCount,u=t.selectedOptions,s=t.queryTerm,l=t.isLoading,c=this.props.options;return o.duplicates_allowed||(c=q()(c,function(e){e.map(function(e){return e.disabled=!!Object(p.find)(r,function(t){return Object(p.isMatch)(t,{id:e.id,type:e.type,subtype:e.subtype})}),e})})),wp.element.createElement(P.Fragment,null,wp.element.createElement("div",{className:"cf-association__bar"},wp.element.createElement(re,{value:s,onChange:this.handleSearchChange}),l?wp.element.createElement("span",{className:"cf-association__spinner spinner is-active"}):"",wp.element.createElement("span",{className:"cf-association__counter"},Object(i.sprintf)(Object(i.__)("Showing %1$d of %2$d results","carbon-fields-ui"),Number(c.length),Number(a)))),wp.element.createElement("div",{className:"cf-association__cols"},wp.element.createElement("div",{className:"cf-association__col",ref:this.sourceList},c.map(function(t,n){return wp.element.createElement("div",{className:G()("cf-association__option",{"cf-association__option--selected":t.disabled}),key:n},t.thumbnail&&wp.element.createElement("img",{className:"cf-association__option-thumb",src:t.thumbnail}),wp.element.createElement("div",{className:"cf-association__option-content"},wp.element.createElement("span",{className:"cf-association__option-title"},wp.element.createElement("span",{className:"cf-association__option-title-inner"},t.title)),wp.element.createElement("span",{className:"cf-association__option-type"},t.type)),wp.element.createElement("div",{className:"cf-association__option-actions"},t.edit_link&&wp.element.createElement("a",{className:"cf-association__option-action cf-association__option-action--edit dashicons dashicons-edit",href:t.edit_link.replace("&","&","g"),target:"_blank",rel:"noopener noreferrer"}),!t.disabled&&(o.max<0||r.length0&&t.length=0||(o[n]=e[n]);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["excludeScrollbar"]));return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(de.createElement)(e,n)},i}(de.Component),n.displayName="OnClickOutside("+(e.displayName||e.name||"Component")+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r},ke=_e(function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i1?n.setState(function(e){return{menuVisible:!e.menuVisible}}):r(t[0])}),l()(F()(F()(n)),"handleItemClick",function(e){n.setState({menuVisible:!1}),n.props.onSelect(e)}),n}return M()(t,e),k()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.buttonText,r=t.groups;return wp.element.createElement("div",{className:"cf-complex__inserter"},wp.element.createElement("button",{type:"button",className:"button cf-complex__inserter-button",onClick:this.handleAddClick},n),r.length>1&&wp.element.createElement("ul",{className:"cf-complex__inserter-menu",hidden:!this.state.menuVisible},r.map(function(t,n){return wp.element.createElement("li",{className:"cf-complex__inserter-item",key:n,onClick:function(){return e.handleItemClick(t)}},t.label)})))}}]),t}(P.Component)),Pe=function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0?u-1:1;n.setState({currentTab:Object(p.get)(r,"".concat(s,".").concat(o),null)})}i(a)}),l()(F()(F()(n)),"handleToggleAllClick",function(){var e=n.props,t=e.allGroupsAreCollapsed;(0,e.onToggleAllGroups)(!t)}),l()(F()(F()(n)),"handleGroupsSortStart",function(e,t){var r=n.props,o=r.value,i=r.groupIdKey,a=t.item.index(),u=Object(p.get)(o,"".concat(a,".").concat(i),null);n.setState({currentDraggedGroup:u})}),l()(F()(F()(n)),"handleGroupsSortUpdate",function(e){var t=n.props,r=t.id;(0,t.onChange)(r,e)}),l()(F()(F()(n)),"handleGroupsSortStop",function(){n.setState({currentDraggedGroup:null})}),l()(F()(F()(n)),"handleTabsChange",function(e){n.setState({currentTab:e})}),n}return M()(t,e),k()(t,[{key:"findGroup",value:function(e){var t=this.props,n=t.value,r=t.groupIdKey;return Object(p.find)(n,[r,e])}},{key:"getAvailableGroups",value:function(e){var t=this.props,n=t.field,r=t.value;if(n.duplicate_groups_allowed)return n.groups;var o=r.map(function(t){return t[e]});return n.groups.filter(function(e){var t=e.name;return-1===o.indexOf(t)})}},{key:"getGroupLabels",value:function(){var e=this.props,t=e.field;return e.groupValues.map(function(e,n){var r=W()(e,2),o=r[0],a=r[1],u=Object(p.find)(t.groups,["name",o]);if(!u)return"N/A";if(!Object(p.isString)(u.label_template))return u.label;try{return Object(p.template)(u.label_template)(f()({$_index:n},a))||u.label}catch(e){return console.error(Object(i.sprintf)(Object(i.__)("Couldn't create the label of group - %s","carbon-fields-ui"),e.message)),"N/A"}})}},{key:"render",value:function(){var e=this,t=this.state,n=t.currentDraggedGroup,r=t.currentTab,o=this.props,a=o.value,u=o.field,s=o.groupIdKey,l=o.groupFilterKey,c=o.allGroupsAreCollapsed,f=o.onGroupSetup,p=o.onGroupFieldSetup,d=o.onToggleGroup,h=this.getAvailableGroups(l),m=this.getGroupLabels(),g=a.map(function(e,t){return{id:e[s],label:m[t]}});return wp.element.createElement(P.Fragment,null,this.isTabbed&&!!a.length&&wp.element.createElement(oe,{items:a,forwardedRef:this.tabsList,options:{axis:"tabbed-vertical"===u.layout?"y":"x",forcePlaceholderSize:!0},onUpdate:this.handleGroupsSortUpdate},wp.element.createElement(Ne,{ref:this.tabsList,items:g,current:r,layout:u.layout,onChange:this.handleTabsChange},!!h.length&&!this.isMaximumReached&&wp.element.createElement(Fe,{buttonText:"+",groups:h,onSelect:this.handleAddGroup}))),!a.length&&wp.element.createElement(Ie,{label:Object(i.__)("There are no entries yet.","carbon-fields-ui")},wp.element.createElement(Fe,{buttonText:this.inserterButtonText,groups:h,onSelect:this.handleAddGroup})),!!a.length&&wp.element.createElement(oe,{items:a,options:{helper:"clone",handle:".cf-complex__group-head",placeholder:"cf-complex__group-placeholder",forceHelperSize:!0,forcePlaceholderSize:!0},forwardedRef:this.groupsList,onStart:this.handleGroupsSortStart,onUpdate:this.handleGroupsSortUpdate,onStop:this.handleGroupsSortStop},wp.element.createElement("div",{className:"cf-complex__groups",ref:this.groupsList},a.map(function(t,o){return wp.element.createElement(Pe,Q()({key:"".concat(t[l],"-").concat(o)},f(t,{index:o,label:m[o],dragged:t[s]===n,tabbed:e.isTabbed,hidden:e.isTabbed&&t[s]!==r,allowClone:u.duplicate_groups_allowed&&!e.isMaximumReached,onFieldSetup:p,onClone:e.handleCloneGroup,onRemove:e.handleRemoveGroup,onToggle:d})))}))),!this.isTabbed&&!!a.length&&wp.element.createElement("div",{className:"cf-complex__actions"},!!h.length&&!this.isMaximumReached&&wp.element.createElement(Fe,{buttonText:this.inserterButtonText,groups:h,onSelect:this.handleAddGroup}),wp.element.createElement("button",{type:"button",className:"button cf-complex__toggler",onClick:this.handleToggleAllClick},c?Object(i.__)("Expand All","carbon-fields-ui"):Object(i.__)("Collapse All","carbon-fields-ui"))))}},{key:"isTabbed",get:function(){return this.props.field.layout.indexOf("tabbed")>-1}},{key:"isMaximumReached",get:function(){var e=this.props,t=e.field,n=e.value;return t.max>0&&n.length>=t.max}},{key:"inserterButtonText",get:function(){var e=this.props.field;return Object(i.sprintf)(Object(i.__)("Add %s","carbon-fields-ui"),e.labels.singular_name)}}]),t}(P.Component);Object(a.addFilter)("carbon-fields.field-wrapper","carbon-fields/core",function(e){return function(t){var n=t.field;return"complex"!==n.type?wp.element.createElement(e,t):wp.element.createElement(e,Q()({className:"cf-complex--".concat(n.layout)},t))}}),Object(a.addFilter)("carbon-fields.complex.validate","carbon-fields/core",function(e,t){var n=e.min,r=e.labels;if(e.required&&Object(p.isEmpty)(t))return Object(i.__)("This field is required.","carbon-fields-ui");if(n>0&&t.length=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},xt=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},Et=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Ct=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t-1}function jt(e){return St(e)?window.pageYOffset:e.scrollTop}function At(e,t){St(e)?window.scrollTo(0,t):e.scrollTop=t}function Dt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ot,o=jt(e),i=t-o,a=0;!function t(){var u,s=i*((u=(u=a+=10)/n-1)*u*u+1)+o;At(e,s),a=d)return{placement:"bottom",maxHeight:t};if(C>=d&&!a)return i&&Dt(s,O,160),{placement:"bottom",maxHeight:t};if(!a&&C>=r||a&&x>=r)return i&&Dt(s,O,160),{placement:"bottom",maxHeight:a?x-b:C-b};if("auto"===o||a){var k=t;return(!a&&E>=r||a&&w>=r)&&(k=a?w-b-u.controlHeight:E-b-u.controlHeight),{placement:"top",maxHeight:k}}if("bottom"===o)return At(s,O),{placement:"bottom",maxHeight:t};break;case"top":if(w>=d)return{placement:"top",maxHeight:t};if(E>=d&&!a)return i&&Dt(s,_,160),{placement:"top",maxHeight:t};if(!a&&E>=r||a&&w>=r){var S=t;return(!a&&E>=r||a&&w>=r)&&(S=a?w-y:E-y),i&&Dt(s,_,160),{placement:"top",maxHeight:S}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'+o+'".')}return l}({maxHeight:o,menuEl:e,minHeight:n,placement:i,shouldScroll:u&&!c,isFixedPosition:c,theme:s});l&&l(f),r.setState(f)}},r.getUpdatedProps=function(){var e=r.props.menuPlacement,t=r.state.placement||Mt(e);return bt({},r.props,{placement:t,maxHeight:r.state.maxHeight})},xt(r,n)}return yt(t,e),gt(t,[{key:"render",value:function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),t}(de.Component);Nt.contextTypes={getPortalPlacement:st.a.func};var Ft=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:2*n+"px "+3*n+"px",textAlign:"center"}},Pt=Ft,It=Ft,Lt=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return he.a.createElement("div",bt({className:r(Object(at.a)(o("noOptionsMessage",e)),{"menu-notice":!0,"menu-notice--no-options":!0},n)},i),t)};Lt.defaultProps={children:"No options"};var Rt=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return he.a.createElement("div",bt({className:r(Object(at.a)(o("loadingMessage",e)),{"menu-notice":!0,"menu-notice--loading":!0},n)},i),t)};Rt.defaultProps={children:"Loading..."};var Ht=function(e){function t(){var e,n,r;mt(this,t);for(var o=arguments.length,i=Array(o),a=0;a0,h=c-f-l,m=!1;h>t&&r.isBottom&&(i&&i(e),r.isBottom=!1),d&&r.isTop&&(u&&u(e),r.isTop=!1),d&&t>h?(o&&!r.isBottom&&o(e),p.scrollTop=c,m=!0,r.isBottom=!0):!d&&-t>l&&(a&&!r.isTop&&a(e),p.scrollTop=0,m=!0,r.isTop=!0),m&&r.cancelScroll(e)},r.onWheel=function(e){r.handleEventDelta(e,e.deltaY)},r.onTouchStart=function(e){r.touchStart=e.changedTouches[0].clientY},r.onTouchMove=function(e){var t=r.touchStart-e.changedTouches[0].clientY;r.handleEventDelta(e,t)},r.getScrollTarget=function(e){r.scrollTarget=e},xt(r,n)}return yt(t,e),gt(t,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(e){e.scrollHeight<=e.clientHeight||("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1))}},{key:"stopListening",value:function(e){e.scrollHeight<=e.clientHeight||("function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return he.a.createElement(Kt,{innerRef:this.getScrollTarget},this.props.children)}}]),t}(de.Component),ln=function(e){function t(){return mt(this,t),xt(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return yt(t,e),gt(t,[{key:"render",value:function(){var e=this.props,t=e.isEnabled,n=wt(e,["isEnabled"]);return t?he.a.createElement(sn,n):this.props.children}}]),t}(de.Component);ln.defaultProps={isEnabled:!0};var cn=function(e){function t(){return mt(this,t),xt(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return yt(t,e),gt(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.cx,o=e.isMulti,i=e.getStyles,a=e.hasValue;return he.a.createElement("div",{className:r(Object(at.a)(i("valueContainer",this.props)),{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":a},n)},t)}}]),t}(de.Component),fn=function(e){var t=e.size,n=wt(e,["size"]);return he.a.createElement("svg",bt({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:Object(at.a)({display:"inline-block",fill:"currentColor",lineHeight:1,stroke:"currentColor",strokeWidth:0})},n))},pn=function(e){return he.a.createElement(fn,bt({size:20},e),he.a.createElement("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},dn=function(e){return he.a.createElement(fn,bt({size:20},e),he.a.createElement("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},hn=function(e){var t=e.isFocused,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{color:t?o.neutral60:o.neutral20,display:"flex",padding:2*r,transition:"color 150ms",":hover":{color:t?o.neutral80:o.neutral40}}},mn=hn,gn=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return he.a.createElement("div",bt({},i,{className:r(Object(at.a)(o("dropdownIndicator",e)),{indicator:!0,"dropdown-indicator":!0},n)}),t)};gn.defaultProps={children:he.a.createElement(dn,null)};var vn=hn,bn=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return he.a.createElement("div",bt({},i,{className:r(Object(at.a)(o("clearIndicator",e)),{indicator:!0,"clear-indicator":!0},n)}),t)};bn.defaultProps={children:he.a.createElement(pn,null)};var yn=function(e){var t=e.color,n=e.delay,r=e.offset;return he.a.createElement("span",{className:Object(at.a)({animationDuration:"1s",animationDelay:n+"ms",animationIterationCount:"infinite",animationName:"react-select-loading-indicator",animationTimingFunction:"ease-in-out",backgroundColor:t,borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":null,height:"1em",verticalAlign:"top",width:"1em"})})};Object(at.b)("@keyframes ","react-select-loading-indicator","{0%,80%,100%{opacity:0;}40%{opacity:1;}};");var wn=function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerProps,i=e.isFocused,a=e.isRtl,u=e.theme.colors,s=i?u.neutral80:u.neutral20;return he.a.createElement("div",bt({},o,{className:n(Object(at.a)(r("loadingIndicator",e)),{indicator:!0,"loading-indicator":!0},t)}),he.a.createElement(yn,{color:s,delay:0,offset:a}),he.a.createElement(yn,{color:s,delay:160,offset:!0}),he.a.createElement(yn,{color:s,delay:320,offset:!a}))};wn.defaultProps={size:4};var xn=function(e){var t=e.children,n=e.innerProps;return he.a.createElement("div",n,t)},En=xn,Cn=xn,On=function(e){function t(){return mt(this,t),xt(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return yt(t,e),gt(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.innerProps;return he.a.createElement("div",n,t)}}]),t}(de.Component);On.defaultProps={children:he.a.createElement(pn,{size:14})};var _n=function(e){function t(){return mt(this,t),xt(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return yt(t,e),gt(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.components,o=e.cx,i=e.data,a=e.getStyles,u=e.innerProps,s=e.isDisabled,l=e.removeProps,c=e.selectProps,f=r.Container,p=r.Label,d=r.Remove,h=bt({className:o(Object(at.a)(a("multiValue",this.props)),{"multi-value":!0,"multi-value--is-disabled":s},n)},u),m={className:o(Object(at.a)(a("multiValueLabel",this.props)),{"multi-value__label":!0},n)},g=bt({className:o(Object(at.a)(a("multiValueRemove",this.props)),{"multi-value__remove":!0},n)},l);return he.a.createElement(f,{data:i,innerProps:h,selectProps:c},he.a.createElement(p,{data:i,innerProps:m,selectProps:c},t),he.a.createElement(d,{data:i,innerProps:g,selectProps:c}))}}]),t}(de.Component);_n.defaultProps={cropWithEllipsis:!0};var kn={ClearIndicator:bn,Control:function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.className,i=e.isDisabled,a=e.isFocused,u=e.innerRef,s=e.innerProps;return he.a.createElement("div",bt({ref:u,className:n(Object(at.a)(r("control",e)),{control:!0,"control--is-disabled":i,"control--is-focused":a},o)},s),t)},DropdownIndicator:gn,DownChevron:dn,CrossIcon:pn,Group:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.Heading,a=e.headingProps,u=e.label,s=e.theme;return he.a.createElement("div",{className:r(Object(at.a)(o("group",e)),{group:!0},n)},he.a.createElement(i,bt({},a,{theme:s,getStyles:o,cx:r}),u),he.a.createElement("div",null,t))},GroupHeading:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.theme,i=wt(e,["className","cx","getStyles","theme"]);return he.a.createElement("div",bt({className:n(Object(at.a)(r("groupHeading",bt({theme:o},i))),{"group-heading":!0},t)},i))},IndicatorsContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles;return he.a.createElement("div",{className:r(Object(at.a)(o("indicatorsContainer",e)),{indicators:!0},n)},t)},IndicatorSeparator:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerProps;return he.a.createElement("span",bt({},o,{className:n(Object(at.a)(r("indicatorSeparator",e)),{"indicator-separator":!0},t)}))},Input:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerRef,i=e.isHidden,a=e.isDisabled,u=e.theme,s=wt(e,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme"]);return he.a.createElement("div",{className:Object(at.a)(r("input",bt({theme:u},s)))},he.a.createElement(ct.a,bt({className:n(null,{input:!0},t),inputRef:o,inputStyle:{background:0,border:0,fontSize:"inherit",opacity:i?0:1,outline:0,padding:0,color:"inherit"},disabled:a},s)))},LoadingIndicator:wn,Menu:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerRef,a=e.innerProps,u=r(Object(at.a)(o("menu",e)),{menu:!0},n);return he.a.createElement("div",bt({className:u},a,{ref:i}),t)},MenuList:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isMulti,a=e.innerRef;return he.a.createElement("div",{className:r(Object(at.a)(o("menuList",e)),{"menu-list":!0,"menu-list--is-multi":i},n),ref:a},t)},MenuPortal:Ht,LoadingMessage:Rt,NoOptionsMessage:Lt,MultiValue:_n,MultiValueContainer:En,MultiValueLabel:Cn,MultiValueRemove:On,Option:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isDisabled,a=e.isFocused,u=e.isSelected,s=e.innerRef,l=e.innerProps;return he.a.createElement("div",bt({ref:s,className:r(Object(at.a)(o("option",e)),{option:!0,"option--is-disabled":i,"option--is-focused":a,"option--is-selected":u},n)},l),t)},Placeholder:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return he.a.createElement("div",bt({className:r(Object(at.a)(o("placeholder",e)),{placeholder:!0},n)},i),t)},SelectContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps,a=e.isDisabled,u=e.isRtl;return he.a.createElement("div",bt({className:r(Object(at.a)(o("container",e)),{"--is-disabled":a,"--is-rtl":u},n)},i),t)},SingleValue:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isDisabled,a=e.innerProps;return he.a.createElement("div",bt({className:r(Object(at.a)(o("singleValue",e)),{"single-value":!0,"single-value--is-disabled":i},n)},a),t)},ValueContainer:cn},Sn=function(e){return bt({},kn,e.components)},jn={clearIndicator:vn,container:function(e){var t=e.isDisabled;return{direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius,a=r.spacing;return{alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px "+o.primary:null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}},dropdownIndicator:mn,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:o.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return{color:t?o.neutral60:o.neutral20,display:"flex",padding:2*i,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:It,menu:function(e){var t,n=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,a=r.colors;return vt(t={},n?{bottom:"top",top:"bottom"}[n]:"bottom","100%"),vt(t,"backgroundColor",a.neutral0),vt(t,"borderRadius",o),vt(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),vt(t,"marginBottom",i.menuGutter),vt(t,"marginTop",i.menuGutter),vt(t,"position","absolute"),vt(t,"width","100%"),vt(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&o.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},noOptionsMessage:Pt,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,a=o.colors;return{backgroundColor:r?a.primary:n?a.primary25:"transparent",color:t?a.neutral20:r?a.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:2*i.baseUnit+"px "+3*i.baseUnit+"px",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:r?a.primary:a.primary50}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{color:t?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - "+2*r.baseUnit+"px)",overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:t.baseUnit/2+"px "+2*t.baseUnit+"px",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},An={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Dn={backspaceRemovesValue:!0,blurInputOnSelect:Tt(),captureMenuScroll:!Tt(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){var n=bt({ignoreCase:!0,ignoreAccents:!0,stringify:$t,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,u=n.matchFrom,s=a?Yt(t):t,l=a?Yt(i(e)):i(e);return r&&(s=s.toLowerCase(),l=l.toLowerCase()),o&&(s=qt(s),l=qt(l)),"start"===u?l.substr(0,s.length)===s:l.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return t+" result"+(1!==t?"s":"")+" available"},styles:{},tabIndex:"0",tabSelectsValue:!0},Tn=1,Mn=function(e){function t(e){mt(this,t);var n=xt(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));Nn.call(n);var r=e.value;n.cacheComponents=pt(n.cacheComponents,Wt).bind(n),n.cacheComponents(e.components),n.instancePrefix="react-select-"+(n.props.instanceId||++Tn);var o=kt(r),i=n.buildMenuOptions(e,o);return n.state.menuOptions=i,n.state.selectValue=o,n}return yt(t,e),gt(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.options,r=t.value,o=t.inputValue;if(this.cacheComponents(e.components),e.value!==r||e.options!==n||e.inputValue!==o){var i=kt(e.value),a=this.buildMenuOptions(e,i),u=this.getNextFocusedValue(i),s=this.getNextFocusedOption(a.focusable);this.setState({menuOptions:a,selectValue:i,focusedOption:s,focusedValue:u})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(e){var t,n,r,o,i,a=this.props,u=a.isDisabled,s=a.menuIsOpen,l=this.state.isFocused;(l&&!u&&e.isDisabled||l&&s&&!e.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),o=n.getBoundingClientRect(),i=n.offsetHeight/3,o.bottom+i>r.bottom?At(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+i,t.scrollHeight)):o.top-i-1&&(i=a)}this.scrollToFocusedOptionOnUpdate=!0,this.inputIsHiddenAfterUpdate=!1,this.onMenuOpen(),this.setState({focusedValue:null,focusedOption:n.focusable[i]}),this.announceAriaLiveContext({event:"menu"})}},{key:"focusValue",value:function(e){var t=this.props,n=t.isMulti,r=t.isSearchable,o=this.state,i=o.selectValue,a=o.focusedValue;if(n){this.setState({focusedOption:null});var u=i.indexOf(a);a||(u=-1,this.announceAriaLiveContext({event:"value"}));var s=i.length-1,l=-1;if(i.length){switch(e){case"previous":l=0===u?0:-1===u?s:u-1;break;case"next":u>-1&&u0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state,r=n.focusedOption,o=n.menuOptions.focusable;if(o.length){var i=0,a=o.indexOf(r);r||(a=-1,this.announceAriaLiveContext({event:"menu"})),"up"===e?i=a>0?a-1:o.length-1:"down"===e?i=(a+1)%o.length:"pageup"===e?(i=a-t)<0&&(i=0):"pagedown"===e?(i=a+t)>o.length-1&&(i=o.length-1):"last"===e&&(i=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[i],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(An):bt({},An,this.props.theme):An}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,r=this.selectOption,o=this.props,i=o.classNamePrefix,a=o.isMulti,u=o.isRtl,s=o.options,l=this.state.selectValue,c=this.hasValue();return{cx:function(e,t,n,r){var o=[t,r];if(n&&e)for(var i in n)n.hasOwnProperty(i)&&n[i]&&o.push(""+_t(e,i));return o.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}.bind(null,i),clearValue:e,getStyles:t,getValue:function(){return l},hasValue:c,isMulti:a,isRtl:u,options:s,selectOption:r,setValue:n,selectProps:o,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(r>-1){if(e.indexOf(n)>-1)return n;if(r-1?t:e[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)}},{key:"isOptionSelected",value:function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var r=this.getOptionValue(e);return t.some(function(e){return n.getOptionValue(e)===r})}},{key:"filterOption",value:function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"buildMenuOptions",value:function(e,t){var n=this,r=e.inputValue,o=void 0===r?"":r,i=e.options,a=function(e,r){var i=n.isOptionDisabled(e,t),a=n.isOptionSelected(e,t),u=n.getOptionLabel(e),s=n.getOptionValue(e);if(!(n.shouldHideSelectedOptions()&&a||!n.filterOption({label:u,value:s,data:e},o))){var l=i?void 0:function(){return n.onOptionHover(e)},c=i?void 0:function(){return n.selectOption(e)},f=n.getElementId("option")+"-"+r;return{innerProps:{id:f,onClick:c,onMouseMove:l,onMouseOver:l,role:"option",tabIndex:-1},data:e,isDisabled:i,isSelected:a,key:f,label:u,type:"option",value:s}}};return i.reduce(function(e,t,r){if(t.options){n.hasGroups||(n.hasGroups=!0);var o=t.options.map(function(t,n){var o=a(t,r+"-"+n);return o&&!o.isDisabled&&e.focusable.push(t),o}).filter(Boolean);if(o.length){var i=n.getElementId("group")+"-"+r;e.render.push({type:"group",key:i,data:t,options:o})}}else{var u=a(t,""+r);u&&(e.render.push(u),u.isDisabled||e.focusable.push(t))}return e},{render:[],focusable:[]})}},{key:"constructAriaLiveMessage",value:function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,r=e.focusedValue,o=e.focusedOption,i=this.props,a=i.options,u=i.menuIsOpen,s=i.inputValue,l=i.screenReaderStatus;return(r?function(e){var t=e.focusedValue,n=e.selectValue;return"value "+(0,e.getOptionLabel)(t)+" focused, "+(n.indexOf(t)+1)+" of "+n.length+"."}({focusedValue:r,getOptionLabel:this.getOptionLabel,selectValue:n}):"")+" "+(o&&u?function(e){var t=e.focusedOption,n=e.options;return"option "+(0,e.getOptionLabel)(t)+" focused, "+(n.indexOf(t)+1)+" of "+n.length+"."}({focusedOption:o,getOptionLabel:this.getOptionLabel,options:a}):"")+" "+function(e){var t=e.inputValue;return e.screenReaderMessage+(t?" for search term "+t:"")+"."}({inputValue:s,screenReaderMessage:l({count:this.countOptions()})})+" "+t}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,o=e.inputValue,i=e.tabIndex,a=this.components.Input,u=this.state.inputIsHidden,s=r||this.getElementId("input");if(!n)return he.a.createElement(Xt,{id:s,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ot,onFocus:this.onInputFocus,readOnly:!0,tabIndex:i,value:""});var l={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]},c=this.commonProps,f=c.cx,p=c.theme;return he.a.createElement(a,bt({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:f,getStyles:this.getStyles,id:s,innerRef:this.getInputRef,isDisabled:t,isHidden:u,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,theme:p,type:"text",value:o},l))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.components,n=t.MultiValue,r=t.MultiValueContainer,o=t.MultiValueLabel,i=t.MultiValueRemove,a=t.SingleValue,u=t.Placeholder,s=this.commonProps,l=this.props,c=l.controlShouldRenderValue,f=l.isDisabled,p=l.isMulti,d=l.inputValue,h=l.placeholder,m=this.state,g=m.selectValue,v=m.focusedValue;if(!this.hasValue()||!c)return d?null:he.a.createElement(u,bt({},s,{key:"placeholder",isDisabled:f}),h);if(p)return g.map(function(t){var a=t===v;return he.a.createElement(n,bt({},s,{components:{Container:r,Label:o,Remove:i},isFocused:a,isDisabled:f,key:e.getOptionValue(t),removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))});if(d)return null;var b=g[0];return he.a.createElement(a,bt({},s,{data:b,isDisabled:f}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||o)return null;var a={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return he.a.createElement(e,bt({},t,{innerProps:a,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;return e&&o?he.a.createElement(e,bt({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,o=this.props.isDisabled,i=this.state.isFocused;return he.a.createElement(n,bt({},r,{isDisabled:o,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return he.a.createElement(e,bt({},t,{innerProps:o,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.components,n=t.Group,r=t.GroupHeading,o=t.Menu,i=t.MenuList,a=t.MenuPortal,u=t.LoadingMessage,s=t.NoOptionsMessage,l=t.Option,c=this.commonProps,f=this.state,p=f.focusedOption,d=f.menuOptions,h=this.props,m=h.captureMenuScroll,g=h.inputValue,v=h.isLoading,b=h.loadingMessage,y=h.minMenuHeight,w=h.maxMenuHeight,x=h.menuIsOpen,E=h.menuPlacement,C=h.menuPosition,O=h.menuPortalTarget,_=h.menuShouldBlockScroll,k=h.menuShouldScrollIntoView,S=h.noOptionsMessage,j=h.onMenuScrollToTop,A=h.onMenuScrollToBottom;if(!x)return null;var D=function(t){var n=p===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,he.a.createElement(l,bt({},c,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))},T=void 0;if(this.hasOptions())T=d.render.map(function(t){if("group"===t.type){t.type;var o=wt(t,["type"]),i=t.key+"-heading";return he.a.createElement(n,bt({},c,o,{Heading:r,headingProps:{id:i},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return D(e)}))}if("option"===t.type)return D(t)});else if(v){var M=b({inputValue:g});if(null===M)return null;T=he.a.createElement(u,c,M)}else{var N=S({inputValue:g});if(null===N)return null;T=he.a.createElement(s,c,N)}var F={minMenuHeight:y,maxMenuHeight:w,menuPlacement:E,menuPosition:C,menuShouldScrollIntoView:k},P=he.a.createElement(Nt,bt({},c,F),function(t){var n=t.ref,r=t.placerProps,a=r.placement,u=r.maxHeight;return he.a.createElement(o,bt({},c,F,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:v,placement:a}),he.a.createElement(ln,{isEnabled:m,onTopArrive:j,onBottomArrive:A},he.a.createElement(un,{isEnabled:_},he.a.createElement(i,bt({},c,{innerRef:e.getMenuListRef,isLoading:v,maxHeight:u}),T))))});return O||"fixed"===C?he.a.createElement(a,bt({},c,{appendTo:O,controlElement:this.controlRef,menuPlacement:E,menuPosition:C}),P):P}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,o=t.isMulti,i=t.name,a=this.state.selectValue;if(i&&!r){if(o){if(n){var u=a.map(function(t){return e.getOptionValue(t)}).join(n);return he.a.createElement("input",{name:i,type:"hidden",value:u})}var s=a.length>0?a.map(function(t,n){return he.a.createElement("input",{key:"i-"+n,name:i,type:"hidden",value:e.getOptionValue(t)})}):he.a.createElement("input",{name:i,type:"hidden"});return he.a.createElement("div",null,s)}var l=a[0]?this.getOptionValue(a[0]):"";return he.a.createElement("input",{name:i,type:"hidden",value:l})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?he.a.createElement(Gt,{"aria-live":"assertive"},he.a.createElement("p",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),he.a.createElement("p",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,o=e.ValueContainer,i=this.props,a=i.className,u=i.id,s=i.isDisabled,l=this.state.isFocused,c=this.commonProps=this.getCommonProps();return he.a.createElement(r,bt({},c,{className:a,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:l}),this.renderLiveRegion(),he.a.createElement(t,bt({},c,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:l}),he.a.createElement(o,bt({},c,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),he.a.createElement(n,bt({},c,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),t}(de.Component);Mn.defaultProps=Dn;var Nn=function(){var e=this;this.state={ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,isComposing:!1,menuOptions:{render:[],focusable:[]},selectValue:[]},this.blockOptionHover=!1,this.clearFocusValueOnUpdate=!1,this.hasGroups=!1,this.initialTouchX=0,this.initialTouchY=0,this.instancePrefix="",this.openAfterFocus=!1,this.scrollToFocusedOptionOnUpdate=!1,this.controlRef=null,this.getControlRef=function(t){e.controlRef=t},this.focusedOptionRef=null,this.getFocusedOptionRef=function(t){e.focusedOptionRef=t},this.menuListRef=null,this.getMenuListRef=function(t){e.menuListRef=t},this.inputRef=null,this.getInputRef=function(t){e.inputRef=t},this.cacheComponents=function(t){e.components=Sn({components:t})},this.focus=this.focusInput,this.blur=this.blurInput,this.setValue=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",r=arguments[2],o=e.props,i=o.closeMenuOnSelect,a=o.isMulti,u=o.onChange;e.onInputChange("",{action:"set-value"}),i&&(e.inputIsHiddenAfterUpdate=!a,e.onMenuClose()),e.clearFocusValueOnUpdate=!0,u(t,{action:n,option:r})},this.selectOption=function(t){var n=e.props,r=n.blurInputOnSelect;if(n.isMulti){var o=e.state.selectValue;if(e.isOptionSelected(t,o)){var i=e.getOptionValue(t);e.setValue(o.filter(function(t){return e.getOptionValue(t)!==i}),"deselect-option",t),e.announceAriaLiveSelection({event:"deselect-option",context:{value:e.getOptionLabel(t)}})}else e.setValue([].concat(Ct(o),[t]),"select-option",t),e.announceAriaLiveSelection({event:"select-option",context:{value:e.getOptionLabel(t)}})}else e.setValue(t,"select-option"),e.announceAriaLiveSelection({event:"select-option",context:{value:e.getOptionLabel(t)}});r&&e.blurInput()},this.removeValue=function(t){var n=e.props.onChange,r=e.state.selectValue,o=e.getOptionValue(t);n(r.filter(function(t){return e.getOptionValue(t)!==o}),{action:"remove-value",removedValue:t}),e.announceAriaLiveSelection({event:"remove-value",context:{value:t?e.getOptionLabel(t):void 0}}),e.focusInput()},this.clearValue=function(){var t=e.props,n=t.isMulti;(0,t.onChange)(n?[]:null,{action:"clear"})},this.popValue=function(){var t=e.props.onChange,n=e.state.selectValue,r=n[n.length-1];e.announceAriaLiveSelection({event:"pop-value",context:{value:r?e.getOptionLabel(r):void 0}}),t(n.slice(0,n.length-1),{action:"pop-value",removedValue:r})},this.getOptionLabel=function(t){return e.props.getOptionLabel(t)},this.getOptionValue=function(t){return e.props.getOptionValue(t)},this.getStyles=function(t,n){var r=jn[t](n);r.boxSizing="border-box";var o=e.props.styles[t];return o?o(r,n):r},this.getElementId=function(t){return e.instancePrefix+"-"+t},this.getActiveDescendentId=function(){var t=e.props.menuIsOpen,n=e.state,r=n.menuOptions,o=n.focusedOption;if(o&&t){var i=r.focusable.indexOf(o),a=r.render[i];return a&&a.key}},this.announceAriaLiveSelection=function(t){var n=t.event,r=t.context;e.setState({ariaLiveSelection:function(e,t){var n=r.value;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option "+n+", deselected.";case"select-option":return"option "+n+", selected."}}(n)})},this.announceAriaLiveContext=function(t){var n=t.event,r=t.context;e.setState({ariaLiveContext:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSearchable,r=t.isMulti,o=t.label;switch(e){case"menu":return"Use Up and Down to choose options, press Backspace to select the currently focused option, press Escape to exit the menu, press Tab to select the option and exit the menu.";case"input":return(o||"Select")+" is focused "+(n?",type to refine list":"")+", press Down to open the menu, "+(r?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Enter to remove the currently focused value"}}(n,bt({},r,{label:e.props["aria-label"]}))})},this.onMenuMouseDown=function(t){0===t.button&&(t.stopPropagation(),t.preventDefault(),e.focusInput())},this.onMenuMouseMove=function(t){e.blockOptionHover=!1},this.onControlMouseDown=function(t){var n=e.props.openMenuOnClick;e.state.isFocused?e.props.menuIsOpen?e.onMenuClose():e.openMenu("first"):(n&&(e.openAfterFocus=!0),e.focusInput()),"INPUT"!==t.target.tagName&&t.preventDefault()},this.onDropdownIndicatorMouseDown=function(t){if(!(t&&"mousedown"===t.type&&0!==t.button||e.props.isDisabled)){var n=e.props,r=n.isMulti,o=n.menuIsOpen;e.focusInput(),o?(e.inputIsHiddenAfterUpdate=!r,e.onMenuClose()):e.openMenu("first"),t.preventDefault(),t.stopPropagation()}},this.onClearIndicatorMouseDown=function(t){t&&"mousedown"===t.type&&0!==t.button||(e.clearValue(),t.stopPropagation(),e.openAfterFocus=!1,setTimeout(function(){return e.focusInput()}))},this.onScroll=function(t){"boolean"==typeof e.props.closeMenuOnScroll?t.target instanceof HTMLElement&&St(t.target)&&e.props.onMenuClose():"function"==typeof e.props.closeMenuOnScroll&&e.props.closeMenuOnScroll(t)&&e.props.onMenuClose()},this.onCompositionStart=function(){e.setState({isComposing:!0})},this.onCompositionEnd=function(){e.setState({isComposing:!1})},this.onTouchStart=function(t){var n=Et(t.touches,1)[0];e.initialTouchX=n.clientX,e.initialTouchY=n.clientY,e.userIsDragging=!1},this.onTouchMove=function(t){var n=Et(t.touches,1)[0],r=Math.abs(n.clientX-e.initialTouchX),o=Math.abs(n.clientY-e.initialTouchY);e.userIsDragging=r>5||o>5},this.onTouchEnd=function(t){if(!e.userIsDragging){var n=t.target;e.controlRef&&!e.controlRef.contains(n)&&e.menuListRef&&!e.menuListRef.contains(n)&&e.blurInput(),e.initialTouchX=0,e.initialTouchY=0}},this.onControlTouchEnd=function(t){e.userIsDragging||e.onControlMouseDown(t)},this.onClearIndicatorTouchEnd=function(t){e.userIsDragging||e.onClearIndicatorMouseDown(t)},this.onDropdownIndicatorTouchEnd=function(t){e.userIsDragging||e.onDropdownIndicatorMouseDown(t)},this.handleInputChange=function(t){var n=t.currentTarget.value;e.inputIsHiddenAfterUpdate=!1,e.onInputChange(n,{action:"input-change"}),e.onMenuOpen()},this.onInputFocus=function(t){var n=e.props,r=n.isSearchable,o=n.isMulti;e.props.onFocus&&e.props.onFocus(t),e.inputIsHiddenAfterUpdate=!1,e.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:o}}),e.setState({isFocused:!0}),(e.openAfterFocus||e.props.openMenuOnFocus)&&e.openMenu("first"),e.openAfterFocus=!1},this.onInputBlur=function(t){e.props.onBlur&&e.props.onBlur(t),e.onInputChange("",{action:"input-blur"}),e.onMenuClose(),e.setState({focusedValue:null,isFocused:!1})},this.onOptionHover=function(t){e.blockOptionHover||e.state.focusedOption===t||e.setState({focusedOption:t})},this.shouldHideSelectedOptions=function(){var t=e.props,n=t.hideSelectedOptions,r=t.isMulti;return void 0===n?r:n},this.onKeyDown=function(t){var n=e.props,r=n.isMulti,o=n.backspaceRemovesValue,i=n.escapeClearsValue,a=n.inputValue,u=n.isClearable,s=n.isDisabled,l=n.menuIsOpen,c=n.onKeyDown,f=n.tabSelectsValue,p=n.openMenuOnFocus,d=e.state,h=d.isComposing,m=d.focusedOption,g=d.focusedValue,v=d.selectValue;if(!(s||"function"==typeof c&&(c(t),t.defaultPrevented))){switch(e.blockOptionHover=!0,t.key){case"ArrowLeft":if(!r||a)return;e.focusValue("previous");break;case"ArrowRight":if(!r||a)return;e.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(g)e.removeValue(g);else{if(!o)return;e.popValue()}break;case"Tab":if(t.shiftKey||!l||!f||!m||p&&e.isOptionSelected(m,v))return;e.selectOption(m);break;case"Enter":if(l){if(!m)return;if(h)return;e.selectOption(m)}else e.focusOption("first");break;case"Escape":l?(e.inputIsHiddenAfterUpdate=!1,e.onInputChange("",{action:"menu-close"}),e.onMenuClose()):u&&i&&e.clearValue();break;case" ":if(a)return;if(!l){e.openMenu("first");break}if(!m)return;e.selectOption(m);break;case"ArrowUp":l?e.focusOption("up"):e.openMenu("last");break;case"ArrowDown":l?e.focusOption("down"):e.openMenu("first");break;case"PageUp":if(!l)return;e.focusOption("pageup");break;case"PageDown":if(!l)return;e.focusOption("pagedown");break;case"Home":if(!l)return;e.focusOption("first");break;case"End":if(!l)return;e.focusOption("last");break;default:return}t.preventDefault()}}},Fn=function(e){var t,n;return n=t=function(t){function n(){var e,t,r;mt(this,n);for(var o=arguments.length,i=Array(o),a=0;a1?n-1:0),o=1;o0?wp.element.createElement(qn,{id:t,name:n,value:this.filterValues(r),options:o.options,delimiter:o.valueDelimiter,onChange:this.handleChange,className:"cf-multiselect__select",classNamePrefix:"cf-multiselect",isMulti:!0}):wp.element.createElement(Yn,null)}}]),t}(P.Component),Gn=n(105),Xn=n.n(Gn),Kn=(n(268),function(e){function t(){var e;return O()(this,t),(e=j()(this,D()(t).apply(this,arguments))).state={width:0,height:0},e.renderIframe=e.renderIframe.bind(F()(F()(e))),e.checkMessageForResize=e.checkMessageForResize.bind(F()(F()(e))),e}return M()(t,e),k()(t,[{key:"isFrameAccessible",value:function(){try{return!!this.iframe.contentDocument.body}catch(e){return!1}}},{key:"componentDidMount",value:function(){window.addEventListener("message",this.checkMessageForResize,!1),this.renderIframe()}},{key:"componentDidUpdate",value:function(){this.renderIframe()}},{key:"checkMessageForResize",value:function(e){var t=this.iframe,n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}if(t&&t.contentWindow===e.source){var r=n,o=r.action,i=r.width,a=r.height,u=this.state,s=u.width,l=u.height;"resize"!==o||s===i&&l===a||this.setState({width:i,height:a})}}},{key:"render",value:function(){var e=this;return wp.element.createElement("div",{className:"cf-oembed__preview"},wp.element.createElement("iframe",{ref:function(t){return e.iframe=t},scrolling:"no",className:"cf-oembed__frame",onLoad:this.renderIframe,width:Math.ceil(this.state.width),height:Math.ceil(this.state.height)}))}},{key:"renderIframe",value:function(){if(this.isFrameAccessible()&&null===this.iframe.contentDocument.body.getAttribute("data-resizable-iframe-connected")){var e="video"===this.props.type?"clientBoundingRect.width / 16 * 9":"clientBoundingRect.height",t="\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: ".concat(e,"\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\n\t\t\t\tfunction removeViewportStyles( ruleOrNode ) {\n\t\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {\n\t\t\t\t\t\tif ( /^\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {\n\t\t\t\t\t\t\truleOrNode.style[ style ] = '';\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\t\t\t\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\t\t\t\tsendResize();\n\t\t} )();"),n=wp.element.createElement("html",{lang:document.documentElement.lang},wp.element.createElement("head",null,wp.element.createElement("style",{dangerouslySetInnerHTML:{__html:"\n\t\t\tbody { margin: 0; }\n\n\t\t\tbody > div { max-width: 600px; }\n\n\t\t\tbody.Kickstarter > div,\n\t\t\tbody.video > div { position: relative; height: 0; padding-bottom: 56.25%; }\n\t\t\tbody.Kickstarter > div > iframe,\n\t\t\tbody.video > div > iframe { position: absolute; width: 100%; height: 100%; top: 0; left: 0; }\n\n\t\t\tbody > div > * { margin: 0 !important;/* has to have !important to override inline styles */ max-width: 100%; }\n\n\t\t\tbody.Flickr > div > a { display: block; }\n\t\t\tbody.Flickr > div > a > img { width: 100%; height: auto; }\n\t\t"}})),wp.element.createElement("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:this.props.type+" "+this.props.provider},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.html}}),wp.element.createElement("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:t}})));this.iframe.contentWindow.document.open(),this.iframe.contentWindow.document.write(""+Object(P.renderToString)(n)),this.iframe.contentWindow.document.close()}}}]),t}(P.Component)),Jn=function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0&&(clearInterval(n),e.handleSearch(t))},100)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.name,r=e.value,o=e.embedCode,i=e.embedType,a=e.provider;return wp.element.createElement("div",{ref:this.node},wp.element.createElement(re,{id:t,value:r,onChange:this.handleChange}),o?wp.element.createElement(Kn,{html:o,type:i,provider:a}):null,wp.element.createElement("input",{type:"hidden",name:n,value:r,readOnly:!0}))}}]),t}(P.Component),Qn=Object(E.withState)({embedCode:"",embedType:"",provider:"",error:"",isLoading:!1}),Zn=Object(Y.withEffects)(function(e){var t=e.useEvent("fetchEmbedCode"),n=W()(t,2),r=n[0],o=n[1],i=Object(X.pipe)(K({onFetchEmbedCode:o}),Object(X.map)(Y.toProps)),a=Object(X.pipe)(r,Object(X.map)(function(e){return{type:"FETCH_EMBED_CODE",payload:e}}));return Object(X.merge)(i,a)},{handler:function(e){return function(t){var n=t.payload;switch(t.type){case"FETCH_EMBED_CODE":var r=Xn.a.get(window.wpApiSettings.root+"oembed/1.0/proxy",{url:n,_wpnonce:window.wpApiSettings.nonce});r.done(function(t){e.setState({embedCode:t.html,embedType:t.type,provider:t.provider_name,isLoading:!1})}),r.fail(function(){alert(Object(i.__)("An error occurred while trying to fetch oembed preview.","carbon-fields-ui")),e.setState({error:Object(i.__)("Not Found","carbon-fields-ui"),isLoading:!1})})}}}}),er=Object(E.compose)(Qn,Zn)(Jn),tr=(n(269),function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0?this.renderOptions():wp.element.createElement(Yn,null)}}]),t}(P.Component)),nr=(n(270),He(function(e){return f()({},e,{field:f()({},e.field,{options:e.field.options.map(function(e){return f()({},e,{label:wp.element.createElement("img",{className:"cf-radio-image__image",src:e.label})})})})})})(tr)),rr=function(e){function t(){var e;return O()(this,t),e=j()(this,D()(t).call(this)),l()(F()(F()(e)),"handleChange",function(t){var n=e.props,r=n.id;(0,n.onChange)(r,Object(p.isString)(t)?t:t.target.value)}),l()(F()(F()(e)),"initEditor",function(){var t=e.props,n=t.id,r=t.field;if(r.rich_editing){var o=f()({},window.tinyMCEPreInit.mceInit[r.settings_reference],{selector:"#".concat(n),setup:function(t){e.editor=t,t.on("blur Change",function(){t.save(),e.handleChange(t.getContent())})}});window.tinymce.init(o)}var i=f()({},window.tinyMCEPreInit.qtInit[r.settings_reference]);if(i){var a=window.quicktags(f()({},i,{id:n}));window.QTags._buttonsInit(a.id)}}),e.node=Object(P.createRef)(),e.editor=null,e}return M()(t,e),k()(t,[{key:"componentDidMount",value:function(){var e=this;this.props.visible&&(this.timer=setTimeout(this.initEditor,250),this.cancelObserver=Xe()(this.node.current,Object(p.debounce)(function(){if(e.editor){var t=window.wpActiveEditor;e.editor.execCommand("wpAutoResize"),window.wpActiveEditor=t}},100)))}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timer),void 0!==this.cancelObserver&&this.cancelObserver(),this.destroyEditor()}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.name,r=e.value,o=e.field,a=["carbon-wysiwyg","wp-editor-wrap",{"tmce-active":o.rich_editing},{"html-active":!o.rich_editing}],u=o.media_buttons?Object(p.template)(o.media_buttons)({id:t}):null,s=o.rich_editing&&window.tinyMCEPreInit.qtInit[o.settings_reference];return wp.element.createElement("div",{id:"wp-".concat(t,"-wrap"),className:G()(a),ref:this.node},o.media_buttons&&wp.element.createElement("div",{id:"wp-".concat(t,"-media-buttons"),className:"hide-if-no-js wp-media-buttons"},wp.element.createElement("span",{dangerouslySetInnerHTML:{__html:u}})),s&&wp.element.createElement("div",{className:"wp-editor-tabs"},wp.element.createElement("button",{type:"button",id:"".concat(t,"-tmce"),className:"wp-switch-editor switch-tmce","data-wp-editor-id":t},Object(i.__)("Visual","carbon-fields-ui")),wp.element.createElement("button",{type:"button",id:"".concat(t,"-html"),className:"wp-switch-editor switch-html","data-wp-editor-id":t},Object(i.__)("Text","carbon-fields-ui"))),wp.element.createElement("div",{id:"wp-".concat(t,"-editor-container"),className:"wp-editor-container"},wp.element.createElement("textarea",Q()({style:{width:"100%"},className:"regular-text",id:t,name:n,value:r,onChange:this.handleChange},o.attributes))))}},{key:"destroyEditor",value:function(){this.editor&&(this.editor.remove(),this.node=null,this.editor=null),delete window.QTags.instances[this.props.id]}}]),t}(P.Component),or=(n(271),function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0?wp.element.createElement("select",{id:t,name:n,value:i,className:"cf-select__input",onChange:this.handleChange},r.options.map(function(e){return wp.element.createElement("option",{key:e.value,value:e.value},e.label)})):wp.element.createElement(Yn,null)}}]),t}(P.Component)),ir=(n(272),function(e){function t(){return O()(this,t),j()(this,D()(t).apply(this,arguments))}return M()(t,e),k()(t,[{key:"render",value:function(){return wp.element.createElement("h3",null,this.props.field.label)}}]),t}(P.Component)),ar=(n(273),function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i-1}),n}return M()(t,e),k()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.id,r=t.name,o=t.value,i=t.field;return i.options.length>0?wp.element.createElement("ul",{className:"cf-set__list"},i.options.map(function(t,a){return wp.element.createElement("li",{className:"cf-set__list-item",key:a},wp.element.createElement("input",Q()({type:"checkbox",id:"".concat(n,"-").concat(t.value),name:"".concat(r,"[]"),checked:e.isChecked(o,t),value:t.value,className:"cf-set__input",onChange:e.handleChange},i.attributes)),wp.element.createElement("label",{className:"cf-set__label",htmlFor:"".concat(n,"-").concat(t.value)},t.label))})):wp.element.createElement(Yn,null)}}]),t}(P.Component)),ur=function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i":return e>n;case"<":return e=":return e>=n;case"<=":return e<=n;case"IN":return Object(p.some)(n,function(t){return t==e});case"NOT IN":return Object(p.every)(n,function(t){return t!=e});case"INCLUDES":return Object(p.every)(Object(p.castArray)(n),function(t){return e.indexOf(t)>-1});case"EXCLUDES":return Object(p.every)(Object(p.castArray)(n),function(t){return-1===e.indexOf(t)})}return!1}(u[t.field],t.compare,t.value);return e.concat(n)},[]),l=!1;switch(o){case"AND":l=Object(p.every)(s);break;case"OR":l=Object(p.some)(s)}l?e.showField(e.id):e.hideField(e.id)}}}return Object(E.createHigherOrderComponent)(function(e){return Object(E.compose)(Object(u.withDispatch)(function(e){var t=e("carbon-fields/core");return{showField:t.showField,hideField:t.hideField}}),Object(u.withSelect)(function(e,t){return{visible:e("carbon-fields/core").isFieldVisible(t.id)}}),Object(Y.withEffects)(n,{handler:r}))(e)},"withConditionalLogic")}var Or=n(106),_r=n.n(Or),kr="Uint8ArdomValuesObj012345679BCDEFGHIJKLMNPQRSTWXYZ_cfghkpqvwxyz";function Sr(){return"cf-".concat(_r()(kr,21))}function jr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0;l--)if(c[l]!==f[l])return!1;for(l=c.length-1;l>=0;l--)if(!b(e[s=c[l]],t[s],n,r))return!1;return!0}(e,t,n,a))}return n?e===t:e==t}function y(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function x(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&g(o,n,"Missing expected exception"+r);var a="string"==typeof r,u=!e&&o&&!n;if((!e&&i.isError(o)&&a&&w(o,n)||u)&&g(o,n,"Got unwanted exception"+r),e&&o&&n&&!w(o,n)||!e&&o)throw o}f.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=h(m(this.actual),128)+" "+this.operator+" "+h(m(this.expected),128),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,o=d(t),i=r.indexOf("\n"+o);if(i>=0){var a=r.indexOf("\n",i+1);r=r.substring(a+1)}this.stack=r}}},i.inherits(f.AssertionError,Error),f.fail=g,f.ok=v,f.equal=function(e,t,n){e!=t&&g(e,t,n,"==",f.equal)},f.notEqual=function(e,t,n){e==t&&g(e,t,n,"!=",f.notEqual)},f.deepEqual=function(e,t,n){b(e,t,!1)||g(e,t,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,n){b(e,t,!0)||g(e,t,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,n){b(e,t,!1)&&g(e,t,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,n,r){b(t,n,!0)&&g(t,n,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,n){e!==t&&g(e,t,n,"===",f.strictEqual)},f.notStrictEqual=function(e,t,n){e===t&&g(e,t,n,"!==",f.notStrictEqual)},f.throws=function(e,t,n){x(!0,e,t,n)},f.doesNotThrow=function(e,t,n){x(!1,e,t,n)},f.ifError=function(e){if(e)throw e};var E=Object.keys||function(e){var t=[];for(var n in e)a.call(e,n)&&t.push(n);return t}}).call(this,n(31))},function(e,t,n){(function(e,r){var o=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],n=0;n=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),s=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),c(r,e,r.depth)}function s(e,t){var n=u.styles[t];return n?"["+u.colors[n][0]+"m"+e+"["+u.colors[n][1]+"m":e}function l(e,t){return e}function c(e,n,r){if(e.customInspect&&n&&C(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return v(o)||(o=c(e,o,r)),o}var i=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(v(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return g(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,n);if(i)return i;var a=Object.keys(n),u=function(e){var t={};return a.forEach(function(e,n){t[e]=!0}),t}();if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),E(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(C(n)){var s=n.name?": "+n.name:"";return e.stylize("[Function"+s+"]","special")}if(y(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(x(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return f(n)}var l,w="",O=!1,_=["{","}"];return d(n)&&(O=!0,_=["[","]"]),C(n)&&(w=" [Function"+(n.name?": "+n.name:"")+"]"),y(n)&&(w=" "+RegExp.prototype.toString.call(n)),x(n)&&(w=" "+Date.prototype.toUTCString.call(n)),E(n)&&(w=" "+f(n)),0!==a.length||O&&0!=n.length?r<0?y(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),l=O?function(e,t,n,r,o){for(var i=[],a=0,u=t.length;a60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(l,w,_)):_[0]+w+_[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,o,i){var a,u,s;if((s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?u=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(u=e.stylize("[Setter]","special")),S(r,o)||(a="["+o+"]"),u||(e.seen.indexOf(s.value)<0?(u=m(n)?c(e,s.value,null):c(e,s.value,n-1)).indexOf("\n")>-1&&(u=i?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n")):u=e.stylize("[Circular]","special")),b(a)){if(i&&o.match(/^\d+$/))return u;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function d(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function b(e){return void 0===e}function y(e){return w(e)&&"[object RegExp]"===O(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===O(e)}function E(e){return w(e)&&("[object Error]"===O(e)||e instanceof Error)}function C(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function _(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(b(i)&&(i=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!a[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){var n=r.pid;a[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else a[e]=function(){};return a[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=h,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=y,t.isObject=w,t.isDate=x,t.isError=E,t.isFunction=C,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(255);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(n=[_((e=new Date).getHours()),_(e.getMinutes()),_(e.getSeconds())].join(":"),[e.getDate(),k[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(256),t._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,n(31),n(94))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){e.exports=function(e){return!(!e||"object"!=typeof e)&&("object"==typeof window&&"object"==typeof window.Node?e instanceof window.Node:"number"==typeof e.nodeType&&"string"==typeof e.nodeName)}},function(e,t,n){},function(e,t,n){},function(e,t,n){(function(t){(function(){var n,r,o,i,a,u;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,i=(n=function(){var e;return 1e9*(e=r())[0]+e[1]})(),u=1e9*t.uptime(),a=i-u):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(this,n(94))},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}t.default=e}(n(21));var r=u(n(262)),o=u(n(265)),i=u(n(1)),a=u(n(95));function u(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,["children","in"]),a=r.default.Children.toArray(t),u=a[0],s=a[1];return delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,r.default.createElement(i.default,o,n?r.default.cloneElement(u,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.default.cloneElement(s,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},a}(r.default.Component);u.propTypes={};var s=u;t.default=s,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.getChildMapping=o,t.mergeChildMappings=i,t.getInitialChildMapping=function(e,t){return o(e.children,function(n){return(0,r.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:a(n,"appear",e),enter:a(n,"enter",e),exit:a(n,"exit",e)})})},t.getNextChildMapping=function(e,t,n){var u=o(e.children),s=i(t,u);return Object.keys(s).forEach(function(o){var i=s[o];if((0,r.isValidElement)(i)){var l=o in t,c=o in u,f=t[o],p=(0,r.isValidElement)(f)&&!f.props.in;!c||l&&!p?c||!l||p?c&&l&&(0,r.isValidElement)(f)&&(s[o]=(0,r.cloneElement)(i,{onExited:n.bind(null,i),in:f.props.in,exit:a(i,"exit",e),enter:a(i,"enter",e)})):s[o]=(0,r.cloneElement)(i,{in:!1}):s[o]=(0,r.cloneElement)(i,{onExited:n.bind(null,i),in:!0,exit:a(i,"exit",e),enter:a(i,"enter",e)})}}),s};var r=n(1);function o(e,t){var n=Object.create(null);return e&&r.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&(0,r.isValidElement)(e)?t(e):e}(e)}),n}function i(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),i=[];for(var a in e)a in t?i.length&&(o[a]=i,i=[]):i.push(a);var u={};for(var s in t){if(o[s])for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"MARK_AS_VALID":return Object(p.omit)(e,[t.payload.fieldId]);case"MARK_AS_INVALID":var n=t.payload,r=n.fieldId,o=n.error;return f()({},e,l()({},r,o));default:return e}},hiddenFields:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_FIELD":return-1===e.indexOf(t.payload.fieldId)?e:Object(p.without)(e,t.payload.fieldId);case"HIDE_FIELD":return e.indexOf(t.payload.fieldId)>-1?e:e.concat(t.payload.fieldId);default:return e}}});function h(e){return{type:"MARK_AS_VALID",payload:{fieldId:e}}}function m(e,t){return{type:"MARK_AS_INVALID",payload:{fieldId:e,error:t}}}function g(e){return{type:"SHOW_FIELD",payload:{fieldId:e}}}function v(e){return{type:"HIDE_FIELD",payload:{fieldId:e}}}function b(e,t){return e.validation[t]||null}function y(e,t){return-1===e.hiddenFields.indexOf(t)}Object(u.registerStore)("carbon-fields/core",{reducer:d,actions:r,selectors:o});var w=n(16),x=n.n(w),E=n(14),C=n(6),O=n.n(C),_=n(7),k=n.n(_),S=n(8),j=n.n(S),A=n(9),D=n.n(A),T=n(10),M=n.n(T),N=n(0),F=n.n(N),P=n(3),I=16;function L(e){return Object(E.createHigherOrderComponent)(function(t){return function(n){function r(n){var o;return O()(this,r),(o=j()(this,D()(r).call(this,n))).onHooksUpdated=o.onHooksUpdated.bind(F()(F()(o))),o.Component=Object(a.applyFilters)(e,t),o.namespace=Object(p.uniqueId)("core/with-filters/component-"),o.throttledForceUpdate=Object(p.debounce)(function(){o.Component=Object(a.applyFilters)(e,t),o.forceUpdate()},I),Object(a.addAction)("hookRemoved",o.namespace,o.onHooksUpdated),Object(a.addAction)("hookAdded",o.namespace,o.onHooksUpdated),o}return M()(r,n),k()(r,[{key:"componentWillUnmount",value:function(){this.throttledForceUpdate.cancel(),Object(a.removeAction)("hookRemoved",this.namespace),Object(a.removeAction)("hookAdded",this.namespace)}},{key:"onHooksUpdated",value:function(t){t===e&&this.throttledForceUpdate()}},{key:"render",value:function(){return wp.element.createElement(this.Component,this.props)}}]),r}(P.Component)},"withFilters")}function R(e,t){var n,r=Object(p.startCase)(e),o={};return n={},l()(n,"register".concat(r,"Type"),function(n,u){return Object(p.isString)(n)?o[n]?(console.error(Object(i.sprintf)(Object(i.__)("%1$s %2$s is already registered.","carbon-fields-ui"),r,n)),!1):u&&Object(p.isFunction)(u)?(o[n]=t.reduce(function(t,r){return f()({},t,l()({},r,Object(a.applyFilters)("carbon-fields.register-".concat(e,"-type"),n,r,u)))},{}),!0):(console.error(Object(i.__)('The "component" param must be a function.',"carbon-fields-ui")),!1):(console.error(Object(i.sprintf)(Object(i.__)("%1$s type must be a string.","carbon-fields-ui"),r)),!1)}),l()(n,"get".concat(r,"Type"),function(e,n){if(t.includes(n)){if(o[e])return o[e][n];console.error(Object(i.sprintf)(Object(i.__)("%s %s isn't registered.","carbon-fields-ui"),r,e))}else console.error(Object(i.sprintf)(Object(i.__)("The provided context isn't a valid one. Must be one of - %s .","carbon-fields-ui"),t.join(", ")))}),n}var H=R("field",["metabox","block"]),B=H.registerFieldType,V=H.getFieldType,U=n(17),W=n.n(U),z=n(32),q=n.n(z),Y=n(18),$=n(20),G=n.n($),X=n(11),K=function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:null;return new Promise(function(r,o){var a=window.jQuery.ajax({url:e,type:t,data:n});a.done(function(e){r(e)}),a.fail(function(){o(Object(i.__)("An error occured.","carbon-fields-ui"))})})},ae=function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),a=0;a0&&a.length>=r.max?alert(Object(i.sprintf)(Object(i.__)("Maximum number of items reached (%s items)","carbon-fields-ui"),Number(r.max))):(u(o,x()(a).concat([Object(p.pick)(e,"id","type","subtype")])),s({selectedOptions:x()(l).concat([e])})))}),l()(F()(F()(n)),"handleRemoveItem",function(e){var t=n.props,r=t.value,o=t.id,i=t.onChange,a=t.setState,u=t.selectedOptions;i(o,Object(p.without)(r,e)),a({selectedOptions:Object(p.without)(u,e)})}),l()(F()(F()(n)),"handleSort",function(e){var t=n.props,r=t.id;(0,t.onChange)(r,e)}),n}return M()(t,e),k()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.fetchSelectedOptions,n=e.field,r=e.value;(0,e.setState)({options:n.options.options,totalOptionsCount:n.options.total_options}),r.length&&t(),this.sourceList.current.addEventListener("scroll",this.handleSourceListScroll)}},{key:"componentWillUnmount",value:function(){this.sourceList.current.removeEventListener("scroll",this.handleSourceListScroll)}},{key:"render",value:function(){var e=this,t=this.props,n=t.name,r=t.value,o=t.field,a=t.totalOptionsCount,u=t.selectedOptions,s=t.queryTerm,l=t.isLoading,c=this.props.options;return o.duplicates_allowed||(c=q()(c,function(e){e.map(function(e){return e.disabled=!!Object(p.find)(r,function(t){return Object(p.isMatch)(t,{id:e.id,type:e.type,subtype:e.subtype})}),e})})),wp.element.createElement(P.Fragment,null,wp.element.createElement("div",{className:"cf-association__bar"},wp.element.createElement(re,{value:s,onChange:this.handleSearchChange}),l?wp.element.createElement("span",{className:"cf-association__spinner spinner is-active"}):"",wp.element.createElement("span",{className:"cf-association__counter"},Object(i.sprintf)(Object(i.__)("Showing %1$d of %2$d results","carbon-fields-ui"),Number(c.length),Number(a)))),wp.element.createElement("div",{className:"cf-association__cols"},wp.element.createElement("div",{className:"cf-association__col",ref:this.sourceList},c.map(function(t,n){return wp.element.createElement("div",{className:G()("cf-association__option",{"cf-association__option--selected":t.disabled}),key:n},t.thumbnail&&wp.element.createElement("img",{className:"cf-association__option-thumb",src:t.thumbnail}),wp.element.createElement("div",{className:"cf-association__option-content"},wp.element.createElement("span",{className:"cf-association__option-title"},wp.element.createElement("span",{className:"cf-association__option-title-inner"},t.title)),wp.element.createElement("span",{className:"cf-association__option-type"},t.type)),wp.element.createElement("div",{className:"cf-association__option-actions"},t.edit_link&&wp.element.createElement("a",{className:"cf-association__option-action cf-association__option-action--edit dashicons dashicons-edit",href:t.edit_link.replace("&","&","g"),target:"_blank",rel:"noopener noreferrer"}),!t.disabled&&(o.max<0||r.length0&&t.length=0||(o[n]=e[n]);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["excludeScrollbar"]));return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(de.createElement)(e,n)},i}(de.Component),n.displayName="OnClickOutside("+(e.displayName||e.name||"Component")+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r},ke=_e(function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i1?n.setState(function(e){return{menuVisible:!e.menuVisible}}):r(t[0])}),l()(F()(F()(n)),"handleItemClick",function(e){n.setState({menuVisible:!1}),n.props.onSelect(e)}),n}return M()(t,e),k()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.buttonText,r=t.groups;return wp.element.createElement("div",{className:"cf-complex__inserter"},wp.element.createElement("button",{type:"button",className:"button cf-complex__inserter-button",onClick:this.handleAddClick},n),r.length>1&&wp.element.createElement("ul",{className:"cf-complex__inserter-menu",hidden:!this.state.menuVisible},r.map(function(t,n){return wp.element.createElement("li",{className:"cf-complex__inserter-item",key:n,onClick:function(){return e.handleItemClick(t)}},t.label)})))}}]),t}(P.Component)),Pe=function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0?u-1:1;n.setState({currentTab:Object(p.get)(r,"".concat(s,".").concat(o),null)})}i(a)}),l()(F()(F()(n)),"handleToggleAllClick",function(){var e=n.props,t=e.allGroupsAreCollapsed;(0,e.onToggleAllGroups)(!t)}),l()(F()(F()(n)),"handleGroupsSortStart",function(e,t){var r=n.props,o=r.value,i=r.groupIdKey,a=t.item.index(),u=Object(p.get)(o,"".concat(a,".").concat(i),null);n.setState({currentDraggedGroup:u})}),l()(F()(F()(n)),"handleGroupsSortUpdate",function(e){var t=n.props,r=t.id;(0,t.onChange)(r,e)}),l()(F()(F()(n)),"handleGroupsSortStop",function(){n.setState({currentDraggedGroup:null})}),l()(F()(F()(n)),"handleTabsChange",function(e){n.setState({currentTab:e})}),n}return M()(t,e),k()(t,[{key:"findGroup",value:function(e){var t=this.props,n=t.value,r=t.groupIdKey;return Object(p.find)(n,[r,e])}},{key:"getAvailableGroups",value:function(e){var t=this.props,n=t.field,r=t.value;if(n.duplicate_groups_allowed)return n.groups;var o=r.map(function(t){return t[e]});return n.groups.filter(function(e){var t=e.name;return-1===o.indexOf(t)})}},{key:"getGroupLabels",value:function(){var e=this.props,t=e.field;return e.groupValues.map(function(e,n){var r=W()(e,2),o=r[0],a=r[1],u=Object(p.find)(t.groups,["name",o]);if(!u)return"N/A";if(!Object(p.isString)(u.label_template))return u.label;try{return Object(p.template)(u.label_template)(f()({$_index:n},a))||u.label}catch(e){return console.error(Object(i.sprintf)(Object(i.__)("Couldn't create the label of group - %s","carbon-fields-ui"),e.message)),"N/A"}})}},{key:"render",value:function(){var e=this,t=this.state,n=t.currentDraggedGroup,r=t.currentTab,o=this.props,a=o.value,u=o.field,s=o.groupIdKey,l=o.groupFilterKey,c=o.allGroupsAreCollapsed,f=o.onGroupSetup,p=o.onGroupFieldSetup,d=o.onToggleGroup,h=this.getAvailableGroups(l),m=this.getGroupLabels(),g=a.map(function(e,t){return{id:e[s],label:m[t]}});return wp.element.createElement(P.Fragment,null,this.isTabbed&&!!a.length&&wp.element.createElement(oe,{items:a,forwardedRef:this.tabsList,options:{axis:"tabbed-vertical"===u.layout?"y":"x",forcePlaceholderSize:!0},onUpdate:this.handleGroupsSortUpdate},wp.element.createElement(Ne,{ref:this.tabsList,items:g,current:r,layout:u.layout,onChange:this.handleTabsChange},!!h.length&&!this.isMaximumReached&&wp.element.createElement(Fe,{buttonText:"+",groups:h,onSelect:this.handleAddGroup}))),!a.length&&wp.element.createElement(Ie,{label:Object(i.__)("There are no entries yet.","carbon-fields-ui")},wp.element.createElement(Fe,{buttonText:this.inserterButtonText,groups:h,onSelect:this.handleAddGroup})),!!a.length&&wp.element.createElement(oe,{items:a,options:{helper:"clone",handle:".cf-complex__group-head",placeholder:"cf-complex__group-placeholder",forceHelperSize:!0,forcePlaceholderSize:!0},forwardedRef:this.groupsList,onStart:this.handleGroupsSortStart,onUpdate:this.handleGroupsSortUpdate,onStop:this.handleGroupsSortStop},wp.element.createElement("div",{className:"cf-complex__groups",ref:this.groupsList},a.map(function(t,o){return wp.element.createElement(Pe,Q()({key:"".concat(t[l],"-").concat(o)},f(t,{index:o,label:m[o],dragged:t[s]===n,tabbed:e.isTabbed,hidden:e.isTabbed&&t[s]!==r,allowClone:u.duplicate_groups_allowed&&!e.isMaximumReached,onFieldSetup:p,onClone:e.handleCloneGroup,onRemove:e.handleRemoveGroup,onToggle:d})))}))),!this.isTabbed&&!!a.length&&wp.element.createElement("div",{className:"cf-complex__actions"},!!h.length&&!this.isMaximumReached&&wp.element.createElement(Fe,{buttonText:this.inserterButtonText,groups:h,onSelect:this.handleAddGroup}),wp.element.createElement("button",{type:"button",className:"button cf-complex__toggler",onClick:this.handleToggleAllClick},c?Object(i.__)("Expand All","carbon-fields-ui"):Object(i.__)("Collapse All","carbon-fields-ui"))))}},{key:"isTabbed",get:function(){return this.props.field.layout.indexOf("tabbed")>-1}},{key:"isMaximumReached",get:function(){var e=this.props,t=e.field,n=e.value;return t.max>0&&n.length>=t.max}},{key:"inserterButtonText",get:function(){var e=this.props.field;return Object(i.sprintf)(Object(i.__)("Add %s","carbon-fields-ui"),e.labels.singular_name)}}]),t}(P.Component);Object(a.addFilter)("carbon-fields.field-wrapper","carbon-fields/core",function(e){return function(t){var n=t.field;return"complex"!==n.type?wp.element.createElement(e,t):wp.element.createElement(e,Q()({className:"cf-complex--".concat(n.layout)},t))}}),Object(a.addFilter)("carbon-fields.complex.validate","carbon-fields/core",function(e,t){var n=e.min,r=e.labels;if(e.required&&Object(p.isEmpty)(t))return Object(i.__)("This field is required.","carbon-fields-ui");if(n>0&&t.length=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},xt=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},Et=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Ct=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t-1}function jt(e){return St(e)?window.pageYOffset:e.scrollTop}function At(e,t){St(e)?window.scrollTo(0,t):e.scrollTop=t}function Dt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ot,o=jt(e),i=t-o,a=0;!function t(){var u,s=i*((u=(u=a+=10)/n-1)*u*u+1)+o;At(e,s),a=d)return{placement:"bottom",maxHeight:t};if(C>=d&&!a)return i&&Dt(s,O,160),{placement:"bottom",maxHeight:t};if(!a&&C>=r||a&&x>=r)return i&&Dt(s,O,160),{placement:"bottom",maxHeight:a?x-b:C-b};if("auto"===o||a){var k=t;return(!a&&E>=r||a&&w>=r)&&(k=a?w-b-u.controlHeight:E-b-u.controlHeight),{placement:"top",maxHeight:k}}if("bottom"===o)return At(s,O),{placement:"bottom",maxHeight:t};break;case"top":if(w>=d)return{placement:"top",maxHeight:t};if(E>=d&&!a)return i&&Dt(s,_,160),{placement:"top",maxHeight:t};if(!a&&E>=r||a&&w>=r){var S=t;return(!a&&E>=r||a&&w>=r)&&(S=a?w-y:E-y),i&&Dt(s,_,160),{placement:"top",maxHeight:S}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'+o+'".')}return l}({maxHeight:o,menuEl:e,minHeight:n,placement:i,shouldScroll:u&&!c,isFixedPosition:c,theme:s});l&&l(f),r.setState(f)}},r.getUpdatedProps=function(){var e=r.props.menuPlacement,t=r.state.placement||Mt(e);return bt({},r.props,{placement:t,maxHeight:r.state.maxHeight})},xt(r,n)}return yt(t,e),gt(t,[{key:"render",value:function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),t}(de.Component);Nt.contextTypes={getPortalPlacement:st.a.func};var Ft=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:2*n+"px "+3*n+"px",textAlign:"center"}},Pt=Ft,It=Ft,Lt=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return he.a.createElement("div",bt({className:r(Object(at.a)(o("noOptionsMessage",e)),{"menu-notice":!0,"menu-notice--no-options":!0},n)},i),t)};Lt.defaultProps={children:"No options"};var Rt=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return he.a.createElement("div",bt({className:r(Object(at.a)(o("loadingMessage",e)),{"menu-notice":!0,"menu-notice--loading":!0},n)},i),t)};Rt.defaultProps={children:"Loading..."};var Ht=function(e){function t(){var e,n,r;mt(this,t);for(var o=arguments.length,i=Array(o),a=0;a0,h=c-f-l,m=!1;h>t&&r.isBottom&&(i&&i(e),r.isBottom=!1),d&&r.isTop&&(u&&u(e),r.isTop=!1),d&&t>h?(o&&!r.isBottom&&o(e),p.scrollTop=c,m=!0,r.isBottom=!0):!d&&-t>l&&(a&&!r.isTop&&a(e),p.scrollTop=0,m=!0,r.isTop=!0),m&&r.cancelScroll(e)},r.onWheel=function(e){r.handleEventDelta(e,e.deltaY)},r.onTouchStart=function(e){r.touchStart=e.changedTouches[0].clientY},r.onTouchMove=function(e){var t=r.touchStart-e.changedTouches[0].clientY;r.handleEventDelta(e,t)},r.getScrollTarget=function(e){r.scrollTarget=e},xt(r,n)}return yt(t,e),gt(t,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(e){e.scrollHeight<=e.clientHeight||("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1))}},{key:"stopListening",value:function(e){e.scrollHeight<=e.clientHeight||("function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return he.a.createElement(Kt,{innerRef:this.getScrollTarget},this.props.children)}}]),t}(de.Component),ln=function(e){function t(){return mt(this,t),xt(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return yt(t,e),gt(t,[{key:"render",value:function(){var e=this.props,t=e.isEnabled,n=wt(e,["isEnabled"]);return t?he.a.createElement(sn,n):this.props.children}}]),t}(de.Component);ln.defaultProps={isEnabled:!0};var cn=function(e){function t(){return mt(this,t),xt(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return yt(t,e),gt(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.cx,o=e.isMulti,i=e.getStyles,a=e.hasValue;return he.a.createElement("div",{className:r(Object(at.a)(i("valueContainer",this.props)),{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":a},n)},t)}}]),t}(de.Component),fn=function(e){var t=e.size,n=wt(e,["size"]);return he.a.createElement("svg",bt({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:Object(at.a)({display:"inline-block",fill:"currentColor",lineHeight:1,stroke:"currentColor",strokeWidth:0})},n))},pn=function(e){return he.a.createElement(fn,bt({size:20},e),he.a.createElement("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},dn=function(e){return he.a.createElement(fn,bt({size:20},e),he.a.createElement("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},hn=function(e){var t=e.isFocused,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{color:t?o.neutral60:o.neutral20,display:"flex",padding:2*r,transition:"color 150ms",":hover":{color:t?o.neutral80:o.neutral40}}},mn=hn,gn=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return he.a.createElement("div",bt({},i,{className:r(Object(at.a)(o("dropdownIndicator",e)),{indicator:!0,"dropdown-indicator":!0},n)}),t)};gn.defaultProps={children:he.a.createElement(dn,null)};var vn=hn,bn=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return he.a.createElement("div",bt({},i,{className:r(Object(at.a)(o("clearIndicator",e)),{indicator:!0,"clear-indicator":!0},n)}),t)};bn.defaultProps={children:he.a.createElement(pn,null)};var yn=function(e){var t=e.color,n=e.delay,r=e.offset;return he.a.createElement("span",{className:Object(at.a)({animationDuration:"1s",animationDelay:n+"ms",animationIterationCount:"infinite",animationName:"react-select-loading-indicator",animationTimingFunction:"ease-in-out",backgroundColor:t,borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":null,height:"1em",verticalAlign:"top",width:"1em"})})};Object(at.b)("@keyframes ","react-select-loading-indicator","{0%,80%,100%{opacity:0;}40%{opacity:1;}};");var wn=function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerProps,i=e.isFocused,a=e.isRtl,u=e.theme.colors,s=i?u.neutral80:u.neutral20;return he.a.createElement("div",bt({},o,{className:n(Object(at.a)(r("loadingIndicator",e)),{indicator:!0,"loading-indicator":!0},t)}),he.a.createElement(yn,{color:s,delay:0,offset:a}),he.a.createElement(yn,{color:s,delay:160,offset:!0}),he.a.createElement(yn,{color:s,delay:320,offset:!a}))};wn.defaultProps={size:4};var xn=function(e){var t=e.children,n=e.innerProps;return he.a.createElement("div",n,t)},En=xn,Cn=xn,On=function(e){function t(){return mt(this,t),xt(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return yt(t,e),gt(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.innerProps;return he.a.createElement("div",n,t)}}]),t}(de.Component);On.defaultProps={children:he.a.createElement(pn,{size:14})};var _n=function(e){function t(){return mt(this,t),xt(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return yt(t,e),gt(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.components,o=e.cx,i=e.data,a=e.getStyles,u=e.innerProps,s=e.isDisabled,l=e.removeProps,c=e.selectProps,f=r.Container,p=r.Label,d=r.Remove,h=bt({className:o(Object(at.a)(a("multiValue",this.props)),{"multi-value":!0,"multi-value--is-disabled":s},n)},u),m={className:o(Object(at.a)(a("multiValueLabel",this.props)),{"multi-value__label":!0},n)},g=bt({className:o(Object(at.a)(a("multiValueRemove",this.props)),{"multi-value__remove":!0},n)},l);return he.a.createElement(f,{data:i,innerProps:h,selectProps:c},he.a.createElement(p,{data:i,innerProps:m,selectProps:c},t),he.a.createElement(d,{data:i,innerProps:g,selectProps:c}))}}]),t}(de.Component);_n.defaultProps={cropWithEllipsis:!0};var kn={ClearIndicator:bn,Control:function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.className,i=e.isDisabled,a=e.isFocused,u=e.innerRef,s=e.innerProps;return he.a.createElement("div",bt({ref:u,className:n(Object(at.a)(r("control",e)),{control:!0,"control--is-disabled":i,"control--is-focused":a},o)},s),t)},DropdownIndicator:gn,DownChevron:dn,CrossIcon:pn,Group:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.Heading,a=e.headingProps,u=e.label,s=e.theme;return he.a.createElement("div",{className:r(Object(at.a)(o("group",e)),{group:!0},n)},he.a.createElement(i,bt({},a,{theme:s,getStyles:o,cx:r}),u),he.a.createElement("div",null,t))},GroupHeading:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.theme,i=wt(e,["className","cx","getStyles","theme"]);return he.a.createElement("div",bt({className:n(Object(at.a)(r("groupHeading",bt({theme:o},i))),{"group-heading":!0},t)},i))},IndicatorsContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles;return he.a.createElement("div",{className:r(Object(at.a)(o("indicatorsContainer",e)),{indicators:!0},n)},t)},IndicatorSeparator:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerProps;return he.a.createElement("span",bt({},o,{className:n(Object(at.a)(r("indicatorSeparator",e)),{"indicator-separator":!0},t)}))},Input:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerRef,i=e.isHidden,a=e.isDisabled,u=e.theme,s=wt(e,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme"]);return he.a.createElement("div",{className:Object(at.a)(r("input",bt({theme:u},s)))},he.a.createElement(ct.a,bt({className:n(null,{input:!0},t),inputRef:o,inputStyle:{background:0,border:0,fontSize:"inherit",opacity:i?0:1,outline:0,padding:0,color:"inherit"},disabled:a},s)))},LoadingIndicator:wn,Menu:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerRef,a=e.innerProps,u=r(Object(at.a)(o("menu",e)),{menu:!0},n);return he.a.createElement("div",bt({className:u},a,{ref:i}),t)},MenuList:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isMulti,a=e.innerRef;return he.a.createElement("div",{className:r(Object(at.a)(o("menuList",e)),{"menu-list":!0,"menu-list--is-multi":i},n),ref:a},t)},MenuPortal:Ht,LoadingMessage:Rt,NoOptionsMessage:Lt,MultiValue:_n,MultiValueContainer:En,MultiValueLabel:Cn,MultiValueRemove:On,Option:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isDisabled,a=e.isFocused,u=e.isSelected,s=e.innerRef,l=e.innerProps;return he.a.createElement("div",bt({ref:s,className:r(Object(at.a)(o("option",e)),{option:!0,"option--is-disabled":i,"option--is-focused":a,"option--is-selected":u},n)},l),t)},Placeholder:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return he.a.createElement("div",bt({className:r(Object(at.a)(o("placeholder",e)),{placeholder:!0},n)},i),t)},SelectContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps,a=e.isDisabled,u=e.isRtl;return he.a.createElement("div",bt({className:r(Object(at.a)(o("container",e)),{"--is-disabled":a,"--is-rtl":u},n)},i),t)},SingleValue:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isDisabled,a=e.innerProps;return he.a.createElement("div",bt({className:r(Object(at.a)(o("singleValue",e)),{"single-value":!0,"single-value--is-disabled":i},n)},a),t)},ValueContainer:cn},Sn=function(e){return bt({},kn,e.components)},jn={clearIndicator:vn,container:function(e){var t=e.isDisabled;return{direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius,a=r.spacing;return{alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px "+o.primary:null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}},dropdownIndicator:mn,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:o.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return{color:t?o.neutral60:o.neutral20,display:"flex",padding:2*i,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:It,menu:function(e){var t,n=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,a=r.colors;return vt(t={},n?{bottom:"top",top:"bottom"}[n]:"bottom","100%"),vt(t,"backgroundColor",a.neutral0),vt(t,"borderRadius",o),vt(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),vt(t,"marginBottom",i.menuGutter),vt(t,"marginTop",i.menuGutter),vt(t,"position","absolute"),vt(t,"width","100%"),vt(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&o.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},noOptionsMessage:Pt,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,a=o.colors;return{backgroundColor:r?a.primary:n?a.primary25:"transparent",color:t?a.neutral20:r?a.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:2*i.baseUnit+"px "+3*i.baseUnit+"px",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:r?a.primary:a.primary50}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{color:t?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - "+2*r.baseUnit+"px)",overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:t.baseUnit/2+"px "+2*t.baseUnit+"px",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},An={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Dn={backspaceRemovesValue:!0,blurInputOnSelect:Tt(),captureMenuScroll:!Tt(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){var n=bt({ignoreCase:!0,ignoreAccents:!0,stringify:$t,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,u=n.matchFrom,s=a?Yt(t):t,l=a?Yt(i(e)):i(e);return r&&(s=s.toLowerCase(),l=l.toLowerCase()),o&&(s=qt(s),l=qt(l)),"start"===u?l.substr(0,s.length)===s:l.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return t+" result"+(1!==t?"s":"")+" available"},styles:{},tabIndex:"0",tabSelectsValue:!0},Tn=1,Mn=function(e){function t(e){mt(this,t);var n=xt(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));Nn.call(n);var r=e.value;n.cacheComponents=pt(n.cacheComponents,Wt).bind(n),n.cacheComponents(e.components),n.instancePrefix="react-select-"+(n.props.instanceId||++Tn);var o=kt(r),i=n.buildMenuOptions(e,o);return n.state.menuOptions=i,n.state.selectValue=o,n}return yt(t,e),gt(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.options,r=t.value,o=t.inputValue;if(this.cacheComponents(e.components),e.value!==r||e.options!==n||e.inputValue!==o){var i=kt(e.value),a=this.buildMenuOptions(e,i),u=this.getNextFocusedValue(i),s=this.getNextFocusedOption(a.focusable);this.setState({menuOptions:a,selectValue:i,focusedOption:s,focusedValue:u})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(e){var t,n,r,o,i,a=this.props,u=a.isDisabled,s=a.menuIsOpen,l=this.state.isFocused;(l&&!u&&e.isDisabled||l&&s&&!e.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),o=n.getBoundingClientRect(),i=n.offsetHeight/3,o.bottom+i>r.bottom?At(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+i,t.scrollHeight)):o.top-i-1&&(i=a)}this.scrollToFocusedOptionOnUpdate=!0,this.inputIsHiddenAfterUpdate=!1,this.onMenuOpen(),this.setState({focusedValue:null,focusedOption:n.focusable[i]}),this.announceAriaLiveContext({event:"menu"})}},{key:"focusValue",value:function(e){var t=this.props,n=t.isMulti,r=t.isSearchable,o=this.state,i=o.selectValue,a=o.focusedValue;if(n){this.setState({focusedOption:null});var u=i.indexOf(a);a||(u=-1,this.announceAriaLiveContext({event:"value"}));var s=i.length-1,l=-1;if(i.length){switch(e){case"previous":l=0===u?0:-1===u?s:u-1;break;case"next":u>-1&&u0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state,r=n.focusedOption,o=n.menuOptions.focusable;if(o.length){var i=0,a=o.indexOf(r);r||(a=-1,this.announceAriaLiveContext({event:"menu"})),"up"===e?i=a>0?a-1:o.length-1:"down"===e?i=(a+1)%o.length:"pageup"===e?(i=a-t)<0&&(i=0):"pagedown"===e?(i=a+t)>o.length-1&&(i=o.length-1):"last"===e&&(i=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[i],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(An):bt({},An,this.props.theme):An}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,r=this.selectOption,o=this.props,i=o.classNamePrefix,a=o.isMulti,u=o.isRtl,s=o.options,l=this.state.selectValue,c=this.hasValue();return{cx:function(e,t,n,r){var o=[t,r];if(n&&e)for(var i in n)n.hasOwnProperty(i)&&n[i]&&o.push(""+_t(e,i));return o.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}.bind(null,i),clearValue:e,getStyles:t,getValue:function(){return l},hasValue:c,isMulti:a,isRtl:u,options:s,selectOption:r,setValue:n,selectProps:o,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(r>-1){if(e.indexOf(n)>-1)return n;if(r-1?t:e[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)}},{key:"isOptionSelected",value:function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var r=this.getOptionValue(e);return t.some(function(e){return n.getOptionValue(e)===r})}},{key:"filterOption",value:function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"buildMenuOptions",value:function(e,t){var n=this,r=e.inputValue,o=void 0===r?"":r,i=e.options,a=function(e,r){var i=n.isOptionDisabled(e,t),a=n.isOptionSelected(e,t),u=n.getOptionLabel(e),s=n.getOptionValue(e);if(!(n.shouldHideSelectedOptions()&&a||!n.filterOption({label:u,value:s,data:e},o))){var l=i?void 0:function(){return n.onOptionHover(e)},c=i?void 0:function(){return n.selectOption(e)},f=n.getElementId("option")+"-"+r;return{innerProps:{id:f,onClick:c,onMouseMove:l,onMouseOver:l,role:"option",tabIndex:-1},data:e,isDisabled:i,isSelected:a,key:f,label:u,type:"option",value:s}}};return i.reduce(function(e,t,r){if(t.options){n.hasGroups||(n.hasGroups=!0);var o=t.options.map(function(t,n){var o=a(t,r+"-"+n);return o&&!o.isDisabled&&e.focusable.push(t),o}).filter(Boolean);if(o.length){var i=n.getElementId("group")+"-"+r;e.render.push({type:"group",key:i,data:t,options:o})}}else{var u=a(t,""+r);u&&(e.render.push(u),u.isDisabled||e.focusable.push(t))}return e},{render:[],focusable:[]})}},{key:"constructAriaLiveMessage",value:function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,r=e.focusedValue,o=e.focusedOption,i=this.props,a=i.options,u=i.menuIsOpen,s=i.inputValue,l=i.screenReaderStatus;return(r?function(e){var t=e.focusedValue,n=e.selectValue;return"value "+(0,e.getOptionLabel)(t)+" focused, "+(n.indexOf(t)+1)+" of "+n.length+"."}({focusedValue:r,getOptionLabel:this.getOptionLabel,selectValue:n}):"")+" "+(o&&u?function(e){var t=e.focusedOption,n=e.options;return"option "+(0,e.getOptionLabel)(t)+" focused, "+(n.indexOf(t)+1)+" of "+n.length+"."}({focusedOption:o,getOptionLabel:this.getOptionLabel,options:a}):"")+" "+function(e){var t=e.inputValue;return e.screenReaderMessage+(t?" for search term "+t:"")+"."}({inputValue:s,screenReaderMessage:l({count:this.countOptions()})})+" "+t}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,o=e.inputValue,i=e.tabIndex,a=this.components.Input,u=this.state.inputIsHidden,s=r||this.getElementId("input");if(!n)return he.a.createElement(Xt,{id:s,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ot,onFocus:this.onInputFocus,readOnly:!0,tabIndex:i,value:""});var l={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]},c=this.commonProps,f=c.cx,p=c.theme;return he.a.createElement(a,bt({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:f,getStyles:this.getStyles,id:s,innerRef:this.getInputRef,isDisabled:t,isHidden:u,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,theme:p,type:"text",value:o},l))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.components,n=t.MultiValue,r=t.MultiValueContainer,o=t.MultiValueLabel,i=t.MultiValueRemove,a=t.SingleValue,u=t.Placeholder,s=this.commonProps,l=this.props,c=l.controlShouldRenderValue,f=l.isDisabled,p=l.isMulti,d=l.inputValue,h=l.placeholder,m=this.state,g=m.selectValue,v=m.focusedValue;if(!this.hasValue()||!c)return d?null:he.a.createElement(u,bt({},s,{key:"placeholder",isDisabled:f}),h);if(p)return g.map(function(t){var a=t===v;return he.a.createElement(n,bt({},s,{components:{Container:r,Label:o,Remove:i},isFocused:a,isDisabled:f,key:e.getOptionValue(t),removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))});if(d)return null;var b=g[0];return he.a.createElement(a,bt({},s,{data:b,isDisabled:f}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||o)return null;var a={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return he.a.createElement(e,bt({},t,{innerProps:a,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;return e&&o?he.a.createElement(e,bt({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,o=this.props.isDisabled,i=this.state.isFocused;return he.a.createElement(n,bt({},r,{isDisabled:o,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return he.a.createElement(e,bt({},t,{innerProps:o,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.components,n=t.Group,r=t.GroupHeading,o=t.Menu,i=t.MenuList,a=t.MenuPortal,u=t.LoadingMessage,s=t.NoOptionsMessage,l=t.Option,c=this.commonProps,f=this.state,p=f.focusedOption,d=f.menuOptions,h=this.props,m=h.captureMenuScroll,g=h.inputValue,v=h.isLoading,b=h.loadingMessage,y=h.minMenuHeight,w=h.maxMenuHeight,x=h.menuIsOpen,E=h.menuPlacement,C=h.menuPosition,O=h.menuPortalTarget,_=h.menuShouldBlockScroll,k=h.menuShouldScrollIntoView,S=h.noOptionsMessage,j=h.onMenuScrollToTop,A=h.onMenuScrollToBottom;if(!x)return null;var D=function(t){var n=p===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,he.a.createElement(l,bt({},c,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))},T=void 0;if(this.hasOptions())T=d.render.map(function(t){if("group"===t.type){t.type;var o=wt(t,["type"]),i=t.key+"-heading";return he.a.createElement(n,bt({},c,o,{Heading:r,headingProps:{id:i},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return D(e)}))}if("option"===t.type)return D(t)});else if(v){var M=b({inputValue:g});if(null===M)return null;T=he.a.createElement(u,c,M)}else{var N=S({inputValue:g});if(null===N)return null;T=he.a.createElement(s,c,N)}var F={minMenuHeight:y,maxMenuHeight:w,menuPlacement:E,menuPosition:C,menuShouldScrollIntoView:k},P=he.a.createElement(Nt,bt({},c,F),function(t){var n=t.ref,r=t.placerProps,a=r.placement,u=r.maxHeight;return he.a.createElement(o,bt({},c,F,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:v,placement:a}),he.a.createElement(ln,{isEnabled:m,onTopArrive:j,onBottomArrive:A},he.a.createElement(un,{isEnabled:_},he.a.createElement(i,bt({},c,{innerRef:e.getMenuListRef,isLoading:v,maxHeight:u}),T))))});return O||"fixed"===C?he.a.createElement(a,bt({},c,{appendTo:O,controlElement:this.controlRef,menuPlacement:E,menuPosition:C}),P):P}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,o=t.isMulti,i=t.name,a=this.state.selectValue;if(i&&!r){if(o){if(n){var u=a.map(function(t){return e.getOptionValue(t)}).join(n);return he.a.createElement("input",{name:i,type:"hidden",value:u})}var s=a.length>0?a.map(function(t,n){return he.a.createElement("input",{key:"i-"+n,name:i,type:"hidden",value:e.getOptionValue(t)})}):he.a.createElement("input",{name:i,type:"hidden"});return he.a.createElement("div",null,s)}var l=a[0]?this.getOptionValue(a[0]):"";return he.a.createElement("input",{name:i,type:"hidden",value:l})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?he.a.createElement(Gt,{"aria-live":"assertive"},he.a.createElement("p",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),he.a.createElement("p",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,o=e.ValueContainer,i=this.props,a=i.className,u=i.id,s=i.isDisabled,l=this.state.isFocused,c=this.commonProps=this.getCommonProps();return he.a.createElement(r,bt({},c,{className:a,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:l}),this.renderLiveRegion(),he.a.createElement(t,bt({},c,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:l}),he.a.createElement(o,bt({},c,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),he.a.createElement(n,bt({},c,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),t}(de.Component);Mn.defaultProps=Dn;var Nn=function(){var e=this;this.state={ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,isComposing:!1,menuOptions:{render:[],focusable:[]},selectValue:[]},this.blockOptionHover=!1,this.clearFocusValueOnUpdate=!1,this.hasGroups=!1,this.initialTouchX=0,this.initialTouchY=0,this.instancePrefix="",this.openAfterFocus=!1,this.scrollToFocusedOptionOnUpdate=!1,this.controlRef=null,this.getControlRef=function(t){e.controlRef=t},this.focusedOptionRef=null,this.getFocusedOptionRef=function(t){e.focusedOptionRef=t},this.menuListRef=null,this.getMenuListRef=function(t){e.menuListRef=t},this.inputRef=null,this.getInputRef=function(t){e.inputRef=t},this.cacheComponents=function(t){e.components=Sn({components:t})},this.focus=this.focusInput,this.blur=this.blurInput,this.setValue=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",r=arguments[2],o=e.props,i=o.closeMenuOnSelect,a=o.isMulti,u=o.onChange;e.onInputChange("",{action:"set-value"}),i&&(e.inputIsHiddenAfterUpdate=!a,e.onMenuClose()),e.clearFocusValueOnUpdate=!0,u(t,{action:n,option:r})},this.selectOption=function(t){var n=e.props,r=n.blurInputOnSelect;if(n.isMulti){var o=e.state.selectValue;if(e.isOptionSelected(t,o)){var i=e.getOptionValue(t);e.setValue(o.filter(function(t){return e.getOptionValue(t)!==i}),"deselect-option",t),e.announceAriaLiveSelection({event:"deselect-option",context:{value:e.getOptionLabel(t)}})}else e.setValue([].concat(Ct(o),[t]),"select-option",t),e.announceAriaLiveSelection({event:"select-option",context:{value:e.getOptionLabel(t)}})}else e.setValue(t,"select-option"),e.announceAriaLiveSelection({event:"select-option",context:{value:e.getOptionLabel(t)}});r&&e.blurInput()},this.removeValue=function(t){var n=e.props.onChange,r=e.state.selectValue,o=e.getOptionValue(t);n(r.filter(function(t){return e.getOptionValue(t)!==o}),{action:"remove-value",removedValue:t}),e.announceAriaLiveSelection({event:"remove-value",context:{value:t?e.getOptionLabel(t):void 0}}),e.focusInput()},this.clearValue=function(){var t=e.props,n=t.isMulti;(0,t.onChange)(n?[]:null,{action:"clear"})},this.popValue=function(){var t=e.props.onChange,n=e.state.selectValue,r=n[n.length-1];e.announceAriaLiveSelection({event:"pop-value",context:{value:r?e.getOptionLabel(r):void 0}}),t(n.slice(0,n.length-1),{action:"pop-value",removedValue:r})},this.getOptionLabel=function(t){return e.props.getOptionLabel(t)},this.getOptionValue=function(t){return e.props.getOptionValue(t)},this.getStyles=function(t,n){var r=jn[t](n);r.boxSizing="border-box";var o=e.props.styles[t];return o?o(r,n):r},this.getElementId=function(t){return e.instancePrefix+"-"+t},this.getActiveDescendentId=function(){var t=e.props.menuIsOpen,n=e.state,r=n.menuOptions,o=n.focusedOption;if(o&&t){var i=r.focusable.indexOf(o),a=r.render[i];return a&&a.key}},this.announceAriaLiveSelection=function(t){var n=t.event,r=t.context;e.setState({ariaLiveSelection:function(e,t){var n=r.value;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option "+n+", deselected.";case"select-option":return"option "+n+", selected."}}(n)})},this.announceAriaLiveContext=function(t){var n=t.event,r=t.context;e.setState({ariaLiveContext:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSearchable,r=t.isMulti,o=t.label;switch(e){case"menu":return"Use Up and Down to choose options, press Backspace to select the currently focused option, press Escape to exit the menu, press Tab to select the option and exit the menu.";case"input":return(o||"Select")+" is focused "+(n?",type to refine list":"")+", press Down to open the menu, "+(r?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Enter to remove the currently focused value"}}(n,bt({},r,{label:e.props["aria-label"]}))})},this.onMenuMouseDown=function(t){0===t.button&&(t.stopPropagation(),t.preventDefault(),e.focusInput())},this.onMenuMouseMove=function(t){e.blockOptionHover=!1},this.onControlMouseDown=function(t){var n=e.props.openMenuOnClick;e.state.isFocused?e.props.menuIsOpen?e.onMenuClose():e.openMenu("first"):(n&&(e.openAfterFocus=!0),e.focusInput()),"INPUT"!==t.target.tagName&&t.preventDefault()},this.onDropdownIndicatorMouseDown=function(t){if(!(t&&"mousedown"===t.type&&0!==t.button||e.props.isDisabled)){var n=e.props,r=n.isMulti,o=n.menuIsOpen;e.focusInput(),o?(e.inputIsHiddenAfterUpdate=!r,e.onMenuClose()):e.openMenu("first"),t.preventDefault(),t.stopPropagation()}},this.onClearIndicatorMouseDown=function(t){t&&"mousedown"===t.type&&0!==t.button||(e.clearValue(),t.stopPropagation(),e.openAfterFocus=!1,setTimeout(function(){return e.focusInput()}))},this.onScroll=function(t){"boolean"==typeof e.props.closeMenuOnScroll?t.target instanceof HTMLElement&&St(t.target)&&e.props.onMenuClose():"function"==typeof e.props.closeMenuOnScroll&&e.props.closeMenuOnScroll(t)&&e.props.onMenuClose()},this.onCompositionStart=function(){e.setState({isComposing:!0})},this.onCompositionEnd=function(){e.setState({isComposing:!1})},this.onTouchStart=function(t){var n=Et(t.touches,1)[0];e.initialTouchX=n.clientX,e.initialTouchY=n.clientY,e.userIsDragging=!1},this.onTouchMove=function(t){var n=Et(t.touches,1)[0],r=Math.abs(n.clientX-e.initialTouchX),o=Math.abs(n.clientY-e.initialTouchY);e.userIsDragging=r>5||o>5},this.onTouchEnd=function(t){if(!e.userIsDragging){var n=t.target;e.controlRef&&!e.controlRef.contains(n)&&e.menuListRef&&!e.menuListRef.contains(n)&&e.blurInput(),e.initialTouchX=0,e.initialTouchY=0}},this.onControlTouchEnd=function(t){e.userIsDragging||e.onControlMouseDown(t)},this.onClearIndicatorTouchEnd=function(t){e.userIsDragging||e.onClearIndicatorMouseDown(t)},this.onDropdownIndicatorTouchEnd=function(t){e.userIsDragging||e.onDropdownIndicatorMouseDown(t)},this.handleInputChange=function(t){var n=t.currentTarget.value;e.inputIsHiddenAfterUpdate=!1,e.onInputChange(n,{action:"input-change"}),e.onMenuOpen()},this.onInputFocus=function(t){var n=e.props,r=n.isSearchable,o=n.isMulti;e.props.onFocus&&e.props.onFocus(t),e.inputIsHiddenAfterUpdate=!1,e.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:o}}),e.setState({isFocused:!0}),(e.openAfterFocus||e.props.openMenuOnFocus)&&e.openMenu("first"),e.openAfterFocus=!1},this.onInputBlur=function(t){e.props.onBlur&&e.props.onBlur(t),e.onInputChange("",{action:"input-blur"}),e.onMenuClose(),e.setState({focusedValue:null,isFocused:!1})},this.onOptionHover=function(t){e.blockOptionHover||e.state.focusedOption===t||e.setState({focusedOption:t})},this.shouldHideSelectedOptions=function(){var t=e.props,n=t.hideSelectedOptions,r=t.isMulti;return void 0===n?r:n},this.onKeyDown=function(t){var n=e.props,r=n.isMulti,o=n.backspaceRemovesValue,i=n.escapeClearsValue,a=n.inputValue,u=n.isClearable,s=n.isDisabled,l=n.menuIsOpen,c=n.onKeyDown,f=n.tabSelectsValue,p=n.openMenuOnFocus,d=e.state,h=d.isComposing,m=d.focusedOption,g=d.focusedValue,v=d.selectValue;if(!(s||"function"==typeof c&&(c(t),t.defaultPrevented))){switch(e.blockOptionHover=!0,t.key){case"ArrowLeft":if(!r||a)return;e.focusValue("previous");break;case"ArrowRight":if(!r||a)return;e.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(g)e.removeValue(g);else{if(!o)return;e.popValue()}break;case"Tab":if(t.shiftKey||!l||!f||!m||p&&e.isOptionSelected(m,v))return;e.selectOption(m);break;case"Enter":if(l){if(!m)return;if(h)return;e.selectOption(m)}else e.focusOption("first");break;case"Escape":l?(e.inputIsHiddenAfterUpdate=!1,e.onInputChange("",{action:"menu-close"}),e.onMenuClose()):u&&i&&e.clearValue();break;case" ":if(a)return;if(!l){e.openMenu("first");break}if(!m)return;e.selectOption(m);break;case"ArrowUp":l?e.focusOption("up"):e.openMenu("last");break;case"ArrowDown":l?e.focusOption("down"):e.openMenu("first");break;case"PageUp":if(!l)return;e.focusOption("pageup");break;case"PageDown":if(!l)return;e.focusOption("pagedown");break;case"Home":if(!l)return;e.focusOption("first");break;case"End":if(!l)return;e.focusOption("last");break;default:return}t.preventDefault()}}},Fn=function(e){var t,n;return n=t=function(t){function n(){var e,t,r;mt(this,n);for(var o=arguments.length,i=Array(o),a=0;a1?n-1:0),o=1;o0?wp.element.createElement(qn,{id:t,name:n,value:this.filterValues(r),options:o.options,delimiter:o.valueDelimiter,onChange:this.handleChange,className:"cf-multiselect__select",classNamePrefix:"cf-multiselect",isMulti:!0}):wp.element.createElement(Yn,null)}}]),t}(P.Component),Gn=n(105),Xn=n.n(Gn),Kn=(n(268),function(e){function t(){var e;return O()(this,t),(e=j()(this,D()(t).apply(this,arguments))).state={width:0,height:0},e.renderIframe=e.renderIframe.bind(F()(F()(e))),e.checkMessageForResize=e.checkMessageForResize.bind(F()(F()(e))),e}return M()(t,e),k()(t,[{key:"isFrameAccessible",value:function(){try{return!!this.iframe.contentDocument.body}catch(e){return!1}}},{key:"componentDidMount",value:function(){window.addEventListener("message",this.checkMessageForResize,!1),this.renderIframe()}},{key:"componentDidUpdate",value:function(){this.renderIframe()}},{key:"checkMessageForResize",value:function(e){var t=this.iframe,n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}if(t&&t.contentWindow===e.source){var r=n,o=r.action,i=r.width,a=r.height,u=this.state,s=u.width,l=u.height;"resize"!==o||s===i&&l===a||this.setState({width:i,height:a})}}},{key:"render",value:function(){var e=this;return wp.element.createElement("div",{className:"cf-oembed__preview"},wp.element.createElement("iframe",{ref:function(t){return e.iframe=t},scrolling:"no",className:"cf-oembed__frame",onLoad:this.renderIframe,width:Math.ceil(this.state.width),height:Math.ceil(this.state.height)}))}},{key:"renderIframe",value:function(){if(this.isFrameAccessible()&&null===this.iframe.contentDocument.body.getAttribute("data-resizable-iframe-connected")){var e="video"===this.props.type?"clientBoundingRect.width / 16 * 9":"clientBoundingRect.height",t="\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: ".concat(e,"\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\n\t\t\t\tfunction removeViewportStyles( ruleOrNode ) {\n\t\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {\n\t\t\t\t\t\tif ( /^\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {\n\t\t\t\t\t\t\truleOrNode.style[ style ] = '';\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\t\t\t\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\t\t\t\tsendResize();\n\t\t} )();"),n=wp.element.createElement("html",{lang:document.documentElement.lang},wp.element.createElement("head",null,wp.element.createElement("style",{dangerouslySetInnerHTML:{__html:"\n\t\t\tbody { margin: 0; }\n\n\t\t\tbody > div { max-width: 600px; }\n\n\t\t\tbody.Kickstarter > div,\n\t\t\tbody.video > div { position: relative; height: 0; padding-bottom: 56.25%; }\n\t\t\tbody.Kickstarter > div > iframe,\n\t\t\tbody.video > div > iframe { position: absolute; width: 100%; height: 100%; top: 0; left: 0; }\n\n\t\t\tbody > div > * { margin: 0 !important;/* has to have !important to override inline styles */ max-width: 100%; }\n\n\t\t\tbody.Flickr > div > a { display: block; }\n\t\t\tbody.Flickr > div > a > img { width: 100%; height: auto; }\n\t\t"}})),wp.element.createElement("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:this.props.type+" "+this.props.provider},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.html}}),wp.element.createElement("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:t}})));this.iframe.contentWindow.document.open(),this.iframe.contentWindow.document.write(""+Object(P.renderToString)(n)),this.iframe.contentWindow.document.close()}}}]),t}(P.Component)),Jn=function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0&&(clearInterval(n),e.handleSearch(t))},100)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.name,r=e.value,o=e.embedCode,i=e.embedType,a=e.provider;return wp.element.createElement("div",{ref:this.node},wp.element.createElement(re,{id:t,value:r,onChange:this.handleChange}),o?wp.element.createElement(Kn,{html:o,type:i,provider:a}):null,wp.element.createElement("input",{type:"hidden",name:n,value:r,readOnly:!0}))}}]),t}(P.Component),Qn=Object(E.withState)({embedCode:"",embedType:"",provider:"",error:"",isLoading:!1}),Zn=Object(Y.withEffects)(function(e){var t=e.useEvent("fetchEmbedCode"),n=W()(t,2),r=n[0],o=n[1],i=Object(X.pipe)(K({onFetchEmbedCode:o}),Object(X.map)(Y.toProps)),a=Object(X.pipe)(r,Object(X.map)(function(e){return{type:"FETCH_EMBED_CODE",payload:e}}));return Object(X.merge)(i,a)},{handler:function(e){return function(t){var n=t.payload;switch(t.type){case"FETCH_EMBED_CODE":var r=Xn.a.get(window.wpApiSettings.root+"oembed/1.0/proxy",{url:n,_wpnonce:window.wpApiSettings.nonce});r.done(function(t){e.setState({embedCode:t.html,embedType:t.type,provider:t.provider_name,isLoading:!1})}),r.fail(function(){alert(Object(i.__)("An error occurred while trying to fetch oembed preview.","carbon-fields-ui")),e.setState({error:Object(i.__)("Not Found","carbon-fields-ui"),isLoading:!1})})}}}}),er=Object(E.compose)(Qn,Zn)(Jn),tr=(n(269),function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0?this.renderOptions():wp.element.createElement(Yn,null)}}]),t}(P.Component)),nr=(n(270),He(function(e){return f()({},e,{field:f()({},e.field,{options:e.field.options.map(function(e){return f()({},e,{label:wp.element.createElement("img",{className:"cf-radio-image__image",src:e.label})})})})})})(tr)),rr=function(e){function t(){var e;return O()(this,t),e=j()(this,D()(t).call(this)),l()(F()(F()(e)),"handleChange",function(t){var n=e.props,r=n.id;(0,n.onChange)(r,Object(p.isString)(t)?t:t.target.value)}),l()(F()(F()(e)),"initEditor",function(){var t=e.props,n=t.id,r=t.field;if(r.rich_editing){var o=f()({},window.tinyMCEPreInit.mceInit[r.settings_reference],{selector:"#".concat(n),setup:function(t){e.editor=t,t.on("blur Change",function(){t.save(),e.handleChange(t.getContent())})}});window.tinymce.init(o)}var i=f()({},window.tinyMCEPreInit.qtInit[r.settings_reference]);if(i){var a=window.quicktags(f()({},i,{id:n}));window.QTags._buttonsInit(a.id)}}),e.node=Object(P.createRef)(),e.editor=null,e}return M()(t,e),k()(t,[{key:"componentDidMount",value:function(){var e=this;this.props.visible&&(this.timer=setTimeout(this.initEditor,250),this.cancelObserver=Xe()(this.node.current,Object(p.debounce)(function(){if(e.editor){var t=window.wpActiveEditor;e.editor.execCommand("wpAutoResize"),window.wpActiveEditor=t}},100)))}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timer),void 0!==this.cancelObserver&&this.cancelObserver(),this.destroyEditor()}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.name,r=e.value,o=e.field,a=["carbon-wysiwyg","wp-editor-wrap",{"tmce-active":o.rich_editing},{"html-active":!o.rich_editing}],u=o.media_buttons?Object(p.template)(o.media_buttons)({id:t}):null,s=o.rich_editing&&window.tinyMCEPreInit.qtInit[o.settings_reference];return wp.element.createElement("div",{id:"wp-".concat(t,"-wrap"),className:G()(a),ref:this.node},o.media_buttons&&wp.element.createElement("div",{id:"wp-".concat(t,"-media-buttons"),className:"hide-if-no-js wp-media-buttons"},wp.element.createElement("span",{dangerouslySetInnerHTML:{__html:u}})),s&&wp.element.createElement("div",{className:"wp-editor-tabs"},wp.element.createElement("button",{type:"button",id:"".concat(t,"-tmce"),className:"wp-switch-editor switch-tmce","data-wp-editor-id":t},Object(i.__)("Visual","carbon-fields-ui")),wp.element.createElement("button",{type:"button",id:"".concat(t,"-html"),className:"wp-switch-editor switch-html","data-wp-editor-id":t},Object(i.__)("Text","carbon-fields-ui"))),wp.element.createElement("div",{id:"wp-".concat(t,"-editor-container"),className:"wp-editor-container"},wp.element.createElement("textarea",Q()({style:{width:"100%"},className:"regular-text",id:t,name:n,value:r,onChange:this.handleChange},o.attributes))))}},{key:"destroyEditor",value:function(){this.editor&&(this.editor.remove(),this.node=null,this.editor=null),delete window.QTags.instances[this.props.id]}}]),t}(P.Component),or=(n(271),function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0?wp.element.createElement("select",{id:t,name:n,value:i,className:"cf-select__input",onChange:this.handleChange},r.options.map(function(e){return wp.element.createElement("option",{key:e.value,value:e.value},e.label)})):wp.element.createElement(Yn,null)}}]),t}(P.Component)),ir=(n(272),function(e){function t(){return O()(this,t),j()(this,D()(t).apply(this,arguments))}return M()(t,e),k()(t,[{key:"render",value:function(){return wp.element.createElement("h3",null,this.props.field.label)}}]),t}(P.Component)),ar=(n(273),function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i-1}),n}return M()(t,e),k()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.id,r=t.name,o=t.value,i=t.field;return i.options.length>0?wp.element.createElement("ul",{className:"cf-set__list"},i.options.map(function(t,a){return wp.element.createElement("li",{className:"cf-set__list-item",key:a},wp.element.createElement("input",Q()({type:"checkbox",id:"".concat(n,"-").concat(t.value),name:"".concat(r,"[]"),checked:e.isChecked(o,t),value:t.value,className:"cf-set__input",onChange:e.handleChange},i.attributes)),wp.element.createElement("label",{className:"cf-set__label",htmlFor:"".concat(n,"-").concat(t.value)},t.label))})):wp.element.createElement(Yn,null)}}]),t}(P.Component)),ur=function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i":return e>n;case"<":return e=":return e>=n;case"<=":return e<=n;case"IN":return Object(p.some)(n,function(t){return t==e});case"NOT IN":return Object(p.every)(n,function(t){return t!=e});case"INCLUDES":return Object(p.every)(Object(p.castArray)(n),function(t){return e.indexOf(t)>-1});case"EXCLUDES":return Object(p.every)(Object(p.castArray)(n),function(t){return-1===e.indexOf(t)})}return!1}(u[t.field],t.compare,t.value);return e.concat(n)},[]),l=!1;switch(o){case"AND":l=Object(p.every)(s);break;case"OR":l=Object(p.some)(s)}l?e.showField(e.id):e.hideField(e.id)}}}return Object(E.createHigherOrderComponent)(function(e){return Object(E.compose)(Object(u.withDispatch)(function(e){var t=e("carbon-fields/core");return{showField:t.showField,hideField:t.hideField}}),Object(u.withSelect)(function(e,t){return{visible:e("carbon-fields/core").isFieldVisible(t.id)}}),Object(Y.withEffects)(n,{handler:r}))(e)},"withConditionalLogic")}var Or=n(106),_r=n.n(Or),kr="Uint8ArdomValuesObj012345679BCDEFGHIJKLMNPQRSTWXYZ_cfghkpqvwxyz";function Sr(){return"cf-".concat(_r()(kr,21))}function jr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rt=>(n,r)=>{if(0!==n)return;let o;t(0,(t,n)=>{0===t?(o=n,r(t,n)):1===t?e(n)?r(t,n):o(1):r(t,n)})})},function(e,t){e.exports=(e=>(t,n)=>{if(0!==t)return;if("function"!=typeof e)return n(0,()=>{}),void n(2);let r,o;const i=e=>{(r=r||2===e)&&"function"==typeof o&&o()};n(0,i),o=e((e,t)=>{r||0===e||(n(e,t),i(e))})})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.containers;case"UPDATE_STATE":return m()(e,function(e){Object(u.values)(t.payload.containers).forEach(function(t){e[t.id]=t})});case"ADD_CONTAINER":return m()(e,function(e){e[t.payload.id]=t.payload});case"REMOVE_CONTAINER":return Object(u.omit)(e,t.payload);default:return e}},fields:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.fields;case"UPDATE_STATE":return m()(e,function(e){Object(u.values)(t.payload.fields).forEach(function(t){e[t.id]=t})});case"UPDATE_FIELD_VALUE":return m()(e,function(n){var r=t.payload,o=r.fieldId,i=r.value,c=r.fieldsToRemove;n[o].value=i,c.reduce(function(t,n){return O(n,e,t)},[]).forEach(function(e){Object(u.unset)(n,e)})});case"ADD_FIELDS":return m()(e,function(e){t.payload.fields.forEach(function(t){e[t.id]=t})});case"CLONE_FIELDS":return m()(e,function(e){var n=t.payload,r=n.originFieldIds,o=n.cloneFieldIds,i=r.reduce(function(t,n,r){return function e(t,n,r,o){var i=Object(u.cloneDeep)(r[t]);return i.id=n,"complex"===i.type&&i.value.forEach(function(t){t.id=Object(v.uniqueId)(),o=t.fields.reduce(function(t,n){var o=n.id,i=Object(v.uniqueId)();return n.id=i,e(o,i,r,t)},o)}),o.concat(i)}(n,o[r],e,t)},[]);Object(u.assign)(e,Object(u.keyBy)(i,"id"))});case"REMOVE_FIELDS":var n=t.payload.fieldIds.reduce(function(t,n){return O(n,e,t)},[]);return Object(u.omit)(e,n);case"RECEIVE_SIDEBAR":return m()(e,function(e){Object(u.forEach)(e,function(e){"sidebar"===e.type&&e.options.unshift(t.payload)})});default:return e}},savingLock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_SAVING":return p()({},e,d()({},t.payload.lockName,!0));case"UNLOCK_SAVING":return Object(u.omit)(e,[t.payload.lockName]);default:return e}},isDirty:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"UPDATE_FIELD_VALUE":return!0;default:return e}}});function g(e,t){return{type:"SETUP_STATE",payload:{containers:e,fields:t}}}function y(e,t){return{type:"UPDATE_STATE",payload:{containers:e,fields:t}}}function h(e,t){return{type:"UPDATE_FIELD_VALUE",payload:{fieldId:e,value:t,fieldsToRemove:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]}}}function w(e){return{type:"ADD_FIELDS",payload:{fields:e}}}function E(e,t){return{type:"CLONE_FIELDS",payload:{originFieldIds:e,cloneFieldIds:t}}}function x(e){return{type:"REMOVE_FIELDS",payload:{fieldIds:e}}}function S(e){return{type:"ADD_CONTAINER",payload:e}}function I(e){return{type:"REMOVE_CONTAINER",payload:e}}function F(e){return{type:"RECEIVE_SIDEBAR",payload:e}}function T(e){return{type:"LOCK_SAVING",payload:{lockName:e}}}function C(e){return{type:"UNLOCK_SAVING",payload:{lockName:e}}}function A(e){return e.containers}function D(e,t){return e.containers[t]}function N(e){return e.fields}function k(e,t){return Object(u.filter)(e.fields,["container_id",t])}function G(e,t){return e.fields[t]}function P(e){return Object.keys(e.savingLock).length>0}function L(e){return e.isDirty}function R(e,t){var n=Object(u.pick)(N(e),t);return n=Object(u.mapKeys)(n,function(e){return e.base_name.replace(/\-/g,"_")}),Object(u.mapValues)(n,function(e){return e.value})}function B(e,t,n){return(e=Object(u.cloneDeep)(e)).id=Object(v.uniqueId)(),e.container_id=t,"complex"===e.type&&e.value.forEach(function(e){e.id=Object(v.uniqueId)(),e.container_id=t,e.fields=e.fields.map(function(e){return B(e,t,n)})}),n.push(e),Object(u.pick)(e,["id","type","name","base_name"])}function V(e){var t=[];return{containers:e.filter(function(e){var t=e.id;return!Object(u.endsWith)(t,"__i__")}).map(function(e){return Object(u.assign)({},e,{fields:e.fields.map(function(n){return B(n,e.id,t)})})}),fields:t}}Object(a.registerStore)("carbon-fields/metaboxes",{reducer:j,actions:r,selectors:o});var U=V(Object(u.get)(window.cf,"preloaded.containers",[])),q=U.containers,M=U.fields;Object(a.dispatch)("carbon-fields/metaboxes").setupState(Object(u.keyBy)(q,"id"),Object(u.keyBy)(M,"id"));var Q=n(10),K=Object(Q.createHigherOrderComponent)(function(e){var t=Object(a.withSelect)(function(e,t){var n=window.cf.config,r=n.compactInput,o=n.compactInputKey,i=e("carbon-fields/metaboxes").getFieldById(t.id),c=i&&i.value,a=t.name||i.name;return r&&!t.name&&-1===a.indexOf("widget-carbon_fields")&&(a="".concat(o,"[").concat(a,"]")),{field:i,name:a,value:c}}),n=Object(a.withDispatch)(function(e){return{onChange:e("carbon-fields/metaboxes").updateFieldValue}});return Object(Q.compose)(t,n)(e)},"withField"),W=n(13),$=n.n(W),z=function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:[];return void 0===e?[]:Object(u.pick)(t,Object(u.difference)(Object(u.map)(e.fields,"id"),n))}function ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(u.map)(e,function(e){return[e.id,"".concat(Object(u.repeat)("parent.",t)).concat(e.base_name)]})}var te=Object(v.withConditionalLogic)(function(e,t){var n=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId;return Object(Y.pipe)(Object(Y.merge)(z(n(e.containerId)),Object(v.fromSelector)(n,e.containerId)),(e=>t=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=H;t(0,(t,n)=>{if(0===t)return o=n,e(0,(e,t)=>{if(0!==e)return 1===e?(a=void 0,i(2),o(2),void(c&&r(2))):void(2===e&&(i=null,a=t,null!=t&&(o(2),c&&r(e,t))));(i=t)(1)}),c=!0,r(0,(e,t)=>{a===H&&(2===e&&i&&i(2),o(e,t))}),void(a!==H&&r(2,a));2===t&&i(2),a===H&&r(t,n)})})(t.unmount),X(u.isEqual))},function(e,t){t=Object(u.keyBy)(t,"id");var n=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),r=[];if(Object(u.some)(n.fields,["id",e.id]))r=ee(r=Z(n,t,[e.id]));else{var o=e.name.replace(new RegExp("^".concat(window.cf.config.compactInputKey,"\\[(.+?)\\]")),"$1"),i=Object(u.find)(t,function(t){return t.container_id===e.containerId&&Object(u.startsWith)(o,t.name)}),c=o.split(/\[|\]/g);c.shift(),(c=c.filter(function(e){return""!==e})).pop();var l=c.reduce(function(e,t){return isNaN(t)?e+1:e},0);r=ee(r=Z(n,t,[i.id]),l+1);for(var s="".concat(i.id,".value");c.length>0;){var d=c.shift(),f=!isNaN(d),p=!f;if(f){s="".concat(s,"[").concat(d,"]");var b=Z(Object(u.get)(t,s),t,[e.id]);r=r.concat(ee(b,l)),s="".concat(s,".fields")}if(p){var m=Object(u.find)(Object(u.get)(t,s),["name",d]);s="".concat(m.id,".value"),l--}}}return r=r.map(function(e){var n=$()(e,2),r=n[0];return[n[1],Object(u.get)(t,"".concat(r,".value"))]}),Object(u.fromPairs)(r)});function ne(){return!Object(u.isUndefined)(window._wpLoadBlockEditor)}function re(e,t){return Object(u.find)(e,function(e){return e.name===t})}Object(c.addFilter)("carbon-fields.association.metabox","carbon-fields/metaboxes",Object(v.withProps)(function(e){return{hierarchyResolver:function(){for(var t,n,r,o,i=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId(e.containerId),c=(t=e.name,n=window.cf.config,r=n.compactInput,o=n.compactInputKey,r&&0===t.indexOf(o)?t.replace(new RegExp("^".concat(o,"\\[(.+?)\\]")),"$1"):t).split(/\[|\]/g),l=re(i,(c=c.filter(function(e){return""!==e})).shift()),s=i.indexOf(l),d=l.base_name;c.length>0;){var f=c.shift(),p=!isNaN(f),b=f===e.field.base_name,m=!p&&!b;if(p&&(s="".concat(s,".value.").concat(f,".name"),d="".concat(d,"[").concat(f,"]:").concat(Object(u.get)(i,s),"/")),m){var v=re(Object(u.get)(i,s.replace(/\.name$/,".fields")),f),O=Object(u.find)(i,["id",v.id]);s=i.indexOf(O),d="".concat(d).concat(O.base_name)}b&&(d="".concat(d).concat(f))}return d}}}));var oe=n(16),ie=n.n(oe),ce=n(17),ae=n.n(ce),ue=n(18),le=n.n(ue),se=n(19),de=n.n(se),fe=n(20),pe=n.n(fe),be=n(7),me=n.n(be),ve=n(12),Oe=(n(29),n(30),Object(Q.compose)(K,Object(v.withFilters)("carbon-fields.field-wrapper.metabox"))(v.Field)),je=function(e){function t(){var e,n;ie()(this,t);for(var r=arguments.length,o=new Array(r),i=0;it=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=!1;for(r(0,(t,n)=>{a&&1===t&&(i=[1,n]),2===t&&(c=!0,e.length=0),o&&o(t,n)});0!==e.length;)1===e.length&&(a=!0),r(1,e.shift());c||t(0,(e,t)=>{if(0===e)return o=t,a=!1,void(i&&(o(...i),i=null));r(e,t)})};function Se(e){var t=parseInt(e.value,10);return!isNaN(t)&&t>=0?t:0}function Ie(e){var t=0;if(e.className){var n=e.className.match(/^level-(\d+)/);n&&(t=parseInt(n[1],10)+1)}return t}function Fe(e){for(var t=[],n=e,r=Ie(e);r>0&&n;)if(Ie(n)===r){var o=parseInt(n.value,10);o>0&&t.unshift(o),n=n.previousSibling,r--}else n=n.previousSibling;return t}var Te={post_ancestors:[],post_parent_id:0,post_level:1};function Ce(e){var t=e.options[e.selectedIndex];return{post_ancestors:Fe(t),post_parent_id:Se(t),post_level:Ie(t)+1}}Object(c.addFilter)("carbon-fields.conditional-display-post-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent_id");return e?Object(Y.pipe)(Object(Y.fromEvent)(e,"change"),Object(Y.map)(function(e){return Ce(e.target)}),xe(Ce(e))):z(Te)}),Object(c.addFilter)("carbon-fields.conditional-display-post-parent.gutenberg","carbon-fields/metaboxes",function(){var e=Object(a.select)("core"),t=e.getPostType,n=e.getEntityRecords;return Object(Y.pipe)(Object(Y.combine)(Object(v.fromSelector)(Object(a.select)("core/editor").getCurrentPostId),Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"type"),Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"parent")),X(u.isEqual),Object(Y.map)(function(e){var r=$()(e,3),o=r[0],i=r[1],c=r[2];if(c=parseInt(c,10),isNaN(c))return Te;var a=t(i);if(!Object(u.get)(a,["hierarchical"],!1))return Te;var l=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=Object(u.find)(n,["id",t]);return o?(r.unshift(o.id),o.parent?e(o.parent,n,r):r):r}(c,n("postType",i,{per_page:-1,exclude:o,parent_exclude:o,orderby:"menu_order",order:"asc"})||[]);return{post_ancestors:l,post_parent_id:c,post_level:l.length+1}}))});var Ae=n(22),De=n.n(Ae),Ne=(e,t,n)=>De()(n=>{let r=n.target;for(;r!==e;){if(r.matches(t))return!0;r=r.parentElement}return!1})(((e,t,n)=>(r,o)=>{if(0!==r)return;let i=!1;const c=e=>{o(1,e)};o(0,r=>{2===r&&(i=!0,e.removeEventListener(t,c,n))}),i||e.addEventListener(t,c,n)})(e,n)),ke={post_format:"standard"};function Ge(e){var t=e.value;return"0"===t&&(t="standard"),{post_format:t}}Object(c.addFilter)("carbon-fields.conditional-display-post-format.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("div#post-formats-select");return e?Object(Y.pipe)(Ne(e,"input.post-format","change"),Object(Y.map)(function(e){return Ge(e.target)}),xe(Ge(e.querySelector("input.post-format:checked")))):z(ke)}),Object(c.addFilter)("carbon-fields.conditional-display-post-format.gutenberg","carbon-fields/metaboxes",function(){return Object(Y.pipe)(Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"format"),X(),Object(Y.filter)(Boolean),Object(Y.map)(function(e){return{post_format:e}}),xe(ke))});var Pe={post_template:""};function Le(e){var t=e.value;return"default"===t&&(t=""),{post_template:t}}Object(c.addFilter)("carbon-fields.conditional-display-post-template.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#page_template");return e?Object(Y.pipe)(Object(Y.fromEvent)(e,"change"),Object(Y.map)(function(e){return Le(e.target)}),xe(Le(e))):z(Pe)}),Object(c.addFilter)("carbon-fields.conditional-display-post-template.gutenberg","carbon-fields/metaboxes",function(){return Object(Y.pipe)(Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"template"),X(),Object(Y.filter)(u.isString),Object(Y.map)(function(e){return{post_template:e}}),xe(Pe))});var Re=n(15),Be=n.n(Re);function Ve(e,t){e["original_".concat(t)]=e[t],e[t]=function(){var n=new Event("change"),r=window.jQuery(arguments.length<=0?void 0:arguments[0]).closest(".postbox").find("textarea.the-tags").get(0),o=e["original_".concat(t)].apply(e,arguments);return r.dispatchEvent(n),o}}window.tagBox&&(Ve(window.tagBox,"parseTags"),Ve(window.tagBox,"flushTags")),Object(c.addFilter)("carbon-fields.conditional-display-post-term.classic","carbon-fields/metaboxes",function(){return Object(Y.pipe)(Y.merge.apply(void 0,Be()((e=document.querySelectorAll('div[id^="taxonomy-"]'),Be()(e).map(function(e){var t=e.id.replace("taxonomy-","");return Object(Y.pipe)(Ne(e.querySelector("#".concat(t,"checklist")),'input[type="checkbox"]',"change"),Object(Y.scan)(function(e,n){var r=n.target;return m()(e,function(e){var n=parseInt(r.value,10);r.checked?e[t].push(n):Object(u.pull)(e[t],n)})},d()({},t,[])),xe(function(e){var t=document.querySelectorAll("#".concat(e,'checklist input[type="checkbox"]:checked'));return Be()(t).reduce(function(t,n){var r=parseInt(n.value,10);return t[e].push(r),t},d()({},e,[]))}(t)))}))).concat(Be()(function(){var e=document.querySelectorAll('div[id^="tagsdiv-"]');return Be()(e).map(function(e){var t=e.id.replace("tagsdiv-","");return Object(Y.pipe)(Object(Y.fromEvent)(e.querySelector("textarea.the-tags"),"change"),Object(Y.map)(function(e){var n=e.target;return d()({},t,n.value?n.value.split(window.tagsSuggestL10n.tagDelimiter):[])}),xe(function(e){var t=document.querySelector("#tagsdiv-".concat(e," textarea.the-tags")),n=t.value?t.value.split(window.tagsSuggestL10n.tagDelimiter):[];return d()({},e,n)}(t)))})}()))),Object(Y.scan)(function(e,t){return{post_term:p()({},e.post_term,t)}},{post_term:{}}));var e}),Object(c.addFilter)("carbon-fields.conditional-display-post-term.gutenberg","carbon-fields/metaboxes",function(){var e=Object(a.select)("core").getTaxonomies,t=Object(a.select)("core/editor").getEditedPostAttribute;return Object(Y.pipe)(Object(v.fromSelector)(e,{per_page:-1}),Object(Y.filter)(Boolean),Object(Y.map)(function(e){var n=e.map(function(e){return[e.slug,t(e.rest_base)||[]]});return{post_term:Object(u.fromPairs)(n)}}))});var Ue={term_ancestors:[],term_parent:0,term_level:1};function qe(e){var t=e.options[e.selectedIndex];return{term_ancestors:Fe(t),term_parent:Se(t),term_level:Ie(t)+1}}Object(c.addFilter)("carbon-fields.conditional-display-term-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent");return e?Object(Y.pipe)(Object(Y.fromEvent)(e,"change"),Object(Y.map)(function(e){return qe(e.target)}),xe(qe(e))):z(Ue)});var Me={user_role:""};function Qe(e){return{user_role:e.value}}Object(c.addFilter)("carbon-fields.conditional-display-user-role.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#role");if(!e){var t=document.querySelector("fieldset[data-profile-role]");return z(t?{user_role:t.dataset.profileRole}:Me)}return Object(Y.pipe)(Object(Y.fromEvent)(e,"change"),Object(Y.map)(function(e){return Qe(e.target)}),xe(Qe(e)))});var Ke=Object(Q.createHigherOrderComponent)(function(e){return Object(a.withSelect)(function(e,t){var n=t.id;return{container:e("carbon-fields/metaboxes").getContainerById(n)}})(e)},"withContainer");Object(c.addFilter)("carbon-fields.register-container-type","carbon-fields/metaboxes",function(e,t,n){return Object(Q.compose)(Ke,Object(v.withFilters)("carbon-fields.".concat(e,".").concat(t)))(n)}),n(37),Object(c.addFilter)("carbon-fields.widget.classic","carbon-fields/metaboxes",Object(we.withEffects)(function(e){var t=e.mount;return Object(Y.pipe)(t,Object(Y.map)(function(){return{type:"COMPONENT_MOUNTED"}}))},{handler:function(e){return function(t){switch(t.type){case"COMPONENT_MOUNTED":var n=e.container,r=window.jQuery(".container-".concat(n.id));r.closest(".widget").find(".widget-top").on("click",function(){setTimeout(function(){r.trigger("change"),r.closest("form").find('input[type="submit"]').trigger("click")},500)})}}}}));var We=n(23),$e=n.n(We);function ze(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.data.indexOf("add-tag")>-1&&!n.documentElement.querySelector("wp_error")}))},{handler:function(e){return function(){var t=l.a.map(e.container.fields,"id"),n=V(l.a.get(window.cf,"preloaded.containers",[])),r=n.containers,o=n.fields,i=l.a.find(r,["id",e.id]),c=l.a.filter(o,["container_id",e.id]),u=Object(a.dispatch)("carbon-fields/metaboxes"),s=u.updateState,d=u.removeFields;s(l.a.keyBy([i],"id"),l.a.keyBy(c,"id")),d(t)}}})),n(38),Object(c.addFilter)("carbon-fields.theme_options.classic","carbon-fields/metaboxes",Object(we.withEffects)(function(){return Object(Y.pipe)(Object(Y.fromEvent)(window,"scroll"),Object(Y.map)(function(){return window.jQuery(window).scrollTop()}))},{handler:function(){return function(e){var t=window.jQuery(".carbon-box:first"),n=window.jQuery("#postbox-container-1"),r=window.jQuery("#wpadminbar").height()+10,o=t.offset().top-r;o>0&&n.toggleClass("fixed",e>=o).css("top",r)}}})),n(39);var He=n(21),Je=n.n(He),Xe=(n(40),function(e){function t(){var e,n;ie()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i-1},evaluate:function(){return!1}},rt={comparers:[p()({},nt,{operators:["=","!="],evaluate:function(e,t,n){switch(t){case"=":return e==n;case"!=":return e!=n;default:return!1}}}),p()({},nt,{operators:["IN","NOT IN"],evaluate:function(e,t,n){switch(t){case"IN":return n.indexOf(e)>-1;case"NOT IN":return-1===n.indexOf(e);default:return!1}}}),p()({},nt,{operators:[">",">=","<","<="],evaluate:function(e,t,n){switch(t){case">":return e>n;case">=":return e>=n;case"<":return e0;case"NOT IN":return 0===Object(u.intersection)(e,n).length;default:return!1}}}),lt=p()({},rt,{comparers:[it,ut],getEnvironmentValue:function(e,t){return Object(u.get)(t,"post_ancestors",[])}}),st=p()({},rt,{isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(u.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(u.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)}}),dt=p()({},rt,{comparers:[it,ut],isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(u.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(u.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)},getEnvironmentValue:function(e,t){return Object(u.get)(t,"term_ancestors",[])}}),ft={boolean:ot,post_term:ct,post_ancestor_id:lt,post_parent_id:rt,post_level:rt,post_format:rt,post_template:at,term_level:rt,term_parent:st,term_ancestor:dt,user_role:rt},pt=Object(a.withSelect)(function(e){return{containers:e("carbon-fields/metaboxes").getContainers()}}),bt=Object(we.withEffects)(function(e,t){var n=t.context,r=Object(c.applyFilters)("carbon-fields.conditional-display-post-parent.".concat(n)),o=Object(c.applyFilters)("carbon-fields.conditional-display-post-format.".concat(n)),i=Object(c.applyFilters)("carbon-fields.conditional-display-post-template.".concat(n)),a=Object(c.applyFilters)("carbon-fields.conditional-display-post-term.".concat(n)),l=Object(c.applyFilters)("carbon-fields.conditional-display-term-parent.".concat(n)),s=Object(c.applyFilters)("carbon-fields.conditional-display-user-role.".concat(n));return Object(Y.pipe)(Object(Y.merge)(r,o,i,a,l,s),Object(Y.scan)(function(e,t){return m()(e,function(e){Object(u.assign)(e,t)})}))},{handler:function(e){var t=e.containers,n=e.context;return function(e){Object(u.map)(t,function(t,n){return[n,function e(t,n,r){var o=t.map(function(t){if(t.relation)return e(t.conditions,n,t.relation);var r=Object(u.get)(ft,t.type);return r?r.isFulfiled(t,n):(console.error(Object(i.sprintf)(Object(i.__)('Unsupported container condition - "%1$s".',"carbon-fields-ui"),t.type)),!1)});switch(r){case"AND":return o.every(Boolean);case"OR":return o.some(Boolean);default:return console.error(Object(i.sprintf)(Object(i.__)('Unsupported container condition relation used - "%1$s".',"carbon-fields-ui"),r)),!1}}(t.conditions.conditions,e,t.conditions.relation)]}).forEach(function(e){var r=$()(e,2),o=r[0],i=r[1],c=document.getElementById(o),a=document.querySelector(".container-".concat(o)),u=!!a.dataset.mounted;c&&(c.hidden=!i),a&&(i&&!u&&tt(t[o],n),!i&&u&&(delete a.dataset.mounted,a._reactRootContainer.unmount()))})}}}),mt=Object(Q.compose)(pt,bt)(function(){return null});function vt(e){return decodeURIComponent((e+"").replace(/%(?![\da-f]{2})/gi,function(){return"%25"}).replace(/\+/g,"%20"))}var Ot="customize.php",jt="carbon_fields_container_",gt=Object(we.withEffects)(function(){return Object(Y.merge)(Object(Y.pipe)(ze(function(e){return window.jQuery(document).on("widget-added widget-updated",e)},function(e){return window.jQuery(document).off("widget-added widget-updated",e)},function(e,t){return{event:e,$widget:t}}),Object(Y.filter)(function(e){return e.$widget[0].id.indexOf("carbon_fields_")>-1}),Object(Y.map)(function(e){return{type:"WIDGET_CREATED_OR_UPDATED",payload:e}})),Object(Y.pipe)(ze(function(e){return window.jQuery(document).on("ajaxSend",e)},function(e){return window.jQuery(document).off("ajaxSend",e)},function(e,t,n,r){return{event:e,xhr:t,options:n,data:r}}),Object(Y.filter)(function(e){var t=e.options;return Object(u.startsWith)(t.data,jt)}),Object(Y.map)(function(e){return{type:"WIDGET_BEIGN_UPDATED_OR_DELETED",payload:e}})))},{handler:function(){return function(e){var t=Object(a.select)("carbon-fields/metaboxes").getContainerById,n=Object(a.dispatch)("carbon-fields/metaboxes"),r=n.addContainer,o=n.removeContainer,i=n.addFields,c=n.removeFields;switch(e.type){case"WIDGET_CREATED_OR_UPDATED":var l=e.payload,s=l.event,d=l.$widget,f=Object(u.flow)(vt,JSON.parse)(d.find("[data-json]").data("json")),p=[];if(f.fields=f.fields.map(function(e){return B(e,f,p)}),i(p),r(f),tt(f,"classic"),window.cf.config.pagenow===Ot&&"widget-added"===s.type){var b=d.find('[name="widget-id"]').val();d.find('[name="savewidget"]').show().end().find(".widget-content:first").off("keydown","input").off("change input propertychange",":input"),wp.customize.Widgets.getWidgetFormControlForWidget(b).liveUpdateMode=!1}break;case"WIDGET_BEIGN_UPDATED_OR_DELETED":var m=e.payload.options.data.match(/widget-id=(.+?)&/),v=$()(m,2)[1],O="".concat(jt).concat(v),j=t(O);Object(ve.unmountComponentAtNode)(document.querySelector(".container-".concat(O)));var g=_.map(j.fields,"id");o(O),c(g)}}}})(function(){return null}),yt=Object(a.withSelect)(function(e){return{isDirty:e("carbon-fields/metaboxes").isDirty()}})(function(e){return wp.element.createElement("input",{type:"hidden",name:window.cf.config.revisionsInputKey,disabled:!e.isDirty,value:"1"})});n.d(t,"registerContainerType",function(){return Ze}),n.d(t,"getContainerType",function(){return et}),Object(i.setLocaleData)(window.cf.config.locale,"carbon-fields-ui");var ht=ne()?"gutenberg":"classic";Object(c.addAction)("carbon-fields.init","carbon-fields/metaboxes",function(){var e,t;e=ht,t=Object(a.select)("carbon-fields/metaboxes").getContainers(),Object(u.forEach)(t,function(t){tt(t,e)}),function(e){var t=window.cf.config.pagenow;Object(ve.render)(wp.element.createElement(ve.Fragment,null,!ne()&&wp.element.createElement(Ee,null),("widgets.php"===t||t===Ot)&&wp.element.createElement(gt,null),wp.element.createElement(mt,{context:e})),document.createElement("div"));var n=document.querySelector("#poststuff");n&&Object(ve.render)(wp.element.createElement(yt,null),n.appendChild(document.createElement("div")))}(ht)})}]); \ No newline at end of file +this.cf=this.cf||{},this.cf.metaboxes=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=41)}([function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.cf.vendor["callbag-basics"]}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.cf.core}()},function(e,t,n){var r=n(8);e.exports=function(e){for(var t=1;tt=>(n,r)=>{if(0!==n)return;let o;t(0,(t,n)=>{0===t?(o=n,r(t,n)):1===t?e(n)?r(t,n):o(1):r(t,n)})})},function(e,t){e.exports=(e=>(t,n)=>{if(0!==t)return;if("function"!=typeof e)return n(0,()=>{}),void n(2);let r,o;const i=e=>{(r=r||2===e)&&"function"==typeof o&&o()};n(0,i),o=e((e,t)=>{r||0===e||(n(e,t),i(e))})})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.containers;case"UPDATE_STATE":return m()(e,function(e){Object(u.values)(t.payload.containers).forEach(function(t){e[t.id]=t})});case"ADD_CONTAINER":return m()(e,function(e){e[t.payload.id]=t.payload});case"REMOVE_CONTAINER":return Object(u.omit)(e,t.payload);default:return e}},fields:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.fields;case"UPDATE_STATE":return m()(e,function(e){Object(u.values)(t.payload.fields).forEach(function(t){e[t.id]=t})});case"UPDATE_FIELD_VALUE":return m()(e,function(n){var r=t.payload,o=r.fieldId,i=r.value,c=r.fieldsToRemove;n[o].value=i,c.reduce(function(t,n){return O(n,e,t)},[]).forEach(function(e){Object(u.unset)(n,e)})});case"ADD_FIELDS":return m()(e,function(e){t.payload.fields.forEach(function(t){e[t.id]=t})});case"CLONE_FIELDS":return m()(e,function(e){var n=t.payload,r=n.originFieldIds,o=n.cloneFieldIds,i=r.reduce(function(t,n,r){return function e(t,n,r,o){var i=Object(u.cloneDeep)(r[t]);return i.id=n,"complex"===i.type&&i.value.forEach(function(t){t.id=Object(v.uniqueId)(),o=t.fields.reduce(function(t,n){var o=n.id,i=Object(v.uniqueId)();return n.id=i,e(o,i,r,t)},o)}),o.concat(i)}(n,o[r],e,t)},[]);Object(u.assign)(e,Object(u.keyBy)(i,"id"))});case"REMOVE_FIELDS":var n=t.payload.fieldIds.reduce(function(t,n){return O(n,e,t)},[]);return Object(u.omit)(e,n);case"RECEIVE_SIDEBAR":return m()(e,function(e){Object(u.forEach)(e,function(e){"sidebar"===e.type&&e.options.unshift(t.payload)})});default:return e}},savingLock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_SAVING":return p()({},e,d()({},t.payload.lockName,!0));case"UNLOCK_SAVING":return Object(u.omit)(e,[t.payload.lockName]);default:return e}},isDirty:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"UPDATE_FIELD_VALUE":return!0;default:return e}}});function g(e,t){return{type:"SETUP_STATE",payload:{containers:e,fields:t}}}function y(e,t){return{type:"UPDATE_STATE",payload:{containers:e,fields:t}}}function h(e,t){return{type:"UPDATE_FIELD_VALUE",payload:{fieldId:e,value:t,fieldsToRemove:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]}}}function w(e){return{type:"ADD_FIELDS",payload:{fields:e}}}function E(e,t){return{type:"CLONE_FIELDS",payload:{originFieldIds:e,cloneFieldIds:t}}}function x(e){return{type:"REMOVE_FIELDS",payload:{fieldIds:e}}}function S(e){return{type:"ADD_CONTAINER",payload:e}}function I(e){return{type:"REMOVE_CONTAINER",payload:e}}function F(e){return{type:"RECEIVE_SIDEBAR",payload:e}}function T(e){return{type:"LOCK_SAVING",payload:{lockName:e}}}function C(e){return{type:"UNLOCK_SAVING",payload:{lockName:e}}}function A(e){return e.containers}function D(e,t){return e.containers[t]}function N(e){return e.fields}function k(e,t){return Object(u.filter)(e.fields,["container_id",t])}function G(e,t){return e.fields[t]}function P(e){return Object.keys(e.savingLock).length>0}function L(e){return e.isDirty}function R(e,t){var n=Object(u.pick)(N(e),t);return n=Object(u.mapKeys)(n,function(e){return e.base_name.replace(/\-/g,"_")}),Object(u.mapValues)(n,function(e){return e.value})}function B(e,t,n){return(e=Object(u.cloneDeep)(e)).id=Object(v.uniqueId)(),e.container_id=t,"complex"===e.type&&e.value.forEach(function(e){e.id=Object(v.uniqueId)(),e.container_id=t,e.fields=e.fields.map(function(e){return B(e,t,n)})}),n.push(e),Object(u.pick)(e,["id","type","name","base_name"])}function V(e){var t=[];return{containers:e.filter(function(e){var t=e.id;return!Object(u.endsWith)(t,"__i__")}).map(function(e){return Object(u.assign)({},e,{fields:e.fields.map(function(n){return B(n,e.id,t)})})}),fields:t}}Object(a.registerStore)("carbon-fields/metaboxes",{reducer:j,actions:r,selectors:o});var U=V(Object(u.get)(window.cf,"preloaded.containers",[])),q=U.containers,M=U.fields;Object(a.dispatch)("carbon-fields/metaboxes").setupState(Object(u.keyBy)(q,"id"),Object(u.keyBy)(M,"id"));var Q=n(10),K=Object(Q.createHigherOrderComponent)(function(e){var t=Object(a.withSelect)(function(e,t){var n=window.cf.config,r=n.compactInput,o=n.compactInputKey,i=e("carbon-fields/metaboxes").getFieldById(t.id),c=i&&i.value,a=t.name||i.name;return r&&!t.name&&-1===a.indexOf("widget-carbon_fields")&&(a="".concat(o,"[").concat(a,"]")),{field:i,name:a,value:c}}),n=Object(a.withDispatch)(function(e){return{onChange:e("carbon-fields/metaboxes").updateFieldValue}});return Object(Q.compose)(t,n)(e)},"withField"),W=n(13),$=n.n(W),z=function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:[];return void 0===e?[]:Object(u.pick)(t,Object(u.difference)(Object(u.map)(e.fields,"id"),n))}function ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(u.map)(e,function(e){return[e.id,"".concat(Object(u.repeat)("parent.",t)).concat(e.base_name)]})}var te=Object(v.withConditionalLogic)(function(e,t){var n=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId;return Object(Y.pipe)(Object(Y.merge)(z(n(e.containerId)),Object(v.fromSelector)(n,e.containerId)),(e=>t=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=H;t(0,(t,n)=>{if(0===t)return o=n,e(0,(e,t)=>{if(0!==e)return 1===e?(a=void 0,i(2),o(2),void(c&&r(2))):void(2===e&&(i=null,a=t,null!=t&&(o(2),c&&r(e,t))));(i=t)(1)}),c=!0,r(0,(e,t)=>{a===H&&(2===e&&i&&i(2),o(e,t))}),void(a!==H&&r(2,a));2===t&&i(2),a===H&&r(t,n)})})(t.unmount),X(u.isEqual))},function(e,t){t=Object(u.keyBy)(t,"id");var n=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),r=[];if(Object(u.some)(n.fields,["id",e.id]))r=ee(r=Z(n,t,[e.id]));else{var o=e.name.replace(new RegExp("^".concat(window.cf.config.compactInputKey,"\\[(.+?)\\]")),"$1"),i=Object(u.find)(t,function(t){return t.container_id===e.containerId&&Object(u.startsWith)(o,t.name)}),c=o.split(/\[|\]/g);c.shift(),(c=c.filter(function(e){return""!==e})).pop();var l=c.reduce(function(e,t){return isNaN(t)?e+1:e},0);r=ee(r=Z(n,t,[i.id]),l+1);for(var s="".concat(i.id,".value");c.length>0;){var d=c.shift(),f=!isNaN(d),p=!f;if(f){s="".concat(s,"[").concat(d,"]");var b=Z(Object(u.get)(t,s),t,[e.id]);r=r.concat(ee(b,l)),s="".concat(s,".fields")}if(p){var m=Object(u.find)(Object(u.get)(t,s),["name",d]);s="".concat(m.id,".value"),l--}}}return r=r.map(function(e){var n=$()(e,2),r=n[0];return[n[1],Object(u.get)(t,"".concat(r,".value"))]}),Object(u.fromPairs)(r)});function ne(){return!Object(u.isUndefined)(window._wpLoadBlockEditor)}function re(e,t){return Object(u.find)(e,function(e){return e.name===t})}Object(c.addFilter)("carbon-fields.association.metabox","carbon-fields/metaboxes",Object(v.withProps)(function(e){return{hierarchyResolver:function(){for(var t,n,r,o,i=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId(e.containerId),c=(t=e.name,n=window.cf.config,r=n.compactInput,o=n.compactInputKey,r&&0===t.indexOf(o)?t.replace(new RegExp("^".concat(o,"\\[(.+?)\\]")),"$1"):t).split(/\[|\]/g),l=re(i,(c=c.filter(function(e){return""!==e})).shift()),s=i.indexOf(l),d=l.base_name;c.length>0;){var f=c.shift(),p=!isNaN(f),b=f===e.field.base_name,m=!p&&!b;if(p&&(s="".concat(s,".value.").concat(f,".name"),d="".concat(d,"[").concat(f,"]:").concat(Object(u.get)(i,s),"/")),m){var v=re(Object(u.get)(i,s.replace(/\.name$/,".fields")),f),O=Object(u.find)(i,["id",v.id]);s=i.indexOf(O),d="".concat(d).concat(O.base_name)}b&&(d="".concat(d).concat(f))}return d}}}));var oe=n(16),ie=n.n(oe),ce=n(17),ae=n.n(ce),ue=n(18),le=n.n(ue),se=n(19),de=n.n(se),fe=n(20),pe=n.n(fe),be=n(7),me=n.n(be),ve=n(12),Oe=(n(29),n(30),Object(Q.compose)(K,Object(v.withFilters)("carbon-fields.field-wrapper.metabox"))(v.Field)),je=function(e){function t(){var e,n;ie()(this,t);for(var r=arguments.length,o=new Array(r),i=0;it=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=!1;for(r(0,(t,n)=>{a&&1===t&&(i=[1,n]),2===t&&(c=!0,e.length=0),o&&o(t,n)});0!==e.length;)1===e.length&&(a=!0),r(1,e.shift());c||t(0,(e,t)=>{if(0===e)return o=t,a=!1,void(i&&(o(...i),i=null));r(e,t)})};function Se(e){var t=parseInt(e.value,10);return!isNaN(t)&&t>=0?t:0}function Ie(e){var t=0;if(e.className){var n=e.className.match(/^level-(\d+)/);n&&(t=parseInt(n[1],10)+1)}return t}function Fe(e){for(var t=[],n=e,r=Ie(e);r>0&&n;)if(Ie(n)===r){var o=parseInt(n.value,10);o>0&&t.unshift(o),n=n.previousSibling,r--}else n=n.previousSibling;return t}var Te={post_ancestors:[],post_parent_id:0,post_level:1};function Ce(e){var t=e.options[e.selectedIndex];return{post_ancestors:Fe(t),post_parent_id:Se(t),post_level:Ie(t)+1}}Object(c.addFilter)("carbon-fields.conditional-display-post-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent_id");return e?Object(Y.pipe)(Object(Y.fromEvent)(e,"change"),Object(Y.map)(function(e){return Ce(e.target)}),xe(Ce(e))):z(Te)}),Object(c.addFilter)("carbon-fields.conditional-display-post-parent.gutenberg","carbon-fields/metaboxes",function(){var e=Object(a.select)("core"),t=e.getPostType,n=e.getEntityRecords;return Object(Y.pipe)(Object(Y.combine)(Object(v.fromSelector)(Object(a.select)("core/editor").getCurrentPostId),Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"type"),Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"parent")),X(u.isEqual),Object(Y.map)(function(e){var r=$()(e,3),o=r[0],i=r[1],c=r[2];if(c=parseInt(c,10),isNaN(c))return Te;var a=t(i);if(!Object(u.get)(a,["hierarchical"],!1))return Te;var l=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=Object(u.find)(n,["id",t]);return o?(r.unshift(o.id),o.parent?e(o.parent,n,r):r):r}(c,n("postType",i,{per_page:-1,exclude:o,parent_exclude:o,orderby:"menu_order",order:"asc"})||[]);return{post_ancestors:l,post_parent_id:c,post_level:l.length+1}}))});var Ae=n(22),De=n.n(Ae),Ne=(e,t,n)=>De()(n=>{let r=n.target;for(;r!==e;){if(r.matches(t))return!0;r=r.parentElement}return!1})(((e,t,n)=>(r,o)=>{if(0!==r)return;let i=!1;const c=e=>{o(1,e)};o(0,r=>{2===r&&(i=!0,e.removeEventListener(t,c,n))}),i||e.addEventListener(t,c,n)})(e,n)),ke={post_format:"standard"};function Ge(e){var t=e.value;return"0"===t&&(t="standard"),{post_format:t}}Object(c.addFilter)("carbon-fields.conditional-display-post-format.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("div#post-formats-select");return e?Object(Y.pipe)(Ne(e,"input.post-format","change"),Object(Y.map)(function(e){return Ge(e.target)}),xe(Ge(e.querySelector("input.post-format:checked")))):z(ke)}),Object(c.addFilter)("carbon-fields.conditional-display-post-format.gutenberg","carbon-fields/metaboxes",function(){return Object(Y.pipe)(Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"format"),X(),Object(Y.filter)(Boolean),Object(Y.map)(function(e){return{post_format:e}}),xe(ke))});var Pe={post_template:""};function Le(e){var t=e.value;return"default"===t&&(t=""),{post_template:t}}Object(c.addFilter)("carbon-fields.conditional-display-post-template.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#page_template");return e?Object(Y.pipe)(Object(Y.fromEvent)(e,"change"),Object(Y.map)(function(e){return Le(e.target)}),xe(Le(e))):z(Pe)}),Object(c.addFilter)("carbon-fields.conditional-display-post-template.gutenberg","carbon-fields/metaboxes",function(){return Object(Y.pipe)(Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"template"),X(),Object(Y.filter)(u.isString),Object(Y.map)(function(e){return{post_template:e}}),xe(Pe))});var Re=n(15),Be=n.n(Re);function Ve(e,t){e["original_".concat(t)]=e[t],e[t]=function(){var n=new Event("change"),r=window.jQuery(arguments.length<=0?void 0:arguments[0]).closest(".postbox").find("textarea.the-tags").get(0),o=e["original_".concat(t)].apply(e,arguments);return r.dispatchEvent(n),o}}window.tagBox&&(Ve(window.tagBox,"parseTags"),Ve(window.tagBox,"flushTags")),Object(c.addFilter)("carbon-fields.conditional-display-post-term.classic","carbon-fields/metaboxes",function(){return Object(Y.pipe)(Y.merge.apply(void 0,Be()((e=document.querySelectorAll('div[id^="taxonomy-"]'),Be()(e).map(function(e){var t=e.id.replace("taxonomy-","");return Object(Y.pipe)(Ne(e.querySelector("#".concat(t,"checklist")),'input[type="checkbox"]',"change"),Object(Y.scan)(function(e,n){var r=n.target;return m()(e,function(e){var n=parseInt(r.value,10);r.checked?e[t].push(n):Object(u.pull)(e[t],n)})},d()({},t,[])),xe(function(e){var t=document.querySelectorAll("#".concat(e,'checklist input[type="checkbox"]:checked'));return Be()(t).reduce(function(t,n){var r=parseInt(n.value,10);return t[e].push(r),t},d()({},e,[]))}(t)))}))).concat(Be()(function(){var e=document.querySelectorAll('div[id^="tagsdiv-"]');return Be()(e).map(function(e){var t=e.id.replace("tagsdiv-","");return Object(Y.pipe)(Object(Y.fromEvent)(e.querySelector("textarea.the-tags"),"change"),Object(Y.map)(function(e){var n=e.target;return d()({},t,n.value?n.value.split(window.tagsSuggestL10n.tagDelimiter):[])}),xe(function(e){var t=document.querySelector("#tagsdiv-".concat(e," textarea.the-tags")),n=t.value?t.value.split(window.tagsSuggestL10n.tagDelimiter):[];return d()({},e,n)}(t)))})}()))),Object(Y.scan)(function(e,t){return{post_term:p()({},e.post_term,t)}},{post_term:{}}));var e}),Object(c.addFilter)("carbon-fields.conditional-display-post-term.gutenberg","carbon-fields/metaboxes",function(){var e=Object(a.select)("core").getTaxonomies,t=Object(a.select)("core/editor").getEditedPostAttribute;return Object(Y.pipe)(Object(v.fromSelector)(e,{per_page:-1}),Object(Y.filter)(Boolean),Object(Y.map)(function(e){var n=e.map(function(e){return[e.slug,t(e.rest_base)||[]]});return{post_term:Object(u.fromPairs)(n)}}))});var Ue={term_ancestors:[],term_parent:0,term_level:1};function qe(e){var t=e.options[e.selectedIndex];return{term_ancestors:Fe(t),term_parent:Se(t),term_level:Ie(t)+1}}Object(c.addFilter)("carbon-fields.conditional-display-term-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent");return e?Object(Y.pipe)(Object(Y.fromEvent)(e,"change"),Object(Y.map)(function(e){return qe(e.target)}),xe(qe(e))):z(Ue)});var Me={user_role:""};function Qe(e){return{user_role:e.value}}Object(c.addFilter)("carbon-fields.conditional-display-user-role.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#role");if(!e){var t=document.querySelector("fieldset[data-profile-role]");return z(t?{user_role:t.dataset.profileRole}:Me)}return Object(Y.pipe)(Object(Y.fromEvent)(e,"change"),Object(Y.map)(function(e){return Qe(e.target)}),xe(Qe(e)))});var Ke=Object(Q.createHigherOrderComponent)(function(e){return Object(a.withSelect)(function(e,t){var n=t.id;return{container:e("carbon-fields/metaboxes").getContainerById(n)}})(e)},"withContainer");Object(c.addFilter)("carbon-fields.register-container-type","carbon-fields/metaboxes",function(e,t,n){return Object(Q.compose)(Ke,Object(v.withFilters)("carbon-fields.".concat(e,".").concat(t)))(n)}),n(37),Object(c.addFilter)("carbon-fields.widget.classic","carbon-fields/metaboxes",Object(we.withEffects)(function(e){var t=e.mount;return Object(Y.pipe)(t,Object(Y.map)(function(){return{type:"COMPONENT_MOUNTED"}}))},{handler:function(e){return function(t){switch(t.type){case"COMPONENT_MOUNTED":var n=e.container,r=window.jQuery(".container-".concat(n.id));r.closest(".widget").find(".widget-top").on("click",function(){setTimeout(function(){r.trigger("change"),r.closest("form").find('input[type="submit"]').trigger("click")},500)})}}}}));var We=n(23),$e=n.n(We);function ze(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.data.indexOf("add-tag")>-1&&!n.documentElement.querySelector("wp_error")}))},{handler:function(e){return function(){var t=l.a.map(e.container.fields,"id"),n=V(l.a.get(window.cf,"preloaded.containers",[])),r=n.containers,o=n.fields,i=l.a.find(r,["id",e.id]),c=l.a.filter(o,["container_id",e.id]),u=Object(a.dispatch)("carbon-fields/metaboxes"),s=u.updateState,d=u.removeFields;s(l.a.keyBy([i],"id"),l.a.keyBy(c,"id")),d(t)}}})),n(38),Object(c.addFilter)("carbon-fields.theme_options.classic","carbon-fields/metaboxes",Object(we.withEffects)(function(){return Object(Y.pipe)(Object(Y.fromEvent)(window,"scroll"),Object(Y.map)(function(){return window.jQuery(window).scrollTop()}))},{handler:function(){return function(e){var t=window.jQuery(".carbon-box:first"),n=window.jQuery("#postbox-container-1"),r=window.jQuery("#wpadminbar").height()+10,o=t.offset().top-r;o>0&&n.toggleClass("fixed",e>=o).css("top",r)}}})),n(39);var He=n(21),Je=n.n(He),Xe=(n(40),function(e){function t(){var e,n;ie()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i-1},evaluate:function(){return!1}},rt={comparers:[p()({},nt,{operators:["=","!="],evaluate:function(e,t,n){switch(t){case"=":return e==n;case"!=":return e!=n;default:return!1}}}),p()({},nt,{operators:["IN","NOT IN"],evaluate:function(e,t,n){switch(t){case"IN":return n.indexOf(e)>-1;case"NOT IN":return-1===n.indexOf(e);default:return!1}}}),p()({},nt,{operators:[">",">=","<","<="],evaluate:function(e,t,n){switch(t){case">":return e>n;case">=":return e>=n;case"<":return e0;case"NOT IN":return 0===Object(u.intersection)(e,n).length;default:return!1}}}),lt=p()({},rt,{comparers:[it,ut],getEnvironmentValue:function(e,t){return Object(u.get)(t,"post_ancestors",[])}}),st=p()({},rt,{isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(u.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(u.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)}}),dt=p()({},rt,{comparers:[it,ut],isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(u.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(u.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)},getEnvironmentValue:function(e,t){return Object(u.get)(t,"term_ancestors",[])}}),ft={boolean:ot,post_term:ct,post_ancestor_id:lt,post_parent_id:rt,post_level:rt,post_format:rt,post_template:at,term_level:rt,term_parent:st,term_ancestor:dt,user_role:rt},pt=Object(a.withSelect)(function(e){return{containers:e("carbon-fields/metaboxes").getContainers()}}),bt=Object(we.withEffects)(function(e,t){var n=t.context,r=Object(c.applyFilters)("carbon-fields.conditional-display-post-parent.".concat(n)),o=Object(c.applyFilters)("carbon-fields.conditional-display-post-format.".concat(n)),i=Object(c.applyFilters)("carbon-fields.conditional-display-post-template.".concat(n)),a=Object(c.applyFilters)("carbon-fields.conditional-display-post-term.".concat(n)),l=Object(c.applyFilters)("carbon-fields.conditional-display-term-parent.".concat(n)),s=Object(c.applyFilters)("carbon-fields.conditional-display-user-role.".concat(n));return Object(Y.pipe)(Object(Y.merge)(r,o,i,a,l,s),Object(Y.scan)(function(e,t){return m()(e,function(e){Object(u.assign)(e,t)})}))},{handler:function(e){var t=e.containers,n=e.context;return function(e){Object(u.map)(t,function(t,n){return[n,function e(t,n,r){var o=t.map(function(t){if(t.relation)return e(t.conditions,n,t.relation);var r=Object(u.get)(ft,t.type);return r?r.isFulfiled(t,n):(console.error(Object(i.sprintf)(Object(i.__)('Unsupported container condition - "%1$s".',"carbon-fields-ui"),t.type)),!1)});switch(r){case"AND":return o.every(Boolean);case"OR":return o.some(Boolean);default:return console.error(Object(i.sprintf)(Object(i.__)('Unsupported container condition relation used - "%1$s".',"carbon-fields-ui"),r)),!1}}(t.conditions.conditions,e,t.conditions.relation)]}).forEach(function(e){var r=$()(e,2),o=r[0],i=r[1],c=document.getElementById(o),a=document.querySelector(".container-".concat(o)),u=!!a.dataset.mounted;c&&(c.hidden=!i),a&&(i&&!u&&tt(t[o],n),!i&&u&&(delete a.dataset.mounted,a._reactRootContainer.unmount()))})}}}),mt=Object(Q.compose)(pt,bt)(function(){return null});function vt(e){return decodeURIComponent((e+"").replace(/%(?![\da-f]{2})/gi,function(){return"%25"}).replace(/\+/g,"%20"))}var Ot="customize.php",jt="carbon_fields_container_",gt=Object(we.withEffects)(function(){return Object(Y.merge)(Object(Y.pipe)(ze(function(e){return window.jQuery(document).on("widget-added widget-updated",e)},function(e){return window.jQuery(document).off("widget-added widget-updated",e)},function(e,t){return{event:e,$widget:t}}),Object(Y.filter)(function(e){return e.$widget[0].id.indexOf("carbon_fields_")>-1}),Object(Y.map)(function(e){return{type:"WIDGET_CREATED_OR_UPDATED",payload:e}})),Object(Y.pipe)(ze(function(e){return window.jQuery(document).on("ajaxSend",e)},function(e){return window.jQuery(document).off("ajaxSend",e)},function(e,t,n,r){return{event:e,xhr:t,options:n,data:r}}),Object(Y.filter)(function(e){var t=e.options;return Object(u.startsWith)(t.data,jt)}),Object(Y.map)(function(e){return{type:"WIDGET_BEIGN_UPDATED_OR_DELETED",payload:e}})))},{handler:function(){return function(e){var t=Object(a.select)("carbon-fields/metaboxes").getContainerById,n=Object(a.dispatch)("carbon-fields/metaboxes"),r=n.addContainer,o=n.removeContainer,i=n.addFields,c=n.removeFields;switch(e.type){case"WIDGET_CREATED_OR_UPDATED":var l=e.payload,s=l.event,d=l.$widget,f=Object(u.flow)(vt,JSON.parse)(d.find("[data-json]").data("json")),p=[];if(f.fields=f.fields.map(function(e){return B(e,f,p)}),i(p),r(f),tt(f,"classic"),window.cf.config.pagenow===Ot&&"widget-added"===s.type){var b=d.find('[name="widget-id"]').val();d.find('[name="savewidget"]').show().end().find(".widget-content:first").off("keydown","input").off("change input propertychange",":input"),wp.customize.Widgets.getWidgetFormControlForWidget(b).liveUpdateMode=!1}break;case"WIDGET_BEIGN_UPDATED_OR_DELETED":var m=e.payload.options.data.match(/widget-id=(.+?)&/),v=$()(m,2)[1],O="".concat(jt).concat(v),j=t(O);Object(ve.unmountComponentAtNode)(document.querySelector(".container-".concat(O)));var g=_.map(j.fields,"id");o(O),c(g)}}}})(function(){return null}),yt=Object(a.withSelect)(function(e){return{isDirty:e("carbon-fields/metaboxes").isDirty()}})(function(e){return wp.element.createElement("input",{type:"hidden",name:window.cf.config.revisionsInputKey,disabled:!e.isDirty,value:"1"})});n.d(t,"registerContainerType",function(){return Ze}),n.d(t,"getContainerType",function(){return et}),Object(i.setLocaleData)(window.cf.config.locale,"carbon-fields-ui");var ht=ne()?"gutenberg":"classic";Object(c.addAction)("carbon-fields.init","carbon-fields/metaboxes",function(){var e,t;e=ht,t=Object(a.select)("carbon-fields/metaboxes").getContainers(),Object(u.forEach)(t,function(t){tt(t,e)}),function(e){var t=window.cf.config.pagenow;Object(ve.render)(wp.element.createElement(ve.Fragment,null,!ne()&&wp.element.createElement(Ee,null),("widgets.php"===t||t===Ot)&&wp.element.createElement(gt,null),wp.element.createElement(mt,{context:e})),document.createElement("div"));var n=document.querySelector("#poststuff");n&&Object(ve.render)(wp.element.createElement(yt,null),n.appendChild(document.createElement("div")))}(ht)})}]); \ No newline at end of file diff --git a/languages/carbon-fields-ui.pot b/languages/carbon-fields-ui.pot index 02a6bddbf..eefb5af26 100644 --- a/languages/carbon-fields-ui.pot +++ b/languages/carbon-fields-ui.pot @@ -3,224 +3,22 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "X-Generator: babel-plugin-makepot\n" -#: packages/blocks/components/block-edit/index.js:214 -msgid "Show preview" -msgstr "" - -#: packages/blocks/components/block-edit/index.js:215 -msgid "Hide preview" -msgstr "" - -#: packages/blocks/components/block-edit/index.js:286 -msgid "Fields" -msgstr "" - -#: packages/blocks/components/not-supported-field/index.js:14 -msgid "Field of type '%s' is not supported in Gutenberg." -msgstr "" - -#: packages/blocks/components/server-side-render/index.js:129 -msgid "Error loading block: %s" -msgstr "" - -#: packages/blocks/components/server-side-render/index.js:135 -msgid "No results found." -msgstr "" - -#: packages/blocks/fields/datetime/index.js:59 -#: packages/core/fields/date/index.js:15 -#: packages/metaboxes/fields/datetime/index.js:9 -msgid "Select Date" -msgstr "" - -#: packages/blocks/fields/file/index.js:16 -#: packages/metaboxes/fields/file/index.js:11 -msgid "Use File" -msgstr "" - -#: packages/blocks/fields/file/index.js:17 -#: packages/metaboxes/fields/file/index.js:12 -msgid "Select File" -msgstr "" - -#: packages/blocks/fields/image/index.js:11 -#: packages/metaboxes/fields/image/index.js:11 -msgid "Use Image" -msgstr "" - -#: packages/blocks/fields/image/index.js:12 -#: packages/metaboxes/fields/image/index.js:12 -msgid "Select Image" -msgstr "" - -#: packages/blocks/fields/media-gallery/index.js:16 -#: packages/metaboxes/fields/media-gallery/index.js:16 -msgid "Use Attachments" -msgstr "" - -#: packages/blocks/fields/media-gallery/index.js:17 -#: packages/metaboxes/fields/media-gallery/index.js:17 -msgid "Select Attachments" -msgstr "" - -#: packages/core/components/no-options/index.js:14 -msgid "No options." -msgstr "" - -#: packages/core/components/search-input/index.js:30 -msgid "Search..." -msgstr "" - -#: packages/core/fields/association/index.js:168 +#: packages/core/fields/association/index.js:169 msgid "Maximum number of items reached (%s items)" msgstr "" -#: packages/core/fields/association/index.js:266 +#: packages/core/fields/association/index.js:267 msgid "Showing %1$d of %2$d results" msgstr "" -#: packages/core/fields/association/index.js:458 +#: packages/core/fields/association/index.js:459 msgid "An error occurred while trying to fetch association options." msgstr "" -#: packages/core/fields/association/index.js:515 -#: packages/core/fields/complex/index.js:428 -#: packages/core/hocs/with-validation/required.js:20 +#: packages/core/fields/association/index.js:516 msgid "This field is required." msgstr "" -#: packages/core/fields/association/index.js:519 +#: packages/core/fields/association/index.js:520 msgid "Minimum number of items not reached (%s items)" -msgstr "" - -#: packages/core/fields/color/index.js:92 -msgid "Select a color" -msgstr "" - -#: packages/core/fields/complex/group.js:154 -msgid "Duplicate" -msgstr "" - -#: packages/core/fields/complex/group.js:163 -msgid "Remove" -msgstr "" - -#: packages/core/fields/complex/group.js:172 -msgid "Collapse" -msgstr "" - -#: packages/core/fields/complex/index.js:146 -msgid "Couldn't create the label of group - %s" -msgstr "" - -#: packages/core/fields/complex/index.js:344 -msgid "There are no entries yet." -msgstr "" - -#: packages/core/fields/complex/index.js:401 -msgid "Expand All" -msgstr "" - -#: packages/core/fields/complex/index.js:401 -msgid "Collapse All" -msgstr "" - -#: packages/core/fields/complex/index.js:435 -msgid "Minimum number of rows not reached (%1$d %2$s)" -msgstr "" - -#: packages/core/fields/complex/index.js:82 -msgid "Add %s" -msgstr "" - -#: packages/core/fields/map/index.js:165 -msgid "The address could not be found." -msgstr "" - -#: packages/core/fields/map/index.js:167 -msgid "Geocode was not successful for the following reason: " -msgstr "" - -#: packages/core/fields/map/index.js:185 -msgid "Error alert" -msgstr "" - -#: packages/core/fields/oembed/index.js:188 -msgid "An error occurred while trying to fetch oembed preview." -msgstr "" - -#: packages/core/fields/oembed/index.js:203 -msgid "Not Found" -msgstr "" - -#: packages/core/fields/rich-text/index.js:123 -msgid "Visual" -msgstr "" - -#: packages/core/fields/rich-text/index.js:127 -msgid "Text" -msgstr "" - -#: packages/core/fields/sidebar/index.js:110 -msgid "Please enter the name of the new sidebar:" -msgstr "" - -#: packages/core/fields/sidebar/index.js:128 -msgid "An error occurred while trying to create the sidebar." -msgstr "" - -#: packages/core/fields/sidebar/index.js:58 -msgid "Please choose" -msgstr "" - -#: packages/core/fields/time/index.js:16 -msgid "Select Time" -msgstr "" - -#: packages/core/hocs/with-conditional-logic/index.js:69 -msgid "An unknown field is used in condition - \"%s\"" -msgstr "" - -#: packages/core/registry/index.js:40 -msgid "%1$s type must be a string." -msgstr "" - -#: packages/core/registry/index.js:46 -msgid "%1$s %2$s is already registered." -msgstr "" - -#: packages/core/registry/index.js:54 -msgid "The \"component\" param must be a function." -msgstr "" - -#: packages/core/registry/index.js:79 -msgid "The provided context isn't a valid one. Must be one of - %s ." -msgstr "" - -#: packages/core/registry/index.js:89 -msgid "%s %s isn't registered." -msgstr "" - -#: packages/core/utils/api-fetch.js:19 -msgid "An error occured." -msgstr "" - -#: packages/core/utils/fetch-attachments-data.js:24 -msgid "An error occurred while trying to fetch files data." -msgstr "" - -#: packages/metaboxes/containers/index.js:55 -msgid "Could not find DOM element for container \"%1$s\"." -msgstr "" - -#: packages/metaboxes/monitors/conditional-display/conditions/base.js:52 -msgid "Unsupported container condition comparison operator used - \"%1$s\"." -msgstr "" - -#: packages/metaboxes/monitors/conditional-display/handler/index.js:55 -msgid "Unsupported container condition - \"%1$s\"." -msgstr "" - -#: packages/metaboxes/monitors/conditional-display/handler/index.js:73 -msgid "Unsupported container condition relation used - \"%1$s\"." msgstr "" \ No newline at end of file