/******/ (function() { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./assets/images/count-animation.png":
/*!*******************************************!*\
  !*** ./assets/images/count-animation.png ***!
  \*******************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
module.exports = __webpack_require__.p + "images/count-animation.1151d25d.png";

/***/ }),

/***/ "./assets/images/typing-animation.png":
/*!********************************************!*\
  !*** ./assets/images/typing-animation.png ***!
  \********************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
module.exports = __webpack_require__.p + "images/typing-animation.d84cccd1.png";

/***/ }),

/***/ "./node_modules/@wordpress/icons/build-module/icon/index.mjs":
/*!*******************************************************************!*\
  !*** ./node_modules/@wordpress/icons/build-module/icon/index.mjs ***!
  \*******************************************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ icon_default; }
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
// packages/icons/src/icon/index.ts

var icon_default = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
  ({ icon, size = 24, ...props }, ref) => {
    return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(icon, {
      width: size,
      height: size,
      ...props,
      ref
    });
  }
);

//# sourceMappingURL=index.mjs.map


/***/ }),

/***/ "./node_modules/@wordpress/icons/build-module/library/backup.mjs":
/*!***********************************************************************!*\
  !*** ./node_modules/@wordpress/icons/build-module/library/backup.mjs ***!
  \***********************************************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ backup_default; }
/* harmony export */ });
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
// packages/icons/src/library/backup.tsx


var backup_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z" }) });

//# sourceMappingURL=backup.mjs.map


/***/ }),

/***/ "./node_modules/@wordpress/icons/build-module/library/brush.mjs":
/*!**********************************************************************!*\
  !*** ./node_modules/@wordpress/icons/build-module/library/brush.mjs ***!
  \**********************************************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ brush_default; }
/* harmony export */ });
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
// packages/icons/src/library/brush.tsx


var brush_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z" }) });

//# sourceMappingURL=brush.mjs.map


/***/ }),

/***/ "./node_modules/@wordpress/icons/build-module/library/settings.mjs":
/*!*************************************************************************!*\
  !*** ./node_modules/@wordpress/icons/build-module/library/settings.mjs ***!
  \*************************************************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ settings_default; }
/* harmony export */ });
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
// packages/icons/src/library/settings.tsx


var settings_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" }),
  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" })
] });

//# sourceMappingURL=settings.mjs.map


/***/ }),

/***/ "./node_modules/classnames/index.js":
/*!******************************************!*\
  !*** ./node_modules/classnames/index.js ***!
  \******************************************/
/***/ (function(module, exports) {

var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/
/* global define */

(function () {
	'use strict';

	var hasOwn = {}.hasOwnProperty;

	function classNames () {
		var classes = '';

		for (var i = 0; i < arguments.length; i++) {
			var arg = arguments[i];
			if (arg) {
				classes = appendClass(classes, parseValue(arg));
			}
		}

		return classes;
	}

	function parseValue (arg) {
		if (typeof arg === 'string' || typeof arg === 'number') {
			return arg;
		}

		if (typeof arg !== 'object') {
			return '';
		}

		if (Array.isArray(arg)) {
			return classNames.apply(null, arg);
		}

		if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
			return arg.toString();
		}

		var classes = '';

		for (var key in arg) {
			if (hasOwn.call(arg, key) && arg[key]) {
				classes = appendClass(classes, key);
			}
		}

		return classes;
	}

	function appendClass (value, newClass) {
		if (!newClass) {
			return value;
		}
	
		if (value) {
			return value + ' ' + newClass;
		}
	
		return value + newClass;
	}

	if ( true && module.exports) {
		classNames.default = classNames;
		module.exports = classNames;
	} else if (true) {
		// register as 'classnames', consistent with npm package name
		!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
			return classNames;
		}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	} else // removed by dead control flow
{}
}());


/***/ }),

/***/ "./node_modules/uuid/dist/regex.js":
/*!*****************************************!*\
  !*** ./node_modules/uuid/dist/regex.js ***!
  \*****************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i);


/***/ }),

/***/ "./node_modules/uuid/dist/rng.js":
/*!***************************************!*\
  !*** ./node_modules/uuid/dist/rng.js ***!
  \***************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ rng; }
/* harmony export */ });
const rnds8 = new Uint8Array(16);
function rng() {
    return crypto.getRandomValues(rnds8);
}


/***/ }),

/***/ "./node_modules/uuid/dist/stringify.js":
/*!*********************************************!*\
  !*** ./node_modules/uuid/dist/stringify.js ***!
  \*********************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   unsafeStringify: function() { return /* binding */ unsafeStringify; }
/* harmony export */ });
/* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate.js */ "./node_modules/uuid/dist/validate.js");

const byteToHex = [];
for (let i = 0; i < 256; ++i) {
    byteToHex.push((i + 0x100).toString(16).slice(1));
}
function unsafeStringify(arr, offset = 0) {
    return (byteToHex[arr[offset + 0]] +
        byteToHex[arr[offset + 1]] +
        byteToHex[arr[offset + 2]] +
        byteToHex[arr[offset + 3]] +
        '-' +
        byteToHex[arr[offset + 4]] +
        byteToHex[arr[offset + 5]] +
        '-' +
        byteToHex[arr[offset + 6]] +
        byteToHex[arr[offset + 7]] +
        '-' +
        byteToHex[arr[offset + 8]] +
        byteToHex[arr[offset + 9]] +
        '-' +
        byteToHex[arr[offset + 10]] +
        byteToHex[arr[offset + 11]] +
        byteToHex[arr[offset + 12]] +
        byteToHex[arr[offset + 13]] +
        byteToHex[arr[offset + 14]] +
        byteToHex[arr[offset + 15]]).toLowerCase();
}
function stringify(arr, offset = 0) {
    const uuid = unsafeStringify(arr, offset);
    if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(uuid)) {
        throw TypeError('Stringified UUID is invalid');
    }
    return uuid;
}
/* harmony default export */ __webpack_exports__["default"] = (stringify);


/***/ }),

/***/ "./node_modules/uuid/dist/v4.js":
/*!**************************************!*\
  !*** ./node_modules/uuid/dist/v4.js ***!
  \**************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rng.js */ "./node_modules/uuid/dist/rng.js");
/* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stringify.js */ "./node_modules/uuid/dist/stringify.js");


function v4(options, buf, offset) {
    if (!buf && !options && crypto.randomUUID) {
        return crypto.randomUUID();
    }
    return _v4(options, buf, offset);
}
function _v4(options, buf, offset) {
    options = options || {};
    const rnds = options.random ?? options.rng?.() ?? (0,_rng_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
    if (rnds.length < 16) {
        throw new Error('Random bytes length must be >= 16');
    }
    rnds[6] = (rnds[6] & 0x0f) | 0x40;
    rnds[8] = (rnds[8] & 0x3f) | 0x80;
    if (buf) {
        offset = offset || 0;
        if (offset < 0 || offset + 16 > buf.length) {
            throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
        }
        for (let i = 0; i < 16; ++i) {
            buf[offset + i] = rnds[i];
        }
        return buf;
    }
    return (0,_stringify_js__WEBPACK_IMPORTED_MODULE_1__.unsafeStringify)(rnds);
}
/* harmony default export */ __webpack_exports__["default"] = (v4);


/***/ }),

/***/ "./node_modules/uuid/dist/validate.js":
/*!********************************************!*\
  !*** ./node_modules/uuid/dist/validate.js ***!
  \********************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _regex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./regex.js */ "./node_modules/uuid/dist/regex.js");

function validate(uuid) {
    return typeof uuid === 'string' && _regex_js__WEBPACK_IMPORTED_MODULE_0__["default"].test(uuid);
}
/* harmony default export */ __webpack_exports__["default"] = (validate);


/***/ }),

/***/ "./src/animation/components/animation-popover.js":
/*!*******************************************************!*\
  !*** ./src/animation/components/animation-popover.js ***!
  \*******************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _data_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../data.js */ "./src/animation/data.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
/**
 * WordPress dependencies.
 */





/**
 * Internal dependencies.
 */


function AnimationPopover({
  animationsList,
  updateAnimation,
  currentAnimationLabel,
  setCurrentAnimationLabel
}) {
  const instanceId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__.useInstanceId)(AnimationPopover);
  const [currentInput, setCurrentInput] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('');
  const [animationFound, setAnimationFound] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
  const getAnimations = (animation, onToggle) => {
    let match = true;
    if (currentInput) {
      const inputWords = currentInput.toLowerCase().split(' ');
      inputWords.forEach(word => {
        if (!animation.label.toLowerCase().includes(word)) {
          match = false;
        }
      });
    }
    if (match && !animationFound) {
      setAnimationFound(true);
    }
    return match && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.MenuItem, {
      className: currentAnimationLabel === animation.label ? 'is-selected' : '',
      onClick: () => {
        setCurrentAnimationLabel(animation.label);
        updateAnimation(animation.value);
        onToggle();
      },
      children: animation.label
    });
  };
  const id = `inspector-o-animations-control-${instanceId}`;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.BaseControl, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Animation', "otter-blocks"),
    id: id,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Dropdown, {
      contentClassName: "o-animations-control__popover",
      position: "bottom center",
      renderToggle: ({
        isOpen,
        onToggle
      }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
        className: "o-animations-control__button",
        id: id,
        onClick: onToggle,
        "aria-expanded": isOpen,
        children: currentAnimationLabel
      }),
      renderContent: ({
        onToggle
      }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.MenuGroup, {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Animations', "otter-blocks"),
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
          placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Search', "otter-blocks"),
          value: currentInput,
          onChange: e => {
            setCurrentInput(e);
            setAnimationFound(false);
          }
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
          className: "components-popover__items",
          children: [animationsList.map((animation, index) => {
            return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.Fragment, {
              children: ['' === currentInput && _data_js__WEBPACK_IMPORTED_MODULE_4__.categories.map((category, catIndex) => {
                return category.value === animation.value ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
                  className: "o-animations-control__category",
                  children: category.label
                }, catIndex) : '';
              }), getAnimations(animation, onToggle)]
            }, index);
          }), !animationFound && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Nothing found. Try searching for something else!', "otter-blocks")
          })]
        })]
      })
    })
  });
}
/* harmony default export */ __webpack_exports__["default"] = (AnimationPopover);

