/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

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

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ chevron_left_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/chevron-left.tsx


var chevron_left_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: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });

//# sourceMappingURL=chevron-left.mjs.map


/***/ }),

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

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ chevron_right_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/chevron-right.tsx


var chevron_right_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: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });

//# sourceMappingURL=chevron-right.mjs.map


/***/ }),

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

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ close_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/close.tsx


var close_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: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) });

//# sourceMappingURL=close.mjs.map


/***/ }),

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

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ code_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/code.tsx


var code_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: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" }) });

//# sourceMappingURL=code.mjs.map


/***/ }),

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

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ copy_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/copy.tsx


var copy_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, { fillRule: "evenodd", clipRule: "evenodd", d: "M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z" }) });

//# sourceMappingURL=copy.mjs.map


/***/ }),

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

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ undo_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/undo.tsx


var undo_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: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z" }) });

//# sourceMappingURL=undo.mjs.map


/***/ }),

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

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* binding */ upload_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/upload.tsx


var upload_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: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) });

//# sourceMappingURL=upload.mjs.map


/***/ }),

/***/ "./src/atomic-wind/animations/index.js":
/*!*********************************************!*\
  !*** ./src/atomic-wind/animations/index.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AnimationControls: function() { return /* binding */ AnimationControls; }
/* harmony export */ });
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__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_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);




const ANIMATION_OPTIONS = [{
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('None', 'otter-blocks'),
  value: ''
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Fade In', 'otter-blocks'),
  value: 'fade-in'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Slide Up', 'otter-blocks'),
  value: 'slide-up'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Slide Down', 'otter-blocks'),
  value: 'slide-down'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Slide Left', 'otter-blocks'),
  value: 'slide-left'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Slide Right', 'otter-blocks'),
  value: 'slide-right'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Zoom In', 'otter-blocks'),
  value: 'zoom-in'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Count Up', 'otter-blocks'),
  value: 'count-up'
}];
const DELAY_OPTIONS = [{
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('0ms', 'otter-blocks'),
  value: '0'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('100ms', 'otter-blocks'),
  value: '100'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('200ms', 'otter-blocks'),
  value: '200'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('300ms', 'otter-blocks'),
  value: '300'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('400ms', 'otter-blocks'),
  value: '400'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('500ms', 'otter-blocks'),
  value: '500'
}];
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__.addFilter)('blocks.registerBlockType', 'atomic-wind/animation-attributes', settings => {
  if (settings.category !== 'atomic-wind') {
    return settings;
  }
  return {
    ...settings,
    attributes: {
      ...settings.attributes,
      animation: {
        type: 'string',
        default: ''
      },
      animationDelay: {
        type: 'string',
        default: ''
      }
    }
  };
});
function AnimationControls({
  attributes,
  setAttributes
}) {
  const {
    animation,
    animationDelay
  } = attributes;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    className: "aw-ce-tab-content",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Animation Type', 'otter-blocks'),
      value: animation || '',
      options: ANIMATION_OPTIONS,
      onChange: value => setAttributes({
        animation: value,
        animationDelay: value ? animationDelay : ''
      }),
      help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Animation is visible on the frontend only.', 'otter-blocks')
    }), animation && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Delay', 'otter-blocks'),
      value: animationDelay || '0',
      options: DELAY_OPTIONS,
      onChange: value => setAttributes({
        animationDelay: value
      })
    })]
  });
}
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__.addFilter)('blocks.getSaveContent.extraProps', 'atomic-wind/animation-save-props', (extraProps, blockType, attributes) => {
  if (blockType.category !== 'atomic-wind') {
    return extraProps;
  }
  if (attributes.animation) {
    extraProps['data-animation'] = attributes.animation;
    if (attributes.animationDelay && attributes.animationDelay !== '0') {
      extraProps['data-animation-delay'] = attributes.animationDelay;
    }
  }
  return extraProps;
});

/***/ }),

/***/ "./src/atomic-wind/blocks/icon.js":
/*!****************************************!*\
  !*** ./src/atomic-wind/blocks/icon.js ***!
  \****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);


/* harmony default export */ __webpack_exports__["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, {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M20.3541 3.64593C18.5085 1.8004 13.2722 4.04455 8.65837 8.65837C4.04455 13.2722 1.8004 18.5085 3.64593 20.3541C5.49146 22.1996 10.7278 19.9555 15.3416 15.3416C19.9555 10.7278 22.1996 5.49146 20.3541 3.64593Z",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: "1.5",
    strokeLinecap: "round",
    strokeLinejoin: "round"
  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M3.64593 3.64593C1.8004 5.49146 4.04455 10.7278 8.65837 15.3416C13.2722 19.9555 18.5085 22.1996 20.3541 20.3541C22.1996 18.5085 19.9555 13.2722 15.3416 8.65837C10.7278 4.04455 5.49146 1.8004 3.64593 3.64593Z",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: "1.5",
    strokeLinecap: "round",
    strokeLinejoin: "round"
  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, {
    d: "M12.009 12H12",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: "1.5",
    strokeLinecap: "round",
    strokeLinejoin: "round"
  })]
}));

/***/ }),

/***/ "./src/atomic-wind/blocks/labels.js":
/*!******************************************!*\
  !*** ./src/atomic-wind/blocks/labels.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   boxLabel: function() { return /* binding */ boxLabel; },
