From 1a3fa2c50f3e25775ff3846c22fab2384312d96a Mon Sep 17 00:00:00 2001 From: Joro Stoyanov Date: Fri, 26 Mar 2021 14:13:14 +0200 Subject: [PATCH] Add bundles --- build/classic/core.js | 4 ++-- build/classic/core.min.js | 6 +++--- build/classic/metaboxes.js | 12 ++++++------ build/classic/metaboxes.min.js | 2 +- build/gutenberg/core.js | 4 ++-- build/gutenberg/core.min.js | 2 +- build/gutenberg/metaboxes.js | 12 ++++++------ build/gutenberg/metaboxes.min.js | 2 +- languages/carbon-fields-ui.pot | 10 +++++++++- 9 files changed, 31 insertions(+), 23 deletions(-) diff --git a/build/classic/core.js b/build/classic/core.js index c82e60c0..e9ea679f 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\", 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?"); +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.label)), __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 = Object(_utils_api_fetch__WEBPACK_IMPORTED_MODULE_23__[\"default\"])(\"\".concat(window.wpApiSettings.root, \"carbon-fields/v1/association/options\"), '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 term: payload.queryTerm,\n page: payload.page || 1\n });\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.then(function (response) {\n setState({\n options: payload.type === 'replace' ? response.options : _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(payload.options).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(response.options)),\n totalOptionsCount: response.total_options\n });\n });\n request.catch(errorHandler);\n request.finally(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?"); /***/ }), @@ -3538,7 +3538,7 @@ eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack://cf.%5Bn /***/ (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_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ \"./node_modules/@babel/runtime/helpers/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! classnames */ \"classnames\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var observe_resize__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! observe-resize */ \"./node_modules/observe-resize/index.js\");\n/* harmony import */ var observe_resize__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(observe_resize__WEBPACK_IMPORTED_MODULE_13__);\n\n\n\n\n\n\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\n\nvar RichTextField =\n/*#__PURE__*/\nfunction (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6___default()(RichTextField, _Component);\n\n /**\n * Define the project base properties\n *\n * @return {void}\n */\n function RichTextField() {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, RichTextField);\n\n _this = _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(RichTextField).call(this));\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7___default()(_this)), \"handleChange\", function (eventOrValue) {\n var _this$props = _this.props,\n id = _this$props.id,\n onChange = _this$props.onChange;\n onChange(id, Object(lodash__WEBPACK_IMPORTED_MODULE_11__[\"isString\"])(eventOrValue) ? eventOrValue : eventOrValue.target.value);\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7___default()(_this)), \"initEditor\", function () {\n var _this$props2 = _this.props,\n id = _this$props2.id,\n field = _this$props2.field;\n\n if (field.rich_editing) {\n var editorSetup = function editorSetup(editor) {\n _this.editor = editor;\n editor.on('blur Change', function () {\n editor.save();\n\n _this.handleChange(editor.getContent());\n });\n };\n\n var editorOptions = _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default()({}, window.tinyMCEPreInit.mceInit[field.settings_reference], {\n selector: \"#\".concat(id),\n setup: editorSetup\n });\n\n window.tinymce.init(editorOptions);\n }\n\n var quickTagsOptions = _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default()({}, window.tinyMCEPreInit.qtInit[field.settings_reference]);\n\n if (quickTagsOptions) {\n var qtagInstance = window.quicktags(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default()({}, quickTagsOptions, {\n id: id\n })); // Force the initialization of the quick tags.\n\n window.QTags._buttonsInit(qtagInstance.id);\n }\n });\n\n _this.node = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__[\"createRef\"])();\n _this.editor = null;\n return _this;\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(RichTextField, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n if (this.props.visible) {\n this.timer = setTimeout(this.initEditor, 250);\n this.cancelObserver = observe_resize__WEBPACK_IMPORTED_MODULE_13___default()(this.node.current, Object(lodash__WEBPACK_IMPORTED_MODULE_11__[\"debounce\"])(function () {\n if (_this2.editor) {\n /**\n * On each call of the `wpAutoResize` method the global `wpActiveEditor` reference\n * is changed to the element that will be resized. In some cases this is causing\n * conflicts with other plugins so we need to preserve and restore the previously\n * referenced element.\n */\n var activeEdtior = window.wpActiveEditor;\n\n _this2.editor.execCommand('wpAutoResize');\n\n window.wpActiveEditor = activeEdtior;\n }\n }, 100));\n }\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n clearTimeout(this.timer);\n\n if (typeof this.cancelObserver !== 'undefined') {\n this.cancelObserver();\n }\n\n this.destroyEditor();\n }\n /**\n * Handles the change of the input.\n *\n * @param {Object|string} eventOrValue\n * @return {void}\n */\n\n }, {\n key: \"render\",\n\n /**\n * Renders the component.\n *\n * @return {Object}\n */\n value: function render() {\n var _this$props3 = this.props,\n id = _this$props3.id,\n name = _this$props3.name,\n value = _this$props3.value,\n field = _this$props3.field;\n var classes = ['carbon-wysiwyg', 'wp-editor-wrap', {\n 'tmce-active': field.rich_editing\n }, {\n 'html-active': !field.rich_editing\n }];\n var mediaButtonsHTML = field.media_buttons ? Object(lodash__WEBPACK_IMPORTED_MODULE_11__[\"template\"])(field.media_buttons)({\n id: id\n }) : null;\n var shouldRenderTabs = field.rich_editing && window.tinyMCEPreInit.qtInit[field.settings_reference];\n return __webpack_provided_wp_dot_element.createElement(\"div\", {\n id: \"wp-\".concat(id, \"-wrap\"),\n className: classnames__WEBPACK_IMPORTED_MODULE_12___default()(classes),\n ref: this.node\n }, field.media_buttons && __webpack_provided_wp_dot_element.createElement(\"div\", {\n id: \"wp-\".concat(id, \"-media-buttons\"),\n className: \"hide-if-no-js wp-media-buttons\"\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n dangerouslySetInnerHTML: {\n __html: mediaButtonsHTML\n }\n })), shouldRenderTabs && __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"wp-editor-tabs\"\n }, __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n id: \"\".concat(id, \"-tmce\"),\n className: \"wp-switch-editor switch-tmce\",\n \"data-wp-editor-id\": id\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('Visual', 'carbon-fields-ui')), __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n id: \"\".concat(id, \"-html\"),\n className: \"wp-switch-editor switch-html\",\n \"data-wp-editor-id\": id\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('Text', 'carbon-fields-ui'))), __webpack_provided_wp_dot_element.createElement(\"div\", {\n id: \"wp-\".concat(id, \"-editor-container\"),\n className: \"wp-editor-container\"\n }, __webpack_provided_wp_dot_element.createElement(\"textarea\", _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n style: {\n width: '100%'\n },\n className: \"regular-text\",\n id: id,\n name: name,\n value: value,\n onChange: this.handleChange\n }, field.attributes))));\n }\n /**\n * Initialize the WYSIWYG editor.\n *\n * @return {void}\n */\n\n }, {\n key: \"destroyEditor\",\n\n /**\n * Destroy the instance of the WYSIWYG editor.\n *\n * @return {void}\n */\n value: function destroyEditor() {\n if (this.editor) {\n this.editor.remove();\n this.node = null;\n this.editor = null;\n }\n\n delete window.QTags.instances[this.props.id];\n }\n }]);\n\n return RichTextField;\n}(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__[\"Component\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (RichTextField);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\")))\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/core/fields/rich-text/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(__webpack_provided_wp_dot_element) {/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ \"./node_modules/@babel/runtime/helpers/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! classnames */ \"classnames\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var observe_resize__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! observe-resize */ \"./node_modules/observe-resize/index.js\");\n/* harmony import */ var observe_resize__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(observe_resize__WEBPACK_IMPORTED_MODULE_13__);\n\n\n\n\n\n\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\n\nvar RichTextField =\n/*#__PURE__*/\nfunction (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6___default()(RichTextField, _Component);\n\n /**\n * Define the project base properties\n *\n * @return {void}\n */\n function RichTextField() {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, RichTextField);\n\n _this = _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(RichTextField).call(this));\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7___default()(_this)), \"handleChange\", function (eventOrValue) {\n var _this$props = _this.props,\n id = _this$props.id,\n onChange = _this$props.onChange;\n onChange(id, Object(lodash__WEBPACK_IMPORTED_MODULE_11__[\"isString\"])(eventOrValue) ? eventOrValue : eventOrValue.target.value);\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7___default()(_this)), \"initEditor\", function () {\n var _this$props2 = _this.props,\n id = _this$props2.id,\n field = _this$props2.field;\n\n if (field.rich_editing) {\n var editorSetup = function editorSetup(editor) {\n _this.editor = editor;\n editor.on('blur Change', function () {\n editor.save();\n\n _this.handleChange(editor.getContent());\n });\n };\n\n var editorOptions = _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default()({}, window.tinyMCEPreInit.mceInit[field.settings_reference], {\n selector: \"#\".concat(id),\n setup: editorSetup\n });\n\n window.tinymce.init(editorOptions);\n }\n\n var quickTagsOptions = _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default()({}, window.tinyMCEPreInit.qtInit[field.settings_reference]);\n\n if (quickTagsOptions) {\n var qtagInstance = window.quicktags(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default()({}, quickTagsOptions, {\n id: id\n })); // Force the initialization of the quick tags.\n\n window.QTags._buttonsInit(qtagInstance.id);\n }\n });\n\n _this.node = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__[\"createRef\"])();\n _this.editor = null;\n return _this;\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(RichTextField, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n if (this.props.visible) {\n this.timer = setTimeout(this.initEditor, 250);\n this.cancelObserver = observe_resize__WEBPACK_IMPORTED_MODULE_13___default()(this.node.current, Object(lodash__WEBPACK_IMPORTED_MODULE_11__[\"debounce\"])(function () {\n if (_this2.editor) {\n /**\n * On each call of the `wpAutoResize` method the global `wpActiveEditor` reference\n * is changed to the element that will be resized. In some cases this is causing\n * conflicts with other plugins so we need to preserve and restore the previously\n * referenced element.\n */\n var activeEdtior = window.wpActiveEditor;\n\n _this2.editor.execCommand('wpAutoResize', undefined, undefined, {\n skip_focus: true\n });\n\n window.wpActiveEditor = activeEdtior;\n }\n }, 100));\n }\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n clearTimeout(this.timer);\n\n if (typeof this.cancelObserver !== 'undefined') {\n this.cancelObserver();\n }\n\n this.destroyEditor();\n }\n /**\n * Handles the change of the input.\n *\n * @param {Object|string} eventOrValue\n * @return {void}\n */\n\n }, {\n key: \"render\",\n\n /**\n * Renders the component.\n *\n * @return {Object}\n */\n value: function render() {\n var _this$props3 = this.props,\n id = _this$props3.id,\n name = _this$props3.name,\n value = _this$props3.value,\n field = _this$props3.field;\n var classes = ['carbon-wysiwyg', 'wp-editor-wrap', {\n 'tmce-active': field.rich_editing\n }, {\n 'html-active': !field.rich_editing\n }];\n var mediaButtonsHTML = field.media_buttons ? Object(lodash__WEBPACK_IMPORTED_MODULE_11__[\"template\"])(field.media_buttons)({\n id: id\n }) : null;\n var shouldRenderTabs = field.rich_editing && window.tinyMCEPreInit.qtInit[field.settings_reference];\n return __webpack_provided_wp_dot_element.createElement(\"div\", {\n id: \"wp-\".concat(id, \"-wrap\"),\n className: classnames__WEBPACK_IMPORTED_MODULE_12___default()(classes),\n ref: this.node\n }, field.media_buttons && __webpack_provided_wp_dot_element.createElement(\"div\", {\n id: \"wp-\".concat(id, \"-media-buttons\"),\n className: \"hide-if-no-js wp-media-buttons\"\n }, __webpack_provided_wp_dot_element.createElement(\"span\", {\n dangerouslySetInnerHTML: {\n __html: mediaButtonsHTML\n }\n })), shouldRenderTabs && __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"wp-editor-tabs\"\n }, __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n id: \"\".concat(id, \"-tmce\"),\n className: \"wp-switch-editor switch-tmce\",\n \"data-wp-editor-id\": id\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('Visual', 'carbon-fields-ui')), __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n id: \"\".concat(id, \"-html\"),\n className: \"wp-switch-editor switch-html\",\n \"data-wp-editor-id\": id\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('Text', 'carbon-fields-ui'))), __webpack_provided_wp_dot_element.createElement(\"div\", {\n id: \"wp-\".concat(id, \"-editor-container\"),\n className: \"wp-editor-container\"\n }, __webpack_provided_wp_dot_element.createElement(\"textarea\", _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n style: {\n width: '100%'\n },\n className: \"regular-text\",\n id: id,\n name: name,\n value: value,\n onChange: this.handleChange\n }, field.attributes))));\n }\n /**\n * Initialize the WYSIWYG editor.\n *\n * @return {void}\n */\n\n }, {\n key: \"destroyEditor\",\n\n /**\n * Destroy the instance of the WYSIWYG editor.\n *\n * @return {void}\n */\n value: function destroyEditor() {\n if (this.editor) {\n this.editor.remove();\n this.node = null;\n this.editor = null;\n }\n\n delete window.QTags.instances[this.props.id];\n }\n }]);\n\n return RichTextField;\n}(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__[\"Component\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (RichTextField);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\")))\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/core/fields/rich-text/index.js?"); /***/ }), diff --git a/build/classic/core.min.js b/build/classic/core.min.js index 499df9cb..d446729d 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){var r=n(88),o=n(65);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(186),o=n(187),i=n(188),a=n(189),u=n(190);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=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(45),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(43),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.label)),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/ @@ -35,7 +35,7 @@ this.cf=this.cf||{},this.cf.core=function(e){var t={};function n(r){if(t[r])retu * * Date: 2019-04-08 */ -function(e){var t,n,r,o,i,a,u,s,c,l,f,p,d,h,m,g,v,b,y,x="sizzle"+1*new Date,w=e.document,E=0,C=0,O=se(),_=se(),k=se(),S=se(),j=function(e,t){return e===t&&(f=!0),0},A={}.hasOwnProperty,D=[],T=D.pop,M=D.push,N=D.push,F=D.slice,P=function(e,t){for(var n=0,r=e.length;n+~]|"+L+")"+L+"*"),q=new RegExp(L+"|>"),Y=new RegExp(B),$=new RegExp("^"+R+"$"),G={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,oe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ie=function(){p()},ae=xe(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{N.apply(D=F.call(w.childNodes),w.childNodes),D[w.childNodes.length].nodeType}catch(e){N={apply:D.length?function(e,t){M.apply(e,F.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function ue(e,t,r,o){var i,u,c,l,f,h,v,b=t&&t.ownerDocument,E=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==E&&9!==E&&11!==E)return r;if(!o&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,m)){if(11!==E&&(f=Z.exec(e)))if(i=f[1]){if(9===E){if(!(c=t.getElementById(i)))return r;if(c.id===i)return r.push(c),r}else if(b&&(c=b.getElementById(i))&&y(t,c)&&c.id===i)return r.push(c),r}else{if(f[2])return N.apply(r,t.getElementsByTagName(e)),r;if((i=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return N.apply(r,t.getElementsByClassName(i)),r}if(n.qsa&&!S[e+" "]&&(!g||!g.test(e))&&(1!==E||"object"!==t.nodeName.toLowerCase())){if(v=e,b=t,1===E&&q.test(e)){for((l=t.getAttribute("id"))?l=l.replace(re,oe):t.setAttribute("id",l=x),u=(h=a(e)).length;u--;)h[u]="#"+l+" "+ye(h[u]);v=h.join(","),b=ee.test(e)&&ve(t.parentNode)||t}try{return N.apply(r,b.querySelectorAll(v)),r}catch(t){S(e,!0)}finally{l===x&&t.removeAttribute("id")}}}return s(e.replace(U,"$1"),t,r,o)}function se(){var e=[];return function t(n,o){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function ce(e){return e[x]=!0,e}function le(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ce(function(t){return t=+t,ce(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ue.support={},i=ue.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!X.test(t||n&&n.nodeName||"HTML")},p=ue.setDocument=function(e){var t,o,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(h=(d=a).documentElement,m=!i(d),w!==d&&(o=d.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",ie,!1):o.attachEvent&&o.attachEvent("onunload",ie)),n.attributes=le(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=le(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=le(function(e){return h.appendChild(e).id=x,!d.getElementsByName||!d.getElementsByName(x).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,o,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=Q.test(d.querySelectorAll))&&(le(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+L+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+L+"*(?:value|"+I+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]")}),le(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+L+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=Q.test(b=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&le(function(e){n.disconnectedMatch=b.call(e,"*"),b.call(e,"[s!='']:x"),v.push("!=",B)}),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),y=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&y(w,e)?-1:t===d||t.ownerDocument===w&&y(w,t)?1:l?P(l,e)-P(l,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===d?-1:t===d?1:o?-1:i?1:l?P(l,e)-P(l,t):0;if(o===i)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?pe(a[r],u[r]):a[r]===w?-1:u[r]===w?1:0},d):d},ue.matches=function(e,t){return ue(e,null,null,t)},ue.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),n.matchesSelector&&m&&!S[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var r=b.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){S(t,!0)}return ue(t,d,null,[e]).length>0},ue.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),y(e,t)},ue.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var o=r.attrHandle[t.toLowerCase()],i=o&&A.call(r.attrHandle,t.toLowerCase())?o(e,t,!m):void 0;return void 0!==i?i:n.attributes||!m?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},ue.escape=function(e){return(e+"").replace(re,oe)},ue.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ue.uniqueSort=function(e){var t,r=[],o=0,i=0;if(f=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(j),f){for(;t=e[i++];)t===e[i]&&(o=r.push(i));for(;o--;)e.splice(r[o],1)}return l=null,e},o=ue.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},(r=ue.selectors={cacheLength:50,createPseudo:ce,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ue.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ue.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&Y.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=O[e+" "];return t||(t=new RegExp("(^|"+L+")"+e+"("+L+"|$)"))&&O(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=ue.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(V," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,s){var c,l,f,p,d,h,m=i!==a?"nextSibling":"previousSibling",g=t.parentNode,v=u&&t.nodeName.toLowerCase(),b=!s&&!u,y=!1;if(g){if(i){for(;m;){for(p=t;p=p[m];)if(u?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&b){for(y=(d=(c=(l=(f=(p=g)[x]||(p[x]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===E&&c[1])&&c[2],p=d&&g.childNodes[d];p=++d&&p&&p[m]||(y=d=0)||h.pop();)if(1===p.nodeType&&++y&&p===t){l[e]=[E,d,y];break}}else if(b&&(y=d=(c=(l=(f=(p=t)[x]||(p[x]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===E&&c[1]),!1===y)for(;(p=++d&&p&&p[m]||(y=d=0)||h.pop())&&((u?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++y||(b&&((l=(f=p[x]||(p[x]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[E,y]),p!==t)););return(y-=o)===r||y%r==0&&y/r>=0}}},PSEUDO:function(e,t){var n,o=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ue.error("unsupported pseudo: "+e);return o[x]?o(t):o.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ce(function(e,n){for(var r,i=o(e,t),a=i.length;a--;)e[r=P(e,i[a])]=!(n[r]=i[a])}):function(e){return o(e,0,n)}):o}},pseudos:{not:ce(function(e){var t=[],n=[],r=u(e.replace(U,"$1"));return r[x]?ce(function(e,t,n,o){for(var i,a=r(e,null,o,[]),u=e.length;u--;)(i=a[u])&&(e[u]=!(t[u]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}}),has:ce(function(e){return function(t){return ue(e,t).length>0}}),contains:ce(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||o(t)).indexOf(e)>-1}}),lang:ce(function(e){return $.test(e||"")||ue.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge(function(){return[0]}),last:ge(function(e,t){return[t-1]}),eq:ge(function(e,t,n){return[n<0?n+t:n]}),even:ge(function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e}),gt:ge(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function Ee(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u-1&&(i[c]=!(a[c]=f))}}else v=Ee(v===a?v.splice(h,v.length):v),o?o(null,a,v,s):N.apply(a,v)})}function Oe(e){for(var t,n,o,i=e.length,a=r.relative[e[0].type],u=a||r.relative[" "],s=a?1:0,l=xe(function(e){return e===t},u,!0),f=xe(function(e){return P(t,e)>-1},u,!0),p=[function(e,n,r){var o=!a&&(r||n!==c)||((t=n).nodeType?l(e,n,r):f(e,n,r));return t=null,o}];s1&&we(p),s>1&&ye(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(U,"$1"),n,s0,o=e.length>0,i=function(i,a,u,s,l){var f,h,g,v=0,b="0",y=i&&[],x=[],w=c,C=i||o&&r.find.TAG("*",l),O=E+=null==w?1:Math.random()||.1,_=C.length;for(l&&(c=a===d||a||l);b!==_&&null!=(f=C[b]);b++){if(o&&f){for(h=0,a||f.ownerDocument===d||(p(f),u=!m);g=e[h++];)if(g(f,a||d,u)){s.push(f);break}l&&(E=O)}n&&((f=!g&&f)&&v--,i&&y.push(f))}if(v+=b,n&&b!==v){for(h=0;g=t[h++];)g(y,x,a,u);if(i){if(v>0)for(;b--;)y[b]||x[b]||(x[b]=T.call(s));x=Ee(x)}N.apply(s,x),l&&!i&&x.length>0&&v+t.length>1&&ue.uniqueSort(s)}return l&&(E=O,c=w),y};return n?ce(i):i}(i,o))).selector=e}return u},s=ue.select=function(e,t,n,o){var i,s,c,l,f,p="function"==typeof e&&e,d=!o&&a(e=p.selector||e);if(n=n||[],1===d.length){if((s=d[0]=d[0].slice(0)).length>2&&"ID"===(c=s[0]).type&&9===t.nodeType&&m&&r.relative[s[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(i=G.needsContext.test(e)?0:s.length;i--&&(c=s[i],!r.relative[l=c.type]);)if((f=r.find[l])&&(o=f(c.matches[0].replace(te,ne),ee.test(s[0].type)&&ve(t.parentNode)||t))){if(s.splice(i,1),!(e=o.length&&ye(s)))return N.apply(n,o),n;break}}return(p||u(e,d))(o,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=x.split("").sort(j).join("")===x,n.detectDuplicates=!!f,p(),n.sortDetached=le(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),le(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&le(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),le(function(e){return null==e.getAttribute("disabled")})||fe(I,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),ue}(n);C.find=k,C.expr=k.selectors,C.expr[":"]=C.expr.pseudos,C.uniqueSort=C.unique=k.uniqueSort,C.text=k.getText,C.isXMLDoc=k.isXML,C.contains=k.contains,C.escapeSelector=k.escape;var S=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&C(e).is(n))break;r.push(e)}return r},j=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},A=C.expr.match.needsContext;function D(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var T=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function M(e,t,n){return b(t)?C.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?C.grep(e,function(e){return e===t!==n}):"string"!=typeof t?C.grep(e,function(e){return f.call(t,e)>-1!==n}):C.filter(t,e,n)}C.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?C.find.matchesSelector(r,e)?[r]:[]:C.find.matches(e,C.grep(t,function(e){return 1===e.nodeType}))},C.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(C(e).filter(function(){for(t=0;t1?C.uniqueSort(n):n},filter:function(e){return this.pushStack(M(this,e||[],!1))},not:function(e){return this.pushStack(M(this,e||[],!0))},is:function(e){return!!M(this,"string"==typeof e&&A.test(e)?C(e):e||[],!1).length}});var N,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(C.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||N,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:F.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof C?t[0]:t,C.merge(this,C.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:a,!0)),T.test(r[1])&&C.isPlainObject(t))for(r in t)b(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(o=a.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):b(e)?void 0!==n.ready?n.ready(e):e(C):C.makeArray(e,this)}).prototype=C.fn,N=C(a);var P=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};function L(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}C.fn.extend({has:function(e){var t=C(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&C.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?C.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?f.call(C(e),this[0]):f.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(C.uniqueSort(C.merge(this.get(),C(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),C.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return S(e,"parentNode")},parentsUntil:function(e,t,n){return S(e,"parentNode",n)},next:function(e){return L(e,"nextSibling")},prev:function(e){return L(e,"previousSibling")},nextAll:function(e){return S(e,"nextSibling")},prevAll:function(e){return S(e,"previousSibling")},nextUntil:function(e,t,n){return S(e,"nextSibling",n)},prevUntil:function(e,t,n){return S(e,"previousSibling",n)},siblings:function(e){return j((e.parentNode||{}).firstChild,e)},children:function(e){return j(e.firstChild)},contents:function(e){return void 0!==e.contentDocument?e.contentDocument:(D(e,"template")&&(e=e.content||e),C.merge([],e.childNodes))}},function(e,t){C.fn[e]=function(n,r){var o=C.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=C.filter(r,o)),this.length>1&&(I[e]||C.uniqueSort(o),P.test(e)&&o.reverse()),this.pushStack(o)}});var R=/[^\x20\t\r\n\f]+/g;function H(e){return e}function B(e){throw e}function V(e,t,n,r){var o;try{e&&b(o=e.promise)?o.call(e).done(t).fail(n):e&&b(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}C.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return C.each(e.match(R)||[],function(e,n){t[n]=!0}),t}(e):C.extend({},e);var t,n,r,o,i=[],a=[],u=-1,s=function(){for(o=o||e.once,r=t=!0;a.length;u=-1)for(n=a.shift();++u-1;)i.splice(n,1),n<=u&&u--}),this},has:function(e){return e?C.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||t||(i=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||s()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},C.extend({Deferred:function(e){var t=[["notify","progress",C.Callbacks("memory"),C.Callbacks("memory"),2],["resolve","done",C.Callbacks("once memory"),C.Callbacks("once memory"),0,"resolved"],["reject","fail",C.Callbacks("once memory"),C.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return C.Deferred(function(n){C.each(t,function(t,r){var o=b(e[r[4]])&&e[r[4]];i[r[1]](function(){var e=o&&o.apply(this,arguments);e&&b(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(e,r,o){var i=0;function a(e,t,r,o){return function(){var u=this,s=arguments,c=function(){var n,c;if(!(e=i&&(r!==B&&(u=void 0,s=[n]),t.rejectWith(u,s))}};e?l():(C.Deferred.getStackHook&&(l.stackTrace=C.Deferred.getStackHook()),n.setTimeout(l))}}return C.Deferred(function(n){t[0][3].add(a(0,n,b(o)?o:H,n.notifyWith)),t[1][3].add(a(0,n,b(e)?e:H)),t[2][3].add(a(0,n,b(r)?r:B))}).promise()},promise:function(e){return null!=e?C.extend(e,o):o}},i={};return C.each(t,function(e,n){var a=n[2],u=n[5];o[n[1]]=a.add,u&&a.add(function(){r=u},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(n[3].fire),i[n[0]]=function(){return i[n[0]+"With"](this===i?void 0:this,arguments),this},i[n[0]+"With"]=a.fireWith}),o.promise(i),e&&e.call(i,i),i},when:function(e){var t=arguments.length,n=t,r=Array(n),o=s.call(arguments),i=C.Deferred(),a=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?s.call(arguments):n,--t||i.resolveWith(r,o)}};if(t<=1&&(V(e,i.done(a(n)).resolve,i.reject,!t),"pending"===i.state()||b(o[n]&&o[n].then)))return i.then();for(;n--;)V(o[n],a(n),i.reject);return i.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;C.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&U.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},C.readyException=function(e){n.setTimeout(function(){throw e})};var W=C.Deferred();function z(){a.removeEventListener("DOMContentLoaded",z),n.removeEventListener("load",z),C.ready()}C.fn.ready=function(e){return W.then(e).catch(function(e){C.readyException(e)}),this},C.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--C.readyWait:C.isReady)||(C.isReady=!0,!0!==e&&--C.readyWait>0||W.resolveWith(a,[C]))}}),C.ready.then=W.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?n.setTimeout(C.ready):(a.addEventListener("DOMContentLoaded",z),n.addEventListener("load",z));var q=function(e,t,n,r,o,i,a){var u=0,s=e.length,c=null==n;if("object"===E(n))for(u in o=!0,n)q(e,t,u,n[u],!0,i,a);else if(void 0!==r&&(o=!0,b(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(C(e),n)})),t))for(;u1,null,!0)},removeData:function(e){return this.each(function(){Z.remove(this,e)})}}),C.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Q.get(e,t),n&&(!r||Array.isArray(n)?r=Q.access(e,t,C.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=C.queue(e,t),r=n.length,o=n.shift(),i=C._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,function(){C.dequeue(e,t)},i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Q.get(e,n)||Q.access(e,n,{empty:C.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",n])})})}}),C.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ve=/^$|^module$|\/(?:java|ecma)script/i,be={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ye(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?C.merge([e],n):n}function xe(e,t){for(var n=0,r=e.length;n-1)o&&o.push(i);else if(c=ue(i),a=ye(f.appendChild(i),"script"),c&&xe(a),n)for(l=0;i=a[l++];)ve.test(i.type||"")&&n.push(i);return f}we=a.createDocumentFragment().appendChild(a.createElement("div")),(Ee=a.createElement("input")).setAttribute("type","radio"),Ee.setAttribute("checked","checked"),Ee.setAttribute("name","t"),we.appendChild(Ee),v.checkClone=we.cloneNode(!0).cloneNode(!0).lastChild.checked,we.innerHTML="",v.noCloneChecked=!!we.cloneNode(!0).lastChild.defaultValue;var _e=/^key/,ke=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Se=/^([^.]*)(?:\.(.+)|)/;function je(){return!0}function Ae(){return!1}function De(e,t){return e===function(){try{return a.activeElement}catch(e){}}()==("focus"===t)}function Te(e,t,n,r,o,i){var a,u;if("object"==typeof t){for(u in"string"!=typeof n&&(r=r||n,n=void 0),t)Te(e,u,n,r,t[u],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=Ae;else if(!o)return e;return 1===i&&(a=o,(o=function(e){return C().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=C.guid++)),e.each(function(){C.event.add(this,t,o,r,n)})}function Me(e,t,n){n?(Q.set(e,t,!1),C.event.add(e,t,{namespace:!1,handler:function(e){var r,o,i=Q.get(this,t);if(1&e.isTrigger&&this[t]){if(i.length)(C.event.special[t]||{}).delegateType&&e.stopPropagation();else if(i=s.call(arguments),Q.set(this,t,i),r=n(this,t),this[t](),i!==(o=Q.get(this,t))||r?Q.set(this,t,!1):o={},i!==o)return e.stopImmediatePropagation(),e.preventDefault(),o.value}else i.length&&(Q.set(this,t,{value:C.event.trigger(C.extend(i[0],C.Event.prototype),i.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,t)&&C.event.add(e,t,je)}C.event={global:{},add:function(e,t,n,r,o){var i,a,u,s,c,l,f,p,d,h,m,g=Q.get(e);if(g)for(n.handler&&(n=(i=n).handler,o=i.selector),o&&C.find.matchesSelector(ae,o),n.guid||(n.guid=C.guid++),(s=g.events)||(s=g.events={}),(a=g.handle)||(a=g.handle=function(t){return void 0!==C&&C.event.triggered!==t.type?C.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(R)||[""]).length;c--;)d=m=(u=Se.exec(t[c])||[])[1],h=(u[2]||"").split(".").sort(),d&&(f=C.event.special[d]||{},d=(o?f.delegateType:f.bindType)||d,f=C.event.special[d]||{},l=C.extend({type:d,origType:m,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&C.expr.match.needsContext.test(o),namespace:h.join(".")},i),(p=s[d])||((p=s[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,l):p.push(l),C.event.global[d]=!0)},remove:function(e,t,n,r,o){var i,a,u,s,c,l,f,p,d,h,m,g=Q.hasData(e)&&Q.get(e);if(g&&(s=g.events)){for(c=(t=(t||"").match(R)||[""]).length;c--;)if(d=m=(u=Se.exec(t[c])||[])[1],h=(u[2]||"").split(".").sort(),d){for(f=C.event.special[d]||{},p=s[d=(r?f.delegateType:f.bindType)||d]||[],u=u[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=p.length;i--;)l=p[i],!o&&m!==l.origType||n&&n.guid!==l.guid||u&&!u.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(p.splice(i,1),l.selector&&p.delegateCount--,f.remove&&f.remove.call(e,l));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,g.handle)||C.removeEvent(e,d,g.handle),delete s[d])}else for(d in s)C.event.remove(e,d+t[c],n,r,!0);C.isEmptyObject(s)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,i,a,u=C.event.fix(e),s=new Array(arguments.length),c=(Q.get(this,"events")||{})[u.type]||[],l=C.event.special[u.type]||{};for(s[0]=u,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(i=[],a={},n=0;n-1:C.find(o,this,null,[c]).length),a[o]&&i.push(r);i.length&&u.push({elem:c,handlers:i})}return c=this,s\x20\t\r\n\f]*)[^>]*)\/>/gi,Fe=/\s*$/g;function Le(e,t){return D(e,"table")&&D(11!==t.nodeType?t:t.firstChild,"tr")&&C(e).children("tbody")[0]||e}function Re(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Be(e,t){var n,r,o,i,a,u,s,c;if(1===t.nodeType){if(Q.hasData(e)&&(i=Q.access(e),a=Q.set(t,i),c=i.events))for(o in delete a.handle,a.events={},c)for(n=0,r=c[o].length;n1&&"string"==typeof h&&!v.checkClone&&Pe.test(h))return e.each(function(o){var i=e.eq(o);m&&(t[0]=h.call(this,o,i.html())),Ve(i,t,n,r)});if(p&&(i=(o=Oe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=i),i||r)){for(u=(a=C.map(ye(o,"script"),Re)).length;f")},clone:function(e,t,n){var r,o,i,a,u,s,c,l=e.cloneNode(!0),f=ue(e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||C.isXMLDoc(e)))for(a=ye(l),r=0,o=(i=ye(e)).length;r0&&xe(a,!f&&ye(e,"script")),l},cleanData:function(e){for(var t,n,r,o=C.event.special,i=0;void 0!==(n=e[i]);i++)if(K(n)){if(t=n[Q.expando]){if(t.events)for(r in t.events)o[r]?C.event.remove(n,r):C.removeEvent(n,r,t.handle);n[Q.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),C.fn.extend({detach:function(e){return Ue(this,e,!0)},remove:function(e){return Ue(this,e)},text:function(e){return q(this,function(e){return void 0===e?C.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ve(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Ve(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ve(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ve(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(C.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return C.clone(this,e,t)})},html:function(e){return q(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Fe.test(e)&&!be[(ge.exec(e)||["",""])[1].toLowerCase()]){e=C.htmlPrefilter(e);try{for(;n=0&&(s+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-s-u-.5))||0),s}function ot(e,t,n){var r=ze(e),o=(!v.boxSizingReliable()||n)&&"border-box"===C.css(e,"boxSizing",!1,r),i=o,a=Ye(e,t,r),u="offset"+t[0].toUpperCase()+t.slice(1);if(We.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&o||"auto"===a||!parseFloat(a)&&"inline"===C.css(e,"display",!1,r))&&e.getClientRects().length&&(o="border-box"===C.css(e,"boxSizing",!1,r),(i=u in e)&&(a=e[u])),(a=parseFloat(a)||0)+rt(e,t,n||(o?"border":"content"),i,r,a)+"px"}function it(e,t,n,r,o){return new it.prototype.init(e,t,n,r,o)}C.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ye(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i,a,u=X(t),s=Ze.test(t),c=e.style;if(s||(t=Je(u)),a=C.cssHooks[t]||C.cssHooks[u],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(e,!1,r))?o:c[t];"string"==(i=typeof n)&&(o=oe.exec(n))&&o[1]&&(n=fe(e,t,o),i="number"),null!=n&&n==n&&("number"!==i||s||(n+=o&&o[3]||(C.cssNumber[u]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(s?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var o,i,a,u=X(t);return Ze.test(t)||(t=Je(u)),(a=C.cssHooks[t]||C.cssHooks[u])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=Ye(e,t,r)),"normal"===o&&t in tt&&(o=tt[t]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),C.each(["height","width"],function(e,t){C.cssHooks[t]={get:function(e,n,r){if(n)return!Qe.test(C.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,t,r):le(e,et,function(){return ot(e,t,r)})},set:function(e,n,r){var o,i=ze(e),a=!v.scrollboxSize()&&"absolute"===i.position,u=(a||r)&&"border-box"===C.css(e,"boxSizing",!1,i),s=r?rt(e,t,r,u,i):0;return u&&a&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-rt(e,t,"border",!1,i)-.5)),s&&(o=oe.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=C.css(e,t)),nt(0,n,s)}}}),C.cssHooks.marginLeft=$e(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ye(e,"marginLeft"))||e.getBoundingClientRect().left-le(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),C.each({margin:"",padding:"",border:"Width"},function(e,t){C.cssHooks[e+t]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[e+ie[r]+t]=i[r]||i[r-2]||i[0];return o}},"margin"!==e&&(C.cssHooks[e+t].set=nt)}),C.fn.extend({css:function(e,t){return q(this,function(e,t,n){var r,o,i={},a=0;if(Array.isArray(t)){for(r=ze(e),o=t.length;a1)}}),C.Tween=it,it.prototype={constructor:it,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||C.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(C.cssNumber[n]?"":"px")},cur:function(){var e=it.propHooks[this.prop];return e&&e.get?e.get(this):it.propHooks._default.get(this)},run:function(e){var t,n=it.propHooks[this.prop];return this.options.duration?this.pos=t=C.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):it.propHooks._default.set(this),this}},it.prototype.init.prototype=it.prototype,it.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=C.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){C.fx.step[e.prop]?C.fx.step[e.prop](e):1!==e.elem.nodeType||!C.cssHooks[e.prop]&&null==e.elem.style[Je(e.prop)]?e.elem[e.prop]=e.now:C.style(e.elem,e.prop,e.now+e.unit)}}},it.propHooks.scrollTop=it.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},C.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},C.fx=it.prototype.init,C.fx.step={};var at,ut,st=/^(?:toggle|show|hide)$/,ct=/queueHooks$/;function lt(){ut&&(!1===a.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(lt):n.setTimeout(lt,C.fx.interval),C.fx.tick())}function ft(){return n.setTimeout(function(){at=void 0}),at=Date.now()}function pt(e,t){var n,r=0,o={height:e};for(t=t?1:0;r<4;r+=2-t)o["margin"+(n=ie[r])]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function dt(e,t,n){for(var r,o=(ht.tweeners[t]||[]).concat(ht.tweeners["*"]),i=0,a=o.length;i1)},removeAttr:function(e){return this.each(function(){C.removeAttr(this,e)})}}),C.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?C.prop(e,t,n):(1===i&&C.isXMLDoc(e)||(o=C.attrHooks[t.toLowerCase()]||(C.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void C.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:null==(r=C.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&D(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(R);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?C.removeAttr(e,n):e.setAttribute(n,n),n}},C.each(C.expr.match.bool.source.match(/\w+/g),function(e,t){var n=gt[t]||C.find.attr;gt[t]=function(e,t,r){var o,i,a=t.toLowerCase();return r||(i=gt[a],gt[a]=o,o=null!=n(e,t,r)?a:null,gt[a]=i),o}});var vt=/^(?:input|select|textarea|button)$/i,bt=/^(?:a|area)$/i;function yt(e){return(e.match(R)||[]).join(" ")}function xt(e){return e.getAttribute&&e.getAttribute("class")||""}function wt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}C.fn.extend({prop:function(e,t){return q(this,C.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[C.propFix[e]||e]})}}),C.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&C.isXMLDoc(e)||(t=C.propFix[t]||t,o=C.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=C.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||bt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(C.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),C.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){C.propFix[this.toLowerCase()]=this}),C.fn.extend({addClass:function(e){var t,n,r,o,i,a,u,s=0;if(b(e))return this.each(function(t){C(this).addClass(e.call(this,t,xt(this)))});if((t=wt(e)).length)for(;n=this[s++];)if(o=xt(n),r=1===n.nodeType&&" "+yt(o)+" "){for(a=0;i=t[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");o!==(u=yt(r))&&n.setAttribute("class",u)}return this},removeClass:function(e){var t,n,r,o,i,a,u,s=0;if(b(e))return this.each(function(t){C(this).removeClass(e.call(this,t,xt(this)))});if(!arguments.length)return this.attr("class","");if((t=wt(e)).length)for(;n=this[s++];)if(o=xt(n),r=1===n.nodeType&&" "+yt(o)+" "){for(a=0;i=t[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");o!==(u=yt(r))&&n.setAttribute("class",u)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):b(e)?this.each(function(n){C(this).toggleClass(e.call(this,n,xt(this),t),t)}):this.each(function(){var t,o,i,a;if(r)for(o=0,i=C(this),a=wt(e);t=a[o++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||((t=xt(this))&&Q.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Q.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+yt(xt(n))+" ").indexOf(t)>-1)return!0;return!1}});var Et=/\r/g;C.fn.extend({val:function(e){var t,n,r,o=this[0];return arguments.length?(r=b(e),this.each(function(n){var o;1===this.nodeType&&(null==(o=r?e.call(this,n,C(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=C.map(o,function(e){return null==e?"":e+""})),(t=C.valHooks[this.type]||C.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))})):o?(t=C.valHooks[o.type]||C.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(Et,""):null==n?"":n:void 0}}),C.extend({valHooks:{option:{get:function(e){var t=C.find.attr(e,"value");return null!=t?t:yt(C.text(e))}},select:{get:function(e){var t,n,r,o=e.options,i=e.selectedIndex,a="select-one"===e.type,u=a?null:[],s=a?i+1:o.length;for(r=i<0?s:a?i:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),C.each(["radio","checkbox"],function(){C.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=C.inArray(C(e).val(),t)>-1}},v.checkOn||(C.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in n;var Ct=/^(?:focusinfocus|focusoutblur)$/,Ot=function(e){e.stopPropagation()};C.extend(C.event,{trigger:function(e,t,r,o){var i,u,s,c,l,f,p,d,m=[r||a],g=h.call(e,"type")?e.type:e,v=h.call(e,"namespace")?e.namespace.split("."):[];if(u=d=s=r=r||a,3!==r.nodeType&&8!==r.nodeType&&!Ct.test(g+C.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),l=g.indexOf(":")<0&&"on"+g,(e=e[C.expando]?e:new C.Event(g,"object"==typeof e&&e)).isTrigger=o?2:3,e.namespace=v.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:C.makeArray(t,[e]),p=C.event.special[g]||{},o||!p.trigger||!1!==p.trigger.apply(r,t))){if(!o&&!p.noBubble&&!y(r)){for(c=p.delegateType||g,Ct.test(c+g)||(u=u.parentNode);u;u=u.parentNode)m.push(u),s=u;s===(r.ownerDocument||a)&&m.push(s.defaultView||s.parentWindow||n)}for(i=0;(u=m[i++])&&!e.isPropagationStopped();)d=u,e.type=i>1?c:p.bindType||g,(f=(Q.get(u,"events")||{})[e.type]&&Q.get(u,"handle"))&&f.apply(u,t),(f=l&&u[l])&&f.apply&&K(u)&&(e.result=f.apply(u,t),!1===e.result&&e.preventDefault());return e.type=g,o||e.isDefaultPrevented()||p._default&&!1!==p._default.apply(m.pop(),t)||!K(r)||l&&b(r[g])&&!y(r)&&((s=r[l])&&(r[l]=null),C.event.triggered=g,e.isPropagationStopped()&&d.addEventListener(g,Ot),r[g](),e.isPropagationStopped()&&d.removeEventListener(g,Ot),C.event.triggered=void 0,s&&(r[l]=s)),e.result}},simulate:function(e,t,n){var r=C.extend(new C.Event,n,{type:e,isSimulated:!0});C.event.trigger(r,null,t)}}),C.fn.extend({trigger:function(e,t){return this.each(function(){C.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return C.event.trigger(e,t,n,!0)}}),v.focusin||C.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){C.event.simulate(t,e.target,C.event.fix(e))};C.event.special[t]={setup:function(){var r=this.ownerDocument||this,o=Q.access(r,t);o||r.addEventListener(e,n,!0),Q.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this,o=Q.access(r,t)-1;o?Q.access(r,t,o):(r.removeEventListener(e,n,!0),Q.remove(r,t))}}});var _t=n.location,kt=Date.now(),St=/\?/;C.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||C.error("Invalid XML: "+e),t};var jt=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Tt=/^(?:input|select|textarea|keygen)/i;function Mt(e,t,n,r){var o;if(Array.isArray(t))C.each(t,function(t,o){n||jt.test(e)?r(e,o):Mt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)});else if(n||"object"!==E(t))r(e,t);else for(o in t)Mt(e+"["+o+"]",t[o],n,r)}C.param=function(e,t){var n,r=[],o=function(e,t){var n=b(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!C.isPlainObject(e))C.each(e,function(){o(this.name,this.value)});else for(n in e)Mt(n,e[n],t,o);return r.join("&")},C.fn.extend({serialize:function(){return C.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=C.prop(this,"elements");return e?C.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!C(this).is(":disabled")&&Tt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!me.test(e))}).map(function(e,t){var n=C(this).val();return null==n?null:Array.isArray(n)?C.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var Nt=/%20/g,Ft=/#.*$/,Pt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Rt=/^\/\//,Ht={},Bt={},Vt="*/".concat("*"),Ut=a.createElement("a");function Wt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,i=t.toLowerCase().match(R)||[];if(b(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function zt(e,t,n,r){var o={},i=e===Bt;function a(u){var s;return o[u]=!0,C.each(e[u]||[],function(e,u){var c=u(t,n,r);return"string"!=typeof c||i||o[c]?i?!(s=c):void 0:(t.dataTypes.unshift(c),a(c),!1)}),s}return a(t.dataTypes[0])||!o["*"]&&a("*")}function qt(e,t){var n,r,o=C.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&C.extend(!0,e,r),e}Ut.href=_t.href,C.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_t.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(_t.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Vt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":C.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?qt(qt(e,C.ajaxSettings),t):qt(C.ajaxSettings,e)},ajaxPrefilter:Wt(Ht),ajaxTransport:Wt(Bt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,o,i,u,s,c,l,f,p,d,h=C.ajaxSetup({},t),m=h.context||h,g=h.context&&(m.nodeType||m.jquery)?C(m):C.event,v=C.Deferred(),b=C.Callbacks("once memory"),y=h.statusCode||{},x={},w={},E="canceled",O={readyState:0,getResponseHeader:function(e){var t;if(l){if(!u)for(u={};t=It.exec(i);)u[t[1].toLowerCase()+" "]=(u[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=u[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?i:null},setRequestHeader:function(e,t){return null==l&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==l&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)O.always(e[O.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||E;return r&&r.abort(t),_(0,t),this}};if(v.promise(O),h.url=((e||h.url||_t.href)+"").replace(Rt,_t.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(R)||[""],null==h.crossDomain){c=a.createElement("a");try{c.href=h.url,c.href=c.href,h.crossDomain=Ut.protocol+"//"+Ut.host!=c.protocol+"//"+c.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=C.param(h.data,h.traditional)),zt(Ht,h,t,O),l)return O;for(p in(f=C.event&&h.global)&&0==C.active++&&C.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Lt.test(h.type),o=h.url.replace(Ft,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Nt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(St.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Pt,"$1"),d=(St.test(o)?"&":"?")+"_="+kt+++d),h.url=o+d),h.ifModified&&(C.lastModified[o]&&O.setRequestHeader("If-Modified-Since",C.lastModified[o]),C.etag[o]&&O.setRequestHeader("If-None-Match",C.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&O.setRequestHeader("Content-Type",h.contentType),O.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Vt+"; q=0.01":""):h.accepts["*"]),h.headers)O.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(m,O,h)||l))return O.abort();if(E="abort",b.add(h.complete),O.done(h.success),O.fail(h.error),r=zt(Bt,h,t,O)){if(O.readyState=1,f&&g.trigger("ajaxSend",[O,h]),l)return O;h.async&&h.timeout>0&&(s=n.setTimeout(function(){O.abort("timeout")},h.timeout));try{l=!1,r.send(x,_)}catch(e){if(l)throw e;_(-1,e)}}else _(-1,"No Transport");function _(e,t,a,u){var c,p,d,x,w,E=t;l||(l=!0,s&&n.clearTimeout(s),r=void 0,i=u||"",O.readyState=e>0?4:0,c=e>=200&&e<300||304===e,a&&(x=function(e,t,n){for(var r,o,i,a,u=e.contents,s=e.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in u)if(u[o]&&u[o].test(r)){s.unshift(o);break}if(s[0]in n)i=s[0];else{for(o in n){if(!s[0]||e.converters[o+" "+s[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==s[0]&&s.unshift(i),n[i]}(h,O,a)),x=function(e,t,n,r){var o,i,a,u,s,c={},l=e.dataTypes.slice();if(l[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(i=l.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!s&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s=i,i=l.shift())if("*"===i)i=s;else if("*"!==s&&s!==i){if(!(a=c[s+" "+i]||c["* "+i]))for(o in c)if((u=o.split(" "))[1]===i&&(a=c[s+" "+u[0]]||c["* "+u[0]])){!0===a?a=c[o]:!0!==c[o]&&(i=u[0],l.unshift(u[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+s+" to "+i}}}return{state:"success",data:t}}(h,x,O,c),c?(h.ifModified&&((w=O.getResponseHeader("Last-Modified"))&&(C.lastModified[o]=w),(w=O.getResponseHeader("etag"))&&(C.etag[o]=w)),204===e||"HEAD"===h.type?E="nocontent":304===e?E="notmodified":(E=x.state,p=x.data,c=!(d=x.error))):(d=E,!e&&E||(E="error",e<0&&(e=0))),O.status=e,O.statusText=(t||E)+"",c?v.resolveWith(m,[p,E,O]):v.rejectWith(m,[O,E,d]),O.statusCode(y),y=void 0,f&&g.trigger(c?"ajaxSuccess":"ajaxError",[O,h,c?p:d]),b.fireWith(m,[O,E]),f&&(g.trigger("ajaxComplete",[O,h]),--C.active||C.event.trigger("ajaxStop")))}return O},getJSON:function(e,t,n){return C.get(e,t,n,"json")},getScript:function(e,t){return C.get(e,void 0,t,"script")}}),C.each(["get","post"],function(e,t){C[t]=function(e,n,r,o){return b(n)&&(o=o||r,r=n,n=void 0),C.ajax(C.extend({url:e,type:t,dataType:o,data:n,success:r},C.isPlainObject(e)&&e))}}),C._evalUrl=function(e,t){return C.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){C.globalEval(e,t)}})},C.fn.extend({wrapAll:function(e){var t;return this[0]&&(b(e)&&(e=e.call(this[0])),t=C(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return b(e)?this.each(function(t){C(this).wrapInner(e.call(this,t))}):this.each(function(){var t=C(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b(e);return this.each(function(n){C(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){C(this).replaceWith(this.childNodes)}),this}}),C.expr.pseudos.hidden=function(e){return!C.expr.pseudos.visible(e)},C.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},C.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},$t=C.ajaxSettings.xhr();v.cors=!!$t&&"withCredentials"in $t,v.ajax=$t=!!$t,C.ajaxTransport(function(e){var t,r;if(v.cors||$t&&!e.crossDomain)return{send:function(o,i){var a,u=e.xhr();if(u.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)u[a]=e.xhrFields[a];for(a in e.mimeType&&u.overrideMimeType&&u.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)u.setRequestHeader(a,o[a]);t=function(e){return function(){t&&(t=r=u.onload=u.onerror=u.onabort=u.ontimeout=u.onreadystatechange=null,"abort"===e?u.abort():"error"===e?"number"!=typeof u.status?i(0,"error"):i(u.status,u.statusText):i(Yt[u.status]||u.status,u.statusText,"text"!==(u.responseType||"text")||"string"!=typeof u.responseText?{binary:u.response}:{text:u.responseText},u.getAllResponseHeaders()))}},u.onload=t(),r=u.onerror=u.ontimeout=t("error"),void 0!==u.onabort?u.onabort=r:u.onreadystatechange=function(){4===u.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{u.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),C.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),C.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return C.globalEval(e),e}}}),C.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),C.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,o){t=C("