/***/ }),

/***/ "./src/animation/count/index.js":
/*!**************************************!*\
  !*** ./src/animation/count/index.js ***!
  \**************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   format: function() { return /* binding */ format; }
/* harmony export */ });
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/brush.mjs");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _inline_controls_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./inline-controls.js */ "./src/animation/count/inline-controls.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
/**
 * External dependencies.
 */


/**
 * WordPress dependencies.
 */





/**
 * Internal dependencies.
 */


const name = 'themeisle-blocks/count-animation';
const format = {
  name,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Count Animation', "otter-blocks"),
  tagName: 'o-anim-count',
  className: null,
  edit: ({
    isActive,
    value,
    onChange,
    contentRef
  }) => {
    const regex = /^\$?[\d,]+(\.\d*)?$/;
    const onToggle = () => {
      if (isActive || !isActive && null !== regex.exec(value.text.substring(value.start, value.end))) {
        onChange((0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_3__.toggleFormat)(value, {
          type: name
        }));
      }
    };
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichTextToolbarButton, {
        icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"],
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Count Animation', "otter-blocks"),
        isDisabled: !isActive && null === regex.exec(value.text.substring(value.start, value.end)),
        onClick: onToggle,
        isActive: isActive
      }), isActive && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_inline_controls_js__WEBPACK_IMPORTED_MODULE_4__["default"], {
        value: value,
        contentRef: contentRef
      })]
    });
  }
};
(0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_3__.registerFormatType)(name, format);

/***/ }),

/***/ "./src/animation/count/inline-controls.js":
/*!************************************************!*\
  !*** ./src/animation/count/inline-controls.js ***!
  \************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _data_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../data.js */ "./src/animation/data.js");
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./index.js */ "./src/animation/count/index.js");
/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../editor.js */ "./src/animation/editor.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
/**
 * WordPress dependencies.
 */







/**
 * Internal dependencies.
 */




const delayListInline = _data_js__WEBPACK_IMPORTED_MODULE_6__.delayList.filter(i => 'o-anim-custom-delay' !== i.value);
const speedListInline = _data_js__WEBPACK_IMPORTED_MODULE_6__.speedList.filter(i => 'o-anim-custom-speed' !== i.value);
const InlineControls = ({
  value,
  contentRef
}) => {
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    let classes;
    if (attributes.className) {
      classes = attributes.className;
      classes = classes.split(' ');
      const countDelayClass = Array.from(delayListInline).find(i => {
        return classes.find(o => o === `o-count-${i.value}`);
      });
      const countSpeedClass = Array.from(speedListInline).find(i => {
        return classes.find(o => o === `o-count-${i.value}`);
      });
      setCountDelay(countDelayClass ? countDelayClass.value : 'none');
      setCountSpeed(countSpeedClass ? countSpeedClass.value : 'none');
    }
  }, []);
  const {
    clientId,
    attributes
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    const {
      getSelectedBlock
    } = select('core/block-editor');
    const currentBlock = getSelectedBlock();
    return {
      clientId: currentBlock?.clientId,
      attributes: currentBlock?.attributes
    };
  }, []);
  const {
    updateBlockAttributes
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)('core/block-editor');
  const setAttributes = attributes => updateBlockAttributes(clientId, attributes);
  const [countDelay, setCountDelay] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('none');
  const [countSpeed, setCountSpeed] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('none');
  const anchorRef = (0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__.useAnchorRef)({
    ref: contentRef,
    value,
    settings: _index_js__WEBPACK_IMPORTED_MODULE_7__.format
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Popover, {
    position: "bottom center right",
    placement: "bottom",
    noArrow: false,
    anchor: anchorRef,
    anchorRef: anchorRef,
    focusOnMount: false,
    className: "o-animation-popover",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, {
      level: 4,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Count Animation', "otter-blocks")
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Delay', "otter-blocks"),
      value: countDelay || 'none',
      options: delayListInline,
      onChange: value => (0,_editor_js__WEBPACK_IMPORTED_MODULE_8__.updateAnimConfig)('count', countDelay, value, () => setCountDelay(value), attributes, setAttributes)
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Speed', "otter-blocks"),
      value: countSpeed || 'none',
      options: speedListInline,
      onChange: value => (0,_editor_js__WEBPACK_IMPORTED_MODULE_8__.updateAnimConfig)('count', countSpeed, value, () => setCountSpeed(value), attributes, setAttributes)
    }), (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__.applyFilters)('otter.poweredBy', '')]
  });
};
/* harmony default export */ __webpack_exports__["default"] = (InlineControls);

/***/ }),

/***/ "./src/animation/data.js":
/*!*******************************!*\
  !*** ./src/animation/data.js ***!
  \*******************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   animationsList: function() { return /* binding */ animationsList; },
/* harmony export */   categories: function() { return /* binding */ categories; },
/* harmony export */   delayList: function() { return /* binding */ delayList; },
/* harmony export */   outAnimation: function() { return /* binding */ outAnimation; },
/* harmony export */   speedList: function() { return /* binding */ speedList; }
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/**
 * WordPress dependencies.
 */

const animationsList = [{
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('None', "otter-blocks"),
  value: 'none'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Back In Down', "otter-blocks"),
  value: 'backInDown'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Back In Left', "otter-blocks"),
  value: 'backInLeft'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Back In Right', "otter-blocks"),
  value: 'backInRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Back In Up', "otter-blocks"),
  value: 'backInUp'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bounce', "otter-blocks"),
  value: 'bounce'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bounce In', "otter-blocks"),
  value: 'bounceIn'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bounce In Down', "otter-blocks"),
  value: 'bounceInDown'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bounce In Left', "otter-blocks"),
  value: 'bounceInLeft'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bounce In Right', "otter-blocks"),
  value: 'bounceInRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bounce In Up', "otter-blocks"),
  value: 'bounceInUp'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In', "otter-blocks"),
  value: 'fadeIn'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Down', "otter-blocks"),
  value: 'fadeInDown'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Down Big', "otter-blocks"),
  value: 'fadeInDownBig'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Left', "otter-blocks"),
  value: 'fadeInLeft'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Left Big', "otter-blocks"),
  value: 'fadeInLeftBig'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Right', "otter-blocks"),
  value: 'fadeInRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Right Big', "otter-blocks"),
  value: 'fadeInRightBig'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Up', "otter-blocks"),
  value: 'fadeInUp'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Top Left', "otter-blocks"),
  value: 'fadeInTopLeft'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Top Right', "otter-blocks"),
  value: 'fadeInTopRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Bottom Left', "otter-blocks"),
  value: 'fadeInBottomLeft'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade In Bottom Right', "otter-blocks"),
  value: 'fadeInBottomRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Flip', "otter-blocks"),
  value: 'flip'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Flip In X', "otter-blocks"),
  value: 'flipInX'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Flip In Y', "otter-blocks"),
  value: 'flipInY'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rotate In', "otter-blocks"),
  value: 'rotateIn'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rotate In Down Left', "otter-blocks"),
  value: 'rotateInDownLeft'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rotate In Down Right', "otter-blocks"),
  value: 'rotateInDownRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rotate In Up Left', "otter-blocks"),
  value: 'rotateInUpLeft'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rotate In Up Right', "otter-blocks"),
  value: 'rotateInUpRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Slide In Down', "otter-blocks"),
  value: 'slideInDown'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Slide In Left', "otter-blocks"),
  value: 'slideInLeft'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Slide In Right', "otter-blocks"),
  value: 'slideInRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Slide In Up', "otter-blocks"),
  value: 'slideInUp'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Zoom In', "otter-blocks"),
  value: 'zoomIn'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Zoom In Down', "otter-blocks"),
  value: 'zoomInDown'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Zoom In Left', "otter-blocks"),
  value: 'zoomInLeft'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Zoom In Right', "otter-blocks"),
  value: 'zoomInRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Zoom In Up', "otter-blocks"),
  value: 'zoomInUp'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Roll In', "otter-blocks"),
  value: 'rollIn'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Light Speed In Right', "otter-blocks"),
  value: 'lightSpeedInRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Light Speed In Left', "otter-blocks"),
  value: 'lightSpeedInLeft'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Flash', "otter-blocks"),
  value: 'flash'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pulse', "otter-blocks"),
  value: 'pulse'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rubber Band', "otter-blocks"),
  value: 'rubberBand'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Shake X', "otter-blocks"),
  value: 'shakeX'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Shake Y', "otter-blocks"),
  value: 'shakeY'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Head Shake', "otter-blocks"),
  value: 'headShake'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Swing', "otter-blocks"),
  value: 'swing'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('TaDa', "otter-blocks"),
  value: 'tada'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Wobble', "otter-blocks"),
  value: 'wobble'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Jello', "otter-blocks"),
  value: 'jello'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Heart Beat', "otter-blocks"),
  value: 'heartBeat'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Hinge', "otter-blocks"),
  value: 'hinge'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Jack In The Box', "otter-blocks"),
  value: 'jackInTheBox'
}];
const categories = [{
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Backing', "otter-blocks"),
  value: 'backInDown'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bouncing', "otter-blocks"),
  value: 'bounce'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fading', "otter-blocks"),
  value: 'fadeIn'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Flipping', "otter-blocks"),
  value: 'flip'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rotating', "otter-blocks"),
  value: 'rotateIn'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sliding', "otter-blocks"),
  value: 'slideInDown'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Zooming', "otter-blocks"),
  value: 'zoomIn'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rolling', "otter-blocks"),
  value: 'rollIn'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Light Speed', "otter-blocks"),
  value: 'lightSpeedInRight'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Other', "otter-blocks"),
  value: 'flash'
}];
const outAnimation = ['backOutDown', 'backOutLeft', 'backOutRight', 'backOutUp', 'bounceOut', 'bounceOutDown', 'bounceOutLeft', 'bounceOutRight', 'bounceOutUp', 'fadeOut', 'fadeOutDown', 'fadeOutDownBig', 'fadeOutLeft', 'fadeOutLeftBig', 'fadeOutRight', 'fadeOutRightBig', 'fadeOutUp', 'fadeOutUpBig', 'fadeOutTopLeft', 'fadeOutTopRight', 'fadeOutBottomRight', 'fadeOutBottomLeft', 'flipOutX', 'flipOutY', 'lightSpeedOutRight', 'lightSpeedOutLeft', 'rotateOut', 'rotateOutDownLeft', 'rotateOutDownRight', 'rotateOutUpLeft', 'rotateOutUpRight', 'slideOutDown', 'slideOutLeft', 'slideOutRight', 'slideOutUp', 'zoomOut', 'zoomOutDown', 'zoomOutLeft', 'zoomOutRight', 'zoomOutUp', 'rollOut'];
const delayList = [{
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('None', "otter-blocks"),
  value: 'none'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('100 Milliseconds', "otter-blocks"),
  value: 'delay-100ms'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('200 Milliseconds', "otter-blocks"),
  value: 'delay-200ms'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('500 Milliseconds', "otter-blocks"),
  value: 'delay-500ms'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('One Second', "otter-blocks"),
  value: 'delay-1s'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Two Second', "otter-blocks"),
  value: 'delay-2s'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Three Second', "otter-blocks"),
  value: 'delay-3s'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Four Second', "otter-blocks"),
  value: 'delay-4s'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Five Second', "otter-blocks"),
  value: 'delay-5s'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Custom', "otter-blocks"),
  value: 'o-anim-custom-delay'
}];
const speedList = [{
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Slow', "otter-blocks"),
  value: 'slow'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Slower', "otter-blocks"),
  value: 'slower'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Default', "otter-blocks"),
  value: 'none'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fast', "otter-blocks"),
  value: 'fast'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Faster', "otter-blocks"),
  value: 'faster'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Custom', "otter-blocks"),
  value: 'o-anim-custom-speed'
}];