/* harmony export */   getStructuralLabel: function() { return /* binding */ getStructuralLabel; },
/* harmony export */   iconLabel: function() { return /* binding */ iconLabel; },
/* harmony export */   imageLabel: function() { return /* binding */ imageLabel; },
/* harmony export */   linkLabel: function() { return /* binding */ linkLabel; },
/* harmony export */   textLabel: function() { return /* binding */ textLabel; },
/* harmony export */   toPlainText: function() { return /* binding */ toPlainText; }
/* 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__);

const LABEL_CONTEXTS = ['list-view', 'breadcrumb'];

// Resolved lazily so locale data registered after module init still applies.
// div and span intentionally have no label so generic wrappers fall through
// to the block title and block variation matching.
const getTagLabel = tagName => {
  switch (tagName) {
    case 'section':
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Section', 'otter-blocks');
    case 'article':
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Article', 'otter-blocks');
    case 'main':
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Main', 'otter-blocks');
    case 'aside':
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Aside', 'otter-blocks');
    case 'header':
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Header', 'otter-blocks');
    case 'footer':
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Footer', 'otter-blocks');
    case 'nav':
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Navigation', 'otter-blocks');
    case 'details':
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Details', 'otter-blocks');
    case 'summary':
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Summary', 'otter-blocks');
    default:
      return undefined;
  }
};
const toPlainText = value => {
  if (!value) {
    return '';
  }
  const text = typeof value === 'string' ? value.replace(/<[^>]+>/g, ' ') : value.toPlainText?.() ?? '';
  return text.replace(/\s+/g, ' ').trim();
};

// Builds an __experimentalLabel callback. The custom name written by the core
// Rename UI (attributes.metadata.name) must win, because defining our own
// label callback prevents core from displaying it; returning undefined when
// there is no better label keeps the block title and variation titles working.
// Content fallbacks return the raw attribute value (string or RichTextData)
// so core converts and decodes it exactly once.
const createLabel = getFallback => (attributes, {
  context
} = {}) => {
  if (!LABEL_CONTEXTS.includes(context)) {
    return undefined;
  }
  const customName = attributes?.metadata?.name;
  if (customName) {
    return customName;
  }
  return getFallback ? getFallback(attributes) : undefined;
};
const boxLabel = createLabel(({
  tagName
}) => getTagLabel(tagName));
const textLabel = createLabel(({
  content
}) => toPlainText(content) ? content : undefined);
const linkLabel = createLabel(({
  mode,
  text
}) => {
  if (mode === 'inner-blocks') {
    return undefined;
  }
  return toPlainText(text) ? text : undefined;
});
const imageLabel = createLabel(({
  alt
}) => toPlainText(alt) || undefined);
const iconLabel = createLabel();
const getStructuralLabel = (blockName, attributes) => {
  if (attributes?.metadata?.name) {
    return attributes.metadata.name;
  }
  return blockName === 'atomic-wind/box' ? getTagLabel(attributes?.tagName) : undefined;
};

/***/ }),

/***/ "./src/atomic-wind/class-editor/index.js":
/*!***********************************************!*\
  !*** ./src/atomic-wind/class-editor/index.js ***!
  \***********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/code.mjs");
/* 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 _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_block_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./panel */ "./src/atomic-wind/class-editor/panel.js");
/* harmony import */ var _blocks_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../blocks/icon */ "./src/atomic-wind/blocks/icon.js");
/* harmony import */ var _states__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../states */ "./src/atomic-wind/states/index.js");
/* harmony import */ var _animations__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../animations */ "./src/atomic-wind/animations/index.js");
/* harmony import */ var _style_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./style.css */ "./src/atomic-wind/class-editor/style.css");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__);















// Shared open state — simple pub/sub so both the plugin and the filter can toggle.

let _isOpen = false;
const _listeners = new Set();
function setOpen(val) {
  _isOpen = val;
  _listeners.forEach(fn => fn(val));
}
function useClassEditorOpen() {
  const [isOpen, setIsOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useState)(_isOpen);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useEffect)(() => {
    const handler = v => setIsOpen(v);
    _listeners.add(handler);
    return () => _listeners.delete(handler);
  }, []);
  return [isOpen, setOpen];
}

// Plugin — Options menu item + floating panel
const ClassEditorPlugin = () => {
  const [isOpen, toggle] = useClassEditorOpen();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_wordpress_editor__WEBPACK_IMPORTED_MODULE_1__.PluginMoreMenuItem, {
      icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_14__["default"],
      onClick: () => toggle(!isOpen),
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Atomic Wind', 'otter-blocks')
    }), isOpen && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_panel__WEBPACK_IMPORTED_MODULE_8__["default"], {
      onClose: () => toggle(false)
    })]
  });
};
(0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__.registerPlugin)('atomic-wind-class-editor', {
  render: ClassEditorPlugin
});

// Filter — toggle button at the top of InspectorControls for all atomic-wind blocks
const withClassEditorToggle = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__.createHigherOrderComponent)(BlockEdit => {
  return props => {
    if (!props.name.startsWith('atomic-wind/')) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(BlockEdit, {
        ...props
      });
    }
    const [isOpen, toggle] = useClassEditorOpen();
    const {
      attributes,
      setAttributes
    } = props;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__.InspectorControls, {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div", {
          className: "aw-ce-inspector-toggle",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.Button, {
            icon: _blocks_icon__WEBPACK_IMPORTED_MODULE_9__["default"],
            onClick: () => toggle(!isOpen),
            className: `aw-ce-inspector-btn${isOpen ? ' is-active' : ''}`,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Atomic Wind', 'otter-blocks')
          })
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(BlockEdit, {
        ...props
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__.InspectorControls, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelBody, {
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('State & Visibility', 'otter-blocks'),
          initialOpen: false,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_states__WEBPACK_IMPORTED_MODULE_10__.StateControls, {
            attributes: attributes,
            setAttributes: setAttributes
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelBody, {
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Animation', 'otter-blocks'),
          initialOpen: false,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_animations__WEBPACK_IMPORTED_MODULE_11__.AnimationControls, {
            attributes: attributes,
            setAttributes: setAttributes
          })
        })]
      })]
    });
  };
}, 'withClassEditorToggle');
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__.addFilter)('editor.BlockEdit', 'atomic-wind/class-editor-toggle', withClassEditorToggle, -100);

/***/ }),

/***/ "./src/atomic-wind/class-editor/panel.js":
/*!***********************************************!*\
  !*** ./src/atomic-wind/class-editor/panel.js ***!
  \***********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__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_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 _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_icons__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/close.mjs");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/chevron-left.mjs");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/chevron-right.mjs");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/copy.mjs");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/upload.mjs");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/undo.mjs");
/* 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_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _blocks_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../blocks/icon */ "./src/atomic-wind/blocks/icon.js");
/* harmony import */ var _blocks_labels__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../blocks/labels */ "./src/atomic-wind/blocks/labels.js");
/* harmony import */ var _states__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../states */ "./src/atomic-wind/states/index.js");
/* harmony import */ var _animations__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../animations */ "./src/atomic-wind/animations/index.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__);












const _decodeEl = document.createElement('textarea');
function decodeEntities(html) {
  _decodeEl.innerHTML = html;
  return _decodeEl.value;
}

// RichTextData.toPlainText() output is already decoded; only raw strings
// still carry entities.
function previewText(value) {
  const plain = (0,_blocks_labels__WEBPACK_IMPORTED_MODULE_7__.toPlainText)(value);
  const text = typeof value === 'string' ? decodeEntities(plain) : plain;
  return text.length > 30 ? text.slice(0, 30) + '…' : text;
}
function getTextPreview(block) {
  if (block.name === 'atomic-wind/text') {
    return previewText(block.attributes?.content);
  }
  if (block.name === 'atomic-wind/link' && block.attributes?.mode !== 'inner-blocks') {
    return previewText(block.attributes?.text);
  }
  return '';
}
const TABS = [{
  id: 'classname',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Classname', 'otter-blocks')
}, {
  id: 'state',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('State', 'otter-blocks')
}, {
  id: 'animation',
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Animation', 'otter-blocks')
}];
const TreeNode = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.memo)(({
  block,
  depth,
  selectedId,
  onSelect,
  collapsed,
  onToggle
}) => {
  const title = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    const type = select(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.store).getBlockType(block.name);
    return (0,_blocks_labels__WEBPACK_IMPORTED_MODULE_7__.getStructuralLabel)(block.name, block.attributes) || (type ? type.title : block.name);
  }, [block.name, block.attributes]);
  const hasChildren = block.innerBlocks && block.innerBlocks.length > 0;
  const isCollapsed = collapsed[block.clientId];
  const isSelected = selectedId === block.clientId;
  const preview = getTextPreview(block);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("button", {
      type: "button",
      className: `aw-ce-tree-node${isSelected ? ' is-selected' : ''}`,
      style: {
        paddingLeft: depth * 16 + 8
      },
      onClick: () => onSelect(block.clientId),
      "data-block-id": block.clientId,
      children: [hasChildren ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
        className: "aw-ce-tree-toggle",
        onClick: e => {
          e.stopPropagation();
          onToggle(block.clientId);
        },
        role: "button",
        tabIndex: -1,
        children: isCollapsed ? '▶' : '▼'
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
        className: "aw-ce-tree-toggle-spacer"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
        className: "aw-ce-tree-title",
        children: title
      }), preview && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
        className: "aw-ce-tree-preview",
        children: preview
      })]
    }), hasChildren && !isCollapsed && block.innerBlocks.map(child => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(TreeNode, {
      block: child,
      depth: depth + 1,
      selectedId: selectedId,
      onSelect: onSelect,
      collapsed: collapsed,
      onToggle: onToggle
    }, child.clientId))]
  });
});
const MIN_PANEL_W = 400;
const MIN_PANEL_H = 240;
const MIN_TREE_W = 120;
const MAX_TREE_W = 500;
const Panel = ({
  onClose
}) => {
  const posRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)({
    left: Math.round(window.innerWidth / 2 - 340),
    top: 80
  });
  const sizeRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)({
    width: 680,
    height: 440
  });
  const treeWidthRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)(220);
  const panelRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)(null);
  const dragRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)(null);
  const treeRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)(null);
  const treeResizeRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)(null);
  const [, forceRender] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(0);
  const [collapsed, setCollapsed] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)({});
  const [treeVisible, setTreeVisible] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(true);
  const [clipboard, setClipboard] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)('');
  const [copied, setCopied] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
  const [prePaste, setPrePaste] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(null); // { clientId, className } before paste
  const [activeTab, setActiveTab] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)('classname');
  const blocks = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store).getBlocks(), []);
  const selectedId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store).getSelectedBlockClientId(), []);
  const selectedClassName = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (!selectedId) {
      return '';
    }
    const attrs = select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store).getBlockAttributes(selectedId);
    return attrs?.className || '';
  }, [selectedId]);
  const {
    selectedTitle,
    selectedPreview,
    selectedAttributes
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (!selectedId) {
      return {
        selectedTitle: '',
        selectedPreview: '',
        selectedAttributes: {}
      };
    }
    const block = select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store).getBlock(selectedId);
    if (!block) {
      return {
        selectedTitle: '',
        selectedPreview: '',
        selectedAttributes: {}
      };
    }
    const type = select(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.store).getBlockType(block.name);
    return {
      selectedTitle: (0,_blocks_labels__WEBPACK_IMPORTED_MODULE_7__.getStructuralLabel)(block.name, block.attributes) || (type ? type.title : block.name),
      selectedPreview: getTextPreview(block),
      selectedAttributes: block.attributes || {}
    };
  }, [selectedId]);
  const {
    selectBlock,
    updateBlockAttributes
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store);
  const handleToggle = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(clientId => {
    setCollapsed(prev => ({
      ...prev,
      [clientId]: !prev[clientId]
    }));
  }, []);
  const handleSelect = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(clientId => {
    selectBlock(clientId);
  }, [selectBlock]);
  const handleClassChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(e => {
    if (!selectedId) {
      return;
    }
    const value = e.target.value.replace(/\n/g, ' ');
    updateBlockAttributes(selectedId, {
      className: value
    });
  }, [selectedId, updateBlockAttributes]);
  const handleKeyDown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(e => {
    if (e.key === 'Enter') {
      e.preventDefault();
    }
  }, []);
  const handleCopy = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(() => {
    if (!selectedClassName) {
      return;
    }
    setClipboard(selectedClassName);
    navigator.clipboard?.writeText(selectedClassName);
    setCopied(true);
    setTimeout(() => setCopied(false), 1500);
  }, [selectedClassName]);
  const handlePaste = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(() => {
    if (!selectedId || !clipboard) {
      return;
    }
    setPrePaste({
      clientId: selectedId,
      className: selectedClassName
    });
    updateBlockAttributes(selectedId, {
      className: clipboard
    });
  }, [selectedId, clipboard, selectedClassName, updateBlockAttributes]);
  const handleUndoPaste = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(() => {
    if (!prePaste) {
      return;
    }
    updateBlockAttributes(prePaste.clientId, {
      className: prePaste.className
    });
    setPrePaste(null);
  }, [prePaste, updateBlockAttributes]);
  const handleSetAttributes = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(attrs => {
    if (!selectedId) {
      return;
    }
    updateBlockAttributes(selectedId, attrs);
  }, [selectedId, updateBlockAttributes]);

  // Clear undo when selection changes
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    setPrePaste(null);
  }, [selectedId]);

  // Scroll tree to selected block
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    if (!selectedId || !treeRef.current || !treeVisible) {
      return;
    }
    const node = treeRef.current.querySelector(`[data-block-id="${selectedId}"]`);
    if (node) {
      node.scrollIntoView({
        block: 'nearest',
        behavior: 'smooth'
      });
    }
  }, [selectedId, treeVisible]);

  // Panel dragging
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    const el = dragRef.current;
    if (!el) {
      return;
    }
    let dragging = false;
    let offsetX = 0;
    let offsetY = 0;
    const onMouseMove = e => {
      if (!dragging) {
        return;
      }
      e.preventDefault();
      const panel = panelRef.current;
      if (!panel) {
        return;
      }
      const rect = panel.getBoundingClientRect();
      let newLeft = e.clientX - offsetX;
      let newTop = e.clientY - offsetY;
      newLeft = Math.max(0, Math.min(newLeft, window.innerWidth - rect.width));
      newTop = Math.max(0, Math.min(newTop, window.innerHeight - rect.height));
      posRef.current = {
        left: newLeft,
        top: newTop
      };
      panel.style.left = newLeft + 'px';
      panel.style.top = newTop + 'px';
    };
    const onMouseUp = () => {
      dragging = false;
      document.removeEventListener('mousemove', onMouseMove);
      document.removeEventListener('mouseup', onMouseUp);
    };
    const onMouseDown = e => {
      if (e.target.closest('button')) {
        return;
      }
      dragging = true;
      offsetX = e.clientX - posRef.current.left;
      offsetY = e.clientY - posRef.current.top;
      document.addEventListener('mousemove', onMouseMove);
      document.addEventListener('mouseup', onMouseUp);
    };
    el.addEventListener('mousedown', onMouseDown);
    return () => {
      el.removeEventListener('mousedown', onMouseDown);
      document.removeEventListener('mousemove', onMouseMove);
      document.removeEventListener('mouseup', onMouseUp);
    };
  }, []);

  // Panel resize (bottom-right corner)
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    const panel = panelRef.current;
    if (!panel) {
      return;
    }
    let resizing = false;
    let startX, startY, startW, startH;
    const onMouseMove = e => {
      if (!resizing) {
        return;
      }
      e.preventDefault();
      const newW = Math.max(MIN_PANEL_W, startW + (e.clientX - startX));
      const newH = Math.max(MIN_PANEL_H, startH + (e.clientY - startY));
      sizeRef.current = {
        width: newW,
        height: newH
      };
      panel.style.width = newW + 'px';
      panel.style.height = newH + 'px';
    };
    const onMouseUp = () => {
      resizing = false;
      document.body.style.cursor = '';
      document.body.style.userSelect = '';
      document.removeEventListener('mousemove', onMouseMove);
      document.removeEventListener('mouseup', onMouseUp);
    };
    const onMouseDown = e => {
      const rect = panel.getBoundingClientRect();
      const inCorner = e.clientX >= rect.right - 18 && e.clientY >= rect.bottom - 18;
      if (!inCorner) {
        return;
      }
      e.preventDefault();
      resizing = true;
      startX = e.clientX;
      startY = e.clientY;
      startW = rect.width;
      startH = rect.height;
      document.body.style.cursor = 'nwse-resize';
      document.body.style.userSelect = 'none';
      document.addEventListener('mousemove', onMouseMove);
      document.addEventListener('mouseup', onMouseUp);
    };
    panel.addEventListener('mousedown', onMouseDown);
    return () => {
      panel.removeEventListener('mousedown', onMouseDown);
      document.removeEventListener('mousemove', onMouseMove);
      document.removeEventListener('mouseup', onMouseUp);
    };
  }, []);

  // Tree sidebar resize — re-bind when tree is toggled (new DOM element)
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    const handle = treeResizeRef.current;
    if (!handle) {
      return;
    }
    let resizing = false;
    let startX, startW;
    const onMouseMove = e => {
      if (!resizing) {
        return;
      }
      e.preventDefault();
      const tree = treeRef.current;
      if (!tree) {
        return;
      }
      const newW = Math.max(MIN_TREE_W, Math.min(MAX_TREE_W, startW + (e.clientX - startX)));
      treeWidthRef.current = newW;
      tree.style.width = newW + 'px';
    };
    const onMouseUp = () => {
      resizing = false;
      document.body.style.cursor = '';
      document.body.style.userSelect = '';
      document.removeEventListener('mousemove', onMouseMove);
      document.removeEventListener('mouseup', onMouseUp);
    };
    const onMouseDown = e => {
      e.preventDefault();
      resizing = true;
      startX = e.clientX;
      startW = treeWidthRef.current;
      document.body.style.cursor = 'col-resize';
      document.body.style.userSelect = 'none';
      document.addEventListener('mousemove', onMouseMove);
      document.addEventListener('mouseup', onMouseUp);
    };
    handle.addEventListener('mousedown', onMouseDown);
    return () => {
      handle.removeEventListener('mousedown', onMouseDown);
      document.removeEventListener('mousemove', onMouseMove);
      document.removeEventListener('mouseup', onMouseUp);
    };
  }, [treeVisible]);
  const renderTabContent = () => {
    if (!selectedId) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", {
        className: "aw-ce-classname-placeholder",
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Select a block to edit.', 'otter-blocks')
      });
    }
    switch (activeTab) {
      case 'state':
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_states__WEBPACK_IMPORTED_MODULE_8__.StateControls, {
          attributes: selectedAttributes,
          setAttributes: handleSetAttributes
        });
      case 'animation':
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_animations__WEBPACK_IMPORTED_MODULE_9__.AnimationControls, {
          attributes: selectedAttributes,
          setAttributes: handleSetAttributes
        });
      case 'classname':
      default:
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("textarea", {
          className: "aw-ce-classname-input",
          value: selectedClassName,
          onChange: handleClassChange,
          onKeyDown: handleKeyDown,
          placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Add Tailwind classes…', 'otter-blocks')
        });
    }
  };
  const panel = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
    className: "aw-ce-panel",
    style: {
      left: posRef.current.left,
      top: posRef.current.top,
      width: sizeRef.current.width,
      height: sizeRef.current.height
    },
    ref: panelRef,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
      className: "aw-ce-header",
      ref: dragRef,
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
        className: "aw-ce-header-left",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
          className: "aw-ce-header-icon",
          children: _blocks_icon__WEBPACK_IMPORTED_MODULE_6__["default"]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
          className: "aw-ce-header-title",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Atomic Wind', 'otter-blocks')
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
        icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_11__["default"],
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Close', 'otter-blocks'),
        onClick: onClose,
        size: "compact",
        className: "aw-ce-header-close"
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
      className: "aw-ce-body",
      children: [treeVisible && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
          className: "aw-ce-tree",
          ref: treeRef,
          style: {
            width: treeWidthRef.current
          },
          children: blocks.map(block => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(TreeNode, {
            block: block,
            depth: 0,
            selectedId: selectedId,
            onSelect: handleSelect,
            collapsed: collapsed,
            onToggle: handleToggle
          }, block.clientId))
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
          className: "aw-ce-tree-resize",
          ref: treeResizeRef
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
        className: "aw-ce-classname",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
          className: "aw-ce-classname-header",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
            icon: treeVisible ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_12__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_13__["default"],
            label: treeVisible ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Hide tree', 'otter-blocks') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Show tree', 'otter-blocks'),
            onClick: () => setTreeVisible(!treeVisible),
            size: "compact",
            className: "aw-ce-sm-btn"
          }), selectedId && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("span", {
            className: "aw-ce-classname-label",
            children: [selectedTitle, selectedPreview && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
              className: "aw-ce-classname-label-preview",
              children: ' — ' + selectedPreview
            })]
          }), selectedId && activeTab === 'classname' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
            className: "aw-ce-classname-actions",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
              icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_14__["default"],
              label: copied ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Copied!', 'otter-blocks') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Copy classes', 'otter-blocks'),
              onClick: handleCopy,
              size: "compact",
              className: `aw-ce-sm-btn${copied ? ' is-copied' : ''}`,
              disabled: !selectedClassName
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
              icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_15__["default"],
              label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Paste classes', 'otter-blocks'),
              onClick: handlePaste,
              size: "compact",
              className: "aw-ce-sm-btn",
              disabled: !clipboard
            }), prePaste && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
              icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_16__["default"],
              label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Undo paste', 'otter-blocks'),
              onClick: handleUndoPaste,
              size: "compact",
              className: "aw-ce-sm-btn is-undo"
            })]
          })]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
          className: "aw-ce-tabs",
          children: TABS.map(tab => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("button", {
            type: "button",
            className: `aw-ce-tab${activeTab === tab.id ? ' is-active' : ''}`,
            onClick: () => setActiveTab(tab.id),
            children: tab.label
          }, tab.id))
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
          className: "aw-ce-classname-body",
          children: renderTabContent()
        })]
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
      className: "aw-ce-resize-handle"
    })]
  });
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.createPortal)(panel, document.body);
};
/* harmony default export */ __webpack_exports__["default"] = (Panel);