/***/ }),

/***/ "./src/animation/editor.js":
/*!*********************************!*\
  !*** ./src/animation/editor.js ***!
  \*********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   updateAnimConfig: function() { return /* binding */ updateAnimConfig; }
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _data_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./data.js */ "./src/animation/data.js");
/* harmony import */ var _components_animation_popover_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/animation-popover.js */ "./src/animation/components/animation-popover.js");
/* harmony import */ var _blocks_components_control_panel_control_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../blocks/components/control-panel-control/index.js */ "./src/blocks/components/control-panel-control/index.js");
/* harmony import */ var _assets_images_count_animation_png__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../assets/images/count-animation.png */ "./assets/images/count-animation.png");
/* harmony import */ var _assets_images_typing_animation_png__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../assets/images/typing-animation.png */ "./assets/images/typing-animation.png");
/* harmony import */ var _blocks_helpers_block_utility_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../blocks/helpers/block-utility.js */ "./src/blocks/helpers/block-utility.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
/**
 * WordPress dependencies.
 */





/**
 * Internal dependencies.
 */





const AnimationType = {
  count: 'count',
  typing: 'typing',
  default: 'default'
};


/**
 * Update the animation config.
 *
 * @param {string}              type          The type of animation. (e.g. count, typing, default)
 * @param {string|undefined}    oldValue      The old value of the animation.
 * @param {string|undefined}    newValue      The new value of the animation.
 * @param {Function|undefined}  callback      The callback function which will be called after the animation is updated.
 * @param {Object}              attributes    The attributes of the block.
 * @param {(x: Object) => void} setAttributes The setAttributes function of the block.
 */

const updateAnimConfig = (type, oldValue, newValue, callback, attributes, setAttributes) => {
  let template;
  switch (type) {
    case AnimationType.count:
      template = 'o-count-';
      break;
    case AnimationType.typing:
      template = 'o-typing-';
      break;
    case AnimationType.default:
      template = '';
      break;
  }
  oldValue ??= '';
  const oldClassName = template + oldValue;
  const newClassName = 'none' !== newValue ? template + newValue : '';
  let classes;
  if (attributes.className) {
    classes = attributes.className;
    classes = classes.split(' ');
    const exists = classes.find(i => i === oldClassName);
    if (oldValue.startsWith('o-anim-value-delay-') || oldValue.startsWith('o-anim-value-speed-') || oldValue.startsWith('o-anim-offset-')) {
      // Remove the old custom value.
      classes = classes.filter(i => !i.includes(oldValue));
    }
    if ('o-anim-custom-delay' === oldValue || 'o-anim-custom-speed' === oldValue) {
      const cssKey = 'o-anim-custom-delay' === oldValue ? 'o-anim-value-delay-' : 'o-anim-value-speed-';

      // Remove the old custom value.
      classes = classes.filter(i => !i.includes(cssKey));
    }
    if (exists) {
      classes = classes.join(' ').replace(oldClassName, newClassName);
    } else {
      classes.push(newClassName);
      classes = classes.join(' ').trim();
    }
  } else {
    classes = newClassName;
  }
  classes = classes.replace(/\s+/g, ' ');
  if ('' === classes) {
    classes = undefined;
  }
  setAttributes({
    className: classes
  });
  callback?.();
};
function AnimationControls({
  clientId,
  attributes,
  setAttributes
}) {
  const [animation, setAnimation] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)('none');
  const [delay, setDelay] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)('none');
  const [speed, setSpeed] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)('none');
  const [currentAnimationLabel, setCurrentAnimationLabel] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('None', "otter-blocks"));
  const [customDelayValue, setCustomDelayValue] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(0);
  const [customSpeedValue, setCustomSpeedValue] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(0);
  const [playOnHover, setPlayOnHover] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  const [triggerOffset, setTriggerOffset] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)('');
  const [triggerOffsetValue, setTriggerOffsetValue] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)('0px');
  const [cssNode, setNodeCSS] = (0,_blocks_helpers_block_utility_js__WEBPACK_IMPORTED_MODULE_9__.useCSSNode)({
    selector: 'animated',
    appendToRoot: true
  });
  const updateAnimation = e => {
    let classes;
    const animationValue = 'none' !== e ? e : '';
    if (attributes.className) {
      classes = attributes.className;
      classes = classes.split(' ');
      const exists = classes.find(i => i === animation);
      const animatedExists = classes.find(i => 'animated' === i);
      if (!animatedExists) {
        classes.push('animated');
      }
      if (exists) {
        classes = classes.join(' ').replace(animation, animationValue);
      } else {
        classes.push(animationValue);
        classes = classes.join(' ');
      }
    } else {
      classes = `animated ${animationValue}`;
    }
    if ('none' === e) {
      classes = classes.replace('animated', '').replace(delay, '').replace(speed, '');
      setDelay('none');
      setSpeed('none');
    }
    classes = classes.replace(/\s+/g, ' ').trim();
    if ('' === classes) {
      classes = undefined;
    }
    setAnimation(e);
    setAttributes({
      className: classes
    });
    const block = document.querySelector(`#block-${clientId} .animated`) || document.querySelector(`#block-${clientId}.animated`);
    if (block) {
      _data_js__WEBPACK_IMPORTED_MODULE_4__.outAnimation.forEach(i => {
        const isOut = block.className.includes(i);
        if (isOut) {
          block.addEventListener('animationend', () => {
            block.classList.remove(i);
            block.addEventListener('animationstart', () => {
              block.classList.remove(i);
            });
          });
        }
      });
    }
  };
  const replayAnimation = () => {
    let classes = attributes.className;
    classes = classes.replace(animation, 'o-replay');
    setAttributes({
      className: classes
    });
    setTimeout(() => setAttributes({
      className: classes.replace('o-replay', animation)
    }), 100);
  };
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (undefined !== window?.blocksAnimation) {
      window.blocksAnimation.removeAnimation = () => updateAnimation('none');
    }
  }, []);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    setNodeCSS(attributes.className?.split(' ').map(i => {
      if (i.includes('o-anim-value-delay-')) {
        return `.${i} { animation-delay: ${i.replace('o-anim-value-delay-', '')}; --webkit-animation-delay: ${i.replace('o-anim-value-delay-', '')}; }`;
      } else if (i.includes('o-anim-value-speed-')) {
        return `.${i} { animation-duration: ${i.replace('o-anim-value-speed-', '')}; --webkit-animation-duration: ${i.replace('o-anim-value-speed-', '')}; }`;
      }
      return '';
    }).filter(i => i) ?? '');
  }, [attributes.className]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    let classes;
    if (attributes.className) {
      classes = attributes.className;
      classes = classes.split(' ');
      const animationClass = Array.from(_data_js__WEBPACK_IMPORTED_MODULE_4__.animationsList).find(i => {
        return classes.find(o => o === i.value);
      });
      const delayClass = Array.from(_data_js__WEBPACK_IMPORTED_MODULE_4__.delayList).find(i => {
        return classes.find(o => o === i.value);
      });
      const speedClass = Array.from(_data_js__WEBPACK_IMPORTED_MODULE_4__.speedList).find(i => {
        return classes.find(o => o === i.value);
      });
      let customDelay = classes.find(i => i.includes('o-anim-value-delay'));
      if (customDelay) {
        customDelay = customDelay.replace('o-anim-value-delay-', '');

        // The string must start with a number and end with s or ms.
        if (!customDelay.match(/^[0-9]*\.?[0-9]+(ms|s)$/)) {
          customDelay = undefined;
        }
      }
      let customSpeed = classes.find(i => i.includes('o-anim-value-speed'));
      if (customSpeed) {
        customSpeed = customSpeed.replace('o-anim-value-speed-', '');

        // The string must start with a number and end with s or ms.
        if (!customSpeed.match(/^[0-9]*\.?[0-9]+(ms|s)$/)) {
          customSpeed = undefined;
        }
      }
      let triggerOffsetValue = classes.find(i => i.includes('o-anim-offset-'));
      if (triggerOffsetValue) {
        triggerOffsetValue = triggerOffsetValue.replace('o-anim-offset-', '');

        // The string must start with a number and end with px or %.
        if (!triggerOffsetValue.match(/^[0-9]+(px|%)$/)) {
          triggerOffsetValue = '0px';
        }
      }
      const playOnHover = classes.find(i => i.includes('o-anim-hover'));
      setAnimation(animationClass ? animationClass.value : 'none');
      setDelay(delayClass ? delayClass.value : 'none');
      setSpeed(speedClass ? speedClass.value : 'none');
      setCustomDelayValue(customDelay || 0);
      setCustomSpeedValue(customSpeed || 0);
      setPlayOnHover(playOnHover ? true : false);
      setCurrentAnimationLabel(animationClass ? animationClass.label : 'none');
      setTriggerOffset(triggerOffsetValue ? `o-anim-offset-${triggerOffsetValue}` : '');
      setTriggerOffsetValue(triggerOffsetValue || '0px');
    }
  }, []);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (!triggerOffset) {
      return;
    }
    if (!triggerOffsetValue) {
      return;
    }
    if (triggerOffset === `o-anim-offset-${triggerOffsetValue}`) {
      return;
    }
    updateAnimConfig(AnimationType.default, 'o-anim-offset-', triggerOffsetValue ? `o-anim-offset-${triggerOffsetValue}` : '', () => setTriggerOffset(`o-anim-offset-${triggerOffsetValue}`), attributes, setAttributes);
  }, [triggerOffsetValue, triggerOffset]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Animations', "otter-blocks"),
    initialOpen: false,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
      className: "o-animations-control",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_animation_popover_js__WEBPACK_IMPORTED_MODULE_5__["default"], {
        animationsList: _data_js__WEBPACK_IMPORTED_MODULE_4__.animationsList,
        updateAnimation: updateAnimation,
        currentAnimationLabel: currentAnimationLabel,
        setCurrentAnimationLabel: setCurrentAnimationLabel
      }), 'none' !== animation && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Delay', "otter-blocks"),
          value: delay || 'none',
          options: _data_js__WEBPACK_IMPORTED_MODULE_4__.delayList,
          onChange: value => updateAnimConfig(AnimationType.default, delay, value, () => setDelay(value), attributes, setAttributes)
        }), 'o-anim-custom-delay' === delay && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalUnitControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Value', "otter-blocks"),
          value: customDelayValue,
          onChange: value => updateAnimConfig(AnimationType.default, 'o-anim-value-delay-', value ? `o-anim-value-delay-${value}` : undefined, () => setCustomDelayValue(value), attributes, setAttributes),
          min: 0,
          step: 0.1,
          allowReset: true,
          units: [{
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('S', "otter-blocks"),
            value: 's'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('MS', "otter-blocks"),
            value: 'ms'
          }]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Speed', "otter-blocks"),
          value: speed || 'none',
          options: _data_js__WEBPACK_IMPORTED_MODULE_4__.speedList,
          onChange: value => updateAnimConfig(AnimationType.default, speed, value, () => setSpeed(value), attributes, setAttributes)
        }), 'o-anim-custom-speed' === speed && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalUnitControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Value', "otter-blocks"),
          value: customSpeedValue,
          onChange: value => updateAnimConfig(AnimationType.default, 'o-anim-value-speed-', `o-anim-value-speed-${value}`, () => setCustomSpeedValue(value), attributes, setAttributes),
          min: 0,
          step: 0.1,
          allowReset: true,
          units: [{
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('S', "otter-blocks"),
            value: 's'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('MS', "otter-blocks"),
            value: 'ms'
          }]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Play on Hover', "otter-blocks"),
          checked: playOnHover,
          onChange: value => updateAnimConfig(AnimationType.default, 'o-anim-hover', value ? 'o-anim-hover' : '', () => setPlayOnHover(value), attributes, setAttributes)
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Trigger Offset', "otter-blocks"),
          checked: Boolean(triggerOffset),
          onChange: value => updateAnimConfig(AnimationType.default, 'o-anim-offset-0px', value ? 'o-anim-offset-0px' : '', () => {
            setTriggerOffset(value ? 'o-anim-offset-0px' : '');
            setTriggerOffsetValue(value ? 'o-anim-offset-0px' : '');
          }, attributes, setAttributes),
          help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This will offset the trigger of animation relative to the screen.', "otter-blocks")
        }), Boolean(triggerOffset) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalUnitControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Height Trigger Offset', "otter-blocks"),
          value: triggerOffsetValue,
          onChange: setTriggerOffsetValue,
          step: 0.1,
          allowReset: true,
          units: [{
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('px', "otter-blocks"),
            value: 'px'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('%', "otter-blocks"),
            value: '%'
          }],
          help: triggerOffsetValue?.endsWith('%') ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Is the percentage of the screen height. E.g: with 50% the animation will trigger after passing the middle of screen.', "otter-blocks") : ''
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
          variant: "secondary",
          onClick: replayAnimation,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Replay Animation', "otter-blocks")
        })]
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_blocks_components_control_panel_control_index_js__WEBPACK_IMPORTED_MODULE_6__["default"], {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Count Animations', "otter-blocks"),
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("img", {
        src: _assets_images_typing_animation_png__WEBPACK_IMPORTED_MODULE_8__,
        alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Using Count Animation in the Block Editor', "otter-blocks"),
        className: "otter-animations-count-image"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can add counting animation from the format toolbar of this block.', "otter-blocks")
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Note: This feature is not available in all the blocks.', "otter-blocks")
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_blocks_components_control_panel_control_index_js__WEBPACK_IMPORTED_MODULE_6__["default"], {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Typing Animations', "otter-blocks"),
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("img", {
        src: _assets_images_count_animation_png__WEBPACK_IMPORTED_MODULE_7__,
        alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Using Typing Animation in the Block Editor', "otter-blocks"),
        className: "otter-animations-count-image"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can add typing animation from the format toolbar of this block.', "otter-blocks")
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Note: This feature is not available in all the blocks.', "otter-blocks")
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
      className: "o-fp-wrap",
      children: [(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__.applyFilters)('otter.feedback', '', 'animations'), (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__.applyFilters)('otter.poweredBy', '')]
    })]
  });
}
/* harmony default export */ __webpack_exports__["default"] = ((0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.memo)(AnimationControls));