/***/ }),

/***/ "./src/atomic-wind/class-editor/style.css":
/*!************************************************!*\
  !*** ./src/atomic-wind/class-editor/style.css ***!
  \************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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


/***/ }),

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

__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _animations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./animations */ "./src/atomic-wind/animations/index.js");
/* harmony import */ var _states__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./states */ "./src/atomic-wind/states/index.js");
/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./query */ "./src/atomic-wind/query/index.js");
/* harmony import */ var _class_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./class-editor */ "./src/atomic-wind/class-editor/index.js");
/* harmony import */ var _wrap_in__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./wrap-in */ "./src/atomic-wind/wrap-in/index.js");






/***/ }),

/***/ "./src/atomic-wind/query/index.js":
/*!****************************************!*\
  !*** ./src/atomic-wind/query/index.js ***!
  \****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__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_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__);
/* 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__);







const POST_FIELD_OPTIONS = {
  'atomic-wind/text': [{
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('None', 'otter-blocks'),
    value: ''
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Title', 'otter-blocks'),
    value: 'title'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Excerpt', 'otter-blocks'),
    value: 'excerpt'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Date', 'otter-blocks'),
    value: 'date'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Author', 'otter-blocks'),
    value: 'author'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Categories', 'otter-blocks'),
    value: 'categories'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Tags', 'otter-blocks'),
    value: 'tags'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Modified Date', 'otter-blocks'),
    value: 'modified_date'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Comment Count', 'otter-blocks'),
    value: 'comment_count'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Reading Time', 'otter-blocks'),
    value: 'reading_time'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Custom Field', 'otter-blocks'),
    value: 'custom_field'
  }],
  'atomic-wind/link': [{
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('None', 'otter-blocks'),
    value: ''
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Permalink', 'otter-blocks'),
    value: 'permalink'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Author Posts URL', 'otter-blocks'),
    value: 'author_posts_url'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Category Link', 'otter-blocks'),
    value: 'category_link'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Tag Link', 'otter-blocks'),
    value: 'tag_link'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Date Archive', 'otter-blocks'),
    value: 'date_archive'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Author Archive', 'otter-blocks'),
    value: 'author_archive'
  }],
  'atomic-wind/image': [{
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('None', 'otter-blocks'),
    value: ''
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Featured Image', 'otter-blocks'),
    value: 'featured_image'
  }, {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Author Avatar', 'otter-blocks'),
    value: 'author_avatar'
  }]
};
const ORDER_BY_OPTIONS = [{
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Date', 'otter-blocks'),
  value: 'date'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Title', 'otter-blocks'),
  value: 'title'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Modified', 'otter-blocks'),
  value: 'modified'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Random', 'otter-blocks'),
  value: 'rand'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Menu Order', 'otter-blocks'),
  value: 'menu_order'
}];
const ORDER_OPTIONS = [{
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('DESC', 'otter-blocks'),
  value: 'DESC'
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('ASC', 'otter-blocks'),
  value: 'ASC'
}];
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__.addFilter)('blocks.registerBlockType', 'atomic-wind/query-attributes', settings => {
  if (settings.category !== 'atomic-wind') {
    return settings;
  }
  const extraAttributes = {
    postField: {
      type: 'string',
      default: ''
    },
    excerptLength: {
      type: 'number',
      default: 25
    },
    customFieldKey: {
      type: 'string',
      default: ''
    }
  };
  if (settings.name === 'atomic-wind/box') {
    extraAttributes.queryPostType = {
      type: 'string',
      default: ''
    };
    extraAttributes.queryCount = {
      type: 'number',
      default: 3
    };
    extraAttributes.queryOrderBy = {
      type: 'string',
      default: 'date'
    };
    extraAttributes.queryOrder = {
      type: 'string',
      default: 'DESC'
    };
    extraAttributes.queryTaxonomy = {
      type: 'string',
      default: ''
    };
    extraAttributes.queryExcludeCurrent = {
      type: 'boolean',
      default: false
    };
    extraAttributes.querySticky = {
      type: 'string',
      default: ''
    };
  }
  return {
    ...settings,
    attributes: {
      ...settings.attributes,
      ...extraAttributes
    }
  };
});
const withQueryControls = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__.createHigherOrderComponent)(BlockEdit => {
  return props => {
    if (!props.name.startsWith('atomic-wind/')) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(BlockEdit, {
        ...props
      });
    }
    const {
      attributes,
      setAttributes
    } = props;
    const isBox = props.name === 'atomic-wind/box';
    const hasPostFieldOptions = POST_FIELD_OPTIONS.hasOwnProperty(props.name);
    const postTypes = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => {
      if (!isBox) {
        return [];
      }
      const types = select('core').getPostTypes({
        per_page: -1
      });
      if (!types) {
        return [];
      }
      return types.filter(type => type.viewable).map(type => ({
        label: type.labels.singular_name,
        value: type.slug
      }));
    }, [isBox]);
    const [taxSlug, termSlug] = (attributes.queryTaxonomy || '').split(':');
    const taxonomies = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => {
      if (!isBox || !attributes.queryPostType) {
        return [];
      }
      const allTaxonomies = select('core').getTaxonomies({
        per_page: -1
      });
      if (!allTaxonomies) {
        return [];
      }
      return allTaxonomies.filter(tax => tax.visibility?.public_queryable !== false && tax.visibility?.show_ui !== false);
    }, [isBox, attributes.queryPostType]);
    const terms = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => {
      if (!isBox || !taxSlug) {
        return [];
      }
      const records = select('core').getEntityRecords('taxonomy', taxSlug, {
        per_page: -1
      });
      return records || [];
    }, [isBox, taxSlug]);
    const isInsideQuery = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => {
      if (!hasPostFieldOptions) {
        return false;
      }
      const {
        getBlockParents,
        getBlock
      } = select('core/block-editor');
      const parents = getBlockParents(props.clientId);
      return parents.some(parentId => {
        const parent = getBlock(parentId);
        return parent?.name === 'atomic-wind/box' && !!parent?.attributes?.queryPostType;
      });
    }, [props.clientId, hasPostFieldOptions]);
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(BlockEdit, {
        ...props
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, {
        children: [isBox && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Query', 'otter-blocks'),
          initialOpen: false,
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Post Type', 'otter-blocks'),
            value: attributes.queryPostType || '',
            options: [{
              label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('None', 'otter-blocks'),
              value: ''
            }, ...postTypes],
            onChange: value => setAttributes({
              queryPostType: value
            })
          }), attributes.queryPostType && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.RangeControl, {
              label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Posts Per Page', 'otter-blocks'),
              value: attributes.queryCount || 3,
              onChange: value => setAttributes({
                queryCount: value
              }),
              min: 1,
              max: 50
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
              label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Order By', 'otter-blocks'),
              value: attributes.queryOrderBy || 'date',
              options: ORDER_BY_OPTIONS,
              onChange: value => setAttributes({
                queryOrderBy: value
              })
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
              label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Order', 'otter-blocks'),
              value: attributes.queryOrder || 'DESC',
              options: ORDER_OPTIONS,
              onChange: value => setAttributes({
                queryOrder: value
              })
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
              label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Taxonomy', 'otter-blocks'),
              value: taxSlug || '',
              options: [{
                label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('None', 'otter-blocks'),
                value: ''
              }, ...taxonomies.map(tax => ({
                label: tax.name,
                value: tax.slug
              }))],
              onChange: value => setAttributes({
                queryTaxonomy: value ? value + ':' : ''
              })
            }), taxSlug && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
              label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Term', 'otter-blocks'),
              value: termSlug || '',
              options: [{
                label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('All', 'otter-blocks'),
                value: ''
              }, ...terms.map(term => ({
                label: term.name,
                value: term.slug
              }))],
              onChange: value => setAttributes({
                queryTaxonomy: taxSlug + ':' + (value || '')
              })
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
              label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Exclude Current Post', 'otter-blocks'),
              checked: !!attributes.queryExcludeCurrent,
              onChange: value => setAttributes({
                queryExcludeCurrent: value
              })
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
              label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Sticky Posts', 'otter-blocks'),
              value: attributes.querySticky || '',
              options: [{
                label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Default', 'otter-blocks'),
                value: ''
              }, {
                label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Exclude', 'otter-blocks'),
                value: 'exclude'
              }, {
                label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Only Sticky', 'otter-blocks'),
                value: 'only'
              }],
              onChange: value => setAttributes({
                querySticky: value
              })
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", {
              className: "components-base-control__help",
              children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Inner blocks are repeated for each queried post on the frontend.', 'otter-blocks')
            })]
          })]
        }), hasPostFieldOptions && isInsideQuery && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Post Data', 'otter-blocks'),
          initialOpen: false,
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Post Field', 'otter-blocks'),
            value: attributes.postField || '',
            options: POST_FIELD_OPTIONS[props.name],
            onChange: value => setAttributes({
              postField: value
            }),
            help: attributes.postField ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Content will be replaced with post data on the frontend.', 'otter-blocks') : undefined
          }), attributes.postField === 'excerpt' && props.name === 'atomic-wind/text' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.RangeControl, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Excerpt Length (words)', 'otter-blocks'),
            value: attributes.excerptLength || 25,
            onChange: value => setAttributes({
              excerptLength: value
            }),
            min: 1,
            max: 100
          }), attributes.postField === 'custom_field' && props.name === 'atomic-wind/text' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.TextControl, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Meta Key', 'otter-blocks'),
            value: attributes.customFieldKey || '',
            onChange: value => setAttributes({
              customFieldKey: value
            }),
            help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Enter the post meta key or ACF field name.', 'otter-blocks')
          })]
        })]
      })]
    });
  };
}, 'withQueryControls');
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__.addFilter)('editor.BlockEdit', 'atomic-wind/query-controls', withQueryControls);

/***/ }),