/***/ }),

/***/ "./src/animation/editor.scss":
/*!***********************************!*\
  !*** ./src/animation/editor.scss ***!
  \***********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/animation/typing/index.js":
/*!***************************************!*\
  !*** ./src/animation/typing/index.js ***!
  \***************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   format: function() { return /* binding */ format; }
/* harmony export */ });
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/brush.mjs");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _inline_controls_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./inline-controls.js */ "./src/animation/typing/inline-controls.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
/**
 * External dependencies.
 */


/**
 * WordPress dependencies.
 */





/**
 * Internal dependencies.
 */


const name = 'themeisle-blocks/typing-animation';
const format = {
  name,
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Typing Animation', "otter-blocks"),
  tagName: 'o-anim-typing',
  className: null,
  edit: ({
    isActive,
    value,
    onChange,
    contentRef
  }) => {
    const onToggle = () => {
      onChange((0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_3__.toggleFormat)(value, {
        type: name
      }));
    };
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichTextToolbarButton, {
        icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"],
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Typing Animation', "otter-blocks"),
        onClick: onToggle,
        isActive: isActive
      }), isActive && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_inline_controls_js__WEBPACK_IMPORTED_MODULE_4__["default"], {
        value: value,
        contentRef: contentRef
      })]
    });
  }
};
(0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_3__.registerFormatType)(name, format);

/***/ }),

/***/ "./src/animation/typing/inline-controls.js":
/*!*************************************************!*\
  !*** ./src/animation/typing/inline-controls.js ***!
  \*************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _data_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../data.js */ "./src/animation/data.js");
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./index.js */ "./src/animation/typing/index.js");
/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../editor.js */ "./src/animation/editor.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
/**
 * WordPress dependencies.
 */







/**
 * Internal dependencies.
 */




const delayListInline = _data_js__WEBPACK_IMPORTED_MODULE_6__.delayList.filter(i => 'o-anim-custom-delay' !== i.value);
const speedListInline = _data_js__WEBPACK_IMPORTED_MODULE_6__.speedList.filter(i => 'o-anim-custom-speed' !== i.value);
const InlineControls = ({
  value,
  contentRef
}) => {
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    let classes;
    if (attributes.className) {
      classes = attributes.className;
      classes = classes.split(' ');
      const typingDelayClass = Array.from(delayListInline).find(i => {
        return classes.find(o => o === `o-typing-${i.value}`);
      });
      const typingSpeedClass = Array.from(speedListInline).find(i => {
        return classes.find(o => o === `o-typing-${i.value}`);
      });
      setTypingDelay(typingDelayClass ? typingDelayClass.value : 'none');
      setTypingSpeed(typingSpeedClass ? typingSpeedClass.value : 'none');
    }
  }, []);
  const {
    clientId,
    attributes
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    const {
      getSelectedBlock
    } = select('core/block-editor');
    const currentBlock = getSelectedBlock();
    return {
      clientId: currentBlock?.clientId,
      attributes: currentBlock?.attributes
    };
  }, []);
  const {
    updateBlockAttributes
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)('core/block-editor');
  const setAttributes = attributes => updateBlockAttributes(clientId, attributes);
  const [typingDelay, setTypingDelay] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('none');
  const [typingSpeed, setTypingSpeed] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('none');
  const anchorRef = (0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__.useAnchorRef)({
    ref: contentRef,
    value,
    settings: _index_js__WEBPACK_IMPORTED_MODULE_7__.format
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Popover, {
    position: "bottom center right",
    placement: "bottom",
    noArrow: false,
    anchor: anchorRef,
    anchorRef: anchorRef,
    focusOnMount: false,
    className: "o-animation-popover",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, {
      level: 4,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Typing Animation', "otter-blocks")
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Delay', "otter-blocks"),
      value: typingDelay || 'none',
      options: delayListInline,
      onChange: value => (0,_editor_js__WEBPACK_IMPORTED_MODULE_8__.updateAnimConfig)('typing', typingDelay, value, () => setTypingDelay(value), attributes, setAttributes)
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Speed', "otter-blocks"),
      value: typingSpeed || 'none',
      options: speedListInline,
      onChange: value => (0,_editor_js__WEBPACK_IMPORTED_MODULE_8__.updateAnimConfig)('typing', typingSpeed, value, () => setTypingSpeed(value), attributes, setAttributes)
    }), (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__.applyFilters)('otter.poweredBy', '')]
  });
};
/* harmony default export */ __webpack_exports__["default"] = (InlineControls);