/***/ "./src/atomic-wind/states/index.js":
/*!*****************************************!*\
  !*** ./src/atomic-wind/states/index.js ***!
  \*****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   StateControls: function() { return /* binding */ StateControls; }
/* harmony export */ });
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__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_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__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 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__);






(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__.addFilter)('blocks.registerBlockType', 'atomic-wind/state-attributes', settings => {
  if (settings.category !== 'atomic-wind') {
    return settings;
  }
  return {
    ...settings,
    attributes: {
      ...settings.attributes,
      showIf: {
        type: 'string',
        default: ''
      },
      hideIf: {
        type: 'string',
        default: ''
      },
      stateTrigger: {
        type: 'string',
        default: ''
      },
      stateAction: {
        type: 'string',
        default: 'toggle'
      },
      stateValue: {
        type: 'string',
        default: ''
      },
      stateDefault: {
        type: 'boolean',
        default: false
      }
    }
  };
});
function SuggestionChips({
  triggers,
  onSelect
}) {
  if (!triggers.size) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
    style: {
      display: 'flex',
      flexWrap: 'wrap',
      gap: '4px',
      marginTop: '4px'
    },
    children: [...triggers.entries()].map(([name, info]) => {
      const chips = [];
      if (info.action === 'set' && info.values.size) {
        for (const val of info.values) {
          chips.push(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("button", {
            type: "button",
            onClick: () => onSelect(`${name}:${val}`),
            style: {
              background: '#f0f0f0',
              border: '1px solid #ddd',
              borderRadius: '2px',
              padding: '0 6px',
              fontSize: '11px',
              cursor: 'pointer',
              lineHeight: '1.8'
            },
            children: [name, ":", val]
          }, `${name}:${val}`));
        }
      } else {
        chips.push(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("button", {
          type: "button",
          onClick: () => onSelect(name),
          style: {
            background: '#f0f0f0',
            border: '1px solid #ddd',
            borderRadius: '2px',
            padding: '0 6px',
            fontSize: '11px',
            cursor: 'pointer',
            lineHeight: '1.8'
          },
          children: name
        }, name));
      }
      return chips;
    })
  });
}
function StateControls({
  attributes,
  setAttributes
}) {
  const {
    showIf,
    hideIf,
    stateTrigger,
    stateAction,
    stateValue,
    stateDefault
  } = attributes;
  const allBlocks = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select('core/block-editor').getBlocks(), []);
  const triggers = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => {
    const map = new Map();
    function walk(list) {
      for (const block of list) {
        const attrs = block.attributes || {};
        if (attrs.stateTrigger) {
          if (!map.has(attrs.stateTrigger)) {
            map.set(attrs.stateTrigger, {
              action: attrs.stateAction || 'toggle',
              values: new Set(),
              hasDefault: false
            });
          }
          const entry = map.get(attrs.stateTrigger);
          if (attrs.stateAction === 'set' && attrs.stateValue) {
            entry.values.add(attrs.stateValue);
          }
          if (attrs.stateDefault) {
            entry.hasDefault = true;
          }
        }
        if (block.innerBlocks?.length) {
          walk(block.innerBlocks);
        }
      }
    }
    walk(allBlocks);
    return map;
  }, [allBlocks]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
    className: "aw-ce-tab-content",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show If', 'otter-blocks'),
      value: showIf || '',
      onChange: value => setAttributes({
        showIf: value
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(SuggestionChips, {
      triggers: triggers,
      onSelect: value => setAttributes({
        showIf: value
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", {
      className: "components-base-control__help",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show this block when a state is active. Use a name (e.g. tabs) for boolean triggers, or name:value (e.g. tabs:pricing) for set-value triggers.', 'otter-blocks')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
      style: {
        marginTop: '16px'
      },
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Hide If', 'otter-blocks'),
        value: hideIf || '',
        onChange: value => setAttributes({
          hideIf: value
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(SuggestionChips, {
        triggers: triggers,
        onSelect: value => setAttributes({
          hideIf: value
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", {
        className: "components-base-control__help",
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Hide this block when a state is active. Same syntax as Show If.', 'otter-blocks')
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('State Trigger', 'otter-blocks'),
      value: stateTrigger || '',
      onChange: value => setAttributes({
        stateTrigger: value
      }),
      help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Give this block a state name so clicking it changes state. Other blocks can react via Show If / Hide If.', 'otter-blocks')
    }), stateTrigger && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Action', 'otter-blocks'),
        value: stateAction || 'toggle',
        options: [{
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Toggle', 'otter-blocks'),
          value: 'toggle'
        }, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Set Value', 'otter-blocks'),
          value: 'set'
        }],
        onChange: value => setAttributes({
          stateAction: value
        }),
        help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Toggle flips a boolean on/off. Set Value assigns a specific value — useful for tab-style interfaces where only one option is active.', 'otter-blocks')
      }), stateAction === 'set' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Value', 'otter-blocks'),
        value: stateValue || '',
        onChange: value => setAttributes({
          stateValue: value
        }),
        help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('The value to assign when this trigger is clicked.', 'otter-blocks')
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Active by Default', 'otter-blocks'),
        checked: !!stateDefault,
        onChange: value => setAttributes({
          stateDefault: value
        }),
        help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Turn on to make this trigger\'s state active on page load.', 'otter-blocks')
      })]
    })]
  });
}
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__.addFilter)('blocks.getSaveContent.extraProps', 'atomic-wind/state-save-props', (extraProps, blockType, attributes) => {
  if (blockType.category !== 'atomic-wind') {
    return extraProps;
  }
  if (attributes.showIf) {
    extraProps['data-show-if'] = attributes.showIf;
  }
  if (attributes.hideIf) {
    extraProps['data-hide-if'] = attributes.hideIf;
  }
  if (attributes.stateTrigger) {
    extraProps['data-state-trigger'] = attributes.stateTrigger;
    extraProps['data-state-action'] = attributes.stateAction;
    if (attributes.stateAction === 'set' && attributes.stateValue) {
      extraProps['data-state-value'] = attributes.stateValue;
    }
    if (attributes.stateDefault) {
      extraProps['data-state-default'] = '';
    }
  }
  return extraProps;
});