/***/ }),

/***/ "./src/blocks/components/control-panel-control/editor.scss":
/*!*****************************************************************!*\
  !*** ./src/blocks/components/control-panel-control/editor.scss ***!
  \*****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/blocks/components/control-panel-control/index.js":
/*!**************************************************************!*\
  !*** ./src/blocks/components/control-panel-control/index.js ***!
  \**************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/icon/index.mjs");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/backup.mjs");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/settings.mjs");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor.scss */ "./src/blocks/components/control-panel-control/editor.scss");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */





/**
 * Internal dependencies
 */


const ControlPanelControl = ({
  label,
  attributes,
  setAttributes,
  resetValues,
  onClick,
  children
}) => {
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    for (const key in resetValues) {
      if (resetValues[key] !== attributes[key]) {
        return setActive(true);
      }
      setActive(false);
    }
  }, [attributes]);
  const instanceId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.useInstanceId)(ControlPanelControl);
  const [isActive, setActive] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
  const id = `inspector-control-panel-control-${instanceId}`;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
    className: "o-control-panel-control",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
      className: "components-base-control__field",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
        className: "components-base-control__title",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("label", {
          className: "components-base-control__label",
          htmlFor: id,
          children: label
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
          className: "floating-controls",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Dropdown, {
            position: "top left",
            headerTitle: label,
            expandOnMobile: true,
            renderToggle: ({
              isOpen,
              onToggle
            }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
              children: [isActive && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
                icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"], {
                  icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__["default"]
                }),
                label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reset to default', "otter-blocks"),
                showTooltip: true,
                isTertiary: true,
                onClick: () => setAttributes({
                  ...resetValues
                })
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
                id: id,
                icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__["default"],
                label: label,
                showTooltip: true,
                onClick: () => {
                  onToggle();
                  if (onClick) {
                    onClick();
                  }
                },
                "aria-expanded": isOpen,
                className: classnames__WEBPACK_IMPORTED_MODULE_0___default()({
                  'is-active': isActive
                })
              })]
            }),
            renderContent: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
              className: "otter-popover-settings",
              children: children
            })
          })
        })]
      })
    })
  });
};
/* harmony default export */ __webpack_exports__["default"] = (ControlPanelControl);

/***/ }),

/***/ "./src/blocks/helpers/block-utility.js":
/*!*********************************************!*\
  !*** ./src/blocks/helpers/block-utility.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   GlobalStateMemory: function() { return /* binding */ GlobalStateMemory; },
/* harmony export */   addBlockId: function() { return /* binding */ addBlockId; },
/* harmony export */   addGlobalDefaults: function() { return /* binding */ addGlobalDefaults; },
/* harmony export */   blockInit: function() { return /* binding */ blockInit; },
/* harmony export */   buildGetSyncValue: function() { return /* binding */ buildGetSyncValue; },
/* harmony export */   copyScriptAssetToIframe: function() { return /* binding */ copyScriptAssetToIframe; },
/* harmony export */   getBlockDocument: function() { return /* binding */ getBlockDocument; },
/* harmony export */   getBlockWindow: function() { return /* binding */ getBlockWindow; },
/* harmony export */   getDefaultValue: function() { return /* binding */ getDefaultValue; },
/* harmony export */   getDefaultValueByField: function() { return /* binding */ getDefaultValueByField; },
/* harmony export */   getEditorIframe: function() { return /* binding */ getEditorIframe; },
/* harmony export */   insertBlockBelow: function() { return /* binding */ insertBlockBelow; },
/* harmony export */   mountIconGradient: function() { return /* binding */ mountIconGradient; },
/* harmony export */   mountIconGradientForEditor: function() { return /* binding */ mountIconGradientForEditor; },
/* harmony export */   pullOtterPatterns: function() { return /* binding */ pullOtterPatterns; },
/* harmony export */   pullPatterns: function() { return /* binding */ pullPatterns; },
/* harmony export */   pullReusableBlockContentById: function() { return /* binding */ pullReusableBlockContentById; },
/* harmony export */   useBlockElementEffect: function() { return /* binding */ useBlockElementEffect; },
/* harmony export */   useCSSNode: function() { return /* binding */ useCSSNode; },
/* harmony export */   useTabSwitch: function() { return /* binding */ useTabSwitch; },
/* harmony export */   watchEditorIframeIconGradient: function() { return /* binding */ watchEditorIframeIconGradient; }
/* harmony export */ });
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/v4.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _plugins_options_global_defaults_defaults_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../plugins/options/global-defaults/defaults.js */ "./src/blocks/plugins/options/global-defaults/defaults.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);
/**
 * External dependencies.
 */


/**
 * WordPress dependencies.
 */




/**
 * Internal dependencies.
 */




/**
 * Initiate the global id tracker with an empty list if it is the case.
 */
window.themeisleGutenberg ??= {};
window.themeisleGutenberg.blockIDs ??= [];

/**
 * Utility function for creating a function that add the global defaults values to the block's attribute value.
 *
 * @param {Object}   attributes        The block's attributes provided by WordPress
 * @param {Function} setAttributes     The block's attributes update function provided by WordPress
 * @param {string}   name              The block's name provided by WordPress
 * @param {Object}   defaultAttributes The default attributes of the block.
 */
const addGlobalDefaults = (attributes, setAttributes, name, defaultAttributes) => {
  // Check if the globals default are available and its values are different from the base values.
  // Optional chaining throughout: a corrupt/empty option localizes globalDefaults as null.
  const globalDefaults = window.themeisleGutenberg?.globalDefaults?.[name];
  if (globalDefaults && !(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isEqual)(_plugins_options_global_defaults_defaults_js__WEBPACK_IMPORTED_MODULE_3__["default"][name], globalDefaults)) {
    const defaultGlobalAttrs = {
      ...globalDefaults
    };
    const attrs = Object.keys(defaultGlobalAttrs).filter(attr => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.isEqual)(attributes[attr], defaultAttributes[attr]?.default)) // Keep only the properties with the default value.
    // Build an attribute object with the properties that are gone take the Global Defaults values.
    .reduce((attrs, attr) => {
      attrs[attr] = defaultGlobalAttrs[attr];
      return attrs;
    }, {});
    setAttributes({
      ...attrs
    });
  }
};

/**
 * Utiliy function for getting the default value of the attribute.
 *
 * @param {string} name              The block's name provided by WordPress
 * @param {string} field             Name of the value to be returned
 * @param {Object} defaultAttributes The default attributes of the block.
 */
const getDefaultValue = (name, field, defaultAttributes) => {
  const blockDefaults = window.themeisleGutenberg.globalDefaults?.[name];
  const value = blockDefaults?.[field] ? blockDefaults?.[field] : defaultAttributes[field]?.default;
  return value;
};

/**
 * Utiliy function for getting the default value of the attribute by value.
 *
 * @param {Object} params                   - The parameters object.
 * @param {string} params.name              The block's name provided by WordPress
 * @param {string} params.field             Name of the value to be returned
 * @param {Object} params.defaultAttributes The default attributes of the block.
 * @param {Object} params.attributes        The attributes of the block.
 */
const getDefaultValueByField = ({
  name,
  field,
  defaultAttributes,
  attributes
}) => {
  if (attributes.isSynced?.includes(field)) {
    return getDefaultValue(name, field, defaultAttributes);
  }
  return attributes[field];
};

/**
 * An object that keep tracking of the block instances. Is used for preventing id duplication on action like: create, duplicate, copy on editor page.
 *
 * @type {Object.<string, Set.<string>>}
 */
const localIDs = {};

/**
 * Check if the ID is inside a reusable block or a Query Loop.
 * @param {string} clientId The client id of the block.
 * @return {boolean}
 */
const isSharedBlock = clientId => getBlockParents(clientId)?.some(id => {
  const {
    attributes,
    name
  } = getBlock(id) ?? {};
  return 'core/query' === name || attributes?.ref;
});

/**
 * Check if the ID is empty.
 * @param {string} clientId The client id of the block.
 * @return {boolean}
 */
const isEmptyId = clientId => {
  const {
    attributes
  } = getBlock(clientId) ?? {};
  return attributes?.id === undefined || '' === attributes?.id;
};

/**
 * Generate an Id based on the client id of the block. If the new id is also already used, create a new one using the `uuid`.
 * This might problem of duplicated new ids can be observed in the `Template Library` of the `Section` block when using Neve
 * Reference: https://github.com/Codeinwp/neve/blob/master/gutenberg/blocks/blog/template.json
 * The created block will share the same client Id at the beginning, after refresh a new will be generated and thus the problem will fix itself
 * by creating new id based on the new uniq `clientId`
 *
 * @param {string}       idPrefix The prefix used for generating the block id
 * @param {string}       clientId The block's client id provided by WordPress
 * @param {Set.<string>} idsList  The ids list for the current type of block
 * @return An uniq id instance
 */
const generateUniqIdInstance = (idPrefix, clientId, idsList) => {
  const instanceId = `${idPrefix}${clientId.slice(0, 8)}`;
  if (idsList.has(instanceId)) {
    let newInstanceId = `${idPrefix}${(0,uuid__WEBPACK_IMPORTED_MODULE_6__["default"])().slice(0, 8)}`;
    while (idsList.has(newInstanceId)) {
      newInstanceId = `${idPrefix}${(0,uuid__WEBPACK_IMPORTED_MODULE_6__["default"])().slice(0, 8)}`;
    }
    return newInstanceId;
  }
  return instanceId;
};

/**
 * Generate the id prefix based on the name of the block
 *
 * @param {string} name Name of the block
 * @return {string}
 */
const generatePrefix = name => {
  return `wp-block-${name.replace('/', '-')}-`;
};
const idGenerationStatus = {};

/**
 * THe args definition for the block id generator
 *
 * @typedef {Object} AddBlockIdProps
 * @property {Object}             attributes        The block's attributes provided by WordPress
 * @property {Function}           setAttributes     The block's attributes update function provided by WordPress
 * @property {string}             name              The block's name provided by WordPress
 * @property {string}             clientId          The block's client id provided by WordPress
 * @property {Object}             defaultAttributes The default attributes of the block.
 * @property {(string|undefined)} idPrefix          (Optional) The prefix used for generating the block id
 */

/**
 * Generate an Id for block so that it will create a conlfict with the others.
 * Prevent the duplicate Id for actions like: duplicate, copy
 *
 * @param {AddBlockIdProps} args Block informatin about clientId, attributes, etc
 * @return {Function} A function that clean up the id from the internal list tracking
 * @external addBlockId
 */
const addBlockId = args => {
  const {
    attributes,
    setAttributes,
    clientId,
    idPrefix,
    name,
    defaultAttributes
  } = args;
  idGenerationStatus[clientId] = 'busy';

  /**
   * Create an alias for the global id tracker
   *
   * @type {Array.<string>}
   */
  const blockIDs = window.themeisleGutenberg?.blockIDs ?? [];
  if (attributes === undefined || setAttributes === undefined) {
    return savedId => {
      localIDs[name]?.delete(savedId);
    };
  }

  // Initialize with an empty array the id list for the given block
  localIDs[name] ??= new Set();

  // Check if the ID is already used. EXCLUDE the one that come from reusable blocks.
  const idIsAlreadyUsed = Boolean(attributes.id && localIDs[name].has(attributes.id));
  if (!attributes.id || idIsAlreadyUsed) {
    // Auto-generate idPrefix if not provided
    const prefix = idPrefix || generatePrefix(name);
    const instanceId = generateUniqIdInstance(prefix, clientId, localIDs[name]);
    if (undefined === attributes.id) {
      // If the id is undefined, then the block is newly created, and so we need to apply the Global Defaults
      addGlobalDefaults(attributes, setAttributes, name, defaultAttributes);
    }

    // Save the id in all methods
    localIDs[name].add(instanceId);
    blockIDs.push(instanceId);
    setAttributes({
      id: instanceId
    });
    return savedId => {
      return savedId => {};
    };
  }

  // No conflicts, save the current id only to keep track of it both in local and global mode.
  localIDs[name].add(attributes.id);
  blockIDs.push(attributes.id);
  return savedId => {
    idGenerationStatus[clientId] = 'free';
    localIDs[name].delete(savedId || attributes?.id);
  };
};
const {
  getBlock
} = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/block-editor');
const {
  getBlockParents
} = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/block-editor');
const {
  updateBlockAttributes
} = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)('core/block-editor');
const {
  getSelectedBlockClientId
} = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/block-editor');

/**
 * Create the function that behaves like `setAttributes` using the client id
 *
 * @param {*} clientId The block's client id provided by WordPress
 * @return {Function} Function that mimics `setAttributes`
 */
const updateAttrs = clientId => attr => {
  updateBlockAttributes(clientId, attr);
};

/**
 * THe args definition for the block id generator
 *
 * @typedef {Object} BlockData
 * @property {Object}   attributes    The block's attributes provided by WordPress
 * @property {Function} setAttributes The block's attributes update function provided by WordPress
 * @property {string}   name          The block's name provided by WordPress
 */

/**
 * Extract the attributes, setAttributes, and the name of the block using the data api
 *
 * @param {string} clientId The block's client id provided by WordPress
 * @return {BlockData}
 */
const extractBlockData = clientId => {
  const block = getBlock(clientId);
  return {
    attributes: block?.attributes,
    name: block?.name
  };
};

/**
 * Generate the id attribute for the given block.
 * This function is a simple wrapper around {@link addBlockId}
 *
 * @param {string} clientId          The block's client id provided by WordPress
 * @param {Object} defaultAttributes The default attributes of the block.
 * @return {Function} A function that clean up the id from the internal list tracking
 * @example
 * import defaultAttributes from './attributes'
 * const Block = ({ clientId }) => {
 * 		useEffect(() => {
 * 			const unsubscribe = blockInit(clientId, defaultAttributes);
 * 			return () => unsubscribe( attributes.id );
 * 		}, [ attributes.id ])
 * }
 */
const blockInit = (clientId, defaultAttributes) => {
  if (undefined === idGenerationStatus[clientId] || isEmptyId(clientId)) {
    idGenerationStatus[clientId] = 'free';
  }
  return 'busy' !== idGenerationStatus[clientId] && (!isSharedBlock(clientId) || getSelectedBlockClientId() === clientId) ? addBlockId({
    clientId,
    defaultAttributes,
    setAttributes: updateAttrs(clientId),
    ...extractBlockData(clientId)
  }) : () => {};
};

/**
 * Create a Style node for handling `head` Node change when working in a Tablet, Mobile mode or in FSE Editor.
 *
 * @param {import('./blocks.js').OtterNodeCSSOptions } options The options.
 * @return {import('./blocks.js').OtterNodeCSSReturn} The name of the node and function handler.
 */
const useCSSNode = (options = {}) => {
  const [cssList, setCSSProps] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)({
    css: [],
    media: []
  });
  const [settings, setSettings] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)({
    node: null,
    cssNodeName: ''
  });

  /**
   *	Set CSS of the node.
   *
   * The `css` and `media` have a 1-1 relationship.
   *
   * @param {string[]} css   A list with CSS code.
   * @param {string[]} media A list CSS media options. One for each CSS item.
   *
   * @example Simple usage.
   *
   * setNodeCSS([
   * 			`.o-review-comparison_buttons span {
   * 				background: ${ attributes.buttonColor } !important;
   * 				color: ${ attributes.buttonText } !important;
   * 			}`
   * ]);
   *
   * @example CSS with Media.
   * setNodeCSS([
   * 			`{
   * 				${ attributes.customTitleFontSize && `--title-text-size: ${ attributes.customTitleFontSize }px;` }
   * 				${ attributes.customDescriptionFontSize && `--description-text-size: ${ attributes.customDescriptionFontSize }px;` }
   * 			}`,
   * 			`{
   * 				${ attributes.customTitleFontSizeTablet && `--title-text-size: ${ attributes.customTitleFontSizeTablet }px;` }
   * 				${ attributes.customDescriptionFontSizeTablet && `--description-text-size: ${ attributes.customDescriptionFontSizeTablet }px;` }
   * 			}`,
   * 			`{
   * 				${ attributes.customTitleFontSizeMobile && `--title-text-size: ${ attributes.customTitleFontSizeMobile }px;` }
   * 				${ attributes.customDescriptionFontSizeMobile && `--description-text-size: ${ attributes.customDescriptionFontSizeMobile }px;` }
   * 			}`
   * 		], [
   * 			'@media ( min-width: 960px )',
   * 			'@media ( min-width: 600px ) and ( max-width: 960px )',
   * 			'@media ( max-width: 600px )'
   * 		]
   * );
   */
  const setNodeCSS = (css = [], media = []) => {
    setCSSProps({
      css,
      media
    });
  };
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    let anchor;

    // Create the CSS node.
    const n = document.createElement('style');
    n.type = 'text/css';
    n.setAttribute('data-generator', 'otter-blocks');
    setTimeout(() => {
      // A small delay for the iFrame to properly initialize.
      anchor = parent.document.querySelector('iframe[name="editor-canvas"]')?.contentWindow.document.head || document.head;
      anchor?.appendChild(n);
    }, 500);
    setSettings({
      node: n,
      cssNodeName: options?.selector ?? `o-node-${(0,uuid__WEBPACK_IMPORTED_MODULE_6__["default"])()}`
    });
    return () => {
      anchor?.removeChild(n);
    };
  }, []);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    if (settings.node && settings.cssNodeName && cssList.media !== undefined) {
      // Create the CSS text by combining the list of CSS items with their media..
      const text = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.zip)(cssList.css, cssList.media).map(x => {
        const [css, media] = x;
        if (media) {
          return `${media} { \n\t .${settings.cssNodeName}${options?.appendToRoot ? '' : ' '}${css} }`;
        }
        return `.${settings.cssNodeName}${options?.appendToRoot ? '' : ' '}${css}`;
      }).join('\n') || '';
      settings.node.textContent = text;
    }
  }, [cssList.css, cssList.media, settings.node, settings.cssNodeName]);
  return [settings.cssNodeName, setNodeCSS, setSettings];
};

/**
 * Get the iframe of the editor. Use in FSE or Mobile/Tablet Preview for Page/Post.
 */
const getEditorIframe = () => document.querySelector('iframe[name^="editor-canvas"]');
const pendingIframeScriptCallbacks = new Map();
const pendingIframeScriptInflight = new Set();

/**
 * Run all queued callbacks for a script copied into the editor iframe.
 *
 * @param {string} assetSelectorId The id selector of the asset.
 */
const flushIframeScriptCallbacks = assetSelectorId => {
  const queue = pendingIframeScriptCallbacks.get(assetSelectorId);
  if (!queue?.length) {
    return;
  }
  pendingIframeScriptCallbacks.delete(assetSelectorId);
  queue.forEach(cb => cb());
};

/**
 * Queue a callback until an iframe script asset has finished loading.
 *
 * @param {string}   assetSelectorId The id selector of the asset.
 * @param {Function} callback        The callback.
 */
const queueIframeScriptCallback = (assetSelectorId, callback) => {
  if (!pendingIframeScriptCallbacks.has(assetSelectorId)) {
    pendingIframeScriptCallbacks.set(assetSelectorId, []);
  }
  pendingIframeScriptCallbacks.get(assetSelectorId).push(callback);
};

/**
 * Whether a copied iframe script node has finished loading.
 *
 * @param {HTMLScriptElement} scriptEl The script element.
 * @return {boolean} True when the script is ready.
 */
const isIframeScriptLoaded = scriptEl => {
  return Boolean(scriptEl.complete || 'complete' === scriptEl.readyState || 'loaded' === scriptEl.readyState);
};