/***/ }),

/***/ "./src/atomic-wind/wrap-in/index.js":
/*!******************************************!*\
  !*** ./src/atomic-wind/wrap-in/index.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__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_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _blocks_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../blocks/icon */ "./src/atomic-wind/blocks/icon.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);








const WrapInControls = () => {
  const {
    clientIds,
    blocks
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    const {
      getSelectedBlockClientIds,
      getBlocksByClientId
    } = select('core/block-editor');
    const ids = getSelectedBlockClientIds();
    return {
      clientIds: ids,
      blocks: getBlocksByClientId(ids)
    };
  }, []);
  const {
    replaceBlocks
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)('core/block-editor');
  const allAtomic = blocks.length > 0 && blocks.every(b => b?.name?.startsWith('atomic-wind/'));
  if (!allAtomic) {
    return null;
  }
  const wrapIn = (wrapperName, attrs = {}) => {
    const wrapper = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__.createBlock)(wrapperName, attrs, blocks.map(b => (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__.createBlock)(b.name, b.attributes, b.innerBlocks)));
    replaceBlocks(clientIds, [wrapper]);
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.BlockSettingsMenuControls, {
    children: ({
      onClose
    }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.MenuItem, {
        icon: _blocks_icon__WEBPACK_IMPORTED_MODULE_6__["default"],
        onClick: () => {
          wrapIn('atomic-wind/box');
          onClose();
        },
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Wrap in Box', 'otter-blocks')
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.MenuItem, {
        icon: _blocks_icon__WEBPACK_IMPORTED_MODULE_6__["default"],
        onClick: () => {
          wrapIn('atomic-wind/link', {
            mode: 'inner-blocks'
          });
          onClose();
        },
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Wrap in Link', 'otter-blocks')
      })]
    })
  });
};
(0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_5__.registerPlugin)('atomic-wind-wrap-in', {
  render: WrapInControls
});