/**
 * Whether a copied iframe script has finished executing in the iframe window.
 *
 * @param {Window}                 iframeWindow    The iframe window.
 * @param {string}                 assetSelectorId The id selector of the asset.
 * @param {HTMLScriptElement|null} scriptEl        The copied script element.
 * @return {boolean} True when the asset is ready to use.
 */
const isIframeScriptReady = (iframeWindow, assetSelectorId, scriptEl) => {
  if ('#leaflet-js' === assetSelectorId) {
    return Boolean(iframeWindow?.L);
  }
  return Boolean(scriptEl && isIframeScriptLoaded(scriptEl));
};

/**
 * Wait until a copied iframe script is ready, then flush queued callbacks.
 *
 * @param {string}                 assetSelectorId The id selector of the asset.
 * @param {Window}                 iframeWindow    The iframe window.
 * @param {HTMLScriptElement|null} scriptEl        The copied script element.
 */
const waitForIframeScriptReady = (assetSelectorId, iframeWindow, scriptEl) => {
  const tryFlush = () => {
    if (isIframeScriptReady(iframeWindow, assetSelectorId, scriptEl)) {
      flushIframeScriptCallbacks(assetSelectorId);
      return true;
    }
    return false;
  };
  if (tryFlush()) {
    return;
  }
  if (scriptEl && !scriptEl.dataset.otterIframeCallbackBound) {
    scriptEl.dataset.otterIframeCallbackBound = 'true';
    scriptEl.addEventListener('load', tryFlush);
  }
  let attempts = 0;
  const poll = () => {
    if (!pendingIframeScriptCallbacks.has(assetSelectorId)) {
      return;
    }
    if (tryFlush() || 300 < attempts++) {
      return;
    }
    requestAnimationFrame(poll);
  };
  requestAnimationFrame(poll);
};

/**
 * Copy the JS node asset from main document to the iframe.
 *
 * WordPress can inject scripts into the canvas iframe natively: anything
 * enqueued on the `enqueue_block_assets` hook is collected by
 * `_wp_get_iframed_editor_assets()` and printed inside the iframe at boot
 * (see the `is_admin()` branch in `inc/class-registration.php`, which already
 * uses this for editor styles). We deliberately do NOT use that for the heavy
 * third-party scripts (Leaflet ~150KB, Lottie player ~280KB, Glide): the
 * iframe assets are resolved once, server-side, on editor load, so the native
 * route would ship them in every editor session even when no such block is
 * used. Copying on demand from the parent document keeps them lazy, at the
 * cost of the load/readiness tracking below. If that trade-off ever flips,
 * delete this machinery and enqueue the scripts on `enqueue_block_assets`.
 *
 * @param {string}   assetSelectorId The id of the asset.
 * @param {Function} callback        The callback.
 */
const copyScriptAssetToIframe = (assetSelectorId, callback) => {
  const iframe = getEditorIframe();
  callback ??= () => {};
  if (!iframe?.contentWindow?.document) {
    return;
  }
  const iframeWindow = iframe.contentWindow;
  const iframeDocument = iframeWindow.document;
  const existing = iframeDocument.querySelector(assetSelectorId);
  if (existing) {
    if (isIframeScriptReady(iframeWindow, assetSelectorId, existing)) {
      callback?.();
    } else {
      queueIframeScriptCallback(assetSelectorId, callback);
      waitForIframeScriptReady(assetSelectorId, iframeWindow, existing);
    }
    return;
  }
  if (pendingIframeScriptInflight.has(assetSelectorId)) {
    queueIframeScriptCallback(assetSelectorId, callback);
    return;
  }
  const original = document.querySelector(assetSelectorId);
  if (!Boolean(original)) {
    console.warn(`Selector: ${assetSelectorId} is invalid.`);
    return;
  }
  pendingIframeScriptInflight.add(assetSelectorId);
  queueIframeScriptCallback(assetSelectorId, callback);
  const script = iframeDocument.createElement('script');
  script.onload = () => {
    pendingIframeScriptInflight.delete(assetSelectorId);
    waitForIframeScriptReady(assetSelectorId, iframeWindow, script);
  };
  script.onerror = () => {
    pendingIframeScriptInflight.delete(assetSelectorId);
    pendingIframeScriptCallbacks.delete(assetSelectorId);
  };
  script.id = original.id;
  script.type = 'text/javascript';
  iframeDocument.head.appendChild(script);
  script.src = original.src;
};

/**
 * Mount the shared Otter icon gradient definition into a document.
 *
 * Block icons in the iframed editor (`apiVersion: 3`) reference
 * `fill: url(#o-icon-fill)` from CSS, so the gradient must live in the same
 * document as the SVG icons.
 *
 * @param {Document} ownerDocument The document that should own the gradient.
 */
const mountIconGradient = ownerDocument => {
  if (!ownerDocument?.body || ownerDocument.querySelector('svg.o-icon-gradient')) {
    return;
  }
  const gradient = ownerDocument.createElement('div');
  gradient.setAttribute('style', 'height: 0; width: 0; overflow: hidden;');
  gradient.setAttribute('aria-hidden', 'true');
  gradient.innerHTML = `
		<svg xmlns="http://www.w3.org/2000/svg" class="o-icon-gradient" height="0" width="0" style="opacity: 0">
			<defs>
				<linearGradient id="o-icon-fill">
					<stop offset="0%" stop-color="#ED6F57" stop-opacity="1"></stop>
					<stop offset="100%" stop-color="#F22B6C" stop-opacity="1"></stop>
				</linearGradient>
			</defs>
		</svg>
	`.trim();
  ownerDocument.body.appendChild(gradient);
};

/**
 * Ensure the Otter icon gradient exists in the editor and canvas iframe.
 */
const mountIconGradientForEditor = () => {
  mountIconGradient(document);
  const iframe = getEditorIframe();
  if (iframe?.contentDocument) {
    mountIconGradient(iframe.contentDocument);
  }
};

/**
 * Keep the icon gradient available when the editor canvas iframe appears.
 */
const watchEditorIframeIconGradient = () => {
  mountIconGradientForEditor();
  const observer = new MutationObserver(() => {
    mountIconGradientForEditor();
  });
  observer.observe(document.body, {
    childList: true,
    subtree: true
  });
  document.addEventListener('load', event => {
    if (event.target?.name?.startsWith?.('editor-canvas')) {
      mountIconGradientForEditor();
    }
  }, true);
};

/**
 * Get the document that owns a block's DOM element.
 *
 * In the iframed editor (`apiVersion: 3`) the block lives inside the editor
 * canvas iframe, so its `ownerDocument` is the iframe document — not the
 * top-level `document`. Reading from the element's `ownerDocument` is the
 * pattern recommended by the WordPress block migration guide and is correct in
 * nested, FSE and Tablet/Mobile preview contexts too. Falls back to the
 * top-level `document` when no element is available yet (e.g. before the ref is
 * attached) or when the editor is not iframed.
 *
 * @param {HTMLElement|{current: ?HTMLElement}|null} [refOrElement] The block element or a ref to it.
 * @return {Document} The document that owns the element.
 */
const getBlockDocument = refOrElement => {
  const element = refOrElement?.current ?? refOrElement;
  return element?.ownerDocument ?? document;
};

/**
 * Get the window that owns a block's DOM element.
 *
 * Companion to {@link getBlockDocument}. Use this to read editor globals (e.g.
 * `themeisleGutenberg`), browser APIs (`location`, `getComputedStyle`) or
 * third-party libraries from within the iframed editor instead of reaching for
 * the top-level `window`.
 *
 * @param {HTMLElement|{current: ?HTMLElement}|null} [refOrElement] The block element or a ref to it.
 * @return {Window} The window that owns the element.
 */
const getBlockWindow = refOrElement => {
  return getBlockDocument(refOrElement).defaultView ?? window;
};

/**
 * Run an effect against a block's DOM element and its owning document/window.
 *
 * Thin wrapper over `useRefEffect` that hands the callback the element plus the
 * `ownerDocument`/`defaultView` it belongs to, so third-party libraries (Glide,
 * Leaflet, Google Maps, …) initialise against the iframed editor's document
 * rather than the top-level one. Return a cleanup function as usual. Spread the
 * returned ref callback onto the target element (it can be merged with other
 * refs via `@wordpress/compose`'s `useMergeRefs`).
 *
 * @param {(element: HTMLElement, ownerDocument: Document, ownerWindow: Window) => (void | (() => void))} callback     The setup callback.
 * @param {Array}                                                                                         dependencies Effect dependencies, forwarded to `useRefEffect`.
 * @return {Function} A ref callback to attach to the target element.
 */
const useBlockElementEffect = (callback, dependencies) => {
  return (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useRefEffect)(element => {
    const ownerDocument = element?.ownerDocument ?? document;
    const ownerWindow = ownerDocument.defaultView ?? window;
    return callback(element, ownerDocument, ownerWindow);
  }, dependencies);
};
const buildGetSyncValue = (name, attributes, defaultAttributes) => {
  return field => {
    if (attributes?.isSynced?.includes(field)) {
      return getDefaultValueByField({
        name,
        field,
        defaultAttributes,
        attributes
      });
    }
    return attributes?.[field];
  };
};

/**
 * Get the reusable block content by id.
 *
 * @param {string} id The id of the reusable block.
 * @return {BlockInstance[]|*[]} The reusable block content.
 */
function pullReusableBlockContentById(id) {
  const reusableBlocks = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core').getEntityRecords('postType', 'wp_block');
  if (!reusableBlocks) {
    return [];
  }
  const reusableBlock = reusableBlocks.find(block => block.id === id);
  if (!reusableBlock || undefined === reusableBlock.content) {
    return [];
  }
  return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.parse)(reusableBlock.content.raw ?? reusableBlock.content);
}

/**
 * Insert a block below the given block.
 *
 * @param {string} clientId The client id of the reference block.
 * @param {any}    block    The block to insert.
 * @see https://github.com/WordPress/gutenberg/blob/e448fa70163ce936eae9aec454ca99f5a6287f15/packages/block-editor/src/store/actions.js#L1604-L1622
 */