/***/ }),

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

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

/***/ }),

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

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

/***/ }),

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

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

/***/ }),

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

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

/***/ }),

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

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

/***/ }),

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

module.exports = window["wp"]["editor"];

/***/ }),

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

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

/***/ }),

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

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

/***/ }),

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

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

/***/ }),

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

module.exports = window["wp"]["plugins"];

/***/ }),

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

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

/***/ }),

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

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;
/******/ 	}
/******/ 	
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = __webpack_modules__;
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/chunk loaded */
/******/ 	!function() {
/******/ 		var deferred = [];
/******/ 		__webpack_require__.O = function(result, chunkIds, fn, priority) {
/******/ 			if(chunkIds) {
/******/ 				priority = priority || 0;
/******/ 				for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
/******/ 				deferred[i] = [chunkIds, fn, priority];
/******/ 				return;
/******/ 			}
/******/ 			var notFulfilled = Infinity;
/******/ 			for (var i = 0; i < deferred.length; i++) {
/******/ 				var chunkIds = deferred[i][0];
/******/ 				var fn = deferred[i][1];
/******/ 				var priority = deferred[i][2];
/******/ 				var fulfilled = true;
/******/ 				for (var j = 0; j < chunkIds.length; j++) {
/******/ 					if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {
/******/ 						chunkIds.splice(j--, 1);
/******/ 					} else {
/******/ 						fulfilled = false;
/******/ 						if(priority < notFulfilled) notFulfilled = priority;
/******/ 					}
/******/ 				}
/******/ 				if(fulfilled) {
/******/ 					deferred.splice(i--, 1)
/******/ 					var r = fn();
/******/ 					if (r !== undefined) result = r;
/******/ 				}
/******/ 			}
/******/ 			return result;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* 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/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/jsonp chunk loading */
/******/ 	!function() {
/******/ 		// no baseURI
/******/ 		
/******/ 		// object to store loaded and loading chunks
/******/ 		// undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ 		// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ 		var installedChunks = {
/******/ 			"editor": 0,
/******/ 			"./style-editor": 0
/******/ 		};
/******/ 		
/******/ 		// no chunk on demand loading
/******/ 		
/******/ 		// no prefetching
/******/ 		
/******/ 		// no preloaded
/******/ 		
/******/ 		// no HMR
/******/ 		
/******/ 		// no HMR manifest
/******/ 		
/******/ 		__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };
/******/ 		
/******/ 		// install a JSONP callback for chunk loading
/******/ 		var webpackJsonpCallback = function(parentChunkLoadingFunction, data) {
/******/ 			var chunkIds = data[0];
/******/ 			var moreModules = data[1];
/******/ 			var runtime = data[2];
/******/ 			// add "moreModules" to the modules object,
/******/ 			// then flag all "chunkIds" as loaded and fire callback
/******/ 			var moduleId, chunkId, i = 0;
/******/ 			if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {
/******/ 				for(moduleId in moreModules) {
/******/ 					if(__webpack_require__.o(moreModules, moduleId)) {
/******/ 						__webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ 					}
/******/ 				}
/******/ 				if(runtime) var result = runtime(__webpack_require__);
/******/ 			}
/******/ 			if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ 			for(;i < chunkIds.length; i++) {
/******/ 				chunkId = chunkIds[i];
/******/ 				if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ 					installedChunks[chunkId][0]();
/******/ 				}
/******/ 				installedChunks[chunkId] = 0;
/******/ 			}
/******/ 			return __webpack_require__.O(result);
/******/ 		}
/******/ 		
/******/ 		var chunkLoadingGlobal = self["webpackChunkotter_blocks"] = self["webpackChunkotter_blocks"] || [];
/******/ 		chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ 		chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ 	}();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module depends on other loaded chunks and execution need to be delayed
/******/ 	var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-editor"], function() { return __webpack_require__("./src/atomic-wind/editor.js"); })
/******/ 	__webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/ 	
/******/ })()
;
//# sourceMappingURL=editor.js.map