function insertBlockBelow(clientId, block) {
  const {
    getBlockRootClientId,
    getTemplateLock,
    getBlockIndex
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/block-editor');
  const {
    insertBlock,
    insertBlocks
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)('core/block-editor');
  const rootClientId = getBlockRootClientId(clientId);
  const isLocked = getTemplateLock(rootClientId);
  if (isLocked) {
    return;
  }
  const index = getBlockIndex(clientId, rootClientId);

  // If the block is an array of blocks, insert them all.
  if (Array.isArray(block)) {
    return insertBlocks(block, index + 1, rootClientId);
  }
  insertBlock(block, index + 1, rootClientId);
}
class GlobalStateMemory {
  constructor() {
    this.states = Object.create(null);
    window.addEventListener('message', this.handleMessage.bind(this));
  }

  /**
   * Handle the message event.
   *
   * @param {MessageEvent} event The message event.
   */
  handleMessage(event) {
    if ('object' === typeof event.data && null !== event.data && 'otterMemoryState' in event.data) {
      const {
        key,
        value,
        location,
        action
      } = event.data.otterMemoryState;
      if ('set' === action) {
        if (this.states[location] === undefined) {
          this.states[location] = Object.create(null);
        }
        this.states[location][key] = value;
      }
      if ('get' === action) {
        (window.parent !== undefined ? window?.parent : window).postMessage?.({
          otterMemoryState: {
            key,
            location,
            value: this.getState(location, key),
            action: 'value'
          }
        });
      }
    }
  }

  /**
   * Get the state value.
   * @param {string} location The location of the state.
   * @param {string} key      The key of the state.
   * @return {undefined|*}
   */
  getState(location, key) {
    if (this.states[location] === undefined) {
      return undefined;
    }
    return this.states[location][key];
  }
}

/**
 * The global state memory.
 *
 * @param {string} key          The key of the state.
 * @param {any}    defaultValue The default value of the state.
 * @return {unknown[]}
 */
function useTabSwitch(key, defaultValue) {
  const location = 'tab';
  const [tab, setTab] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(defaultValue);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    /**
     * Retrieve the initial state from the parent via bi-directional communication.
     * @param event
     */
    const listener = event => {
      if ('object' === typeof event.data && null !== event.data && 'otterMemoryState' in event.data) {
        const {
          key: componentKey,
          value,
          location,
          action
        } = event.data.otterMemoryState;
        if ('tab' === location && key === componentKey && 'value' === action) {
          setTab(value ?? defaultValue);
        }
      }
    };
    window.addEventListener('message', listener);

    // Request the state from the parent.
    (window.parent !== undefined ? window?.parent : window).postMessage({
      otterMemoryState: {
        key,
        location,
        action: 'get'
      }
    });
    return () => {
      window.removeEventListener('message', listener);
    };
  }, []);
  return [tab, value => {
    /**
     * Update the state in the parent.
     */
    (window.parent !== undefined ? window?.parent : window).postMessage?.({
      otterMemoryState: {
        key,
        location,
        value,
        action: 'set'
      }
    });
    setTab(value);
  }];
}

/**
 * Get all registered patterns.
 *
 * @return {Array.<{name: string, title: string, content: string, categories: string[], source: string | undefined, blockTypes: string[]|undefined}>}
 */
function pullPatterns() {
  return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core')?.getBlockPatterns() ?? [];
}

/**
 * Get all registered patterns that are part of the Otter Blocks category.
 *
 * @return {{name: string, title: string, content: string, categories: string[], source: (string|undefined), blockTypes: (string[]|undefined)}[]}
 */
function pullOtterPatterns() {
  return pullPatterns().filter(pattern => pattern?.name?.startsWith('otter-blocks/') || pattern?.name?.startsWith('otter-pro/'));
}

/***/ }),

/***/ "./src/blocks/plugins/options/global-defaults/defaults.js":
/*!****************************************************************!*\
  !*** ./src/blocks/plugins/options/global-defaults/defaults.js ***!
  \****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
const defaultsAttrs = {
  'themeisle-blocks/button-group': {},
  'themeisle-blocks/button': {},
  'themeisle-blocks/font-awesome-icons': {},
  'themeisle-blocks/advanced-columns': {},
  'themeisle-blocks/advanced-column': {},
  'themeisle-blocks/accordion': {},
  'themeisle-blocks/review': {
    features: []
  },
  'themeisle-blocks/form': {},
  'themeisle-blocks/tabs': {},
  'themeisle-blocks/advanced-heading': {}
};
/* harmony default export */ __webpack_exports__["default"] = (defaultsAttrs);

/***/ }),

/***/ "@wordpress/block-editor":
/*!*************************************!*\
  !*** external ["wp","blockEditor"] ***!
  \*************************************/
/***/ (function(module) {

"use strict";
module.exports = window["wp"]["blockEditor"];

/***/ }),

/***/ "@wordpress/blocks":
/*!********************************!*\
  !*** external ["wp","blocks"] ***!
  \********************************/
/***/ (function(module) {

"use strict";
module.exports = window["wp"]["blocks"];

/***/ }),

/***/ "@wordpress/components":
/*!************************************!*\
  !*** external ["wp","components"] ***!
  \************************************/
/***/ (function(module) {

"use strict";
module.exports = window["wp"]["components"];

/***/ }),

/***/ "@wordpress/compose":
/*!*********************************!*\
  !*** external ["wp","compose"] ***!
  \*********************************/
/***/ (function(module) {

"use strict";
module.exports = window["wp"]["compose"];

/***/ }),

/***/ "@wordpress/data":
/*!******************************!*\
  !*** external ["wp","data"] ***!
  \******************************/
/***/ (function(module) {

"use strict";
module.exports = window["wp"]["data"];

/***/ }),

/***/ "@wordpress/element":
/*!*********************************!*\
  !*** external ["wp","element"] ***!
  \*********************************/
/***/ (function(module) {

"use strict";
module.exports = window["wp"]["element"];

/***/ }),

/***/ "@wordpress/hooks":
/*!*******************************!*\
  !*** external ["wp","hooks"] ***!
  \*******************************/
/***/ (function(module) {

"use strict";
module.exports = window["wp"]["hooks"];

/***/ }),

/***/ "@wordpress/i18n":
/*!******************************!*\
  !*** external ["wp","i18n"] ***!
  \******************************/
/***/ (function(module) {

"use strict";
module.exports = window["wp"]["i18n"];

/***/ }),

/***/ "@wordpress/primitives":
/*!************************************!*\
  !*** external ["wp","primitives"] ***!
  \************************************/
/***/ (function(module) {

"use strict";
module.exports = window["wp"]["primitives"];

/***/ }),

/***/ "@wordpress/rich-text":
/*!**********************************!*\
  !*** external ["wp","richText"] ***!
  \**********************************/
/***/ (function(module) {

"use strict";
module.exports = window["wp"]["richText"];

/***/ }),

/***/ "lodash":
/*!*************************!*\
  !*** external "lodash" ***!
  \*************************/
/***/ (function(module) {

"use strict";
module.exports = window["lodash"];

/***/ }),

/***/ "react/jsx-runtime":
/*!**********************************!*\
  !*** external "ReactJSXRuntime" ***!
  \**********************************/
/***/ (function(module) {

"use strict";
module.exports = window["ReactJSXRuntime"];

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	!function() {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/publicPath */
/******/ 	!function() {
/******/ 		var scriptUrl;
/******/ 		if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
/******/ 		var document = __webpack_require__.g.document;
/******/ 		if (!scriptUrl && document) {
/******/ 			if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
/******/ 				scriptUrl = document.currentScript.src;
/******/ 			if (!scriptUrl) {
/******/ 				var scripts = document.getElementsByTagName("script");
/******/ 				if(scripts.length) {
/******/ 					var i = scripts.length - 1;
/******/ 					while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
/******/ 				}
/******/ 			}
/******/ 		}
/******/ 		// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
/******/ 		// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
/******/ 		if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
/******/ 		scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
/******/ 		__webpack_require__.p = scriptUrl;
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
!function() {
"use strict";
/*!********************************!*\
  !*** ./src/animation/index.js ***!
  \********************************/
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./editor.scss */ "./src/animation/editor.scss");
/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./editor.js */ "./src/animation/editor.js");
/* harmony import */ var _count_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./count/index.js */ "./src/animation/count/index.js");
/* harmony import */ var _typing_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./typing/index.js */ "./src/animation/typing/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__);
/**
 * WordPress dependencies.
 */









/**
 * Internal dependencies.
 */





const excludedBlocks = ['themeisle-blocks/popup'];
const BlockAnimation = (el, props) => {
  if ((0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.hasBlockSupport)(props.name, 'customClassName', true) && !excludedBlocks.includes(props.name)) {
    const showAsDefault = Boolean((0,_wordpress_data__WEBPACK_IMPORTED_MODULE_7__.select)('core/preferences')?.get('themeisle/otter-blocks', 'show-animations') ?? true);
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
      children: [el, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToolsPanelItem, {
        hasValue: () => Boolean(props?.attributes?.className?.includes('animated')),
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Animations', "otter-blocks"),
        onDeselect: () => window?.blocksAnimation?.removeAnimation(),
        isShownByDefault: showAsDefault,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_editor_js__WEBPACK_IMPORTED_MODULE_9__["default"], {
          ...props
        })
      })]
    });
  }
  return el;
};
const withInspectorControls = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__.createHigherOrderComponent)(BlockEdit => {
  return props => {
    const hasCustomClassName = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.hasBlockSupport)(props.name, 'customClassName', true);
    if (hasCustomClassName && props.isSelected && !excludedBlocks.includes(props.name)) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(BlockEdit, {
          ...props
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, {
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_editor_js__WEBPACK_IMPORTED_MODULE_9__["default"], {
            ...props
          })
        })]
      });
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(BlockEdit, {
      ...props
    });
  };
}, 'withInspectorControl');
if (Boolean(window?.blocksAnimation?.hasOtter)) {
  (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__.addFilter)('otter.blockTools', 'themeisle-animations/with-inspector-controls', BlockAnimation, 1);
} else {
  (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__.addFilter)('editor.BlockEdit', 'themeisle-animations/with-inspector-controls', withInspectorControls);
}
}();
/******/ })()
;
//# sourceMappingURL=index.js.map