Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 14.4.0 |
Comparing to | |
See all releases |
Code changes from version 14.3.1 to 14.4.0
- build/block-editor/index.js +1206 -504
- build/block-editor/index.min.asset.php +1 -1
- build/block-editor/index.min.js +43 -44
build/block-editor/index.js
CHANGED
@@ -3288,7 +3288,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
3288 |
"__experimentalUseGradient": () => (/* reexport */ __experimentalUseGradient),
|
3289 |
"__experimentalUseHasRecursion": () => (/* reexport */ useHasRecursion),
|
3290 |
"__experimentalUseMultipleOriginColorsAndGradients": () => (/* reexport */ useMultipleOriginColorsAndGradients),
|
3291 |
-
"__experimentalUseOnBlockDrop": () => (/* reexport */ useOnBlockDrop),
|
3292 |
"__experimentalUseResizeCanvas": () => (/* reexport */ useResizeCanvas),
|
3293 |
"__experimentaluseLayoutClasses": () => (/* reexport */ useLayoutClasses),
|
3294 |
"__experimentaluseLayoutStyles": () => (/* reexport */ useLayoutStyles),
|
@@ -3313,6 +3312,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
3313 |
"getColorClassName": () => (/* reexport */ getColorClassName),
|
3314 |
"getColorObjectByAttributeValues": () => (/* reexport */ getColorObjectByAttributeValues),
|
3315 |
"getColorObjectByColorValue": () => (/* reexport */ getColorObjectByColorValue),
|
|
|
3316 |
"getFontSize": () => (/* reexport */ getFontSize),
|
3317 |
"getFontSizeClass": () => (/* reexport */ getFontSizeClass),
|
3318 |
"getFontSizeObjectByValue": () => (/* reexport */ getFontSizeObjectByValue),
|
@@ -3557,12 +3557,12 @@ const external_wp_element_namespaceObject = window["wp"]["element"];
|
|
3557 |
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
3558 |
var classnames = __webpack_require__(4403);
|
3559 |
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
3560 |
-
;// CONCATENATED MODULE: external "lodash"
|
3561 |
-
const external_lodash_namespaceObject = window["lodash"];
|
3562 |
;// CONCATENATED MODULE: external ["wp","compose"]
|
3563 |
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
3564 |
;// CONCATENATED MODULE: external ["wp","data"]
|
3565 |
const external_wp_data_namespaceObject = window["wp"]["data"];
|
|
|
|
|
3566 |
;// CONCATENATED MODULE: external ["wp","components"]
|
3567 |
const external_wp_components_namespaceObject = window["wp"]["components"];
|
3568 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-controls/groups.js
|
@@ -3614,6 +3614,7 @@ const PREFERENCES_DEFAULTS = {
|
|
3614 |
* @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor
|
3615 |
* @property {boolean} generateAnchors Enable/Disable auto anchor generation for Heading blocks
|
3616 |
* @property {boolean} __experimentalCanUserUseUnfilteredHTML Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes.
|
|
|
3617 |
* @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
|
3618 |
* @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
|
3619 |
* @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
|
@@ -3726,11 +3727,13 @@ const SETTINGS_DEFAULTS = {
|
|
3726 |
// Allows to disable block locking interface.
|
3727 |
canLockBlocks: true,
|
3728 |
__experimentalCanUserUseUnfilteredHTML: false,
|
|
|
3729 |
__experimentalBlockDirectory: false,
|
3730 |
__mobileEnablePageTemplates: false,
|
3731 |
__experimentalBlockPatterns: [],
|
3732 |
__experimentalBlockPatternCategories: [],
|
3733 |
__unstableGalleryWithImageBlocks: false,
|
|
|
3734 |
generateAnchors: false,
|
3735 |
// gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
|
3736 |
// The setting is only kept for backward compatibility purposes.
|
@@ -4180,9 +4183,13 @@ const withBlockTree = reducer => function () {
|
|
4180 |
|
4181 |
case 'SAVE_REUSABLE_BLOCK_SUCCESS':
|
4182 |
{
|
4183 |
-
const updatedBlockUids = Object.
|
4184 |
-
|
4185 |
-
|
|
|
|
|
|
|
|
|
4186 |
newState.tree = updateParentInnerBlocksInTree(newState, { ...newState.tree,
|
4187 |
...updatedBlockUids.reduce((result, clientId) => {
|
4188 |
result[clientId] = { ...newState.byClientId[clientId],
|
@@ -4668,6 +4675,8 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
4668 |
|
4669 |
case 'MOVE_BLOCKS_TO_POSITION':
|
4670 |
{
|
|
|
|
|
4671 |
const {
|
4672 |
fromRootClientId = '',
|
4673 |
toRootClientId = '',
|
@@ -4687,7 +4696,7 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
4687 |
|
4688 |
|
4689 |
return { ...state,
|
4690 |
-
[fromRootClientId]: (
|
4691 |
[toRootClientId]: insertAt(state[toRootClientId], clientIds, index)
|
4692 |
};
|
4693 |
}
|
@@ -4760,7 +4769,11 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
4760 |
case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN':
|
4761 |
return (0,external_wp_compose_namespaceObject.pipe)([// Remove inner block ordering for removed blocks.
|
4762 |
nextState => (0,external_lodash_namespaceObject.omit)(nextState, action.removedClientIds), // Remove deleted blocks from other blocks' orderings.
|
4763 |
-
nextState => (0,external_lodash_namespaceObject.mapValues)(nextState, subState =>
|
|
|
|
|
|
|
|
|
4764 |
}
|
4765 |
|
4766 |
return state;
|
@@ -5163,16 +5176,22 @@ function insertionPoint() {
|
|
5163 |
|
5164 |
switch (action.type) {
|
5165 |
case 'SHOW_INSERTION_POINT':
|
5166 |
-
|
5167 |
-
|
5168 |
-
|
5169 |
-
|
5170 |
-
|
5171 |
-
|
5172 |
-
|
5173 |
-
|
5174 |
-
|
5175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5176 |
|
5177 |
case 'HIDE_INSERTION_POINT':
|
5178 |
return null;
|
@@ -8459,6 +8478,7 @@ function retrieveSelectedAttribute(blockAttributes) {
|
|
8459 |
|
8460 |
|
8461 |
|
|
|
8462 |
|
8463 |
const castArray = maybeArray => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
|
8464 |
/**
|
@@ -9052,10 +9072,13 @@ const insertBlocks = function (blocks, index, rootClientId) {
|
|
9052 |
/**
|
9053 |
* Action that shows the insertion point.
|
9054 |
*
|
9055 |
-
* @param
|
9056 |
-
*
|
9057 |
-
* @param
|
9058 |
-
* @param
|
|
|
|
|
|
|
9059 |
*
|
9060 |
* @return {Object} Action object.
|
9061 |
*/
|
@@ -9064,26 +9087,35 @@ function showInsertionPoint(rootClientId, index) {
|
|
9064 |
let __unstableOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
9065 |
|
9066 |
const {
|
9067 |
-
__unstableWithInserter
|
|
|
9068 |
} = __unstableOptions;
|
9069 |
return {
|
9070 |
type: 'SHOW_INSERTION_POINT',
|
9071 |
rootClientId,
|
9072 |
index,
|
9073 |
-
__unstableWithInserter
|
|
|
9074 |
};
|
9075 |
}
|
9076 |
/**
|
9077 |
* Action that hides the insertion point.
|
9078 |
-
*
|
9079 |
-
* @return {Object} Action object.
|
9080 |
*/
|
9081 |
|
9082 |
-
|
9083 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9084 |
type: 'HIDE_INSERTION_POINT'
|
9085 |
-
};
|
9086 |
-
}
|
9087 |
/**
|
9088 |
* Action that resets the template validity.
|
9089 |
*
|
@@ -9104,11 +9136,11 @@ function setTemplateValidity(isValid) {
|
|
9104 |
* @return {Object} Action object.
|
9105 |
*/
|
9106 |
|
9107 |
-
const synchronizeTemplate = () =>
|
9108 |
let {
|
9109 |
select,
|
9110 |
dispatch
|
9111 |
-
} =
|
9112 |
dispatch({
|
9113 |
type: 'SYNCHRONIZE_TEMPLATE'
|
9114 |
});
|
@@ -9123,12 +9155,12 @@ const synchronizeTemplate = () => _ref11 => {
|
|
9123 |
* @param {boolean} isForward
|
9124 |
*/
|
9125 |
|
9126 |
-
const __unstableDeleteSelection = isForward =>
|
9127 |
let {
|
9128 |
registry,
|
9129 |
select,
|
9130 |
dispatch
|
9131 |
-
} =
|
9132 |
const selectionAnchor = select.getSelectionStart();
|
9133 |
const selectionFocus = select.getSelectionEnd();
|
9134 |
if (selectionAnchor.clientId === selectionFocus.clientId) return; // It's not mergeable if there's no rich text selection.
|
@@ -9246,11 +9278,11 @@ const __unstableDeleteSelection = isForward => _ref12 => {
|
|
9246 |
* Split the current selection.
|
9247 |
*/
|
9248 |
|
9249 |
-
const __unstableSplitSelection = () =>
|
9250 |
let {
|
9251 |
select,
|
9252 |
dispatch
|
9253 |
-
} =
|
9254 |
const selectionAnchor = select.getSelectionStart();
|
9255 |
const selectionFocus = select.getSelectionEnd();
|
9256 |
if (selectionAnchor.clientId === selectionFocus.clientId) return; // Can't split if the selection is not set.
|
@@ -9321,11 +9353,11 @@ const __unstableSplitSelection = () => _ref13 => {
|
|
9321 |
* Expand the selection to cover the entire blocks, removing partial selection.
|
9322 |
*/
|
9323 |
|
9324 |
-
const __unstableExpandSelection = () =>
|
9325 |
let {
|
9326 |
select,
|
9327 |
dispatch
|
9328 |
-
} =
|
9329 |
const selectionAnchor = select.getSelectionStart();
|
9330 |
const selectionFocus = select.getSelectionEnd();
|
9331 |
dispatch.selectionChange({
|
@@ -9344,12 +9376,12 @@ const __unstableExpandSelection = () => _ref14 => {
|
|
9344 |
* @param {string} secondBlockClientId Client ID of the second block to merge.
|
9345 |
*/
|
9346 |
|
9347 |
-
const mergeBlocks = (firstBlockClientId, secondBlockClientId) =>
|
9348 |
let {
|
9349 |
registry,
|
9350 |
select,
|
9351 |
dispatch
|
9352 |
-
} =
|
9353 |
const blocks = [firstBlockClientId, secondBlockClientId];
|
9354 |
dispatch({
|
9355 |
type: 'MERGE_BLOCKS',
|
@@ -9471,11 +9503,11 @@ const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref15 => {
|
|
9471 |
|
9472 |
const removeBlocks = function (clientIds) {
|
9473 |
let selectPrevious = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
9474 |
-
return
|
9475 |
let {
|
9476 |
select,
|
9477 |
dispatch
|
9478 |
-
} =
|
9479 |
|
9480 |
if (!clientIds || !clientIds.length) {
|
9481 |
return;
|
@@ -9676,10 +9708,10 @@ function selectionChange(clientId, attributeKey, startOffset, endOffset) {
|
|
9676 |
* @param {?number} index Optional index where to insert the default block.
|
9677 |
*/
|
9678 |
|
9679 |
-
const insertDefaultBlock = (attributes, rootClientId, index) =>
|
9680 |
let {
|
9681 |
dispatch
|
9682 |
-
} =
|
9683 |
// Abort if there is no default block type (if it has been unregistered).
|
9684 |
const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)();
|
9685 |
|
@@ -9768,10 +9800,10 @@ function __unstableMarkNextChangeAsNotPersistent() {
|
|
9768 |
* selection changes have been recorded.
|
9769 |
*/
|
9770 |
|
9771 |
-
const __unstableMarkAutomaticChange = () =>
|
9772 |
let {
|
9773 |
dispatch
|
9774 |
-
} =
|
9775 |
dispatch({
|
9776 |
type: 'MARK_AUTOMATIC_CHANGE'
|
9777 |
});
|
@@ -9792,10 +9824,10 @@ const __unstableMarkAutomaticChange = () => _ref18 => {
|
|
9792 |
|
9793 |
const setNavigationMode = function () {
|
9794 |
let isNavigationMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
9795 |
-
return
|
9796 |
let {
|
9797 |
dispatch
|
9798 |
-
} =
|
9799 |
|
9800 |
dispatch.__unstableSetEditorMode(isNavigationMode ? 'navigation' : 'edit');
|
9801 |
};
|
@@ -9806,11 +9838,11 @@ const setNavigationMode = function () {
|
|
9806 |
* @param {string} mode Editor mode
|
9807 |
*/
|
9808 |
|
9809 |
-
const __unstableSetEditorMode = mode =>
|
9810 |
let {
|
9811 |
dispatch,
|
9812 |
select
|
9813 |
-
} =
|
9814 |
|
9815 |
// When switching to zoom-out mode, we need to select the root block
|
9816 |
if (mode === 'zoom-out') {
|
@@ -9842,10 +9874,10 @@ const __unstableSetEditorMode = mode => _ref20 => {
|
|
9842 |
|
9843 |
const setBlockMovingClientId = function () {
|
9844 |
let hasBlockMovingClientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
9845 |
-
return
|
9846 |
let {
|
9847 |
dispatch
|
9848 |
-
} =
|
9849 |
dispatch({
|
9850 |
type: 'SET_BLOCK_MOVING_MODE',
|
9851 |
hasBlockMovingClientId
|
@@ -9865,11 +9897,11 @@ const setBlockMovingClientId = function () {
|
|
9865 |
|
9866 |
const duplicateBlocks = function (clientIds) {
|
9867 |
let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
9868 |
-
return
|
9869 |
let {
|
9870 |
select,
|
9871 |
dispatch
|
9872 |
-
} =
|
9873 |
|
9874 |
if (!clientIds || !clientIds.length) {
|
9875 |
return;
|
@@ -9908,11 +9940,11 @@ const duplicateBlocks = function (clientIds) {
|
|
9908 |
* @param {string} clientId
|
9909 |
*/
|
9910 |
|
9911 |
-
const insertBeforeBlock = clientId =>
|
9912 |
let {
|
9913 |
select,
|
9914 |
dispatch
|
9915 |
-
} =
|
9916 |
|
9917 |
if (!clientId) {
|
9918 |
return;
|
@@ -9934,11 +9966,11 @@ const insertBeforeBlock = clientId => _ref23 => {
|
|
9934 |
* @param {string} clientId
|
9935 |
*/
|
9936 |
|
9937 |
-
const insertAfterBlock = clientId =>
|
9938 |
let {
|
9939 |
select,
|
9940 |
dispatch
|
9941 |
-
} =
|
9942 |
|
9943 |
if (!clientId) {
|
9944 |
return;
|
@@ -9974,10 +10006,10 @@ function toggleBlockHighlight(clientId, isHighlighted) {
|
|
9974 |
* @param {string} clientId Target block client ID.
|
9975 |
*/
|
9976 |
|
9977 |
-
const flashBlock = clientId => async
|
9978 |
let {
|
9979 |
dispatch
|
9980 |
-
} =
|
9981 |
dispatch(toggleBlockHighlight(clientId, true));
|
9982 |
await new Promise(resolve => setTimeout(resolve, 150));
|
9983 |
dispatch(toggleBlockHighlight(clientId, false));
|
@@ -10348,7 +10380,7 @@ const arrowRight = (0,external_wp_element_namespaceObject.createElement)(externa
|
|
10348 |
xmlns: "http://www.w3.org/2000/svg",
|
10349 |
viewBox: "0 0 24 24"
|
10350 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
10351 |
-
d: "
|
10352 |
}));
|
10353 |
/* harmony default export */ const arrow_right = (arrowRight);
|
10354 |
|
@@ -10363,7 +10395,7 @@ const arrowDown = (0,external_wp_element_namespaceObject.createElement)(external
|
|
10363 |
xmlns: "http://www.w3.org/2000/svg",
|
10364 |
viewBox: "0 0 24 24"
|
10365 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
10366 |
-
d: "
|
10367 |
}));
|
10368 |
/* harmony default export */ const arrow_down = (arrowDown);
|
10369 |
|
@@ -10996,8 +11028,34 @@ function useSetting(path) {
|
|
10996 |
|
10997 |
|
10998 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10999 |
function SpacingInputControl(_ref) {
|
11000 |
-
var _spacingSizes$current;
|
11001 |
|
11002 |
let {
|
11003 |
spacingSizes,
|
@@ -11049,7 +11107,7 @@ function SpacingInputControl(_ref) {
|
|
11049 |
return value === undefined ? undefined : (_spacingSizes$newValu = spacingSizes[newValue]) === null || _spacingSizes$newValu === void 0 ? void 0 : _spacingSizes$newValu.name;
|
11050 |
};
|
11051 |
|
11052 |
-
const customRangeValue =
|
11053 |
|
11054 |
const getNewCustomValue = newSize => {
|
11055 |
const isNumeric = !isNaN(parseFloat(newSize));
|
@@ -11127,11 +11185,13 @@ function SpacingInputControl(_ref) {
|
|
11127 |
className: "components-spacing-sizes-control__custom-value-input",
|
11128 |
style: {
|
11129 |
gridColumn: '1'
|
11130 |
-
}
|
|
|
11131 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
|
11132 |
value: customRangeValue,
|
11133 |
min: 0,
|
11134 |
-
max:
|
|
|
11135 |
withInputField: false,
|
11136 |
onChange: handleCustomValueSliderChange,
|
11137 |
className: "components-spacing-sizes-control__custom-value-range"
|
@@ -11168,7 +11228,8 @@ function SpacingInputControl(_ref) {
|
|
11168 |
options: options,
|
11169 |
label: ariaLabel,
|
11170 |
hideLabelFromVision: true,
|
11171 |
-
__nextUnconstrainedWidth: true
|
|
|
11172 |
}));
|
11173 |
}
|
11174 |
|
@@ -11573,7 +11634,7 @@ function transformStyles(activeSupports, migrationPaths, result, source, index,
|
|
11573 |
var _source$;
|
11574 |
|
11575 |
// If there are no active supports return early.
|
11576 |
-
if ((0
|
11577 |
return result;
|
11578 |
} // If the condition verifies we are probably in the presence of a wrapping transform
|
11579 |
// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.
|
@@ -11891,6 +11952,7 @@ function BlockPopover(_ref, ref) {
|
|
11891 |
__unstableCoverTarget = false,
|
11892 |
__unstablePopoverSlot,
|
11893 |
__unstableContentRef,
|
|
|
11894 |
...props
|
11895 |
} = _ref;
|
11896 |
const selectedElement = useBlockElement(clientId);
|
@@ -11978,7 +12040,7 @@ function BlockPopover(_ref, ref) {
|
|
11978 |
placement: "top-start",
|
11979 |
resize: false,
|
11980 |
flip: false,
|
11981 |
-
shift:
|
11982 |
}, props, {
|
11983 |
className: classnames_default()('block-editor-block-popover', props.className)
|
11984 |
}), __unstableCoverTarget && (0,external_wp_element_namespaceObject.createElement)("div", {
|
@@ -12154,10 +12216,10 @@ function MarginVisualizer(_ref2) {
|
|
12154 |
borderRightWidth: marginRight,
|
12155 |
borderBottomWidth: marginBottom,
|
12156 |
borderLeftWidth: marginLeft,
|
12157 |
-
top: marginTop !== 0 ?
|
12158 |
-
right: marginRight !== 0 ?
|
12159 |
-
bottom: marginBottom !== 0 ?
|
12160 |
-
left: marginLeft !== 0 ?
|
12161 |
};
|
12162 |
}, [margin]);
|
12163 |
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
|
@@ -12190,7 +12252,8 @@ function MarginVisualizer(_ref2) {
|
|
12190 |
return (0,external_wp_element_namespaceObject.createElement)(block_popover, {
|
12191 |
clientId: clientId,
|
12192 |
__unstableCoverTarget: true,
|
12193 |
-
__unstableRefreshSize: margin
|
|
|
12194 |
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
12195 |
className: "block-editor__padding-visualizer",
|
12196 |
style: style
|
@@ -12390,7 +12453,8 @@ function PaddingVisualizer(_ref2) {
|
|
12390 |
return (0,external_wp_element_namespaceObject.createElement)(block_popover, {
|
12391 |
clientId: clientId,
|
12392 |
__unstableCoverTarget: true,
|
12393 |
-
__unstableRefreshSize: padding
|
|
|
12394 |
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
12395 |
className: "block-editor__padding-visualizer",
|
12396 |
style: style
|
@@ -14176,7 +14240,6 @@ const BlockAlignmentToolbar = props => {
|
|
14176 |
* External dependencies
|
14177 |
*/
|
14178 |
|
14179 |
-
|
14180 |
/**
|
14181 |
* WordPress dependencies
|
14182 |
*/
|
@@ -14238,7 +14301,7 @@ function getValidAlignments(blockAlign) {
|
|
14238 |
}
|
14239 |
|
14240 |
if (!hasWideEnabled || blockAlign === true && !hasWideBlockSupport) {
|
14241 |
-
return
|
14242 |
}
|
14243 |
|
14244 |
return validAlignments;
|
@@ -20833,17 +20896,17 @@ const applyWithSelect = (0,external_wp_data_namespaceObject.withSelect)((select,
|
|
20833 |
isSelected
|
20834 |
};
|
20835 |
});
|
20836 |
-
const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps,
|
20837 |
-
let {
|
20838 |
-
select
|
20839 |
-
} = _ref4;
|
20840 |
const {
|
20841 |
updateBlockAttributes,
|
20842 |
insertBlocks,
|
20843 |
mergeBlocks,
|
20844 |
replaceBlocks,
|
20845 |
toggleSelection,
|
20846 |
-
__unstableMarkLastChangeAsPersistent
|
|
|
|
|
|
|
20847 |
} = dispatch(store); // Do not add new properties here, use `useDispatch` instead to avoid
|
20848 |
// leaking new props to the public API (editor.BlockListBlock filter).
|
20849 |
|
@@ -20851,7 +20914,7 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
|
|
20851 |
setAttributes(newAttributes) {
|
20852 |
const {
|
20853 |
getMultiSelectedBlockClientIds
|
20854 |
-
} = select(store);
|
20855 |
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds();
|
20856 |
const {
|
20857 |
clientId
|
@@ -20874,7 +20937,7 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
|
|
20874 |
} = ownProps;
|
20875 |
const {
|
20876 |
getBlockIndex
|
20877 |
-
} = select(store);
|
20878 |
const index = getBlockIndex(clientId);
|
20879 |
insertBlocks(blocks, index + 1, rootClientId);
|
20880 |
},
|
@@ -20887,13 +20950,52 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
|
|
20887 |
const {
|
20888 |
getPreviousBlockClientId,
|
20889 |
getNextBlockClientId,
|
20890 |
-
getBlock
|
20891 |
-
|
|
|
|
|
|
|
|
|
20892 |
|
20893 |
if (forward) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20894 |
const nextBlockClientId = getNextBlockClientId(clientId);
|
20895 |
|
20896 |
-
if (nextBlockClientId) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20897 |
mergeBlocks(clientId, nextBlockClientId);
|
20898 |
}
|
20899 |
} else {
|
@@ -20902,12 +21004,31 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
|
|
20902 |
if (previousBlockClientId) {
|
20903 |
mergeBlocks(previousBlockClientId, clientId);
|
20904 |
} else if (rootClientId) {
|
20905 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20906 |
// preceding block to merge with.
|
|
|
|
|
20907 |
const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(rootClientId), '*');
|
20908 |
|
20909 |
if (replacement && replacement.length) {
|
20910 |
-
|
|
|
|
|
|
|
20911 |
}
|
20912 |
}
|
20913 |
}
|
@@ -20930,10 +21051,10 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
|
|
20930 |
/* harmony default export */ const block = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.pure, applyWithSelect, applyWithDispatch, // Block is sometimes not mounted at the right time, causing it be undefined
|
20931 |
// see issue for more info
|
20932 |
// https://github.com/WordPress/gutenberg/issues/17013
|
20933 |
-
(0,external_wp_compose_namespaceObject.ifCondition)(
|
20934 |
let {
|
20935 |
block
|
20936 |
-
} =
|
20937 |
return !!block;
|
20938 |
}), (0,external_wp_components_namespaceObject.withFilters)('editor.BlockListBlock'))(BlockListBlock));
|
20939 |
|
@@ -21432,15 +21553,10 @@ function BlockEditorProvider(props) {
|
|
21432 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-preview/live.js
|
21433 |
|
21434 |
|
21435 |
-
/**
|
21436 |
-
* WordPress dependencies
|
21437 |
-
*/
|
21438 |
-
|
21439 |
/**
|
21440 |
* Internal dependencies
|
21441 |
*/
|
21442 |
|
21443 |
-
|
21444 |
function LiveBlockPreview(_ref) {
|
21445 |
let {
|
21446 |
onClick
|
@@ -21450,7 +21566,9 @@ function LiveBlockPreview(_ref) {
|
|
21450 |
role: "button",
|
21451 |
onClick: onClick,
|
21452 |
onKeyPress: onClick
|
21453 |
-
}, (0,external_wp_element_namespaceObject.createElement)(
|
|
|
|
|
21454 |
}
|
21455 |
|
21456 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-selection-clearer/index.js
|
@@ -21477,13 +21595,21 @@ function LiveBlockPreview(_ref) {
|
|
21477 |
|
21478 |
function useBlockSelectionClearer() {
|
21479 |
const {
|
|
|
21480 |
hasSelectedBlock,
|
21481 |
hasMultiSelection
|
21482 |
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
21483 |
const {
|
21484 |
clearSelectedBlock
|
21485 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
|
|
|
|
|
|
21486 |
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
|
|
|
|
|
|
|
|
|
21487 |
function onMouseDown(event) {
|
21488 |
if (!hasSelectedBlock() && !hasMultiSelection()) {
|
21489 |
return;
|
@@ -21501,7 +21627,7 @@ function useBlockSelectionClearer() {
|
|
21501 |
return () => {
|
21502 |
node.removeEventListener('mousedown', onMouseDown);
|
21503 |
};
|
21504 |
-
}, [hasSelectedBlock, hasMultiSelection, clearSelectedBlock]);
|
21505 |
}
|
21506 |
function BlockSelectionClearer(props) {
|
21507 |
return (0,external_wp_element_namespaceObject.createElement)("div", _extends({
|
@@ -24831,12 +24957,9 @@ function BlockPreview(_ref) {
|
|
24831 |
__experimentalMinHeight
|
24832 |
} = _ref;
|
24833 |
const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []);
|
24834 |
-
const settings = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
24835 |
-
|
24836 |
-
|
24837 |
-
_settings.__experimentalBlockPatterns = [];
|
24838 |
-
return _settings;
|
24839 |
-
}, [originalSettings]);
|
24840 |
const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_lodash_namespaceObject.castArray)(blocks), [blocks]);
|
24841 |
|
24842 |
if (!blocks || blocks.length === 0) {
|
@@ -24891,11 +25014,11 @@ function useBlockPreview(_ref2) {
|
|
24891 |
__experimentalLayout
|
24892 |
} = _ref2;
|
24893 |
const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []);
|
24894 |
-
const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)();
|
24895 |
-
const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, disabledRef]);
|
24896 |
const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings,
|
24897 |
-
|
24898 |
}), [originalSettings]);
|
|
|
|
|
24899 |
const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_lodash_namespaceObject.castArray)(blocks), [blocks]);
|
24900 |
const children = (0,external_wp_element_namespaceObject.createElement)(provider, {
|
24901 |
value: renderedBlocks,
|
@@ -25059,8 +25182,12 @@ const dragHandle = (0,external_wp_element_namespaceObject.createElement)(externa
|
|
25059 |
function BlockDraggableChip(_ref) {
|
25060 |
let {
|
25061 |
count,
|
25062 |
-
icon
|
|
|
25063 |
} = _ref;
|
|
|
|
|
|
|
25064 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
25065 |
className: "block-editor-block-draggable-chip-wrapper"
|
25066 |
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
@@ -25071,7 +25198,7 @@ function BlockDraggableChip(_ref) {
|
|
25071 |
className: "block-editor-block-draggable-chip__content"
|
25072 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, icon ? (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
25073 |
icon: icon
|
25074 |
-
}) : (0,external_wp_i18n_namespaceObject.sprintf)(
|
25075 |
/* translators: %d: Number of blocks. */
|
25076 |
(0,external_wp_i18n_namespaceObject._n)('%d block', '%d blocks', count), count)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
25077 |
icon: drag_handle
|
@@ -25096,7 +25223,8 @@ const InserterDraggableBlocks = _ref => {
|
|
25096 |
isEnabled,
|
25097 |
blocks,
|
25098 |
icon,
|
25099 |
-
children
|
|
|
25100 |
} = _ref;
|
25101 |
const transferData = {
|
25102 |
type: 'inserter',
|
@@ -25107,7 +25235,8 @@ const InserterDraggableBlocks = _ref => {
|
|
25107 |
transferData: transferData,
|
25108 |
__experimentalDragComponent: (0,external_wp_element_namespaceObject.createElement)(BlockDraggableChip, {
|
25109 |
count: blocks.length,
|
25110 |
-
icon: icon
|
|
|
25111 |
})
|
25112 |
}, _ref2 => {
|
25113 |
let {
|
@@ -25605,80 +25734,35 @@ function BlockTypesTab(_ref) {
|
|
25605 |
}
|
25606 |
/* harmony default export */ const block_types_tab = (BlockTypesTab);
|
25607 |
|
25608 |
-
;// CONCATENATED MODULE: ./packages/
|
25609 |
|
25610 |
|
25611 |
-
/**
|
25612 |
-
* External dependencies
|
25613 |
-
*/
|
25614 |
-
|
25615 |
/**
|
25616 |
* WordPress dependencies
|
25617 |
*/
|
25618 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25619 |
|
|
|
25620 |
|
25621 |
|
|
|
|
|
|
|
25622 |
|
25623 |
-
|
25624 |
-
|
25625 |
-
|
25626 |
-
|
25627 |
-
|
25628 |
-
|
25629 |
-
|
25630 |
-
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
|
25631 |
-
|
25632 |
-
const categoryOptions = () => {
|
25633 |
-
const options = [];
|
25634 |
-
patternCategories.map(patternCategory => {
|
25635 |
-
return options.push({
|
25636 |
-
value: patternCategory.name,
|
25637 |
-
label: patternCategory.label
|
25638 |
-
});
|
25639 |
-
});
|
25640 |
-
return options;
|
25641 |
-
};
|
25642 |
-
|
25643 |
-
const onChangeSelect = selected => {
|
25644 |
-
onClickCategory(patternCategories.find(patternCategory => selected === patternCategory.name));
|
25645 |
-
};
|
25646 |
-
|
25647 |
-
const className = classnames_default()('block-editor-inserter__panel-header', 'block-editor-inserter__panel-header-patterns'); // In iOS-based mobile devices, the onBlur will fire when selecting an option
|
25648 |
-
// from a Select element. To prevent closing the useDialog on iOS devices, we
|
25649 |
-
// stop propagating the onBlur event if there is no relatedTarget, which means
|
25650 |
-
// that the user most likely did not click on an element within the editor canvas.
|
25651 |
-
|
25652 |
-
const onBlur = event => {
|
25653 |
-
if (!(event !== null && event !== void 0 && event.relatedTarget)) {
|
25654 |
-
event.stopPropagation();
|
25655 |
-
}
|
25656 |
-
};
|
25657 |
-
|
25658 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
|
25659 |
-
justify: "space-between",
|
25660 |
-
align: "start",
|
25661 |
-
gap: "4",
|
25662 |
-
className: className
|
25663 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
|
25664 |
-
isBlock: true
|
25665 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
|
25666 |
-
className: "block-editor-inserter__panel-dropdown",
|
25667 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Filter patterns'),
|
25668 |
-
hideLabelFromVision: true,
|
25669 |
-
value: selectedCategory.name,
|
25670 |
-
onChange: onChangeSelect,
|
25671 |
-
onBlur: onBlur,
|
25672 |
-
options: categoryOptions()
|
25673 |
-
})), !isMobile && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
25674 |
-
variant: "secondary",
|
25675 |
-
className: "block-editor-inserter__patterns-explorer-expand",
|
25676 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Explore all patterns'),
|
25677 |
-
onClick: () => openPatternExplorer()
|
25678 |
-
}, (0,external_wp_i18n_namespaceObject._x)('Explore', 'Label for showing all block patterns'))));
|
25679 |
-
}
|
25680 |
-
|
25681 |
-
/* harmony default export */ const pattern_panel = (PatternInserterPanel);
|
25682 |
|
25683 |
;// CONCATENATED MODULE: external ["wp","notices"]
|
25684 |
const external_wp_notices_namespaceObject = window["wp"]["notices"];
|
@@ -25772,7 +25856,8 @@ function BlockPattern(_ref) {
|
|
25772 |
const descriptionId = `block-editor-block-patterns-list__item-description-${instanceId}`;
|
25773 |
return (0,external_wp_element_namespaceObject.createElement)(inserter_draggable_blocks, {
|
25774 |
isEnabled: isDraggable,
|
25775 |
-
blocks: blocks
|
|
|
25776 |
}, _ref2 => {
|
25777 |
let {
|
25778 |
draggable,
|
@@ -25781,8 +25866,6 @@ function BlockPattern(_ref) {
|
|
25781 |
} = _ref2;
|
25782 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
25783 |
className: "block-editor-block-patterns-list__list-item",
|
25784 |
-
"aria-label": pattern.title,
|
25785 |
-
"aria-describedby": pattern.description ? descriptionId : undefined,
|
25786 |
draggable: draggable,
|
25787 |
onDragStart: onDragStart,
|
25788 |
onDragEnd: onDragEnd
|
@@ -25791,7 +25874,9 @@ function BlockPattern(_ref) {
|
|
25791 |
as: "div"
|
25792 |
}, composite, {
|
25793 |
className: "block-editor-block-patterns-list__item",
|
25794 |
-
onClick: () => onClick(pattern, blocks)
|
|
|
|
|
25795 |
}), (0,external_wp_element_namespaceObject.createElement)(block_preview, {
|
25796 |
blocks: blocks,
|
25797 |
viewportWidth: viewportWidth
|
@@ -26393,76 +26478,18 @@ function PatternsExplorerModal(_ref2) {
|
|
26393 |
|
26394 |
|
26395 |
|
26396 |
-
/**
|
26397 |
-
* Internal dependencies
|
26398 |
-
*/
|
26399 |
-
|
26400 |
-
|
26401 |
-
|
26402 |
-
|
26403 |
-
|
26404 |
|
26405 |
-
function BlockPatternsCategory(_ref) {
|
26406 |
-
let {
|
26407 |
-
rootClientId,
|
26408 |
-
onInsert,
|
26409 |
-
selectedCategory,
|
26410 |
-
populatedCategories
|
26411 |
-
} = _ref;
|
26412 |
-
const [allPatterns,, onClick] = use_patterns_state(onInsert, rootClientId);
|
26413 |
-
const getPatternIndex = (0,external_wp_element_namespaceObject.useCallback)(pattern => {
|
26414 |
-
var _pattern$categories;
|
26415 |
|
26416 |
-
if (!((_pattern$categories = pattern.categories) !== null && _pattern$categories !== void 0 && _pattern$categories.length)) {
|
26417 |
-
return Infinity;
|
26418 |
-
}
|
26419 |
|
26420 |
-
|
26421 |
-
|
26422 |
-
|
26423 |
-
} = _ref2;
|
26424 |
-
accumulator[name] = index;
|
26425 |
-
return accumulator;
|
26426 |
-
}, {});
|
26427 |
-
return Math.min(...pattern.categories.map(cat => indexedCategories[cat] !== undefined ? indexedCategories[cat] : Infinity));
|
26428 |
-
}, [populatedCategories]);
|
26429 |
-
const currentCategoryPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => allPatterns.filter(pattern => {
|
26430 |
-
var _pattern$categories2;
|
26431 |
|
26432 |
-
return selectedCategory.name === 'uncategorized' ? getPatternIndex(pattern) === Infinity : (_pattern$categories2 = pattern.categories) === null || _pattern$categories2 === void 0 ? void 0 : _pattern$categories2.includes(selectedCategory.name);
|
26433 |
-
}), [allPatterns, selectedCategory]); // Ordering the patterns is important for the async rendering.
|
26434 |
|
26435 |
-
const orderedPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
26436 |
-
return currentCategoryPatterns.sort((a, b) => {
|
26437 |
-
return getPatternIndex(a) - getPatternIndex(b);
|
26438 |
-
});
|
26439 |
-
}, [currentCategoryPatterns, getPatternIndex]);
|
26440 |
-
const currentShownPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(orderedPatterns);
|
26441 |
|
26442 |
-
if (!currentCategoryPatterns.length) {
|
26443 |
-
return null;
|
26444 |
-
}
|
26445 |
|
26446 |
-
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
26447 |
-
className: "block-editor-inserter__panel-content"
|
26448 |
-
}, (0,external_wp_element_namespaceObject.createElement)(block_patterns_list, {
|
26449 |
-
shownPatterns: currentShownPatterns,
|
26450 |
-
blockPatterns: currentCategoryPatterns,
|
26451 |
-
onClickPattern: onClick,
|
26452 |
-
label: selectedCategory.label,
|
26453 |
-
orientation: "vertical",
|
26454 |
-
isDraggable: true
|
26455 |
-
}));
|
26456 |
-
}
|
26457 |
|
26458 |
-
function
|
26459 |
-
let {
|
26460 |
-
rootClientId,
|
26461 |
-
onInsert,
|
26462 |
-
onClickCategory,
|
26463 |
-
selectedCategory
|
26464 |
-
} = _ref3;
|
26465 |
-
const [showPatternsExplorer, setShowPatternsExplorer] = (0,external_wp_element_namespaceObject.useState)(false);
|
26466 |
const [allPatterns, allCategories] = use_patterns_state();
|
26467 |
const hasRegisteredCategory = (0,external_wp_element_namespaceObject.useCallback)(pattern => {
|
26468 |
if (!pattern.categories || !pattern.categories.length) {
|
@@ -26474,16 +26501,16 @@ function BlockPatternsTabs(_ref3) {
|
|
26474 |
|
26475 |
const populatedCategories = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
26476 |
const categories = allCategories.filter(category => allPatterns.some(pattern => {
|
26477 |
-
var _pattern$
|
26478 |
|
26479 |
-
return (_pattern$
|
26480 |
-
})).sort((
|
26481 |
let {
|
26482 |
name: currentName
|
26483 |
-
} =
|
26484 |
let {
|
26485 |
name: nextName
|
26486 |
-
} =
|
26487 |
|
26488 |
if (![currentName, nextName].includes('featured')) {
|
26489 |
return 0;
|
@@ -26501,24 +26528,149 @@ function BlockPatternsTabs(_ref3) {
|
|
26501 |
|
26502 |
return categories;
|
26503 |
}, [allPatterns, allCategories]);
|
26504 |
-
|
26505 |
-
|
26506 |
-
|
26507 |
-
|
26508 |
-
|
26509 |
-
|
26510 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26511 |
rootClientId: rootClientId,
|
26512 |
onInsert: onInsert,
|
26513 |
-
|
26514 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26515 |
}), showPatternsExplorer && (0,external_wp_element_namespaceObject.createElement)(explorer, {
|
26516 |
-
initialCategory:
|
26517 |
-
patternCategories:
|
26518 |
onModalClose: () => setShowPatternsExplorer(false)
|
26519 |
}));
|
26520 |
}
|
26521 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26522 |
/* harmony default export */ const block_patterns_tab = (BlockPatternsTabs);
|
26523 |
|
26524 |
;// CONCATENATED MODULE: external ["wp","url"]
|
@@ -26875,6 +27027,7 @@ function InserterMenu(_ref, ref) {
|
|
26875 |
const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)(__experimentalFilterValue);
|
26876 |
const [hoveredItem, setHoveredItem] = (0,external_wp_element_namespaceObject.useState)(null);
|
26877 |
const [selectedPatternCategory, setSelectedPatternCategory] = (0,external_wp_element_namespaceObject.useState)(null);
|
|
|
26878 |
const [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint] = use_insertion_point({
|
26879 |
rootClientId,
|
26880 |
clientId,
|
@@ -26929,7 +27082,7 @@ function InserterMenu(_ref, ref) {
|
|
26929 |
const patternsTab = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(block_patterns_tab, {
|
26930 |
rootClientId: destinationRootClientId,
|
26931 |
onInsert: onInsertPattern,
|
26932 |
-
|
26933 |
selectedCategory: selectedPatternCategory
|
26934 |
}), [destinationRootClientId, onInsertPattern, onClickPatternCategory, selectedPatternCategory]);
|
26935 |
const reusableBlocksTab = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(reusable_blocks_tab, {
|
@@ -26952,6 +27105,7 @@ function InserterMenu(_ref, ref) {
|
|
26952 |
searchRef.current.focus();
|
26953 |
}
|
26954 |
}));
|
|
|
26955 |
const showAsTabs = !filterValue && (showPatterns || hasReusableBlocks);
|
26956 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
26957 |
className: "block-editor-inserter__menu"
|
@@ -26984,11 +27138,16 @@ function InserterMenu(_ref, ref) {
|
|
26984 |
})), showAsTabs && (0,external_wp_element_namespaceObject.createElement)(tabs, {
|
26985 |
showPatterns: showPatterns,
|
26986 |
showReusableBlocks: hasReusableBlocks,
|
26987 |
-
prioritizePatterns: prioritizePatterns
|
|
|
26988 |
}, getCurrentTab), !filterValue && !showAsTabs && (0,external_wp_element_namespaceObject.createElement)("div", {
|
26989 |
className: "block-editor-inserter__no-tab-container"
|
26990 |
}, blocksTab)), showInserterHelpPanel && hoveredItem && (0,external_wp_element_namespaceObject.createElement)(preview_panel, {
|
26991 |
item: hoveredItem
|
|
|
|
|
|
|
|
|
26992 |
}));
|
26993 |
}
|
26994 |
|
@@ -28031,9 +28190,81 @@ function BlockPopoverInbetween(_ref) {
|
|
28031 |
|
28032 |
/* harmony default export */ const inbetween = (BlockPopoverInbetween);
|
28033 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28034 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/insertion-point.js
|
28035 |
|
28036 |
|
|
|
28037 |
/**
|
28038 |
* External dependencies
|
28039 |
*/
|
@@ -28053,16 +28284,16 @@ function BlockPopoverInbetween(_ref) {
|
|
28053 |
|
28054 |
|
28055 |
|
|
|
28056 |
const insertion_point_InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)();
|
28057 |
|
28058 |
-
function
|
28059 |
let {
|
28060 |
__unstablePopoverSlot,
|
28061 |
__unstableContentRef
|
28062 |
} = _ref;
|
28063 |
const {
|
28064 |
-
selectBlock
|
28065 |
-
hideInsertionPoint
|
28066 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
28067 |
const openRef = (0,external_wp_element_namespaceObject.useContext)(insertion_point_InsertionPointOpenRef);
|
28068 |
const ref = (0,external_wp_element_namespaceObject.useRef)();
|
@@ -28071,7 +28302,9 @@ function InsertionPointPopover(_ref) {
|
|
28071 |
previousClientId,
|
28072 |
nextClientId,
|
28073 |
rootClientId,
|
28074 |
-
isInserterShown
|
|
|
|
|
28075 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
28076 |
var _getBlockListSettings;
|
28077 |
|
@@ -28081,7 +28314,9 @@ function InsertionPointPopover(_ref) {
|
|
28081 |
getBlockInsertionPoint,
|
28082 |
isBlockBeingDragged,
|
28083 |
getPreviousBlockClientId,
|
28084 |
-
getNextBlockClientId
|
|
|
|
|
28085 |
} = select(store);
|
28086 |
const insertionPoint = getBlockInsertionPoint();
|
28087 |
const order = getBlockOrder(insertionPoint.rootClientId);
|
@@ -28101,11 +28336,14 @@ function InsertionPointPopover(_ref) {
|
|
28101 |
_nextClientId = getNextBlockClientId(_nextClientId);
|
28102 |
}
|
28103 |
|
|
|
28104 |
return {
|
28105 |
previousClientId: _previousClientId,
|
28106 |
nextClientId: _nextClientId,
|
28107 |
orientation: ((_getBlockListSettings = getBlockListSettings(insertionPoint.rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical',
|
28108 |
rootClientId: insertionPoint.rootClientId,
|
|
|
|
|
28109 |
isInserterShown: insertionPoint === null || insertionPoint === void 0 ? void 0 : insertionPoint.__unstableWithInserter
|
28110 |
};
|
28111 |
}, []);
|
@@ -28124,14 +28362,6 @@ function InsertionPointPopover(_ref) {
|
|
28124 |
if (event.target !== ref.current) {
|
28125 |
openRef.current = true;
|
28126 |
}
|
28127 |
-
}
|
28128 |
-
|
28129 |
-
function maybeHideInserterPoint(event) {
|
28130 |
-
// Only hide the inserter if it's triggered on the wrapper,
|
28131 |
-
// and the inserter is not open.
|
28132 |
-
if (event.target === ref.current && !openRef.current) {
|
28133 |
-
hideInsertionPoint();
|
28134 |
-
}
|
28135 |
} // Define animation variants for the line element.
|
28136 |
|
28137 |
|
@@ -28186,7 +28416,7 @@ function InsertionPointPopover(_ref) {
|
|
28186 |
opacity: 1,
|
28187 |
borderRadius: '2px',
|
28188 |
transition: {
|
28189 |
-
delay: isInserterShown ? 0.
|
28190 |
type: 'tween'
|
28191 |
}
|
28192 |
},
|
@@ -28194,7 +28424,7 @@ function InsertionPointPopover(_ref) {
|
|
28194 |
opacity: 1,
|
28195 |
borderRadius: '2px',
|
28196 |
transition: {
|
28197 |
-
delay: 0.
|
28198 |
type: 'tween'
|
28199 |
}
|
28200 |
}
|
@@ -28206,10 +28436,16 @@ function InsertionPointPopover(_ref) {
|
|
28206 |
rest: {
|
28207 |
scale: 1,
|
28208 |
transition: {
|
|
|
28209 |
type: 'tween'
|
28210 |
}
|
28211 |
}
|
28212 |
};
|
|
|
|
|
|
|
|
|
|
|
28213 |
const className = classnames_default()('block-editor-block-list__insertion-point', 'is-' + orientation);
|
28214 |
return (0,external_wp_element_namespaceObject.createElement)(inbetween, {
|
28215 |
previousClientId: previousClientId,
|
@@ -28229,8 +28465,7 @@ function InsertionPointPopover(_ref) {
|
|
28229 |
onFocus: onFocus,
|
28230 |
className: classnames_default()(className, {
|
28231 |
'is-with-inserter': isInserterShown
|
28232 |
-
})
|
28233 |
-
onHoverEnd: maybeHideInserterPoint
|
28234 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
|
28235 |
variants: lineVariants,
|
28236 |
className: "block-editor-block-list__insertion-point-indicator",
|
@@ -28253,10 +28488,33 @@ function InsertionPointPopover(_ref) {
|
|
28253 |
}
|
28254 |
|
28255 |
function InsertionPoint(props) {
|
28256 |
-
const
|
28257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28258 |
}, []);
|
28259 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28260 |
}
|
28261 |
|
28262 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-in-between-inserter.js
|
@@ -28274,7 +28532,7 @@ function InsertionPoint(props) {
|
|
28274 |
|
28275 |
function useInBetweenInserter() {
|
28276 |
const openRef = (0,external_wp_element_namespaceObject.useContext)(insertion_point_InsertionPointOpenRef);
|
28277 |
-
const isInBetweenInserterDisabled = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().
|
28278 |
const {
|
28279 |
getBlockListSettings,
|
28280 |
getBlockRootClientId,
|
@@ -28289,9 +28547,6 @@ function useInBetweenInserter() {
|
|
28289 |
showInsertionPoint,
|
28290 |
hideInsertionPoint
|
28291 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
28292 |
-
const delayedShowInsertionPoint = (0,external_wp_compose_namespaceObject.useDebounce)(showInsertionPoint, 500, {
|
28293 |
-
trailing: true
|
28294 |
-
});
|
28295 |
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
|
28296 |
if (isInBetweenInserterDisabled) {
|
28297 |
return;
|
@@ -28309,12 +28564,7 @@ function useInBetweenInserter() {
|
|
28309 |
}
|
28310 |
|
28311 |
if (!event.target.classList.contains('block-editor-block-list__layout')) {
|
28312 |
-
|
28313 |
-
|
28314 |
-
if (isBlockInsertionPointVisible()) {
|
28315 |
-
hideInsertionPoint();
|
28316 |
-
}
|
28317 |
-
|
28318 |
return;
|
28319 |
}
|
28320 |
|
@@ -28340,6 +28590,7 @@ function useInBetweenInserter() {
|
|
28340 |
});
|
28341 |
|
28342 |
if (!element) {
|
|
|
28343 |
return;
|
28344 |
} // The block may be in an alignment wrapper, so check the first direct
|
28345 |
// child if the element has no ID.
|
@@ -28349,6 +28600,7 @@ function useInBetweenInserter() {
|
|
28349 |
element = element.firstElementChild;
|
28350 |
|
28351 |
if (!element) {
|
|
|
28352 |
return;
|
28353 |
}
|
28354 |
} // Don't show the insertion point if a parent block has an "overlay"
|
@@ -28370,12 +28622,7 @@ function useInBetweenInserter() {
|
|
28370 |
const elementRect = element.getBoundingClientRect();
|
28371 |
|
28372 |
if (orientation === 'horizontal' && (event.clientY > elementRect.bottom || event.clientY < elementRect.top) || orientation === 'vertical' && (event.clientX > elementRect.right || event.clientX < elementRect.left)) {
|
28373 |
-
|
28374 |
-
|
28375 |
-
if (isBlockInsertionPointVisible()) {
|
28376 |
-
hideInsertionPoint();
|
28377 |
-
}
|
28378 |
-
|
28379 |
return;
|
28380 |
}
|
28381 |
|
@@ -28383,16 +28630,11 @@ function useInBetweenInserter() {
|
|
28383 |
// the list (preserves the original behaviour).
|
28384 |
|
28385 |
if (index === 0) {
|
28386 |
-
|
28387 |
-
|
28388 |
-
if (isBlockInsertionPointVisible()) {
|
28389 |
-
hideInsertionPoint();
|
28390 |
-
}
|
28391 |
-
|
28392 |
return;
|
28393 |
}
|
28394 |
|
28395 |
-
|
28396 |
__unstableWithInserter: true
|
28397 |
});
|
28398 |
}
|
@@ -28435,8 +28677,25 @@ const cancelIdleCallback = (() => {
|
|
28435 |
})();
|
28436 |
|
28437 |
function usePreParsePatterns() {
|
28438 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28439 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
|
|
|
|
|
|
|
|
28440 |
if (!(patterns !== null && patterns !== void 0 && patterns.length)) {
|
28441 |
return;
|
28442 |
}
|
@@ -28458,7 +28717,7 @@ function usePreParsePatterns() {
|
|
28458 |
|
28459 |
handle = requestIdleCallback(callback);
|
28460 |
return () => cancelIdleCallback(handle);
|
28461 |
-
}, [patterns]);
|
28462 |
return null;
|
28463 |
}
|
28464 |
|
@@ -28851,36 +29110,6 @@ const BlockDraggable = _ref => {
|
|
28851 |
|
28852 |
/* harmony default export */ const block_draggable = (BlockDraggable);
|
28853 |
|
28854 |
-
;// CONCATENATED MODULE: ./packages/icons/build-module/library/chevron-right.js
|
28855 |
-
|
28856 |
-
|
28857 |
-
/**
|
28858 |
-
* WordPress dependencies
|
28859 |
-
*/
|
28860 |
-
|
28861 |
-
const chevronRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
28862 |
-
xmlns: "http://www.w3.org/2000/svg",
|
28863 |
-
viewBox: "0 0 24 24"
|
28864 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
28865 |
-
d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
|
28866 |
-
}));
|
28867 |
-
/* harmony default export */ const chevron_right = (chevronRight);
|
28868 |
-
|
28869 |
-
;// CONCATENATED MODULE: ./packages/icons/build-module/library/chevron-left.js
|
28870 |
-
|
28871 |
-
|
28872 |
-
/**
|
28873 |
-
* WordPress dependencies
|
28874 |
-
*/
|
28875 |
-
|
28876 |
-
const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
28877 |
-
xmlns: "http://www.w3.org/2000/svg",
|
28878 |
-
viewBox: "0 0 24 24"
|
28879 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
28880 |
-
d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
|
28881 |
-
}));
|
28882 |
-
/* harmony default export */ const chevron_left = (chevronLeft);
|
28883 |
-
|
28884 |
;// CONCATENATED MODULE: ./packages/icons/build-module/library/chevron-up.js
|
28885 |
|
28886 |
|
@@ -30015,7 +30244,7 @@ function BlockParentSelector() {
|
|
30015 |
const {
|
30016 |
firstParentClientId,
|
30017 |
shouldHide,
|
30018 |
-
|
30019 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
30020 |
const {
|
30021 |
getBlockName,
|
@@ -30037,7 +30266,7 @@ function BlockParentSelector() {
|
|
30037 |
return {
|
30038 |
firstParentClientId: _firstParentClientId,
|
30039 |
shouldHide: !hasBlockSupport(_parentBlockType, '__experimentalParentSelector', true),
|
30040 |
-
|
30041 |
};
|
30042 |
}, []);
|
30043 |
const blockInformation = useBlockDisplayInformation(firstParentClientId); // Allows highlighting the parent block outline when focusing or hovering
|
@@ -30050,7 +30279,7 @@ function BlockParentSelector() {
|
|
30050 |
ref: nodeRef,
|
30051 |
|
30052 |
onChange(isFocused) {
|
30053 |
-
if (isFocused &&
|
30054 |
return;
|
30055 |
}
|
30056 |
|
@@ -31888,7 +32117,9 @@ const lock = (0,external_wp_element_namespaceObject.createElement)(external_wp_p
|
|
31888 |
|
31889 |
|
31890 |
|
|
|
31891 |
|
|
|
31892 |
|
31893 |
function getTemplateLockValue(lock) {
|
31894 |
// Prevents all operations.
|
@@ -31919,7 +32150,7 @@ function BlockLockModal(_ref) {
|
|
31919 |
canRemove
|
31920 |
} = useBlockLock(clientId);
|
31921 |
const {
|
31922 |
-
|
31923 |
templateLock,
|
31924 |
hasTemplateLock
|
31925 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
@@ -31932,7 +32163,7 @@ function BlockLockModal(_ref) {
|
|
31932 |
const blockName = getBlockName(clientId);
|
31933 |
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
|
31934 |
return {
|
31935 |
-
|
31936 |
templateLock: (_getBlockAttributes = getBlockAttributes(clientId)) === null || _getBlockAttributes === void 0 ? void 0 : _getBlockAttributes.templateLock,
|
31937 |
hasTemplateLock: !!(blockType !== null && blockType !== void 0 && (_blockType$attributes = blockType.attributes) !== null && _blockType$attributes !== void 0 && _blockType$attributes.templateLock)
|
31938 |
};
|
@@ -31947,11 +32178,11 @@ function BlockLockModal(_ref) {
|
|
31947 |
setLock({
|
31948 |
move: !canMove,
|
31949 |
remove: !canRemove,
|
31950 |
-
...(
|
31951 |
edit: !canEdit
|
31952 |
} : {})
|
31953 |
});
|
31954 |
-
}, [canEdit, canMove, canRemove,
|
31955 |
const isAllChecked = Object.values(lock).every(Boolean);
|
31956 |
const isMixed = Object.values(lock).some(Boolean) && !isAllChecked;
|
31957 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
|
@@ -31984,13 +32215,13 @@ function BlockLockModal(_ref) {
|
|
31984 |
onChange: newValue => setLock({
|
31985 |
move: newValue,
|
31986 |
remove: newValue,
|
31987 |
-
...(
|
31988 |
edit: newValue
|
31989 |
} : {})
|
31990 |
})
|
31991 |
}), (0,external_wp_element_namespaceObject.createElement)("ul", {
|
31992 |
className: "block-editor-block-lock-modal__checklist"
|
31993 |
-
},
|
31994 |
className: "block-editor-block-lock-modal__checklist-item"
|
31995 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
31996 |
label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Restrict editing'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
|
@@ -32244,7 +32475,7 @@ function BlockSettingsDropdown(_ref2) {
|
|
32244 |
const firstBlockClientId = blockClientIds[0];
|
32245 |
const {
|
32246 |
firstParentClientId,
|
32247 |
-
|
32248 |
onlyBlock,
|
32249 |
parentBlockType,
|
32250 |
previousBlockClientId,
|
@@ -32254,20 +32485,26 @@ function BlockSettingsDropdown(_ref2) {
|
|
32254 |
const {
|
32255 |
getBlockCount,
|
32256 |
getBlockName,
|
32257 |
-
|
32258 |
getPreviousBlockClientId,
|
32259 |
getNextBlockClientId,
|
32260 |
getSelectedBlockClientIds,
|
32261 |
-
getSettings
|
|
|
32262 |
} = select(store);
|
32263 |
-
const
|
32264 |
-
|
32265 |
-
|
|
|
|
|
|
|
|
|
|
|
32266 |
return {
|
32267 |
firstParentClientId: _firstParentClientId,
|
32268 |
-
|
32269 |
-
onlyBlock: 1 === getBlockCount(),
|
32270 |
-
parentBlockType: (0,external_wp_blocks_namespaceObject.getBlockType)(parentBlockName),
|
32271 |
previousBlockClientId: getPreviousBlockClientId(firstBlockClientId),
|
32272 |
nextBlockClientId: getNextBlockClientId(firstBlockClientId),
|
32273 |
selectedBlockClientIds: getSelectedBlockClientIds()
|
@@ -32323,7 +32560,7 @@ function BlockSettingsDropdown(_ref2) {
|
|
32323 |
ref: selectParentButtonRef,
|
32324 |
|
32325 |
onChange(isFocused) {
|
32326 |
-
if (isFocused &&
|
32327 |
return;
|
32328 |
}
|
32329 |
|
@@ -32362,7 +32599,7 @@ function BlockSettingsDropdown(_ref2) {
|
|
32362 |
fillProps: {
|
32363 |
onClose
|
32364 |
}
|
32365 |
-
}), firstParentClientId
|
32366 |
ref: selectParentButtonRef,
|
32367 |
icon: (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
32368 |
icon: parentBlockType.icon
|
@@ -32732,7 +32969,7 @@ const BlockToolbar = _ref => {
|
|
32732 |
blockClientId,
|
32733 |
blockType,
|
32734 |
hasFixedToolbar,
|
32735 |
-
|
32736 |
isValid,
|
32737 |
isVisual,
|
32738 |
isContentLocked
|
@@ -32755,7 +32992,7 @@ const BlockToolbar = _ref => {
|
|
32755 |
blockClientId: selectedBlockClientId,
|
32756 |
blockType: selectedBlockClientId && (0,external_wp_blocks_namespaceObject.getBlockType)(getBlockName(selectedBlockClientId)),
|
32757 |
hasFixedToolbar: settings.hasFixedToolbar,
|
32758 |
-
|
32759 |
rootClientId: blockRootClientId,
|
32760 |
isValid: selectedBlockClientIds.every(id => isBlockValid(id)),
|
32761 |
isVisual: selectedBlockClientIds.every(id => getBlockMode(id) === 'visual'),
|
@@ -32775,7 +33012,7 @@ const BlockToolbar = _ref => {
|
|
32775 |
ref: nodeRef,
|
32776 |
|
32777 |
onChange(isFocused) {
|
32778 |
-
if (isFocused &&
|
32779 |
return;
|
32780 |
}
|
32781 |
|
@@ -32814,7 +33051,7 @@ const BlockToolbar = _ref => {
|
|
32814 |
clientId: blockClientIds[0]
|
32815 |
}), (0,external_wp_element_namespaceObject.createElement)(block_mover, {
|
32816 |
clientIds: blockClientIds,
|
32817 |
-
hideDragHandle: hideDragHandle
|
32818 |
}))), shouldShowVisualToolbar && isMultiToolbar && (0,external_wp_element_namespaceObject.createElement)(toolbar, null), shouldShowVisualToolbar && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, {
|
32819 |
group: "parent",
|
32820 |
className: "block-editor-block-toolbar__slot"
|
@@ -33089,6 +33326,7 @@ function selected_block_popover_selector(select) {
|
|
33089 |
isMultiSelecting: isMultiSelecting(),
|
33090 |
isTyping: isTyping(),
|
33091 |
hasFixedToolbar: getSettings().hasFixedToolbar,
|
|
|
33092 |
lastClientId: hasMultiSelection() ? getLastMultiSelectedBlockClientId() : null
|
33093 |
};
|
33094 |
}
|
@@ -33098,6 +33336,8 @@ function SelectedBlockPopover(_ref) {
|
|
33098 |
clientId,
|
33099 |
rootClientId,
|
33100 |
isEmptyDefaultBlock,
|
|
|
|
|
33101 |
capturingClientId,
|
33102 |
__unstablePopoverSlot,
|
33103 |
__unstableContentRef
|
@@ -33107,6 +33347,7 @@ function SelectedBlockPopover(_ref) {
|
|
33107 |
isMultiSelecting,
|
33108 |
isTyping,
|
33109 |
hasFixedToolbar,
|
|
|
33110 |
lastClientId
|
33111 |
} = (0,external_wp_data_namespaceObject.useSelect)(selected_block_popover_selector, []);
|
33112 |
const isInsertionPointVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
@@ -33132,7 +33373,7 @@ function SelectedBlockPopover(_ref) {
|
|
33132 |
const showEmptyBlockSideInserter = !isTyping && editorMode === 'edit' && isEmptyDefaultBlock;
|
33133 |
const shouldShowBreadcrumb = editorMode === 'navigation' || editorMode === 'zoom-out';
|
33134 |
const shouldShowContextualToolbar = editorMode === 'edit' && !hasFixedToolbar && isLargeViewport && !isMultiSelecting && !showEmptyBlockSideInserter && !isTyping;
|
33135 |
-
const canFocusHiddenToolbar = editorMode === 'edit' && !shouldShowContextualToolbar && !hasFixedToolbar && !isEmptyDefaultBlock;
|
33136 |
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', () => {
|
33137 |
isToolbarForced.current = true;
|
33138 |
stopTyping(true);
|
@@ -33163,7 +33404,7 @@ function SelectedBlockPopover(_ref) {
|
|
33163 |
__unstablePopoverSlot: __unstablePopoverSlot,
|
33164 |
__unstableContentRef: __unstableContentRef,
|
33165 |
resize: false
|
33166 |
-
}, popoverProps), shouldShowContextualToolbar && (0,external_wp_element_namespaceObject.createElement)(block_contextual_toolbar // If the toolbar is being shown because of being forced
|
33167 |
// it should focus the toolbar right after the mount.
|
33168 |
, {
|
33169 |
focusOnMount: isToolbarForced.current,
|
@@ -33187,6 +33428,8 @@ function wrapperSelector(select) {
|
|
33187 |
getBlockRootClientId,
|
33188 |
getBlock,
|
33189 |
getBlockParents,
|
|
|
|
|
33190 |
__experimentalGetBlockListSettingsForBlocks
|
33191 |
} = select(store);
|
33192 |
const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
|
@@ -33209,10 +33452,13 @@ function wrapperSelector(select) {
|
|
33209 |
|
33210 |
return (_parentBlockListSetti = parentBlockListSettings[parentClientId]) === null || _parentBlockListSetti === void 0 ? void 0 : _parentBlockListSetti.__experimentalCaptureToolbars;
|
33211 |
});
|
|
|
33212 |
return {
|
33213 |
clientId,
|
33214 |
rootClientId: getBlockRootClientId(clientId),
|
33215 |
name,
|
|
|
|
|
33216 |
isEmptyDefaultBlock: name && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)({
|
33217 |
name,
|
33218 |
attributes
|
@@ -33237,7 +33483,9 @@ function WrappedBlockPopover(_ref2) {
|
|
33237 |
rootClientId,
|
33238 |
name,
|
33239 |
isEmptyDefaultBlock,
|
33240 |
-
capturingClientId
|
|
|
|
|
33241 |
} = selected;
|
33242 |
|
33243 |
if (!name) {
|
@@ -33248,6 +33496,7 @@ function WrappedBlockPopover(_ref2) {
|
|
33248 |
clientId: clientId,
|
33249 |
rootClientId: rootClientId,
|
33250 |
isEmptyDefaultBlock: isEmptyDefaultBlock,
|
|
|
33251 |
capturingClientId: capturingClientId,
|
33252 |
__unstablePopoverSlot: __unstablePopoverSlot,
|
33253 |
__unstableContentRef: __unstableContentRef
|
@@ -33282,7 +33531,8 @@ function BlockToolsBackCompat(_ref) {
|
|
33282 |
|
33283 |
external_wp_deprecated_default()('wp.components.Popover.Slot name="block-toolbar"', {
|
33284 |
alternative: 'wp.blockEditor.BlockTools',
|
33285 |
-
since: '5.8'
|
|
|
33286 |
});
|
33287 |
return (0,external_wp_element_namespaceObject.createElement)(InsertionPoint, {
|
33288 |
__unstablePopoverSlot: "block-toolbar"
|
@@ -33536,7 +33786,8 @@ function useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultB
|
|
33536 |
|
33537 |
function useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection) {
|
33538 |
const {
|
33539 |
-
getSelectedBlocksInitialCaretPosition
|
|
|
33540 |
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
33541 |
const {
|
33542 |
replaceInnerBlocks
|
@@ -33567,7 +33818,7 @@ function useInnerBlockTemplateSync(clientId, template, templateLock, templateIns
|
|
33567 |
const nextBlocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(currentInnerBlocks, template);
|
33568 |
|
33569 |
if (!(0,external_lodash_namespaceObject.isEqual)(nextBlocks, currentInnerBlocks)) {
|
33570 |
-
replaceInnerBlocks(clientId, nextBlocks, currentInnerBlocks.length === 0 && templateInsertUpdatesSelection && nextBlocks.length !== 0, // This ensures the "initialPosition" doesn't change when applying the template
|
33571 |
// If we're supposed to focus the block, we'll focus the first inner block
|
33572 |
// otherwise, we won't apply any auto-focus.
|
33573 |
// This ensures for instance that the focus stays in the inserter when inserting the "buttons" block.
|
@@ -33630,6 +33881,8 @@ function getBlockContext(attributes, blockType) {
|
|
33630 |
|
33631 |
/** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */
|
33632 |
|
|
|
|
|
33633 |
/**
|
33634 |
* Retrieve the data for a block drop event.
|
33635 |
*
|
@@ -33764,20 +34017,18 @@ function onHTMLDrop(targetRootClientId, targetBlockIndex, insertOrReplaceBlocks)
|
|
33764 |
/**
|
33765 |
* A React hook for handling block drop events.
|
33766 |
*
|
33767 |
-
* @
|
33768 |
-
*
|
33769 |
-
* @param {
|
33770 |
-
* @param {
|
33771 |
-
* @param {Object} options The optional options.
|
33772 |
-
* @param {DropAction} options.action The type of action to perform on drop. Could be `insert` or `replace` for now.
|
33773 |
*
|
33774 |
-
* @return {
|
33775 |
*/
|
33776 |
|
33777 |
function useOnBlockDrop(targetRootClientId, targetBlockIndex) {
|
33778 |
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
33779 |
const {
|
33780 |
-
|
33781 |
} = options;
|
33782 |
const hasUploadPermissions = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().mediaUpload, []);
|
33783 |
const {
|
@@ -33800,16 +34051,16 @@ function useOnBlockDrop(targetRootClientId, targetBlockIndex) {
|
|
33800 |
let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
33801 |
let initialPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
33802 |
|
33803 |
-
if (
|
33804 |
const clientIds = getBlockOrder(targetRootClientId);
|
33805 |
const clientId = clientIds[targetBlockIndex];
|
33806 |
replaceBlocks(clientId, blocks, undefined, initialPosition);
|
33807 |
} else {
|
33808 |
insertBlocks(blocks, targetBlockIndex, targetRootClientId, updateSelection, initialPosition);
|
33809 |
}
|
33810 |
-
}, [
|
33811 |
const moveBlocks = (0,external_wp_element_namespaceObject.useCallback)((sourceClientIds, sourceRootClientId, insertIndex) => {
|
33812 |
-
if (
|
33813 |
const sourceBlocks = getBlocksByClientId(sourceClientIds);
|
33814 |
const targetBlockClientIds = getBlockOrder(targetRootClientId);
|
33815 |
const targetBlockClientId = targetBlockClientIds[targetBlockIndex];
|
@@ -33822,7 +34073,7 @@ function useOnBlockDrop(targetRootClientId, targetBlockIndex) {
|
|
33822 |
} else {
|
33823 |
moveBlocksToPosition(sourceClientIds, sourceRootClientId, targetRootClientId, insertIndex);
|
33824 |
}
|
33825 |
-
}, [
|
33826 |
|
33827 |
const _onDrop = onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getClientIdsOfDescendants, moveBlocks, insertOrReplaceBlocks, clearSelectedBlock);
|
33828 |
|
@@ -33932,6 +34183,18 @@ function getDistanceToNearestEdge(point, rect) {
|
|
33932 |
});
|
33933 |
return [candidateDistance, candidateEdge];
|
33934 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33935 |
|
33936 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/use-block-drop-zone/index.js
|
33937 |
/**
|
@@ -33941,6 +34204,7 @@ function getDistanceToNearestEdge(point, rect) {
|
|
33941 |
|
33942 |
|
33943 |
|
|
|
33944 |
/**
|
33945 |
* Internal dependencies
|
33946 |
*/
|
@@ -33950,6 +34214,8 @@ function getDistanceToNearestEdge(point, rect) {
|
|
33950 |
|
33951 |
/** @typedef {import('../../utils/math').WPPoint} WPPoint */
|
33952 |
|
|
|
|
|
33953 |
/**
|
33954 |
* The orientation of a block list.
|
33955 |
*
|
@@ -33957,48 +34223,70 @@ function getDistanceToNearestEdge(point, rect) {
|
|
33957 |
*/
|
33958 |
|
33959 |
/**
|
33960 |
-
*
|
33961 |
-
* at.
|
33962 |
*
|
33963 |
-
* @
|
33964 |
-
|
33965 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33966 |
*
|
33967 |
-
* @
|
|
|
|
|
|
|
33968 |
*/
|
33969 |
|
33970 |
-
function
|
|
|
|
|
|
|
33971 |
const allowedEdges = orientation === 'horizontal' ? ['left', 'right'] : ['top', 'bottom'];
|
33972 |
const isRightToLeft = (0,external_wp_i18n_namespaceObject.isRTL)();
|
33973 |
-
let
|
33974 |
-
let
|
33975 |
-
|
33976 |
-
|
33977 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
33978 |
|
33979 |
-
if (
|
33980 |
-
|
33981 |
-
|
33982 |
-
// Take RTL languages into account where the left edge is
|
33983 |
-
// the trailing edge.
|
33984 |
-
const isTrailingEdge = edge === 'bottom' || !isRightToLeft && edge === 'right' || isRightToLeft && edge === 'left';
|
33985 |
-
const offset = isTrailingEdge ? 1 : 0; // Update the currently known best candidate.
|
33986 |
|
33987 |
-
|
33988 |
-
|
|
|
|
|
|
|
|
|
33989 |
}
|
33990 |
});
|
33991 |
-
|
33992 |
-
|
33993 |
-
|
33994 |
-
|
33995 |
-
|
33996 |
-
|
33997 |
-
|
33998 |
-
|
|
|
|
|
33999 |
|
34000 |
-
|
34001 |
-
return
|
34002 |
}
|
34003 |
/**
|
34004 |
* @typedef {Object} WPBlockDropZoneConfig
|
@@ -34011,7 +34299,6 @@ function isEmptyParagraph(element) {
|
|
34011 |
* @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone.
|
34012 |
*/
|
34013 |
|
34014 |
-
|
34015 |
function useBlockDropZone() {
|
34016 |
let {
|
34017 |
// An undefined value represents a top-level block. Default to an empty
|
@@ -34020,7 +34307,10 @@ function useBlockDropZone() {
|
|
34020 |
// an empty string to represent top-level blocks.
|
34021 |
rootClientId: targetRootClientId = ''
|
34022 |
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
34023 |
-
const [
|
|
|
|
|
|
|
34024 |
const isDisabled = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
34025 |
const {
|
34026 |
getTemplateLock,
|
@@ -34031,35 +34321,50 @@ function useBlockDropZone() {
|
|
34031 |
return ['all', 'contentOnly'].some(lock => lock === templateLock) || __unstableHasActiveBlockOverlayActive(targetRootClientId) || __unstableIsWithinBlockOverlay(targetRootClientId);
|
34032 |
}, [targetRootClientId]);
|
34033 |
const {
|
34034 |
-
getBlockListSettings
|
|
|
|
|
34035 |
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
34036 |
const {
|
34037 |
showInsertionPoint,
|
34038 |
hideInsertionPoint
|
34039 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
34040 |
-
const onBlockDrop = useOnBlockDrop(targetRootClientId,
|
34041 |
-
|
|
|
|
|
34042 |
var _getBlockListSettings;
|
34043 |
|
34044 |
-
const
|
34045 |
-
|
34046 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34047 |
x: event.clientX,
|
34048 |
y: event.clientY
|
34049 |
}, (_getBlockListSettings = getBlockListSettings(targetRootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation);
|
34050 |
-
|
34051 |
-
|
34052 |
-
|
34053 |
-
|
34054 |
-
|
34055 |
-
|
34056 |
-
|
34057 |
-
|
34058 |
-
}
|
34059 |
-
|
34060 |
-
showInsertionPoint(targetRootClientId, targetIndex);
|
34061 |
-
}
|
34062 |
-
}, []), 200);
|
34063 |
return (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
|
34064 |
isDisabled,
|
34065 |
onDrop: onBlockDrop,
|
@@ -34068,19 +34373,17 @@ function useBlockDropZone() {
|
|
34068 |
// `currentTarget` is only available while the event is being
|
34069 |
// handled, so get it now and pass it to the thottled function.
|
34070 |
// https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget
|
34071 |
-
throttled(event, event.currentTarget);
|
34072 |
},
|
34073 |
|
34074 |
onDragLeave() {
|
34075 |
throttled.cancel();
|
34076 |
hideInsertionPoint();
|
34077 |
-
setTargetBlockIndex(null);
|
34078 |
},
|
34079 |
|
34080 |
onDragEnd() {
|
34081 |
throttled.cancel();
|
34082 |
hideInsertionPoint();
|
34083 |
-
setTargetBlockIndex(null);
|
34084 |
}
|
34085 |
|
34086 |
});
|
@@ -35876,7 +36179,7 @@ function ColorGradientControlSelect(props) {
|
|
35876 |
}
|
35877 |
|
35878 |
function ColorGradientControl(props) {
|
35879 |
-
if (
|
35880 |
return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlInner, props);
|
35881 |
}
|
35882 |
|
@@ -37702,6 +38005,252 @@ function FontSizePicker(props) {
|
|
37702 |
|
37703 |
/* harmony default export */ const font_size_picker = (FontSizePicker);
|
37704 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37705 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/font-size.js
|
37706 |
|
37707 |
|
@@ -37712,6 +38261,7 @@ function FontSizePicker(props) {
|
|
37712 |
|
37713 |
|
37714 |
|
|
|
37715 |
/**
|
37716 |
* Internal dependencies
|
37717 |
*/
|
@@ -37720,6 +38270,7 @@ function FontSizePicker(props) {
|
|
37720 |
|
37721 |
|
37722 |
|
|
|
37723 |
const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
|
37724 |
/**
|
37725 |
* Filters registered block settings, extending attributes to include
|
@@ -37954,11 +38505,67 @@ function font_size_addTransforms(result, source, index, results) {
|
|
37954 |
};
|
37955 |
return transformStyles(activeSupports, font_size_MIGRATION_PATHS, result, source, index, results);
|
37956 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37957 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes);
|
37958 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/font/addSaveProps', font_size_addSaveProps);
|
37959 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addEditProps', font_size_addEditProps);
|
37960 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles);
|
37961 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/font-size/addTransforms', font_size_addTransforms);
|
|
|
|
|
|
|
37962 |
|
37963 |
;// CONCATENATED MODULE: ./packages/icons/build-module/library/reset.js
|
37964 |
|
@@ -38712,7 +39319,6 @@ function useIsTypographyDisabled() {
|
|
38712 |
* External dependencies
|
38713 |
*/
|
38714 |
|
38715 |
-
|
38716 |
/**
|
38717 |
* WordPress dependencies
|
38718 |
*/
|
@@ -38825,6 +39431,128 @@ const skipSerializationPathsSave = { ...skipSerializationPathsEdit,
|
|
38825 |
const renamedFeatures = {
|
38826 |
gradients: 'gradient'
|
38827 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38828 |
/**
|
38829 |
* Override props assigned to save component to inject the CSS variables definition.
|
38830 |
*
|
@@ -38851,13 +39579,13 @@ function style_addSaveProps(props, blockType, attributes) {
|
|
38851 |
const skipSerialization = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, indicator);
|
38852 |
|
38853 |
if (skipSerialization === true) {
|
38854 |
-
style = (
|
38855 |
}
|
38856 |
|
38857 |
if (Array.isArray(skipSerialization)) {
|
38858 |
skipSerialization.forEach(featureName => {
|
38859 |
const feature = renamedFeatures[featureName] || featureName;
|
38860 |
-
style = (
|
38861 |
});
|
38862 |
}
|
38863 |
});
|
@@ -40131,6 +40859,7 @@ function getSpacingClassesAndStyles(attributes) {
|
|
40131 |
*/
|
40132 |
|
40133 |
|
|
|
40134 |
// This utility is intended to assist where the serialization of the typography
|
40135 |
// block support is being skipped for a block but the typography related CSS
|
40136 |
// styles still need to be generated so they can be applied to inner elements.
|
@@ -40139,15 +40868,27 @@ function getSpacingClassesAndStyles(attributes) {
|
|
40139 |
* Provides the CSS class names and inline styles for a block's typography support
|
40140 |
* attributes.
|
40141 |
*
|
40142 |
-
* @param {Object}
|
|
|
40143 |
*
|
40144 |
* @return {Object} Typography block support derived CSS classes & styles.
|
40145 |
*/
|
40146 |
|
40147 |
-
function getTypographyClassesAndStyles(attributes) {
|
40148 |
var _attributes$style;
|
40149 |
|
40150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40151 |
const style = getInlineStyles({
|
40152 |
typography: typographyStyles
|
40153 |
});
|
@@ -40592,6 +41333,7 @@ const with_font_sizes_upperFirst = _ref => {
|
|
40592 |
|
40593 |
|
40594 |
|
|
|
40595 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/duotone/index.js
|
40596 |
|
40597 |
|
@@ -42448,18 +43190,6 @@ function useListViewClientIds(blocks) {
|
|
42448 |
* 'inside' refers to nesting as an inner block.
|
42449 |
*/
|
42450 |
|
42451 |
-
/**
|
42452 |
-
* Is the point contained by the rectangle.
|
42453 |
-
*
|
42454 |
-
* @param {WPPoint} point The point.
|
42455 |
-
* @param {DOMRect} rect The rectangle.
|
42456 |
-
*
|
42457 |
-
* @return {boolean} True if the point is contained by the rectangle, false otherwise.
|
42458 |
-
*/
|
42459 |
-
|
42460 |
-
function isPointContainedByRect(point, rect) {
|
42461 |
-
return rect.left <= point.x && rect.right >= point.x && rect.top <= point.y && rect.bottom >= point.y;
|
42462 |
-
}
|
42463 |
/**
|
42464 |
* Determines whether the user positioning the dragged block to nest as an
|
42465 |
* inner block.
|
@@ -42471,7 +43201,6 @@ function isPointContainedByRect(point, rect) {
|
|
42471 |
* @param {DOMRect} rect The rectangle.
|
42472 |
*/
|
42473 |
|
42474 |
-
|
42475 |
function isNestingGesture(point, rect) {
|
42476 |
const blockCenterX = rect.left + rect.width / 2;
|
42477 |
return point.x > blockCenterX;
|
@@ -43002,6 +43731,7 @@ function BlockStylesPreviewPanel(_ref) {
|
|
43002 |
|
43003 |
|
43004 |
|
|
|
43005 |
/**
|
43006 |
* Internal dependencies
|
43007 |
*/
|
@@ -43009,41 +43739,15 @@ function BlockStylesPreviewPanel(_ref) {
|
|
43009 |
|
43010 |
|
43011 |
|
43012 |
-
function BlockStylesPreviewPanelSlot(_ref) {
|
43013 |
-
let {
|
43014 |
-
scope
|
43015 |
-
} = _ref;
|
43016 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, {
|
43017 |
-
name: `BlockStylesPreviewPanel/${scope}`
|
43018 |
-
});
|
43019 |
-
}
|
43020 |
-
|
43021 |
-
function BlockStylesPreviewPanelFill(_ref2) {
|
43022 |
-
let {
|
43023 |
-
children,
|
43024 |
-
scope,
|
43025 |
-
...props
|
43026 |
-
} = _ref2;
|
43027 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
|
43028 |
-
name: `BlockStylesPreviewPanel/${scope}`
|
43029 |
-
}, (0,external_wp_element_namespaceObject.createElement)("div", props, children));
|
43030 |
-
} // Top position (in px) of the Block Styles container
|
43031 |
-
// relative to the editor pane.
|
43032 |
-
// The value is the equivalent of the container's right position.
|
43033 |
-
|
43034 |
-
|
43035 |
-
const DEFAULT_POSITION_TOP = 16;
|
43036 |
-
|
43037 |
const block_styles_noop = () => {}; // Block Styles component for the Settings Sidebar.
|
43038 |
|
43039 |
|
43040 |
-
function BlockStyles(
|
43041 |
let {
|
43042 |
clientId,
|
43043 |
onSwitch = block_styles_noop,
|
43044 |
-
onHoverClassName = block_styles_noop
|
43045 |
-
|
43046 |
-
} = _ref3;
|
43047 |
const {
|
43048 |
onSelect,
|
43049 |
stylesToRender,
|
@@ -43055,13 +43759,7 @@ function BlockStyles(_ref3) {
|
|
43055 |
onSwitch
|
43056 |
});
|
43057 |
const [hoveredStyle, setHoveredStyle] = (0,external_wp_element_namespaceObject.useState)(null);
|
43058 |
-
const [containerScrollTop, setContainerScrollTop] = (0,external_wp_element_namespaceObject.useState)(0);
|
43059 |
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
|
43060 |
-
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
|
43061 |
-
const scrollContainer = document.querySelector('.interface-interface-skeleton__content');
|
43062 |
-
const scrollTop = (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollTop) || 0;
|
43063 |
-
setContainerScrollTop(scrollTop + DEFAULT_POSITION_TOP);
|
43064 |
-
}, [hoveredStyle]);
|
43065 |
|
43066 |
if (!stylesToRender || stylesToRender.length === 0) {
|
43067 |
return null;
|
@@ -43111,24 +43809,30 @@ function BlockStyles(_ref3) {
|
|
43111 |
numberOfLines: 1,
|
43112 |
className: "block-editor-block-styles__item-text"
|
43113 |
}, buttonText));
|
43114 |
-
})), hoveredStyle && !isMobileViewport && (0,external_wp_element_namespaceObject.createElement)(
|
43115 |
-
|
|
|
|
|
43116 |
className: "block-editor-block-styles__preview-panel",
|
43117 |
-
style: {
|
43118 |
-
top: containerScrollTop
|
43119 |
-
},
|
43120 |
onMouseLeave: () => styleItemHandler(null)
|
43121 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockStylesPreviewPanel, {
|
43122 |
activeStyle: activeStyle,
|
43123 |
className: previewClassName,
|
43124 |
genericPreviewBlock: genericPreviewBlock,
|
43125 |
style: hoveredStyle
|
43126 |
-
})));
|
43127 |
}
|
43128 |
|
43129 |
-
BlockStyles.Slot = BlockStylesPreviewPanelSlot;
|
43130 |
/* harmony default export */ const block_styles = (BlockStyles);
|
43131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43132 |
;// CONCATENATED MODULE: ./packages/icons/build-module/library/layout.js
|
43133 |
|
43134 |
|
@@ -43896,7 +44600,7 @@ const PanelColorGradientSettingsInner = _ref => {
|
|
43896 |
batch
|
43897 |
} = (0,external_wp_data_namespaceObject.useRegistry)();
|
43898 |
|
43899 |
-
if ((0,external_lodash_namespaceObject.isEmpty)(colors) && (0,external_lodash_namespaceObject.isEmpty)(gradients) && disableCustomColors && disableCustomGradients &&
|
43900 |
return null;
|
43901 |
}
|
43902 |
|
@@ -43952,7 +44656,7 @@ const PanelColorGradientSettingsMultipleSelect = props => {
|
|
43952 |
};
|
43953 |
|
43954 |
const PanelColorGradientSettings = props => {
|
43955 |
-
if (
|
43956 |
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, props);
|
43957 |
}
|
43958 |
|
@@ -50968,7 +51672,7 @@ const arrowLeft = (0,external_wp_element_namespaceObject.createElement)(external
|
|
50968 |
xmlns: "http://www.w3.org/2000/svg",
|
50969 |
viewBox: "0 0 24 24"
|
50970 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
50971 |
-
d: "M20
|
50972 |
}));
|
50973 |
/* harmony default export */ const arrow_left = (arrowLeft);
|
50974 |
|
@@ -51349,6 +52053,7 @@ const ImageURLInputUI = _ref => {
|
|
51349 |
function PreviewOptions(_ref) {
|
51350 |
let {
|
51351 |
children,
|
|
|
51352 |
className,
|
51353 |
isEnabled = true,
|
51354 |
deviceType,
|
@@ -51364,9 +52069,7 @@ function PreviewOptions(_ref) {
|
|
51364 |
variant: 'tertiary',
|
51365 |
className: 'block-editor-post-preview__button-toggle',
|
51366 |
disabled: !isEnabled,
|
51367 |
-
|
51368 |
-
/* translators: button label text should, if possible, be under 16 characters. */
|
51369 |
-
children: (0,external_wp_i18n_namespaceObject.__)('View')
|
51370 |
};
|
51371 |
const menuProps = {
|
51372 |
'aria-label': (0,external_wp_i18n_namespaceObject.__)('View options')
|
@@ -51661,7 +52364,7 @@ function DefaultStylePicker(_ref) {
|
|
51661 |
function useContentBlocks(blockTypes, block) {
|
51662 |
const contenBlocksObjectAux = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
51663 |
return blockTypes.reduce((result, blockType) => {
|
51664 |
-
if (Object.entries(blockType.attributes).some(_ref => {
|
51665 |
let [, {
|
51666 |
__experimentalRole
|
51667 |
}] = _ref;
|
@@ -51771,7 +52474,8 @@ const BlockInspector = _ref5 => {
|
|
51771 |
getSelectedBlockClientId,
|
51772 |
getSelectedBlockCount,
|
51773 |
getBlockName,
|
51774 |
-
__unstableGetContentLockingParent
|
|
|
51775 |
} = select(store);
|
51776 |
|
51777 |
const _selectedBlockClientId = getSelectedBlockClientId();
|
@@ -51785,7 +52489,7 @@ const BlockInspector = _ref5 => {
|
|
51785 |
selectedBlockClientId: _selectedBlockClientId,
|
51786 |
selectedBlockName: _selectedBlockName,
|
51787 |
blockType: _blockType,
|
51788 |
-
topLevelLockedBlock: __unstableGetContentLockingParent(_selectedBlockClientId)
|
51789 |
};
|
51790 |
}, []);
|
51791 |
|
@@ -51856,7 +52560,6 @@ const BlockInspectorSingleBlock = _ref6 => {
|
|
51856 |
}), hasBlockStyles && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
|
51857 |
title: (0,external_wp_i18n_namespaceObject.__)('Styles')
|
51858 |
}, (0,external_wp_element_namespaceObject.createElement)(block_styles, {
|
51859 |
-
scope: "core/block-inspector",
|
51860 |
clientId: clientId
|
51861 |
}), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'defaultStylePicker', true) && (0,external_wp_element_namespaceObject.createElement)(DefaultStylePicker, {
|
51862 |
blockName: blockName
|
@@ -53085,7 +53788,6 @@ function PublishDateTimePicker(_ref, ref) {
|
|
53085 |
|
53086 |
|
53087 |
|
53088 |
-
|
53089 |
|
53090 |
|
53091 |
|
3288 |
"__experimentalUseGradient": () => (/* reexport */ __experimentalUseGradient),
|
3289 |
"__experimentalUseHasRecursion": () => (/* reexport */ useHasRecursion),
|
3290 |
"__experimentalUseMultipleOriginColorsAndGradients": () => (/* reexport */ useMultipleOriginColorsAndGradients),
|
|
|
3291 |
"__experimentalUseResizeCanvas": () => (/* reexport */ useResizeCanvas),
|
3292 |
"__experimentaluseLayoutClasses": () => (/* reexport */ useLayoutClasses),
|
3293 |
"__experimentaluseLayoutStyles": () => (/* reexport */ useLayoutStyles),
|
3312 |
"getColorClassName": () => (/* reexport */ getColorClassName),
|
3313 |
"getColorObjectByAttributeValues": () => (/* reexport */ getColorObjectByAttributeValues),
|
3314 |
"getColorObjectByColorValue": () => (/* reexport */ getColorObjectByColorValue),
|
3315 |
+
"getComputedFluidTypographyValue": () => (/* reexport */ getComputedFluidTypographyValue),
|
3316 |
"getFontSize": () => (/* reexport */ getFontSize),
|
3317 |
"getFontSizeClass": () => (/* reexport */ getFontSizeClass),
|
3318 |
"getFontSizeObjectByValue": () => (/* reexport */ getFontSizeObjectByValue),
|
3557 |
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
3558 |
var classnames = __webpack_require__(4403);
|
3559 |
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
|
|
3560 |
;// CONCATENATED MODULE: external ["wp","compose"]
|
3561 |
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
3562 |
;// CONCATENATED MODULE: external ["wp","data"]
|
3563 |
const external_wp_data_namespaceObject = window["wp"]["data"];
|
3564 |
+
;// CONCATENATED MODULE: external "lodash"
|
3565 |
+
const external_lodash_namespaceObject = window["lodash"];
|
3566 |
;// CONCATENATED MODULE: external ["wp","components"]
|
3567 |
const external_wp_components_namespaceObject = window["wp"]["components"];
|
3568 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-controls/groups.js
|
3614 |
* @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor
|
3615 |
* @property {boolean} generateAnchors Enable/Disable auto anchor generation for Heading blocks
|
3616 |
* @property {boolean} __experimentalCanUserUseUnfilteredHTML Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes.
|
3617 |
+
* @property {boolean} __experimentalClearBlockSelection Whether the block editor should clear selection on mousedown when a block is not clicked.
|
3618 |
* @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
|
3619 |
* @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
|
3620 |
* @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
|
3727 |
// Allows to disable block locking interface.
|
3728 |
canLockBlocks: true,
|
3729 |
__experimentalCanUserUseUnfilteredHTML: false,
|
3730 |
+
__experimentalClearBlockSelection: true,
|
3731 |
__experimentalBlockDirectory: false,
|
3732 |
__mobileEnablePageTemplates: false,
|
3733 |
__experimentalBlockPatterns: [],
|
3734 |
__experimentalBlockPatternCategories: [],
|
3735 |
__unstableGalleryWithImageBlocks: false,
|
3736 |
+
__unstableIsPreviewMode: false,
|
3737 |
generateAnchors: false,
|
3738 |
// gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
|
3739 |
// The setting is only kept for backward compatibility purposes.
|
4183 |
|
4184 |
case 'SAVE_REUSABLE_BLOCK_SUCCESS':
|
4185 |
{
|
4186 |
+
const updatedBlockUids = Object.entries(newState.attributes).filter(_ref => {
|
4187 |
+
let [clientId, attributes] = _ref;
|
4188 |
+
return newState.byClientId[clientId].name === 'core/block' && attributes.ref === action.updatedId;
|
4189 |
+
}).map(_ref2 => {
|
4190 |
+
let [clientId] = _ref2;
|
4191 |
+
return clientId;
|
4192 |
+
});
|
4193 |
newState.tree = updateParentInnerBlocksInTree(newState, { ...newState.tree,
|
4194 |
...updatedBlockUids.reduce((result, clientId) => {
|
4195 |
result[clientId] = { ...newState.byClientId[clientId],
|
4675 |
|
4676 |
case 'MOVE_BLOCKS_TO_POSITION':
|
4677 |
{
|
4678 |
+
var _state$fromRootClient, _state$fromRootClient2;
|
4679 |
+
|
4680 |
const {
|
4681 |
fromRootClientId = '',
|
4682 |
toRootClientId = '',
|
4696 |
|
4697 |
|
4698 |
return { ...state,
|
4699 |
+
[fromRootClientId]: (_state$fromRootClient = (_state$fromRootClient2 = state[fromRootClientId]) === null || _state$fromRootClient2 === void 0 ? void 0 : _state$fromRootClient2.filter(id => !clientIds.includes(id))) !== null && _state$fromRootClient !== void 0 ? _state$fromRootClient : [],
|
4700 |
[toRootClientId]: insertAt(state[toRootClientId], clientIds, index)
|
4701 |
};
|
4702 |
}
|
4769 |
case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN':
|
4770 |
return (0,external_wp_compose_namespaceObject.pipe)([// Remove inner block ordering for removed blocks.
|
4771 |
nextState => (0,external_lodash_namespaceObject.omit)(nextState, action.removedClientIds), // Remove deleted blocks from other blocks' orderings.
|
4772 |
+
nextState => (0,external_lodash_namespaceObject.mapValues)(nextState, subState => {
|
4773 |
+
var _subState$filter;
|
4774 |
+
|
4775 |
+
return (_subState$filter = subState === null || subState === void 0 ? void 0 : subState.filter(id => !action.removedClientIds.includes(id))) !== null && _subState$filter !== void 0 ? _subState$filter : [];
|
4776 |
+
})])(state);
|
4777 |
}
|
4778 |
|
4779 |
return state;
|
5176 |
|
5177 |
switch (action.type) {
|
5178 |
case 'SHOW_INSERTION_POINT':
|
5179 |
+
{
|
5180 |
+
const {
|
5181 |
+
rootClientId,
|
5182 |
+
index,
|
5183 |
+
__unstableWithInserter,
|
5184 |
+
operation
|
5185 |
+
} = action;
|
5186 |
+
const nextState = {
|
5187 |
+
rootClientId,
|
5188 |
+
index,
|
5189 |
+
__unstableWithInserter,
|
5190 |
+
operation
|
5191 |
+
}; // Bail out updates if the states are the same.
|
5192 |
+
|
5193 |
+
return (0,external_lodash_namespaceObject.isEqual)(state, nextState) ? state : nextState;
|
5194 |
+
}
|
5195 |
|
5196 |
case 'HIDE_INSERTION_POINT':
|
5197 |
return null;
|
8478 |
|
8479 |
|
8480 |
|
8481 |
+
/** @typedef {import('../components/use-on-block-drop/types').WPDropOperation} WPDropOperation */
|
8482 |
|
8483 |
const castArray = maybeArray => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
|
8484 |
/**
|
9072 |
/**
|
9073 |
* Action that shows the insertion point.
|
9074 |
*
|
9075 |
+
* @param {?string} rootClientId Optional root client ID of block list on
|
9076 |
+
* which to insert.
|
9077 |
+
* @param {?number} index Index at which block should be inserted.
|
9078 |
+
* @param {?Object} __unstableOptions Additional options.
|
9079 |
+
* @property {boolean} __unstableWithInserter Whether or not to show an inserter button.
|
9080 |
+
* @property {WPDropOperation} operation The operation to perform when applied,
|
9081 |
+
* either 'insert' or 'replace' for now.
|
9082 |
*
|
9083 |
* @return {Object} Action object.
|
9084 |
*/
|
9087 |
let __unstableOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
9088 |
|
9089 |
const {
|
9090 |
+
__unstableWithInserter,
|
9091 |
+
operation
|
9092 |
} = __unstableOptions;
|
9093 |
return {
|
9094 |
type: 'SHOW_INSERTION_POINT',
|
9095 |
rootClientId,
|
9096 |
index,
|
9097 |
+
__unstableWithInserter,
|
9098 |
+
operation
|
9099 |
};
|
9100 |
}
|
9101 |
/**
|
9102 |
* Action that hides the insertion point.
|
|
|
|
|
9103 |
*/
|
9104 |
|
9105 |
+
const hideInsertionPoint = () => _ref11 => {
|
9106 |
+
let {
|
9107 |
+
select,
|
9108 |
+
dispatch
|
9109 |
+
} = _ref11;
|
9110 |
+
|
9111 |
+
if (!select.isBlockInsertionPointVisible()) {
|
9112 |
+
return;
|
9113 |
+
}
|
9114 |
+
|
9115 |
+
dispatch({
|
9116 |
type: 'HIDE_INSERTION_POINT'
|
9117 |
+
});
|
9118 |
+
};
|
9119 |
/**
|
9120 |
* Action that resets the template validity.
|
9121 |
*
|
9136 |
* @return {Object} Action object.
|
9137 |
*/
|
9138 |
|
9139 |
+
const synchronizeTemplate = () => _ref12 => {
|
9140 |
let {
|
9141 |
select,
|
9142 |
dispatch
|
9143 |
+
} = _ref12;
|
9144 |
dispatch({
|
9145 |
type: 'SYNCHRONIZE_TEMPLATE'
|
9146 |
});
|
9155 |
* @param {boolean} isForward
|
9156 |
*/
|
9157 |
|
9158 |
+
const __unstableDeleteSelection = isForward => _ref13 => {
|
9159 |
let {
|
9160 |
registry,
|
9161 |
select,
|
9162 |
dispatch
|
9163 |
+
} = _ref13;
|
9164 |
const selectionAnchor = select.getSelectionStart();
|
9165 |
const selectionFocus = select.getSelectionEnd();
|
9166 |
if (selectionAnchor.clientId === selectionFocus.clientId) return; // It's not mergeable if there's no rich text selection.
|
9278 |
* Split the current selection.
|
9279 |
*/
|
9280 |
|
9281 |
+
const __unstableSplitSelection = () => _ref14 => {
|
9282 |
let {
|
9283 |
select,
|
9284 |
dispatch
|
9285 |
+
} = _ref14;
|
9286 |
const selectionAnchor = select.getSelectionStart();
|
9287 |
const selectionFocus = select.getSelectionEnd();
|
9288 |
if (selectionAnchor.clientId === selectionFocus.clientId) return; // Can't split if the selection is not set.
|
9353 |
* Expand the selection to cover the entire blocks, removing partial selection.
|
9354 |
*/
|
9355 |
|
9356 |
+
const __unstableExpandSelection = () => _ref15 => {
|
9357 |
let {
|
9358 |
select,
|
9359 |
dispatch
|
9360 |
+
} = _ref15;
|
9361 |
const selectionAnchor = select.getSelectionStart();
|
9362 |
const selectionFocus = select.getSelectionEnd();
|
9363 |
dispatch.selectionChange({
|
9376 |
* @param {string} secondBlockClientId Client ID of the second block to merge.
|
9377 |
*/
|
9378 |
|
9379 |
+
const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref16 => {
|
9380 |
let {
|
9381 |
registry,
|
9382 |
select,
|
9383 |
dispatch
|
9384 |
+
} = _ref16;
|
9385 |
const blocks = [firstBlockClientId, secondBlockClientId];
|
9386 |
dispatch({
|
9387 |
type: 'MERGE_BLOCKS',
|
9503 |
|
9504 |
const removeBlocks = function (clientIds) {
|
9505 |
let selectPrevious = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
9506 |
+
return _ref17 => {
|
9507 |
let {
|
9508 |
select,
|
9509 |
dispatch
|
9510 |
+
} = _ref17;
|
9511 |
|
9512 |
if (!clientIds || !clientIds.length) {
|
9513 |
return;
|
9708 |
* @param {?number} index Optional index where to insert the default block.
|
9709 |
*/
|
9710 |
|
9711 |
+
const insertDefaultBlock = (attributes, rootClientId, index) => _ref18 => {
|
9712 |
let {
|
9713 |
dispatch
|
9714 |
+
} = _ref18;
|
9715 |
// Abort if there is no default block type (if it has been unregistered).
|
9716 |
const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)();
|
9717 |
|
9800 |
* selection changes have been recorded.
|
9801 |
*/
|
9802 |
|
9803 |
+
const __unstableMarkAutomaticChange = () => _ref19 => {
|
9804 |
let {
|
9805 |
dispatch
|
9806 |
+
} = _ref19;
|
9807 |
dispatch({
|
9808 |
type: 'MARK_AUTOMATIC_CHANGE'
|
9809 |
});
|
9824 |
|
9825 |
const setNavigationMode = function () {
|
9826 |
let isNavigationMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
9827 |
+
return _ref20 => {
|
9828 |
let {
|
9829 |
dispatch
|
9830 |
+
} = _ref20;
|
9831 |
|
9832 |
dispatch.__unstableSetEditorMode(isNavigationMode ? 'navigation' : 'edit');
|
9833 |
};
|
9838 |
* @param {string} mode Editor mode
|
9839 |
*/
|
9840 |
|
9841 |
+
const __unstableSetEditorMode = mode => _ref21 => {
|
9842 |
let {
|
9843 |
dispatch,
|
9844 |
select
|
9845 |
+
} = _ref21;
|
9846 |
|
9847 |
// When switching to zoom-out mode, we need to select the root block
|
9848 |
if (mode === 'zoom-out') {
|
9874 |
|
9875 |
const setBlockMovingClientId = function () {
|
9876 |
let hasBlockMovingClientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
9877 |
+
return _ref22 => {
|
9878 |
let {
|
9879 |
dispatch
|
9880 |
+
} = _ref22;
|
9881 |
dispatch({
|
9882 |
type: 'SET_BLOCK_MOVING_MODE',
|
9883 |
hasBlockMovingClientId
|
9897 |
|
9898 |
const duplicateBlocks = function (clientIds) {
|
9899 |
let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
9900 |
+
return _ref23 => {
|
9901 |
let {
|
9902 |
select,
|
9903 |
dispatch
|
9904 |
+
} = _ref23;
|
9905 |
|
9906 |
if (!clientIds || !clientIds.length) {
|
9907 |
return;
|
9940 |
* @param {string} clientId
|
9941 |
*/
|
9942 |
|
9943 |
+
const insertBeforeBlock = clientId => _ref24 => {
|
9944 |
let {
|
9945 |
select,
|
9946 |
dispatch
|
9947 |
+
} = _ref24;
|
9948 |
|
9949 |
if (!clientId) {
|
9950 |
return;
|
9966 |
* @param {string} clientId
|
9967 |
*/
|
9968 |
|
9969 |
+
const insertAfterBlock = clientId => _ref25 => {
|
9970 |
let {
|
9971 |
select,
|
9972 |
dispatch
|
9973 |
+
} = _ref25;
|
9974 |
|
9975 |
if (!clientId) {
|
9976 |
return;
|
10006 |
* @param {string} clientId Target block client ID.
|
10007 |
*/
|
10008 |
|
10009 |
+
const flashBlock = clientId => async _ref26 => {
|
10010 |
let {
|
10011 |
dispatch
|
10012 |
+
} = _ref26;
|
10013 |
dispatch(toggleBlockHighlight(clientId, true));
|
10014 |
await new Promise(resolve => setTimeout(resolve, 150));
|
10015 |
dispatch(toggleBlockHighlight(clientId, false));
|
10380 |
xmlns: "http://www.w3.org/2000/svg",
|
10381 |
viewBox: "0 0 24 24"
|
10382 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
10383 |
+
d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"
|
10384 |
}));
|
10385 |
/* harmony default export */ const arrow_right = (arrowRight);
|
10386 |
|
10395 |
xmlns: "http://www.w3.org/2000/svg",
|
10396 |
viewBox: "0 0 24 24"
|
10397 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
10398 |
+
d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"
|
10399 |
}));
|
10400 |
/* harmony default export */ const arrow_down = (arrowDown);
|
10401 |
|
11028 |
|
11029 |
|
11030 |
|
11031 |
+
const CUSTOM_VALUE_SETTINGS = {
|
11032 |
+
px: {
|
11033 |
+
max: 300,
|
11034 |
+
steps: 1
|
11035 |
+
},
|
11036 |
+
'%': {
|
11037 |
+
max: 100,
|
11038 |
+
steps: 1
|
11039 |
+
},
|
11040 |
+
vw: {
|
11041 |
+
max: 100,
|
11042 |
+
steps: 1
|
11043 |
+
},
|
11044 |
+
vh: {
|
11045 |
+
max: 100,
|
11046 |
+
steps: 1
|
11047 |
+
},
|
11048 |
+
em: {
|
11049 |
+
max: 10,
|
11050 |
+
steps: 0.1
|
11051 |
+
},
|
11052 |
+
rm: {
|
11053 |
+
max: 10,
|
11054 |
+
steps: 0.1
|
11055 |
+
}
|
11056 |
+
};
|
11057 |
function SpacingInputControl(_ref) {
|
11058 |
+
var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2, _CUSTOM_VALUE_SETTING3, _CUSTOM_VALUE_SETTING4, _spacingSizes$current;
|
11059 |
|
11060 |
let {
|
11061 |
spacingSizes,
|
11107 |
return value === undefined ? undefined : (_spacingSizes$newValu = spacingSizes[newValue]) === null || _spacingSizes$newValu === void 0 ? void 0 : _spacingSizes$newValu.name;
|
11108 |
};
|
11109 |
|
11110 |
+
const customRangeValue = parseFloat(currentValue, 10);
|
11111 |
|
11112 |
const getNewCustomValue = newSize => {
|
11113 |
const isNumeric = !isNaN(parseFloat(newSize));
|
11185 |
className: "components-spacing-sizes-control__custom-value-input",
|
11186 |
style: {
|
11187 |
gridColumn: '1'
|
11188 |
+
},
|
11189 |
+
size: '__unstable-large'
|
11190 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
|
11191 |
value: customRangeValue,
|
11192 |
min: 0,
|
11193 |
+
max: (_CUSTOM_VALUE_SETTING = (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[selectedUnit]) === null || _CUSTOM_VALUE_SETTING2 === void 0 ? void 0 : _CUSTOM_VALUE_SETTING2.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
|
11194 |
+
step: (_CUSTOM_VALUE_SETTING3 = (_CUSTOM_VALUE_SETTING4 = CUSTOM_VALUE_SETTINGS[selectedUnit]) === null || _CUSTOM_VALUE_SETTING4 === void 0 ? void 0 : _CUSTOM_VALUE_SETTING4.steps) !== null && _CUSTOM_VALUE_SETTING3 !== void 0 ? _CUSTOM_VALUE_SETTING3 : 0.1,
|
11195 |
withInputField: false,
|
11196 |
onChange: handleCustomValueSliderChange,
|
11197 |
className: "components-spacing-sizes-control__custom-value-range"
|
11228 |
options: options,
|
11229 |
label: ariaLabel,
|
11230 |
hideLabelFromVision: true,
|
11231 |
+
__nextUnconstrainedWidth: true,
|
11232 |
+
size: '__unstable-large'
|
11233 |
}));
|
11234 |
}
|
11235 |
|
11634 |
var _source$;
|
11635 |
|
11636 |
// If there are no active supports return early.
|
11637 |
+
if (Object.values(activeSupports !== null && activeSupports !== void 0 ? activeSupports : {}).every(isActive => !isActive)) {
|
11638 |
return result;
|
11639 |
} // If the condition verifies we are probably in the presence of a wrapping transform
|
11640 |
// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.
|
11952 |
__unstableCoverTarget = false,
|
11953 |
__unstablePopoverSlot,
|
11954 |
__unstableContentRef,
|
11955 |
+
shift = true,
|
11956 |
...props
|
11957 |
} = _ref;
|
11958 |
const selectedElement = useBlockElement(clientId);
|
12040 |
placement: "top-start",
|
12041 |
resize: false,
|
12042 |
flip: false,
|
12043 |
+
shift: shift
|
12044 |
}, props, {
|
12045 |
className: classnames_default()('block-editor-block-popover', props.className)
|
12046 |
}), __unstableCoverTarget && (0,external_wp_element_namespaceObject.createElement)("div", {
|
12216 |
borderRightWidth: marginRight,
|
12217 |
borderBottomWidth: marginBottom,
|
12218 |
borderLeftWidth: marginLeft,
|
12219 |
+
top: marginTop !== 0 ? `calc(${marginTop} * -1)` : 0,
|
12220 |
+
right: marginRight !== 0 ? `calc(${marginRight} * -1)` : 0,
|
12221 |
+
bottom: marginBottom !== 0 ? `calc(${marginBottom} * -1)` : 0,
|
12222 |
+
left: marginLeft !== 0 ? `calc(${marginLeft} * -1)` : 0
|
12223 |
};
|
12224 |
}, [margin]);
|
12225 |
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
|
12252 |
return (0,external_wp_element_namespaceObject.createElement)(block_popover, {
|
12253 |
clientId: clientId,
|
12254 |
__unstableCoverTarget: true,
|
12255 |
+
__unstableRefreshSize: margin,
|
12256 |
+
shift: false
|
12257 |
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
12258 |
className: "block-editor__padding-visualizer",
|
12259 |
style: style
|
12453 |
return (0,external_wp_element_namespaceObject.createElement)(block_popover, {
|
12454 |
clientId: clientId,
|
12455 |
__unstableCoverTarget: true,
|
12456 |
+
__unstableRefreshSize: padding,
|
12457 |
+
shift: false
|
12458 |
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
12459 |
className: "block-editor__padding-visualizer",
|
12460 |
style: style
|
14240 |
* External dependencies
|
14241 |
*/
|
14242 |
|
|
|
14243 |
/**
|
14244 |
* WordPress dependencies
|
14245 |
*/
|
14301 |
}
|
14302 |
|
14303 |
if (!hasWideEnabled || blockAlign === true && !hasWideBlockSupport) {
|
14304 |
+
return validAlignments.filter(alignment => !WIDE_ALIGNMENTS.includes(alignment));
|
14305 |
}
|
14306 |
|
14307 |
return validAlignments;
|
20896 |
isSelected
|
20897 |
};
|
20898 |
});
|
20899 |
+
const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => {
|
|
|
|
|
|
|
20900 |
const {
|
20901 |
updateBlockAttributes,
|
20902 |
insertBlocks,
|
20903 |
mergeBlocks,
|
20904 |
replaceBlocks,
|
20905 |
toggleSelection,
|
20906 |
+
__unstableMarkLastChangeAsPersistent,
|
20907 |
+
moveBlocksToPosition,
|
20908 |
+
removeBlock,
|
20909 |
+
selectBlock
|
20910 |
} = dispatch(store); // Do not add new properties here, use `useDispatch` instead to avoid
|
20911 |
// leaking new props to the public API (editor.BlockListBlock filter).
|
20912 |
|
20914 |
setAttributes(newAttributes) {
|
20915 |
const {
|
20916 |
getMultiSelectedBlockClientIds
|
20917 |
+
} = registry.select(store);
|
20918 |
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds();
|
20919 |
const {
|
20920 |
clientId
|
20937 |
} = ownProps;
|
20938 |
const {
|
20939 |
getBlockIndex
|
20940 |
+
} = registry.select(store);
|
20941 |
const index = getBlockIndex(clientId);
|
20942 |
insertBlocks(blocks, index + 1, rootClientId);
|
20943 |
},
|
20950 |
const {
|
20951 |
getPreviousBlockClientId,
|
20952 |
getNextBlockClientId,
|
20953 |
+
getBlock,
|
20954 |
+
getBlockAttributes,
|
20955 |
+
getBlockName,
|
20956 |
+
getBlockOrder
|
20957 |
+
} = registry.select(store); // For `Delete` or forward merge, we should do the exact same thing
|
20958 |
+
// as `Backspace`, but from the other block.
|
20959 |
|
20960 |
if (forward) {
|
20961 |
+
if (rootClientId) {
|
20962 |
+
const nextRootClientId = getNextBlockClientId(rootClientId);
|
20963 |
+
|
20964 |
+
if (nextRootClientId) {
|
20965 |
+
// If there is a block that follows with the same parent
|
20966 |
+
// block name and the same attributes, merge the inner
|
20967 |
+
// blocks.
|
20968 |
+
if (getBlockName(rootClientId) === getBlockName(nextRootClientId)) {
|
20969 |
+
const rootAttributes = getBlockAttributes(rootClientId);
|
20970 |
+
const previousRootAttributes = getBlockAttributes(nextRootClientId);
|
20971 |
+
|
20972 |
+
if (Object.keys(rootAttributes).every(key => rootAttributes[key] === previousRootAttributes[key])) {
|
20973 |
+
registry.batch(() => {
|
20974 |
+
moveBlocksToPosition(getBlockOrder(nextRootClientId), nextRootClientId, rootClientId);
|
20975 |
+
removeBlock(nextRootClientId, false);
|
20976 |
+
});
|
20977 |
+
return;
|
20978 |
+
}
|
20979 |
+
} else {
|
20980 |
+
mergeBlocks(rootClientId, nextRootClientId);
|
20981 |
+
return;
|
20982 |
+
}
|
20983 |
+
}
|
20984 |
+
}
|
20985 |
+
|
20986 |
const nextBlockClientId = getNextBlockClientId(clientId);
|
20987 |
|
20988 |
+
if (!nextBlockClientId) {
|
20989 |
+
return;
|
20990 |
+
} // Check if it's possibile to "unwrap" the following block
|
20991 |
+
// before trying to merge.
|
20992 |
+
|
20993 |
+
|
20994 |
+
const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(nextBlockClientId), '*');
|
20995 |
+
|
20996 |
+
if (replacement && replacement.length) {
|
20997 |
+
replaceBlocks(nextBlockClientId, replacement);
|
20998 |
+
} else {
|
20999 |
mergeBlocks(clientId, nextBlockClientId);
|
21000 |
}
|
21001 |
} else {
|
21004 |
if (previousBlockClientId) {
|
21005 |
mergeBlocks(previousBlockClientId, clientId);
|
21006 |
} else if (rootClientId) {
|
21007 |
+
const previousRootClientId = getPreviousBlockClientId(rootClientId); // If there is a preceding block with the same parent block
|
21008 |
+
// name and the same attributes, merge the inner blocks.
|
21009 |
+
|
21010 |
+
if (previousRootClientId && getBlockName(rootClientId) === getBlockName(previousRootClientId)) {
|
21011 |
+
const rootAttributes = getBlockAttributes(rootClientId);
|
21012 |
+
const previousRootAttributes = getBlockAttributes(previousRootClientId);
|
21013 |
+
|
21014 |
+
if (Object.keys(rootAttributes).every(key => rootAttributes[key] === previousRootAttributes[key])) {
|
21015 |
+
registry.batch(() => {
|
21016 |
+
moveBlocksToPosition(getBlockOrder(rootClientId), rootClientId, previousRootClientId);
|
21017 |
+
removeBlock(rootClientId, false);
|
21018 |
+
});
|
21019 |
+
return;
|
21020 |
+
}
|
21021 |
+
} // Attempt to "unwrap" the block contents when there's no
|
21022 |
// preceding block to merge with.
|
21023 |
+
|
21024 |
+
|
21025 |
const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(rootClientId), '*');
|
21026 |
|
21027 |
if (replacement && replacement.length) {
|
21028 |
+
registry.batch(() => {
|
21029 |
+
replaceBlocks(rootClientId, replacement);
|
21030 |
+
selectBlock(replacement[0].clientId, 0);
|
21031 |
+
});
|
21032 |
}
|
21033 |
}
|
21034 |
}
|
21051 |
/* harmony default export */ const block = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.pure, applyWithSelect, applyWithDispatch, // Block is sometimes not mounted at the right time, causing it be undefined
|
21052 |
// see issue for more info
|
21053 |
// https://github.com/WordPress/gutenberg/issues/17013
|
21054 |
+
(0,external_wp_compose_namespaceObject.ifCondition)(_ref4 => {
|
21055 |
let {
|
21056 |
block
|
21057 |
+
} = _ref4;
|
21058 |
return !!block;
|
21059 |
}), (0,external_wp_components_namespaceObject.withFilters)('editor.BlockListBlock'))(BlockListBlock));
|
21060 |
|
21553 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-preview/live.js
|
21554 |
|
21555 |
|
|
|
|
|
|
|
|
|
21556 |
/**
|
21557 |
* Internal dependencies
|
21558 |
*/
|
21559 |
|
|
|
21560 |
function LiveBlockPreview(_ref) {
|
21561 |
let {
|
21562 |
onClick
|
21566 |
role: "button",
|
21567 |
onClick: onClick,
|
21568 |
onKeyPress: onClick
|
21569 |
+
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
21570 |
+
inert: "true"
|
21571 |
+
}, (0,external_wp_element_namespaceObject.createElement)(BlockList, null)));
|
21572 |
}
|
21573 |
|
21574 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-selection-clearer/index.js
|
21595 |
|
21596 |
function useBlockSelectionClearer() {
|
21597 |
const {
|
21598 |
+
getSettings,
|
21599 |
hasSelectedBlock,
|
21600 |
hasMultiSelection
|
21601 |
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
21602 |
const {
|
21603 |
clearSelectedBlock
|
21604 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
21605 |
+
const {
|
21606 |
+
__experimentalClearBlockSelection: isEnabled
|
21607 |
+
} = getSettings();
|
21608 |
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
|
21609 |
+
if (!isEnabled) {
|
21610 |
+
return;
|
21611 |
+
}
|
21612 |
+
|
21613 |
function onMouseDown(event) {
|
21614 |
if (!hasSelectedBlock() && !hasMultiSelection()) {
|
21615 |
return;
|
21627 |
return () => {
|
21628 |
node.removeEventListener('mousedown', onMouseDown);
|
21629 |
};
|
21630 |
+
}, [hasSelectedBlock, hasMultiSelection, clearSelectedBlock, isEnabled]);
|
21631 |
}
|
21632 |
function BlockSelectionClearer(props) {
|
21633 |
return (0,external_wp_element_namespaceObject.createElement)("div", _extends({
|
24957 |
__experimentalMinHeight
|
24958 |
} = _ref;
|
24959 |
const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []);
|
24960 |
+
const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings,
|
24961 |
+
__unstableIsPreviewMode: true
|
24962 |
+
}), [originalSettings]);
|
|
|
|
|
|
|
24963 |
const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_lodash_namespaceObject.castArray)(blocks), [blocks]);
|
24964 |
|
24965 |
if (!blocks || blocks.length === 0) {
|
25014 |
__experimentalLayout
|
25015 |
} = _ref2;
|
25016 |
const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []);
|
|
|
|
|
25017 |
const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings,
|
25018 |
+
__unstableIsPreviewMode: true
|
25019 |
}), [originalSettings]);
|
25020 |
+
const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)();
|
25021 |
+
const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, disabledRef]);
|
25022 |
const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_lodash_namespaceObject.castArray)(blocks), [blocks]);
|
25023 |
const children = (0,external_wp_element_namespaceObject.createElement)(provider, {
|
25024 |
value: renderedBlocks,
|
25182 |
function BlockDraggableChip(_ref) {
|
25183 |
let {
|
25184 |
count,
|
25185 |
+
icon,
|
25186 |
+
isPattern
|
25187 |
} = _ref;
|
25188 |
+
|
25189 |
+
const patternLabel = isPattern && (0,external_wp_i18n_namespaceObject.__)('Pattern');
|
25190 |
+
|
25191 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
25192 |
className: "block-editor-block-draggable-chip-wrapper"
|
25193 |
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
25198 |
className: "block-editor-block-draggable-chip__content"
|
25199 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, icon ? (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
25200 |
icon: icon
|
25201 |
+
}) : patternLabel || (0,external_wp_i18n_namespaceObject.sprintf)(
|
25202 |
/* translators: %d: Number of blocks. */
|
25203 |
(0,external_wp_i18n_namespaceObject._n)('%d block', '%d blocks', count), count)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
25204 |
icon: drag_handle
|
25223 |
isEnabled,
|
25224 |
blocks,
|
25225 |
icon,
|
25226 |
+
children,
|
25227 |
+
isPattern
|
25228 |
} = _ref;
|
25229 |
const transferData = {
|
25230 |
type: 'inserter',
|
25235 |
transferData: transferData,
|
25236 |
__experimentalDragComponent: (0,external_wp_element_namespaceObject.createElement)(BlockDraggableChip, {
|
25237 |
count: blocks.length,
|
25238 |
+
icon: icon,
|
25239 |
+
isPattern: isPattern
|
25240 |
})
|
25241 |
}, _ref2 => {
|
25242 |
let {
|
25734 |
}
|
25735 |
/* harmony default export */ const block_types_tab = (BlockTypesTab);
|
25736 |
|
25737 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/chevron-right.js
|
25738 |
|
25739 |
|
|
|
|
|
|
|
|
|
25740 |
/**
|
25741 |
* WordPress dependencies
|
25742 |
*/
|
25743 |
|
25744 |
+
const chevronRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
25745 |
+
xmlns: "http://www.w3.org/2000/svg",
|
25746 |
+
viewBox: "0 0 24 24"
|
25747 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
25748 |
+
d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
|
25749 |
+
}));
|
25750 |
+
/* harmony default export */ const chevron_right = (chevronRight);
|
25751 |
|
25752 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/chevron-left.js
|
25753 |
|
25754 |
|
25755 |
+
/**
|
25756 |
+
* WordPress dependencies
|
25757 |
+
*/
|
25758 |
|
25759 |
+
const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
25760 |
+
xmlns: "http://www.w3.org/2000/svg",
|
25761 |
+
viewBox: "0 0 24 24"
|
25762 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
25763 |
+
d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
|
25764 |
+
}));
|
25765 |
+
/* harmony default export */ const chevron_left = (chevronLeft);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25766 |
|
25767 |
;// CONCATENATED MODULE: external ["wp","notices"]
|
25768 |
const external_wp_notices_namespaceObject = window["wp"]["notices"];
|
25856 |
const descriptionId = `block-editor-block-patterns-list__item-description-${instanceId}`;
|
25857 |
return (0,external_wp_element_namespaceObject.createElement)(inserter_draggable_blocks, {
|
25858 |
isEnabled: isDraggable,
|
25859 |
+
blocks: blocks,
|
25860 |
+
isPattern: !!pattern
|
25861 |
}, _ref2 => {
|
25862 |
let {
|
25863 |
draggable,
|
25866 |
} = _ref2;
|
25867 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
25868 |
className: "block-editor-block-patterns-list__list-item",
|
|
|
|
|
25869 |
draggable: draggable,
|
25870 |
onDragStart: onDragStart,
|
25871 |
onDragEnd: onDragEnd
|
25874 |
as: "div"
|
25875 |
}, composite, {
|
25876 |
className: "block-editor-block-patterns-list__item",
|
25877 |
+
onClick: () => onClick(pattern, blocks),
|
25878 |
+
"aria-label": pattern.title,
|
25879 |
+
"aria-describedby": pattern.description ? descriptionId : undefined
|
25880 |
}), (0,external_wp_element_namespaceObject.createElement)(block_preview, {
|
25881 |
blocks: blocks,
|
25882 |
viewportWidth: viewportWidth
|
26478 |
|
26479 |
|
26480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26481 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26482 |
|
|
|
|
|
|
|
26483 |
|
26484 |
+
/**
|
26485 |
+
* Internal dependencies
|
26486 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26487 |
|
|
|
|
|
26488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
26489 |
|
|
|
|
|
|
|
26490 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26491 |
|
26492 |
+
function usePatternsCategories() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26493 |
const [allPatterns, allCategories] = use_patterns_state();
|
26494 |
const hasRegisteredCategory = (0,external_wp_element_namespaceObject.useCallback)(pattern => {
|
26495 |
if (!pattern.categories || !pattern.categories.length) {
|
26501 |
|
26502 |
const populatedCategories = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
26503 |
const categories = allCategories.filter(category => allPatterns.some(pattern => {
|
26504 |
+
var _pattern$categories;
|
26505 |
|
26506 |
+
return (_pattern$categories = pattern.categories) === null || _pattern$categories === void 0 ? void 0 : _pattern$categories.includes(category.name);
|
26507 |
+
})).sort((_ref, _ref2) => {
|
26508 |
let {
|
26509 |
name: currentName
|
26510 |
+
} = _ref;
|
26511 |
let {
|
26512 |
name: nextName
|
26513 |
+
} = _ref2;
|
26514 |
|
26515 |
if (![currentName, nextName].includes('featured')) {
|
26516 |
return 0;
|
26528 |
|
26529 |
return categories;
|
26530 |
}, [allPatterns, allCategories]);
|
26531 |
+
return populatedCategories;
|
26532 |
+
}
|
26533 |
+
|
26534 |
+
function BlockPatternsCategoryDialog(_ref3) {
|
26535 |
+
let {
|
26536 |
+
rootClientId,
|
26537 |
+
onInsert,
|
26538 |
+
category
|
26539 |
+
} = _ref3;
|
26540 |
+
const container = (0,external_wp_element_namespaceObject.useRef)();
|
26541 |
+
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
26542 |
+
const timeout = setTimeout(() => {
|
26543 |
+
const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(container.current);
|
26544 |
+
firstTabbable === null || firstTabbable === void 0 ? void 0 : firstTabbable.focus();
|
26545 |
+
});
|
26546 |
+
return () => clearTimeout(timeout);
|
26547 |
+
}, [category]);
|
26548 |
+
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
26549 |
+
ref: container,
|
26550 |
+
className: "block-editor-inserter__patterns-category-panel"
|
26551 |
+
}, (0,external_wp_element_namespaceObject.createElement)(BlockPatternsCategoryPanel, {
|
26552 |
rootClientId: rootClientId,
|
26553 |
onInsert: onInsert,
|
26554 |
+
category: category
|
26555 |
+
}));
|
26556 |
+
}
|
26557 |
+
function BlockPatternsCategoryPanel(_ref4) {
|
26558 |
+
let {
|
26559 |
+
rootClientId,
|
26560 |
+
onInsert,
|
26561 |
+
category
|
26562 |
+
} = _ref4;
|
26563 |
+
const [allPatterns,, onClick] = use_patterns_state(onInsert, rootClientId);
|
26564 |
+
const availableCategories = usePatternsCategories();
|
26565 |
+
const currentCategoryPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => allPatterns.filter(pattern => {
|
26566 |
+
var _pattern$categories$f, _pattern$categories3;
|
26567 |
+
|
26568 |
+
if (category.name !== 'uncategorized') {
|
26569 |
+
var _pattern$categories2;
|
26570 |
+
|
26571 |
+
return (_pattern$categories2 = pattern.categories) === null || _pattern$categories2 === void 0 ? void 0 : _pattern$categories2.includes(category.name);
|
26572 |
+
} // The uncategorized category should show all the patterns without any category
|
26573 |
+
// or with no available category.
|
26574 |
+
|
26575 |
+
|
26576 |
+
const availablePatternCategories = (_pattern$categories$f = (_pattern$categories3 = pattern.categories) === null || _pattern$categories3 === void 0 ? void 0 : _pattern$categories3.filter(cat => availableCategories.find(availableCategory => availableCategory.name === cat))) !== null && _pattern$categories$f !== void 0 ? _pattern$categories$f : [];
|
26577 |
+
return availablePatternCategories.length === 0;
|
26578 |
+
}), [allPatterns, category]);
|
26579 |
+
const currentShownPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(currentCategoryPatterns);
|
26580 |
+
|
26581 |
+
if (!currentCategoryPatterns.length) {
|
26582 |
+
return null;
|
26583 |
+
}
|
26584 |
+
|
26585 |
+
return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("div", {
|
26586 |
+
className: "block-editor-inserter__patterns-category-panel-title"
|
26587 |
+
}, category.label), (0,external_wp_element_namespaceObject.createElement)("p", null, category.description), (0,external_wp_element_namespaceObject.createElement)(block_patterns_list, {
|
26588 |
+
shownPatterns: currentShownPatterns,
|
26589 |
+
blockPatterns: currentCategoryPatterns,
|
26590 |
+
onClickPattern: onClick,
|
26591 |
+
label: category.label,
|
26592 |
+
orientation: "vertical",
|
26593 |
+
category: category.label,
|
26594 |
+
isDraggable: true
|
26595 |
+
}));
|
26596 |
+
}
|
26597 |
+
|
26598 |
+
function BlockPatternsTabs(_ref5) {
|
26599 |
+
let {
|
26600 |
+
onSelectCategory,
|
26601 |
+
selectedCategory,
|
26602 |
+
onInsert,
|
26603 |
+
rootClientId
|
26604 |
+
} = _ref5;
|
26605 |
+
const [showPatternsExplorer, setShowPatternsExplorer] = (0,external_wp_element_namespaceObject.useState)(false);
|
26606 |
+
const categories = usePatternsCategories();
|
26607 |
+
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
|
26608 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isMobile && (0,external_wp_element_namespaceObject.createElement)("div", {
|
26609 |
+
className: "block-editor-inserter__block-patterns-tabs-container"
|
26610 |
+
}, (0,external_wp_element_namespaceObject.createElement)("nav", {
|
26611 |
+
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Block pattern categories')
|
26612 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
|
26613 |
+
role: "list",
|
26614 |
+
className: "block-editor-inserter__block-patterns-tabs"
|
26615 |
+
}, categories.map(category => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItem, {
|
26616 |
+
role: "listitem",
|
26617 |
+
key: category.name,
|
26618 |
+
onClick: () => onSelectCategory(category),
|
26619 |
+
className: category === selectedCategory ? 'block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category' : 'block-editor-inserter__patterns-category',
|
26620 |
+
"aria-label": category.label,
|
26621 |
+
"aria-current": category === selectedCategory ? 'true' : undefined
|
26622 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexBlock, null, category.label), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
26623 |
+
icon: chevron_right
|
26624 |
+
})))), (0,external_wp_element_namespaceObject.createElement)("div", {
|
26625 |
+
role: "presentation",
|
26626 |
+
className: "block-editor-inserter__patterns-fill-space"
|
26627 |
+
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
26628 |
+
role: "listitem"
|
26629 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
26630 |
+
className: "block-editor-inserter__patterns-explore-button",
|
26631 |
+
onClick: () => setShowPatternsExplorer(true),
|
26632 |
+
variant: "secondary"
|
26633 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Explore all patterns')))))), isMobile && (0,external_wp_element_namespaceObject.createElement)(BlockPatternsTabNavigation, {
|
26634 |
+
onInsert: onInsert,
|
26635 |
+
rootClientId: rootClientId
|
26636 |
}), showPatternsExplorer && (0,external_wp_element_namespaceObject.createElement)(explorer, {
|
26637 |
+
initialCategory: selectedCategory,
|
26638 |
+
patternCategories: categories,
|
26639 |
onModalClose: () => setShowPatternsExplorer(false)
|
26640 |
}));
|
26641 |
}
|
26642 |
|
26643 |
+
function BlockPatternsTabNavigation(_ref6) {
|
26644 |
+
let {
|
26645 |
+
onInsert,
|
26646 |
+
rootClientId
|
26647 |
+
} = _ref6;
|
26648 |
+
const categories = usePatternsCategories();
|
26649 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, {
|
26650 |
+
initialPath: "/"
|
26651 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
26652 |
+
path: "/"
|
26653 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, categories.map(category => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, {
|
26654 |
+
key: category.name,
|
26655 |
+
path: `/category/${category.name}`,
|
26656 |
+
as: external_wp_components_namespaceObject.__experimentalItem,
|
26657 |
+
isAction: true
|
26658 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexBlock, null, category.label), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
26659 |
+
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right
|
26660 |
+
})))))), categories.map(category => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
26661 |
+
key: category.name,
|
26662 |
+
path: `/category/${category.name}`
|
26663 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorBackButton, {
|
26664 |
+
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left,
|
26665 |
+
isSmall: true,
|
26666 |
+
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigate to the categories list')
|
26667 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Back')), (0,external_wp_element_namespaceObject.createElement)(BlockPatternsCategoryPanel, {
|
26668 |
+
category: category,
|
26669 |
+
rootClientId: rootClientId,
|
26670 |
+
onInsert: onInsert
|
26671 |
+
}))));
|
26672 |
+
}
|
26673 |
+
|
26674 |
/* harmony default export */ const block_patterns_tab = (BlockPatternsTabs);
|
26675 |
|
26676 |
;// CONCATENATED MODULE: external ["wp","url"]
|
27027 |
const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)(__experimentalFilterValue);
|
27028 |
const [hoveredItem, setHoveredItem] = (0,external_wp_element_namespaceObject.useState)(null);
|
27029 |
const [selectedPatternCategory, setSelectedPatternCategory] = (0,external_wp_element_namespaceObject.useState)(null);
|
27030 |
+
const [selectedTab, setSelectedTab] = (0,external_wp_element_namespaceObject.useState)(null);
|
27031 |
const [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint] = use_insertion_point({
|
27032 |
rootClientId,
|
27033 |
clientId,
|
27082 |
const patternsTab = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(block_patterns_tab, {
|
27083 |
rootClientId: destinationRootClientId,
|
27084 |
onInsert: onInsertPattern,
|
27085 |
+
onSelectCategory: onClickPatternCategory,
|
27086 |
selectedCategory: selectedPatternCategory
|
27087 |
}), [destinationRootClientId, onInsertPattern, onClickPatternCategory, selectedPatternCategory]);
|
27088 |
const reusableBlocksTab = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(reusable_blocks_tab, {
|
27105 |
searchRef.current.focus();
|
27106 |
}
|
27107 |
}));
|
27108 |
+
const showPatternPanel = selectedTab === 'patterns' && !filterValue && selectedPatternCategory;
|
27109 |
const showAsTabs = !filterValue && (showPatterns || hasReusableBlocks);
|
27110 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
27111 |
className: "block-editor-inserter__menu"
|
27138 |
})), showAsTabs && (0,external_wp_element_namespaceObject.createElement)(tabs, {
|
27139 |
showPatterns: showPatterns,
|
27140 |
showReusableBlocks: hasReusableBlocks,
|
27141 |
+
prioritizePatterns: prioritizePatterns,
|
27142 |
+
onSelect: setSelectedTab
|
27143 |
}, getCurrentTab), !filterValue && !showAsTabs && (0,external_wp_element_namespaceObject.createElement)("div", {
|
27144 |
className: "block-editor-inserter__no-tab-container"
|
27145 |
}, blocksTab)), showInserterHelpPanel && hoveredItem && (0,external_wp_element_namespaceObject.createElement)(preview_panel, {
|
27146 |
item: hoveredItem
|
27147 |
+
}), showPatternPanel && (0,external_wp_element_namespaceObject.createElement)(BlockPatternsCategoryDialog, {
|
27148 |
+
rootClientId: destinationRootClientId,
|
27149 |
+
onInsert: onInsertPattern,
|
27150 |
+
category: selectedPatternCategory
|
27151 |
}));
|
27152 |
}
|
27153 |
|
28190 |
|
28191 |
/* harmony default export */ const inbetween = (BlockPopoverInbetween);
|
28192 |
|
28193 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-popover/drop-zone.js
|
28194 |
+
|
28195 |
+
|
28196 |
+
/**
|
28197 |
+
* WordPress dependencies
|
28198 |
+
*/
|
28199 |
+
|
28200 |
+
|
28201 |
+
|
28202 |
+
/**
|
28203 |
+
* Internal dependencies
|
28204 |
+
*/
|
28205 |
+
|
28206 |
+
|
28207 |
+
|
28208 |
+
const animateVariants = {
|
28209 |
+
hide: {
|
28210 |
+
opacity: 0,
|
28211 |
+
scaleY: 0.75
|
28212 |
+
},
|
28213 |
+
show: {
|
28214 |
+
opacity: 1,
|
28215 |
+
scaleY: 1
|
28216 |
+
},
|
28217 |
+
exit: {
|
28218 |
+
opacity: 0,
|
28219 |
+
scaleY: 0.9
|
28220 |
+
}
|
28221 |
+
};
|
28222 |
+
|
28223 |
+
function BlockDropZonePopover(_ref) {
|
28224 |
+
let {
|
28225 |
+
__unstablePopoverSlot,
|
28226 |
+
__unstableContentRef
|
28227 |
+
} = _ref;
|
28228 |
+
const {
|
28229 |
+
clientId
|
28230 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
28231 |
+
const {
|
28232 |
+
getBlockOrder,
|
28233 |
+
getBlockInsertionPoint
|
28234 |
+
} = select(store);
|
28235 |
+
const insertionPoint = getBlockInsertionPoint();
|
28236 |
+
const order = getBlockOrder(insertionPoint.rootClientId);
|
28237 |
+
|
28238 |
+
if (!order.length) {
|
28239 |
+
return {};
|
28240 |
+
}
|
28241 |
+
|
28242 |
+
return {
|
28243 |
+
clientId: order[insertionPoint.index]
|
28244 |
+
};
|
28245 |
+
}, []);
|
28246 |
+
const reducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
|
28247 |
+
return (0,external_wp_element_namespaceObject.createElement)(block_popover, {
|
28248 |
+
clientId: clientId,
|
28249 |
+
__unstableCoverTarget: true,
|
28250 |
+
__unstablePopoverSlot: __unstablePopoverSlot,
|
28251 |
+
__unstableContentRef: __unstableContentRef,
|
28252 |
+
className: "block-editor-block-popover__drop-zone"
|
28253 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
|
28254 |
+
"data-testid": "block-popover-drop-zone",
|
28255 |
+
initial: reducedMotion ? animateVariants.show : animateVariants.hide,
|
28256 |
+
animate: animateVariants.show,
|
28257 |
+
exit: reducedMotion ? animateVariants.show : animateVariants.exit,
|
28258 |
+
className: "block-editor-block-popover__drop-zone-foreground"
|
28259 |
+
}));
|
28260 |
+
}
|
28261 |
+
|
28262 |
+
/* harmony default export */ const drop_zone = (BlockDropZonePopover);
|
28263 |
+
|
28264 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/insertion-point.js
|
28265 |
|
28266 |
|
28267 |
+
|
28268 |
/**
|
28269 |
* External dependencies
|
28270 |
*/
|
28284 |
|
28285 |
|
28286 |
|
28287 |
+
|
28288 |
const insertion_point_InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)();
|
28289 |
|
28290 |
+
function InbetweenInsertionPointPopover(_ref) {
|
28291 |
let {
|
28292 |
__unstablePopoverSlot,
|
28293 |
__unstableContentRef
|
28294 |
} = _ref;
|
28295 |
const {
|
28296 |
+
selectBlock
|
|
|
28297 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
28298 |
const openRef = (0,external_wp_element_namespaceObject.useContext)(insertion_point_InsertionPointOpenRef);
|
28299 |
const ref = (0,external_wp_element_namespaceObject.useRef)();
|
28302 |
previousClientId,
|
28303 |
nextClientId,
|
28304 |
rootClientId,
|
28305 |
+
isInserterShown,
|
28306 |
+
isDistractionFree,
|
28307 |
+
isNavigationMode
|
28308 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
28309 |
var _getBlockListSettings;
|
28310 |
|
28314 |
getBlockInsertionPoint,
|
28315 |
isBlockBeingDragged,
|
28316 |
getPreviousBlockClientId,
|
28317 |
+
getNextBlockClientId,
|
28318 |
+
getSettings,
|
28319 |
+
isNavigationMode: _isNavigationMode
|
28320 |
} = select(store);
|
28321 |
const insertionPoint = getBlockInsertionPoint();
|
28322 |
const order = getBlockOrder(insertionPoint.rootClientId);
|
28336 |
_nextClientId = getNextBlockClientId(_nextClientId);
|
28337 |
}
|
28338 |
|
28339 |
+
const settings = getSettings();
|
28340 |
return {
|
28341 |
previousClientId: _previousClientId,
|
28342 |
nextClientId: _nextClientId,
|
28343 |
orientation: ((_getBlockListSettings = getBlockListSettings(insertionPoint.rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical',
|
28344 |
rootClientId: insertionPoint.rootClientId,
|
28345 |
+
isNavigationMode: _isNavigationMode(),
|
28346 |
+
isDistractionFree: settings.isDistractionFree,
|
28347 |
isInserterShown: insertionPoint === null || insertionPoint === void 0 ? void 0 : insertionPoint.__unstableWithInserter
|
28348 |
};
|
28349 |
}, []);
|
28362 |
if (event.target !== ref.current) {
|
28363 |
openRef.current = true;
|
28364 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28365 |
} // Define animation variants for the line element.
|
28366 |
|
28367 |
|
28416 |
opacity: 1,
|
28417 |
borderRadius: '2px',
|
28418 |
transition: {
|
28419 |
+
delay: isInserterShown ? 0.5 : 0,
|
28420 |
type: 'tween'
|
28421 |
}
|
28422 |
},
|
28424 |
opacity: 1,
|
28425 |
borderRadius: '2px',
|
28426 |
transition: {
|
28427 |
+
delay: 0.5,
|
28428 |
type: 'tween'
|
28429 |
}
|
28430 |
}
|
28436 |
rest: {
|
28437 |
scale: 1,
|
28438 |
transition: {
|
28439 |
+
delay: 0.4,
|
28440 |
type: 'tween'
|
28441 |
}
|
28442 |
}
|
28443 |
};
|
28444 |
+
|
28445 |
+
if (isDistractionFree && !isNavigationMode) {
|
28446 |
+
return null;
|
28447 |
+
}
|
28448 |
+
|
28449 |
const className = classnames_default()('block-editor-block-list__insertion-point', 'is-' + orientation);
|
28450 |
return (0,external_wp_element_namespaceObject.createElement)(inbetween, {
|
28451 |
previousClientId: previousClientId,
|
28465 |
onFocus: onFocus,
|
28466 |
className: classnames_default()(className, {
|
28467 |
'is-with-inserter': isInserterShown
|
28468 |
+
})
|
|
|
28469 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
|
28470 |
variants: lineVariants,
|
28471 |
className: "block-editor-block-list__insertion-point-indicator",
|
28488 |
}
|
28489 |
|
28490 |
function InsertionPoint(props) {
|
28491 |
+
const {
|
28492 |
+
insertionPoint,
|
28493 |
+
isVisible
|
28494 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
28495 |
+
const {
|
28496 |
+
getBlockInsertionPoint,
|
28497 |
+
isBlockInsertionPointVisible
|
28498 |
+
} = select(store);
|
28499 |
+
return {
|
28500 |
+
insertionPoint: getBlockInsertionPoint(),
|
28501 |
+
isVisible: isBlockInsertionPointVisible()
|
28502 |
+
};
|
28503 |
}, []);
|
28504 |
+
|
28505 |
+
if (!isVisible) {
|
28506 |
+
return null;
|
28507 |
+
}
|
28508 |
+
/**
|
28509 |
+
* Render a popover that overlays the block when the desired operation is to replace it.
|
28510 |
+
* Otherwise, render a popover in between blocks for the indication of inserting between them.
|
28511 |
+
*/
|
28512 |
+
|
28513 |
+
|
28514 |
+
return insertionPoint.operation === 'replace' ? (0,external_wp_element_namespaceObject.createElement)(drop_zone // Force remount to trigger the animation.
|
28515 |
+
, _extends({
|
28516 |
+
key: `${insertionPoint.rootClientId}-${insertionPoint.index}`
|
28517 |
+
}, props)) : (0,external_wp_element_namespaceObject.createElement)(InbetweenInsertionPointPopover, props);
|
28518 |
}
|
28519 |
|
28520 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-in-between-inserter.js
|
28532 |
|
28533 |
function useInBetweenInserter() {
|
28534 |
const openRef = (0,external_wp_element_namespaceObject.useContext)(insertion_point_InsertionPointOpenRef);
|
28535 |
+
const isInBetweenInserterDisabled = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().isDistractionFree || select(store).__unstableGetEditorMode() === 'zoom-out', []);
|
28536 |
const {
|
28537 |
getBlockListSettings,
|
28538 |
getBlockRootClientId,
|
28547 |
showInsertionPoint,
|
28548 |
hideInsertionPoint
|
28549 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
|
|
|
|
|
|
28550 |
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
|
28551 |
if (isInBetweenInserterDisabled) {
|
28552 |
return;
|
28564 |
}
|
28565 |
|
28566 |
if (!event.target.classList.contains('block-editor-block-list__layout')) {
|
28567 |
+
hideInsertionPoint();
|
|
|
|
|
|
|
|
|
|
|
28568 |
return;
|
28569 |
}
|
28570 |
|
28590 |
});
|
28591 |
|
28592 |
if (!element) {
|
28593 |
+
hideInsertionPoint();
|
28594 |
return;
|
28595 |
} // The block may be in an alignment wrapper, so check the first direct
|
28596 |
// child if the element has no ID.
|
28600 |
element = element.firstElementChild;
|
28601 |
|
28602 |
if (!element) {
|
28603 |
+
hideInsertionPoint();
|
28604 |
return;
|
28605 |
}
|
28606 |
} // Don't show the insertion point if a parent block has an "overlay"
|
28622 |
const elementRect = element.getBoundingClientRect();
|
28623 |
|
28624 |
if (orientation === 'horizontal' && (event.clientY > elementRect.bottom || event.clientY < elementRect.top) || orientation === 'vertical' && (event.clientX > elementRect.right || event.clientX < elementRect.left)) {
|
28625 |
+
hideInsertionPoint();
|
|
|
|
|
|
|
|
|
|
|
28626 |
return;
|
28627 |
}
|
28628 |
|
28630 |
// the list (preserves the original behaviour).
|
28631 |
|
28632 |
if (index === 0) {
|
28633 |
+
hideInsertionPoint();
|
|
|
|
|
|
|
|
|
|
|
28634 |
return;
|
28635 |
}
|
28636 |
|
28637 |
+
showInsertionPoint(rootClientId, index, {
|
28638 |
__unstableWithInserter: true
|
28639 |
});
|
28640 |
}
|
28677 |
})();
|
28678 |
|
28679 |
function usePreParsePatterns() {
|
28680 |
+
const {
|
28681 |
+
patterns,
|
28682 |
+
isPreviewMode
|
28683 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(_select => {
|
28684 |
+
const {
|
28685 |
+
__experimentalBlockPatterns,
|
28686 |
+
__unstableIsPreviewMode
|
28687 |
+
} = _select(store).getSettings();
|
28688 |
+
|
28689 |
+
return {
|
28690 |
+
patterns: __experimentalBlockPatterns,
|
28691 |
+
isPreviewMode: __unstableIsPreviewMode
|
28692 |
+
};
|
28693 |
+
}, []);
|
28694 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
28695 |
+
if (isPreviewMode) {
|
28696 |
+
return;
|
28697 |
+
}
|
28698 |
+
|
28699 |
if (!(patterns !== null && patterns !== void 0 && patterns.length)) {
|
28700 |
return;
|
28701 |
}
|
28717 |
|
28718 |
handle = requestIdleCallback(callback);
|
28719 |
return () => cancelIdleCallback(handle);
|
28720 |
+
}, [patterns, isPreviewMode]);
|
28721 |
return null;
|
28722 |
}
|
28723 |
|
29110 |
|
29111 |
/* harmony default export */ const block_draggable = (BlockDraggable);
|
29112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29113 |
;// CONCATENATED MODULE: ./packages/icons/build-module/library/chevron-up.js
|
29114 |
|
29115 |
|
30244 |
const {
|
30245 |
firstParentClientId,
|
30246 |
shouldHide,
|
30247 |
+
isDistractionFree
|
30248 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
30249 |
const {
|
30250 |
getBlockName,
|
30266 |
return {
|
30267 |
firstParentClientId: _firstParentClientId,
|
30268 |
shouldHide: !hasBlockSupport(_parentBlockType, '__experimentalParentSelector', true),
|
30269 |
+
isDistractionFree: settings.isDistractionFree
|
30270 |
};
|
30271 |
}, []);
|
30272 |
const blockInformation = useBlockDisplayInformation(firstParentClientId); // Allows highlighting the parent block outline when focusing or hovering
|
30279 |
ref: nodeRef,
|
30280 |
|
30281 |
onChange(isFocused) {
|
30282 |
+
if (isFocused && isDistractionFree) {
|
30283 |
return;
|
30284 |
}
|
30285 |
|
32117 |
|
32118 |
|
32119 |
|
32120 |
+
// Entity based blocks which allow edit locking
|
32121 |
|
32122 |
+
const ALLOWS_EDIT_LOCKING = ['core/block', 'core/navigation'];
|
32123 |
|
32124 |
function getTemplateLockValue(lock) {
|
32125 |
// Prevents all operations.
|
32150 |
canRemove
|
32151 |
} = useBlockLock(clientId);
|
32152 |
const {
|
32153 |
+
allowsEditLocking,
|
32154 |
templateLock,
|
32155 |
hasTemplateLock
|
32156 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
32163 |
const blockName = getBlockName(clientId);
|
32164 |
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
|
32165 |
return {
|
32166 |
+
allowsEditLocking: ALLOWS_EDIT_LOCKING.includes(blockName),
|
32167 |
templateLock: (_getBlockAttributes = getBlockAttributes(clientId)) === null || _getBlockAttributes === void 0 ? void 0 : _getBlockAttributes.templateLock,
|
32168 |
hasTemplateLock: !!(blockType !== null && blockType !== void 0 && (_blockType$attributes = blockType.attributes) !== null && _blockType$attributes !== void 0 && _blockType$attributes.templateLock)
|
32169 |
};
|
32178 |
setLock({
|
32179 |
move: !canMove,
|
32180 |
remove: !canRemove,
|
32181 |
+
...(allowsEditLocking ? {
|
32182 |
edit: !canEdit
|
32183 |
} : {})
|
32184 |
});
|
32185 |
+
}, [canEdit, canMove, canRemove, allowsEditLocking]);
|
32186 |
const isAllChecked = Object.values(lock).every(Boolean);
|
32187 |
const isMixed = Object.values(lock).some(Boolean) && !isAllChecked;
|
32188 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
|
32215 |
onChange: newValue => setLock({
|
32216 |
move: newValue,
|
32217 |
remove: newValue,
|
32218 |
+
...(allowsEditLocking ? {
|
32219 |
edit: newValue
|
32220 |
} : {})
|
32221 |
})
|
32222 |
}), (0,external_wp_element_namespaceObject.createElement)("ul", {
|
32223 |
className: "block-editor-block-lock-modal__checklist"
|
32224 |
+
}, allowsEditLocking && (0,external_wp_element_namespaceObject.createElement)("li", {
|
32225 |
className: "block-editor-block-lock-modal__checklist-item"
|
32226 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
32227 |
label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Restrict editing'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
|
32475 |
const firstBlockClientId = blockClientIds[0];
|
32476 |
const {
|
32477 |
firstParentClientId,
|
32478 |
+
isDistractionFree,
|
32479 |
onlyBlock,
|
32480 |
parentBlockType,
|
32481 |
previousBlockClientId,
|
32485 |
const {
|
32486 |
getBlockCount,
|
32487 |
getBlockName,
|
32488 |
+
getBlockRootClientId,
|
32489 |
getPreviousBlockClientId,
|
32490 |
getNextBlockClientId,
|
32491 |
getSelectedBlockClientIds,
|
32492 |
+
getSettings,
|
32493 |
+
getBlockAttributes
|
32494 |
} = select(store);
|
32495 |
+
const {
|
32496 |
+
getActiveBlockVariation
|
32497 |
+
} = select(external_wp_blocks_namespaceObject.store);
|
32498 |
+
|
32499 |
+
const _firstParentClientId = getBlockRootClientId(firstBlockClientId);
|
32500 |
+
|
32501 |
+
const parentBlockName = _firstParentClientId && getBlockName(_firstParentClientId);
|
32502 |
+
|
32503 |
return {
|
32504 |
firstParentClientId: _firstParentClientId,
|
32505 |
+
isDistractionFree: getSettings().isDistractionFree,
|
32506 |
+
onlyBlock: 1 === getBlockCount(_firstParentClientId),
|
32507 |
+
parentBlockType: _firstParentClientId && (getActiveBlockVariation(parentBlockName, getBlockAttributes(_firstParentClientId)) || (0,external_wp_blocks_namespaceObject.getBlockType)(parentBlockName)),
|
32508 |
previousBlockClientId: getPreviousBlockClientId(firstBlockClientId),
|
32509 |
nextBlockClientId: getNextBlockClientId(firstBlockClientId),
|
32510 |
selectedBlockClientIds: getSelectedBlockClientIds()
|
32560 |
ref: selectParentButtonRef,
|
32561 |
|
32562 |
onChange(isFocused) {
|
32563 |
+
if (isFocused && isDistractionFree) {
|
32564 |
return;
|
32565 |
}
|
32566 |
|
32599 |
fillProps: {
|
32600 |
onClose
|
32601 |
}
|
32602 |
+
}), !!firstParentClientId && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, _extends({}, showParentOutlineGestures, {
|
32603 |
ref: selectParentButtonRef,
|
32604 |
icon: (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
32605 |
icon: parentBlockType.icon
|
32969 |
blockClientId,
|
32970 |
blockType,
|
32971 |
hasFixedToolbar,
|
32972 |
+
isDistractionFree,
|
32973 |
isValid,
|
32974 |
isVisual,
|
32975 |
isContentLocked
|
32992 |
blockClientId: selectedBlockClientId,
|
32993 |
blockType: selectedBlockClientId && (0,external_wp_blocks_namespaceObject.getBlockType)(getBlockName(selectedBlockClientId)),
|
32994 |
hasFixedToolbar: settings.hasFixedToolbar,
|
32995 |
+
isDistractionFree: settings.isDistractionFree,
|
32996 |
rootClientId: blockRootClientId,
|
32997 |
isValid: selectedBlockClientIds.every(id => isBlockValid(id)),
|
32998 |
isVisual: selectedBlockClientIds.every(id => getBlockMode(id) === 'visual'),
|
33012 |
ref: nodeRef,
|
33013 |
|
33014 |
onChange(isFocused) {
|
33015 |
+
if (isFocused && isDistractionFree) {
|
33016 |
return;
|
33017 |
}
|
33018 |
|
33051 |
clientId: blockClientIds[0]
|
33052 |
}), (0,external_wp_element_namespaceObject.createElement)(block_mover, {
|
33053 |
clientIds: blockClientIds,
|
33054 |
+
hideDragHandle: hideDragHandle
|
33055 |
}))), shouldShowVisualToolbar && isMultiToolbar && (0,external_wp_element_namespaceObject.createElement)(toolbar, null), shouldShowVisualToolbar && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, {
|
33056 |
group: "parent",
|
33057 |
className: "block-editor-block-toolbar__slot"
|
33326 |
isMultiSelecting: isMultiSelecting(),
|
33327 |
isTyping: isTyping(),
|
33328 |
hasFixedToolbar: getSettings().hasFixedToolbar,
|
33329 |
+
isDistractionFree: getSettings().isDistractionFree,
|
33330 |
lastClientId: hasMultiSelection() ? getLastMultiSelectedBlockClientId() : null
|
33331 |
};
|
33332 |
}
|
33336 |
clientId,
|
33337 |
rootClientId,
|
33338 |
isEmptyDefaultBlock,
|
33339 |
+
showContents,
|
33340 |
+
// we may need to mount an empty popover because we reuse
|
33341 |
capturingClientId,
|
33342 |
__unstablePopoverSlot,
|
33343 |
__unstableContentRef
|
33347 |
isMultiSelecting,
|
33348 |
isTyping,
|
33349 |
hasFixedToolbar,
|
33350 |
+
isDistractionFree,
|
33351 |
lastClientId
|
33352 |
} = (0,external_wp_data_namespaceObject.useSelect)(selected_block_popover_selector, []);
|
33353 |
const isInsertionPointVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
33373 |
const showEmptyBlockSideInserter = !isTyping && editorMode === 'edit' && isEmptyDefaultBlock;
|
33374 |
const shouldShowBreadcrumb = editorMode === 'navigation' || editorMode === 'zoom-out';
|
33375 |
const shouldShowContextualToolbar = editorMode === 'edit' && !hasFixedToolbar && isLargeViewport && !isMultiSelecting && !showEmptyBlockSideInserter && !isTyping;
|
33376 |
+
const canFocusHiddenToolbar = editorMode === 'edit' && !shouldShowContextualToolbar && !hasFixedToolbar && !isDistractionFree && !isEmptyDefaultBlock;
|
33377 |
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', () => {
|
33378 |
isToolbarForced.current = true;
|
33379 |
stopTyping(true);
|
33404 |
__unstablePopoverSlot: __unstablePopoverSlot,
|
33405 |
__unstableContentRef: __unstableContentRef,
|
33406 |
resize: false
|
33407 |
+
}, popoverProps), shouldShowContextualToolbar && showContents && (0,external_wp_element_namespaceObject.createElement)(block_contextual_toolbar // If the toolbar is being shown because of being forced
|
33408 |
// it should focus the toolbar right after the mount.
|
33409 |
, {
|
33410 |
focusOnMount: isToolbarForced.current,
|
33428 |
getBlockRootClientId,
|
33429 |
getBlock,
|
33430 |
getBlockParents,
|
33431 |
+
getSettings,
|
33432 |
+
isNavigationMode: _isNavigationMode,
|
33433 |
__experimentalGetBlockListSettingsForBlocks
|
33434 |
} = select(store);
|
33435 |
const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
|
33452 |
|
33453 |
return (_parentBlockListSetti = parentBlockListSettings[parentClientId]) === null || _parentBlockListSetti === void 0 ? void 0 : _parentBlockListSetti.__experimentalCaptureToolbars;
|
33454 |
});
|
33455 |
+
const settings = getSettings();
|
33456 |
return {
|
33457 |
clientId,
|
33458 |
rootClientId: getBlockRootClientId(clientId),
|
33459 |
name,
|
33460 |
+
isDistractionFree: settings.isDistractionFree,
|
33461 |
+
isNavigationMode: _isNavigationMode(),
|
33462 |
isEmptyDefaultBlock: name && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)({
|
33463 |
name,
|
33464 |
attributes
|
33483 |
rootClientId,
|
33484 |
name,
|
33485 |
isEmptyDefaultBlock,
|
33486 |
+
capturingClientId,
|
33487 |
+
isDistractionFree,
|
33488 |
+
isNavigationMode
|
33489 |
} = selected;
|
33490 |
|
33491 |
if (!name) {
|
33496 |
clientId: clientId,
|
33497 |
rootClientId: rootClientId,
|
33498 |
isEmptyDefaultBlock: isEmptyDefaultBlock,
|
33499 |
+
showContents: !isDistractionFree || isNavigationMode,
|
33500 |
capturingClientId: capturingClientId,
|
33501 |
__unstablePopoverSlot: __unstablePopoverSlot,
|
33502 |
__unstableContentRef: __unstableContentRef
|
33531 |
|
33532 |
external_wp_deprecated_default()('wp.components.Popover.Slot name="block-toolbar"', {
|
33533 |
alternative: 'wp.blockEditor.BlockTools',
|
33534 |
+
since: '5.8',
|
33535 |
+
version: '6.3'
|
33536 |
});
|
33537 |
return (0,external_wp_element_namespaceObject.createElement)(InsertionPoint, {
|
33538 |
__unstablePopoverSlot: "block-toolbar"
|
33786 |
|
33787 |
function useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection) {
|
33788 |
const {
|
33789 |
+
getSelectedBlocksInitialCaretPosition,
|
33790 |
+
isBlockSelected
|
33791 |
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
33792 |
const {
|
33793 |
replaceInnerBlocks
|
33818 |
const nextBlocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(currentInnerBlocks, template);
|
33819 |
|
33820 |
if (!(0,external_lodash_namespaceObject.isEqual)(nextBlocks, currentInnerBlocks)) {
|
33821 |
+
replaceInnerBlocks(clientId, nextBlocks, currentInnerBlocks.length === 0 && templateInsertUpdatesSelection && nextBlocks.length !== 0 && isBlockSelected(clientId), // This ensures the "initialPosition" doesn't change when applying the template
|
33822 |
// If we're supposed to focus the block, we'll focus the first inner block
|
33823 |
// otherwise, we won't apply any auto-focus.
|
33824 |
// This ensures for instance that the focus stays in the inserter when inserting the "buttons" block.
|
33881 |
|
33882 |
/** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */
|
33883 |
|
33884 |
+
/** @typedef {import('./types').WPDropOperation} WPDropOperation */
|
33885 |
+
|
33886 |
/**
|
33887 |
* Retrieve the data for a block drop event.
|
33888 |
*
|
34017 |
/**
|
34018 |
* A React hook for handling block drop events.
|
34019 |
*
|
34020 |
+
* @param {string} targetRootClientId The root client id where the block(s) will be inserted.
|
34021 |
+
* @param {number} targetBlockIndex The index where the block(s) will be inserted.
|
34022 |
+
* @param {Object} options The optional options.
|
34023 |
+
* @param {WPDropOperation} [options.operation] The type of operation to perform on drop. Could be `insert` or `replace` for now.
|
|
|
|
|
34024 |
*
|
34025 |
+
* @return {Function} A function to be passed to the onDrop handler.
|
34026 |
*/
|
34027 |
|
34028 |
function useOnBlockDrop(targetRootClientId, targetBlockIndex) {
|
34029 |
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
34030 |
const {
|
34031 |
+
operation = 'insert'
|
34032 |
} = options;
|
34033 |
const hasUploadPermissions = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().mediaUpload, []);
|
34034 |
const {
|
34051 |
let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
34052 |
let initialPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
34053 |
|
34054 |
+
if (operation === 'replace') {
|
34055 |
const clientIds = getBlockOrder(targetRootClientId);
|
34056 |
const clientId = clientIds[targetBlockIndex];
|
34057 |
replaceBlocks(clientId, blocks, undefined, initialPosition);
|
34058 |
} else {
|
34059 |
insertBlocks(blocks, targetBlockIndex, targetRootClientId, updateSelection, initialPosition);
|
34060 |
}
|
34061 |
+
}, [operation, getBlockOrder, insertBlocks, replaceBlocks, targetBlockIndex, targetRootClientId]);
|
34062 |
const moveBlocks = (0,external_wp_element_namespaceObject.useCallback)((sourceClientIds, sourceRootClientId, insertIndex) => {
|
34063 |
+
if (operation === 'replace') {
|
34064 |
const sourceBlocks = getBlocksByClientId(sourceClientIds);
|
34065 |
const targetBlockClientIds = getBlockOrder(targetRootClientId);
|
34066 |
const targetBlockClientId = targetBlockClientIds[targetBlockIndex];
|
34073 |
} else {
|
34074 |
moveBlocksToPosition(sourceClientIds, sourceRootClientId, targetRootClientId, insertIndex);
|
34075 |
}
|
34076 |
+
}, [operation, getBlockOrder, getBlocksByClientId, insertBlocks, moveBlocksToPosition, removeBlocks, targetBlockIndex, targetRootClientId]);
|
34077 |
|
34078 |
const _onDrop = onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getClientIdsOfDescendants, moveBlocks, insertOrReplaceBlocks, clearSelectedBlock);
|
34079 |
|
34183 |
});
|
34184 |
return [candidateDistance, candidateEdge];
|
34185 |
}
|
34186 |
+
/**
|
34187 |
+
* Is the point contained by the rectangle.
|
34188 |
+
*
|
34189 |
+
* @param {WPPoint} point The point.
|
34190 |
+
* @param {DOMRect} rect The rectangle.
|
34191 |
+
*
|
34192 |
+
* @return {boolean} True if the point is contained by the rectangle, false otherwise.
|
34193 |
+
*/
|
34194 |
+
|
34195 |
+
function isPointContainedByRect(point, rect) {
|
34196 |
+
return rect.left <= point.x && rect.right >= point.x && rect.top <= point.y && rect.bottom >= point.y;
|
34197 |
+
}
|
34198 |
|
34199 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/use-block-drop-zone/index.js
|
34200 |
/**
|
34204 |
|
34205 |
|
34206 |
|
34207 |
+
|
34208 |
/**
|
34209 |
* Internal dependencies
|
34210 |
*/
|
34214 |
|
34215 |
/** @typedef {import('../../utils/math').WPPoint} WPPoint */
|
34216 |
|
34217 |
+
/** @typedef {import('../use-on-block-drop/types').WPDropOperation} WPDropOperation */
|
34218 |
+
|
34219 |
/**
|
34220 |
* The orientation of a block list.
|
34221 |
*
|
34223 |
*/
|
34224 |
|
34225 |
/**
|
34226 |
+
* The insert position when dropping a block.
|
|
|
34227 |
*
|
34228 |
+
* @typedef {'before'|'after'} WPInsertPosition
|
34229 |
+
*/
|
34230 |
+
|
34231 |
+
/**
|
34232 |
+
* @typedef {Object} WPBlockData
|
34233 |
+
* @property {boolean} isUnmodifiedDefaultBlock Is the block unmodified default block.
|
34234 |
+
* @property {() => DOMRect} getBoundingClientRect Get the bounding client rect of the block.
|
34235 |
+
* @property {number} blockIndex The index of the block.
|
34236 |
+
*/
|
34237 |
+
|
34238 |
+
/**
|
34239 |
+
* Get the drop target position from a given drop point and the orientation.
|
34240 |
*
|
34241 |
+
* @param {WPBlockData[]} blocksData The block data list.
|
34242 |
+
* @param {WPPoint} position The position of the item being dragged.
|
34243 |
+
* @param {WPBlockListOrientation} orientation The orientation of the block list.
|
34244 |
+
* @return {[number, WPDropOperation]} The drop target position.
|
34245 |
*/
|
34246 |
|
34247 |
+
function getDropTargetPosition(blocksData, position) {
|
34248 |
+
var _blocksData$nearestIn, _blocksData$adjacentI;
|
34249 |
+
|
34250 |
+
let orientation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'vertical';
|
34251 |
const allowedEdges = orientation === 'horizontal' ? ['left', 'right'] : ['top', 'bottom'];
|
34252 |
const isRightToLeft = (0,external_wp_i18n_namespaceObject.isRTL)();
|
34253 |
+
let nearestIndex = 0;
|
34254 |
+
let insertPosition = 'before';
|
34255 |
+
let minDistance = Infinity;
|
34256 |
+
blocksData.forEach(_ref => {
|
34257 |
+
let {
|
34258 |
+
isUnmodifiedDefaultBlock,
|
34259 |
+
getBoundingClientRect,
|
34260 |
+
blockIndex
|
34261 |
+
} = _ref;
|
34262 |
+
const rect = getBoundingClientRect();
|
34263 |
+
let [distance, edge] = getDistanceToNearestEdge(position, rect, allowedEdges); // Prioritize the element if the point is inside of an unmodified default block.
|
34264 |
|
34265 |
+
if (isUnmodifiedDefaultBlock && isPointContainedByRect(position, rect)) {
|
34266 |
+
distance = 0;
|
34267 |
+
}
|
|
|
|
|
|
|
|
|
34268 |
|
34269 |
+
if (distance < minDistance) {
|
34270 |
+
// Where the dropped block will be inserted on the nearest block.
|
34271 |
+
insertPosition = edge === 'bottom' || !isRightToLeft && edge === 'right' || isRightToLeft && edge === 'left' ? 'after' : 'before'; // Update the currently known best candidate.
|
34272 |
+
|
34273 |
+
minDistance = distance;
|
34274 |
+
nearestIndex = blockIndex;
|
34275 |
}
|
34276 |
});
|
34277 |
+
const adjacentIndex = nearestIndex + (insertPosition === 'after' ? 1 : -1);
|
34278 |
+
const isNearestBlockUnmodifiedDefaultBlock = !!((_blocksData$nearestIn = blocksData[nearestIndex]) !== null && _blocksData$nearestIn !== void 0 && _blocksData$nearestIn.isUnmodifiedDefaultBlock);
|
34279 |
+
const isAdjacentBlockUnmodifiedDefaultBlock = !!((_blocksData$adjacentI = blocksData[adjacentIndex]) !== null && _blocksData$adjacentI !== void 0 && _blocksData$adjacentI.isUnmodifiedDefaultBlock); // If both blocks are not unmodified default blocks then just insert between them.
|
34280 |
+
|
34281 |
+
if (!isNearestBlockUnmodifiedDefaultBlock && !isAdjacentBlockUnmodifiedDefaultBlock) {
|
34282 |
+
// If the user is dropping to the trailing edge of the block
|
34283 |
+
// add 1 to the index to represent dragging after.
|
34284 |
+
const insertionIndex = insertPosition === 'after' ? nearestIndex + 1 : nearestIndex;
|
34285 |
+
return [insertionIndex, 'insert'];
|
34286 |
+
} // Otherwise, replace the nearest unmodified default block.
|
34287 |
|
34288 |
+
|
34289 |
+
return [isNearestBlockUnmodifiedDefaultBlock ? nearestIndex : adjacentIndex, 'replace'];
|
34290 |
}
|
34291 |
/**
|
34292 |
* @typedef {Object} WPBlockDropZoneConfig
|
34299 |
* @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone.
|
34300 |
*/
|
34301 |
|
|
|
34302 |
function useBlockDropZone() {
|
34303 |
let {
|
34304 |
// An undefined value represents a top-level block. Default to an empty
|
34307 |
// an empty string to represent top-level blocks.
|
34308 |
rootClientId: targetRootClientId = ''
|
34309 |
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
34310 |
+
const [dropTarget, setDropTarget] = (0,external_wp_element_namespaceObject.useState)({
|
34311 |
+
index: null,
|
34312 |
+
operation: 'insert'
|
34313 |
+
});
|
34314 |
const isDisabled = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
34315 |
const {
|
34316 |
getTemplateLock,
|
34321 |
return ['all', 'contentOnly'].some(lock => lock === templateLock) || __unstableHasActiveBlockOverlayActive(targetRootClientId) || __unstableIsWithinBlockOverlay(targetRootClientId);
|
34322 |
}, [targetRootClientId]);
|
34323 |
const {
|
34324 |
+
getBlockListSettings,
|
34325 |
+
getBlocks,
|
34326 |
+
getBlockIndex
|
34327 |
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
34328 |
const {
|
34329 |
showInsertionPoint,
|
34330 |
hideInsertionPoint
|
34331 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
34332 |
+
const onBlockDrop = useOnBlockDrop(targetRootClientId, dropTarget.index, {
|
34333 |
+
operation: dropTarget.operation
|
34334 |
+
});
|
34335 |
+
const throttled = (0,external_wp_compose_namespaceObject.useThrottle)((0,external_wp_element_namespaceObject.useCallback)((event, ownerDocument) => {
|
34336 |
var _getBlockListSettings;
|
34337 |
|
34338 |
+
const blocks = getBlocks(targetRootClientId); // The block list is empty, don't show the insertion point but still allow dropping.
|
34339 |
+
|
34340 |
+
if (blocks.length === 0) {
|
34341 |
+
setDropTarget({
|
34342 |
+
index: 0,
|
34343 |
+
operation: 'insert'
|
34344 |
+
});
|
34345 |
+
return;
|
34346 |
+
}
|
34347 |
+
|
34348 |
+
const blocksData = blocks.map(block => {
|
34349 |
+
const clientId = block.clientId;
|
34350 |
+
return {
|
34351 |
+
isUnmodifiedDefaultBlock: (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(block),
|
34352 |
+
getBoundingClientRect: () => ownerDocument.getElementById(`block-${clientId}`).getBoundingClientRect(),
|
34353 |
+
blockIndex: getBlockIndex(clientId)
|
34354 |
+
};
|
34355 |
+
});
|
34356 |
+
const [targetIndex, operation] = getDropTargetPosition(blocksData, {
|
34357 |
x: event.clientX,
|
34358 |
y: event.clientY
|
34359 |
}, (_getBlockListSettings = getBlockListSettings(targetRootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation);
|
34360 |
+
setDropTarget({
|
34361 |
+
index: targetIndex,
|
34362 |
+
operation
|
34363 |
+
});
|
34364 |
+
showInsertionPoint(targetRootClientId, targetIndex, {
|
34365 |
+
operation
|
34366 |
+
});
|
34367 |
+
}, [targetRootClientId]), 200);
|
|
|
|
|
|
|
|
|
|
|
34368 |
return (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
|
34369 |
isDisabled,
|
34370 |
onDrop: onBlockDrop,
|
34373 |
// `currentTarget` is only available while the event is being
|
34374 |
// handled, so get it now and pass it to the thottled function.
|
34375 |
// https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget
|
34376 |
+
throttled(event, event.currentTarget.ownerDocument);
|
34377 |
},
|
34378 |
|
34379 |
onDragLeave() {
|
34380 |
throttled.cancel();
|
34381 |
hideInsertionPoint();
|
|
|
34382 |
},
|
34383 |
|
34384 |
onDragEnd() {
|
34385 |
throttled.cancel();
|
34386 |
hideInsertionPoint();
|
|
|
34387 |
}
|
34388 |
|
34389 |
});
|
36179 |
}
|
36180 |
|
36181 |
function ColorGradientControl(props) {
|
36182 |
+
if (colorsAndGradientKeys.every(key => props.hasOwnProperty(key))) {
|
36183 |
return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlInner, props);
|
36184 |
}
|
36185 |
|
38005 |
|
38006 |
/* harmony default export */ const font_size_picker = (FontSizePicker);
|
38007 |
|
38008 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/font-sizes/fluid-utils.js
|
38009 |
+
/**
|
38010 |
+
* The fluid utilities must match the backend equivalent.
|
38011 |
+
* See: gutenberg_get_typography_font_size_value() in lib/block-supports/typography.php
|
38012 |
+
* ---------------------------------------------------------------
|
38013 |
+
*/
|
38014 |
+
// Defaults.
|
38015 |
+
const DEFAULT_MAXIMUM_VIEWPORT_WIDTH = '1600px';
|
38016 |
+
const DEFAULT_MINIMUM_VIEWPORT_WIDTH = '768px';
|
38017 |
+
const DEFAULT_SCALE_FACTOR = 1;
|
38018 |
+
const DEFAULT_MINIMUM_FONT_SIZE_FACTOR = 0.75;
|
38019 |
+
const DEFAULT_MAXIMUM_FONT_SIZE_FACTOR = 1.5;
|
38020 |
+
const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';
|
38021 |
+
/**
|
38022 |
+
* Computes a fluid font-size value that uses clamp(). A minimum and maxinmum
|
38023 |
+
* font size OR a single font size can be specified.
|
38024 |
+
*
|
38025 |
+
* If a single font size is specified, it is scaled up and down by
|
38026 |
+
* minimumFontSizeFactor and maximumFontSizeFactor to arrive at the minimum and
|
38027 |
+
* maximum sizes.
|
38028 |
+
*
|
38029 |
+
* @example
|
38030 |
+
* ```js
|
38031 |
+
* // Calculate fluid font-size value from a minimum and maximum value.
|
38032 |
+
* const fontSize = getComputedFluidTypographyValue( {
|
38033 |
+
* minimumFontSize: '20px',
|
38034 |
+
* maximumFontSize: '45px'
|
38035 |
+
* } );
|
38036 |
+
* // Calculate fluid font-size value from a single font size.
|
38037 |
+
* const fontSize = getComputedFluidTypographyValue( {
|
38038 |
+
* fontSize: '30px',
|
38039 |
+
* } );
|
38040 |
+
* ```
|
38041 |
+
*
|
38042 |
+
* @param {Object} args
|
38043 |
+
* @param {?string} args.minimumViewPortWidth Minimum viewport size from which type will have fluidity. Optional if fontSize is specified.
|
38044 |
+
* @param {?string} args.maximumViewPortWidth Maximum size up to which type will have fluidity. Optional if fontSize is specified.
|
38045 |
+
* @param {string|number} [args.fontSize] Size to derive maximumFontSize and minimumFontSize from, if necessary. Optional if minimumFontSize and maximumFontSize are specified.
|
38046 |
+
* @param {?string} args.maximumFontSize Maximum font size for any clamp() calculation. Optional.
|
38047 |
+
* @param {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional.
|
38048 |
+
* @param {?number} args.scaleFactor A scale factor to determine how fast a font scales within boundaries. Optional.
|
38049 |
+
* @param {?number} args.minimumFontSizeFactor How much to scale defaultFontSize by to derive minimumFontSize. Optional.
|
38050 |
+
* @param {?number} args.maximumFontSizeFactor How much to scale defaultFontSize by to derive maximumFontSize. Optional.
|
38051 |
+
*
|
38052 |
+
* @return {string|null} A font-size value using clamp().
|
38053 |
+
*/
|
38054 |
+
|
38055 |
+
function getComputedFluidTypographyValue(_ref) {
|
38056 |
+
let {
|
38057 |
+
minimumFontSize,
|
38058 |
+
maximumFontSize,
|
38059 |
+
fontSize,
|
38060 |
+
minimumViewPortWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH,
|
38061 |
+
maximumViewPortWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
|
38062 |
+
scaleFactor = DEFAULT_SCALE_FACTOR,
|
38063 |
+
minimumFontSizeFactor = DEFAULT_MINIMUM_FONT_SIZE_FACTOR,
|
38064 |
+
maximumFontSizeFactor = DEFAULT_MAXIMUM_FONT_SIZE_FACTOR,
|
38065 |
+
minimumFontSizeLimit = DEFAULT_MINIMUM_FONT_SIZE_LIMIT
|
38066 |
+
} = _ref;
|
38067 |
+
|
38068 |
+
/*
|
38069 |
+
* Caches minimumFontSize in minimumFontSizeValue
|
38070 |
+
* so we can check if minimumFontSize exists later.
|
38071 |
+
*/
|
38072 |
+
let minimumFontSizeValue = minimumFontSize;
|
38073 |
+
/*
|
38074 |
+
* Calculates missing minimumFontSize and maximumFontSize from
|
38075 |
+
* defaultFontSize if provided.
|
38076 |
+
*/
|
38077 |
+
|
38078 |
+
if (fontSize) {
|
38079 |
+
// Parses default font size.
|
38080 |
+
const fontSizeParsed = getTypographyValueAndUnit(fontSize); // Protect against invalid units.
|
38081 |
+
|
38082 |
+
if (!(fontSizeParsed !== null && fontSizeParsed !== void 0 && fontSizeParsed.unit)) {
|
38083 |
+
return null;
|
38084 |
+
} // If no minimumFontSize is provided, derive using min scale factor.
|
38085 |
+
|
38086 |
+
|
38087 |
+
if (!minimumFontSizeValue) {
|
38088 |
+
minimumFontSizeValue = roundToPrecision(fontSizeParsed.value * minimumFontSizeFactor, 3) + fontSizeParsed.unit;
|
38089 |
+
} // Parses the minimum font size limit, so we can perform checks using it.
|
38090 |
+
|
38091 |
+
|
38092 |
+
const minimumFontSizeLimitParsed = getTypographyValueAndUnit(minimumFontSizeLimit, {
|
38093 |
+
coerceTo: fontSizeParsed.unit
|
38094 |
+
});
|
38095 |
+
|
38096 |
+
if (!!(minimumFontSizeLimitParsed !== null && minimumFontSizeLimitParsed !== void 0 && minimumFontSizeLimitParsed.value)) {
|
38097 |
+
/*
|
38098 |
+
* If a minimum size was not passed to this function
|
38099 |
+
* and the user-defined font size is lower than `minimumFontSizeLimit`,
|
38100 |
+
* then uses the user-defined font size as the minimum font-size.
|
38101 |
+
*/
|
38102 |
+
if (!minimumFontSize && (fontSizeParsed === null || fontSizeParsed === void 0 ? void 0 : fontSizeParsed.value) < (minimumFontSizeLimitParsed === null || minimumFontSizeLimitParsed === void 0 ? void 0 : minimumFontSizeLimitParsed.value)) {
|
38103 |
+
minimumFontSizeValue = `${fontSizeParsed.value}${fontSizeParsed.unit}`;
|
38104 |
+
} else {
|
38105 |
+
const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSizeValue, {
|
38106 |
+
coerceTo: fontSizeParsed.unit
|
38107 |
+
});
|
38108 |
+
/*
|
38109 |
+
* Otherwise, if the passed or calculated minimum font size is lower than `minimumFontSizeLimit`
|
38110 |
+
* use `minimumFontSizeLimit` instead.
|
38111 |
+
*/
|
38112 |
+
|
38113 |
+
if (!!(minimumFontSizeParsed !== null && minimumFontSizeParsed !== void 0 && minimumFontSizeParsed.value) && minimumFontSizeParsed.value < minimumFontSizeLimitParsed.value) {
|
38114 |
+
minimumFontSizeValue = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`;
|
38115 |
+
}
|
38116 |
+
}
|
38117 |
+
} // If no maximumFontSize is provided, derive using max scale factor.
|
38118 |
+
|
38119 |
+
|
38120 |
+
if (!maximumFontSize) {
|
38121 |
+
maximumFontSize = roundToPrecision(fontSizeParsed.value * maximumFontSizeFactor, 3) + fontSizeParsed.unit;
|
38122 |
+
}
|
38123 |
+
} // Return early if one of the provided inputs is not provided.
|
38124 |
+
|
38125 |
+
|
38126 |
+
if (!minimumFontSizeValue || !maximumFontSize) {
|
38127 |
+
return null;
|
38128 |
+
} // Grab the minimum font size and normalize it in order to use the value for calculations.
|
38129 |
+
|
38130 |
+
|
38131 |
+
const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSizeValue); // We get a 'preferred' unit to keep units consistent when calculating,
|
38132 |
+
// otherwise the result will not be accurate.
|
38133 |
+
|
38134 |
+
const fontSizeUnit = (minimumFontSizeParsed === null || minimumFontSizeParsed === void 0 ? void 0 : minimumFontSizeParsed.unit) || 'rem'; // Grabs the maximum font size and normalize it in order to use the value for calculations.
|
38135 |
+
|
38136 |
+
const maximumFontSizeParsed = getTypographyValueAndUnit(maximumFontSize, {
|
38137 |
+
coerceTo: fontSizeUnit
|
38138 |
+
}); // Checks for mandatory min and max sizes, and protects against unsupported units.
|
38139 |
+
|
38140 |
+
if (!minimumFontSizeParsed || !maximumFontSizeParsed) {
|
38141 |
+
return null;
|
38142 |
+
} // Uses rem for accessible fluid target font scaling.
|
38143 |
+
|
38144 |
+
|
38145 |
+
const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSizeValue, {
|
38146 |
+
coerceTo: 'rem'
|
38147 |
+
}); // Viewport widths defined for fluid typography. Normalize units
|
38148 |
+
|
38149 |
+
const maximumViewPortWidthParsed = getTypographyValueAndUnit(maximumViewPortWidth, {
|
38150 |
+
coerceTo: fontSizeUnit
|
38151 |
+
});
|
38152 |
+
const minumumViewPortWidthParsed = getTypographyValueAndUnit(minimumViewPortWidth, {
|
38153 |
+
coerceTo: fontSizeUnit
|
38154 |
+
}); // Protect against unsupported units.
|
38155 |
+
|
38156 |
+
if (!maximumViewPortWidthParsed || !minumumViewPortWidthParsed || !minimumFontSizeRem) {
|
38157 |
+
return null;
|
38158 |
+
} // Build CSS rule.
|
38159 |
+
// Borrowed from https://websemantics.uk/tools/responsive-font-calculator/.
|
38160 |
+
|
38161 |
+
|
38162 |
+
const minViewPortWidthOffsetValue = roundToPrecision(minumumViewPortWidthParsed.value / 100, 3);
|
38163 |
+
const viewPortWidthOffset = roundToPrecision(minViewPortWidthOffsetValue, 3) + fontSizeUnit;
|
38164 |
+
const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / (maximumViewPortWidthParsed.value - minumumViewPortWidthParsed.value));
|
38165 |
+
const linearFactorScaled = roundToPrecision((linearFactor || 1) * scaleFactor, 3);
|
38166 |
+
const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewPortWidthOffset}) * ${linearFactorScaled})`;
|
38167 |
+
return `clamp(${minimumFontSizeValue}, ${fluidTargetFontSize}, ${maximumFontSize})`;
|
38168 |
+
}
|
38169 |
+
/**
|
38170 |
+
* Internal method that checks a string for a unit and value and returns an array consisting of `'value'` and `'unit'`, e.g., [ '42', 'rem' ].
|
38171 |
+
* A raw font size of `value + unit` is expected. If the value is an integer, it will convert to `value + 'px'`.
|
38172 |
+
*
|
38173 |
+
* @param {string|number} rawValue Raw size value from theme.json.
|
38174 |
+
* @param {Object|undefined} options Calculation options.
|
38175 |
+
*
|
38176 |
+
* @return {{ unit: string, value: number }|null} An object consisting of `'value'` and `'unit'` properties.
|
38177 |
+
*/
|
38178 |
+
|
38179 |
+
function getTypographyValueAndUnit(rawValue) {
|
38180 |
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
38181 |
+
|
38182 |
+
if (typeof rawValue !== 'string' && typeof rawValue !== 'number') {
|
38183 |
+
return null;
|
38184 |
+
} // Converts numeric values to pixel values by default.
|
38185 |
+
|
38186 |
+
|
38187 |
+
if (isFinite(rawValue)) {
|
38188 |
+
rawValue = `${rawValue}px`;
|
38189 |
+
}
|
38190 |
+
|
38191 |
+
const {
|
38192 |
+
coerceTo,
|
38193 |
+
rootSizeValue,
|
38194 |
+
acceptableUnits
|
38195 |
+
} = {
|
38196 |
+
coerceTo: '',
|
38197 |
+
// Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( "html" ) ).fontSize`.
|
38198 |
+
rootSizeValue: 16,
|
38199 |
+
acceptableUnits: ['rem', 'px', 'em'],
|
38200 |
+
...options
|
38201 |
+
};
|
38202 |
+
const acceptableUnitsGroup = acceptableUnits === null || acceptableUnits === void 0 ? void 0 : acceptableUnits.join('|');
|
38203 |
+
const regexUnits = new RegExp(`^(\\d*\\.?\\d+)(${acceptableUnitsGroup}){1,1}$`);
|
38204 |
+
const matches = rawValue.match(regexUnits); // We need a number value and a unit.
|
38205 |
+
|
38206 |
+
if (!matches || matches.length < 3) {
|
38207 |
+
return null;
|
38208 |
+
}
|
38209 |
+
|
38210 |
+
let [, value, unit] = matches;
|
38211 |
+
let returnValue = parseFloat(value);
|
38212 |
+
|
38213 |
+
if ('px' === coerceTo && ('em' === unit || 'rem' === unit)) {
|
38214 |
+
returnValue = returnValue * rootSizeValue;
|
38215 |
+
unit = coerceTo;
|
38216 |
+
}
|
38217 |
+
|
38218 |
+
if ('px' === unit && ('em' === coerceTo || 'rem' === coerceTo)) {
|
38219 |
+
returnValue = returnValue / rootSizeValue;
|
38220 |
+
unit = coerceTo;
|
38221 |
+
}
|
38222 |
+
/*
|
38223 |
+
* No calculation is required if swapping between em and rem yet,
|
38224 |
+
* since we assume a root size value. Later we might like to differentiate between
|
38225 |
+
* :root font size (rem) and parent element font size (em) relativity.
|
38226 |
+
*/
|
38227 |
+
|
38228 |
+
|
38229 |
+
if (('em' === coerceTo || 'rem' === coerceTo) && ('em' === unit || 'rem' === unit)) {
|
38230 |
+
unit = coerceTo;
|
38231 |
+
}
|
38232 |
+
|
38233 |
+
return {
|
38234 |
+
value: roundToPrecision(returnValue, 3),
|
38235 |
+
unit
|
38236 |
+
};
|
38237 |
+
}
|
38238 |
+
/**
|
38239 |
+
* Returns a value rounded to defined precision.
|
38240 |
+
* Returns `undefined` if the value is not a valid finite number.
|
38241 |
+
*
|
38242 |
+
* @param {number} value Raw value.
|
38243 |
+
* @param {number} digits The number of digits to appear after the decimal point
|
38244 |
+
*
|
38245 |
+
* @return {number|undefined} Value rounded to standard precision.
|
38246 |
+
*/
|
38247 |
+
|
38248 |
+
function roundToPrecision(value) {
|
38249 |
+
let digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
38250 |
+
const base = Math.pow(10, digits);
|
38251 |
+
return Number.isFinite(value) ? parseFloat(Math.round(value * base) / base) : undefined;
|
38252 |
+
}
|
38253 |
+
|
38254 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/font-size.js
|
38255 |
|
38256 |
|
38261 |
|
38262 |
|
38263 |
|
38264 |
+
|
38265 |
/**
|
38266 |
* Internal dependencies
|
38267 |
*/
|
38270 |
|
38271 |
|
38272 |
|
38273 |
+
|
38274 |
const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
|
38275 |
/**
|
38276 |
* Filters registered block settings, extending attributes to include
|
38505 |
};
|
38506 |
return transformStyles(activeSupports, font_size_MIGRATION_PATHS, result, source, index, results);
|
38507 |
}
|
38508 |
+
/**
|
38509 |
+
* Allow custom font sizes to appear fluid when fluid typography is enabled at
|
38510 |
+
* the theme level.
|
38511 |
+
*
|
38512 |
+
* Adds a custom getEditWrapperProps() callback to all block types that support
|
38513 |
+
* font sizes. Then, if fluid typography is enabled, this callback will swap any
|
38514 |
+
* custom font size in style.fontSize with a fluid font size (i.e. one that uses
|
38515 |
+
* clamp()).
|
38516 |
+
*
|
38517 |
+
* It's important that this hook runs after 'core/style/addEditProps' sets
|
38518 |
+
* style.fontSize as otherwise fontSize will be overwritten.
|
38519 |
+
*
|
38520 |
+
* @param {Object} blockType Block settings object.
|
38521 |
+
*/
|
38522 |
+
|
38523 |
+
function addEditPropsForFluidCustomFontSizes(blockType) {
|
38524 |
+
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, FONT_SIZE_SUPPORT_KEY) || shouldSkipSerialization(blockType, TYPOGRAPHY_SUPPORT_KEY, 'fontSize')) {
|
38525 |
+
return blockType;
|
38526 |
+
}
|
38527 |
+
|
38528 |
+
const existingGetEditWrapperProps = blockType.getEditWrapperProps;
|
38529 |
+
|
38530 |
+
blockType.getEditWrapperProps = attributes => {
|
38531 |
+
var _wrapperProps$style, _select$getSettings$_, _select$getSettings$_2;
|
38532 |
+
|
38533 |
+
const wrapperProps = existingGetEditWrapperProps ? existingGetEditWrapperProps(attributes) : {};
|
38534 |
+
const fontSize = wrapperProps === null || wrapperProps === void 0 ? void 0 : (_wrapperProps$style = wrapperProps.style) === null || _wrapperProps$style === void 0 ? void 0 : _wrapperProps$style.fontSize; // TODO: This sucks! We should be using useSetting( 'typography.fluid' )
|
38535 |
+
// or even useSelect( blockEditorStore ). We can't do either here
|
38536 |
+
// because getEditWrapperProps is a plain JavaScript function called by
|
38537 |
+
// BlockListBlock and not a React component rendered within
|
38538 |
+
// BlockListContext.Provider. If we set fontSize using editor.
|
38539 |
+
// BlockListBlock instead of using getEditWrapperProps then the value is
|
38540 |
+
// clobbered when the core/style/addEditProps filter runs.
|
38541 |
+
|
38542 |
+
const isFluidTypographyEnabled = !!((_select$getSettings$_ = (0,external_wp_data_namespaceObject.select)(store).getSettings().__experimentalFeatures) !== null && _select$getSettings$_ !== void 0 && (_select$getSettings$_2 = _select$getSettings$_.typography) !== null && _select$getSettings$_2 !== void 0 && _select$getSettings$_2.fluid);
|
38543 |
+
const newFontSize = fontSize && isFluidTypographyEnabled ? getComputedFluidTypographyValue({
|
38544 |
+
fontSize
|
38545 |
+
}) : null;
|
38546 |
+
|
38547 |
+
if (newFontSize === null) {
|
38548 |
+
return wrapperProps;
|
38549 |
+
}
|
38550 |
+
|
38551 |
+
return { ...wrapperProps,
|
38552 |
+
style: { ...(wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style),
|
38553 |
+
fontSize: newFontSize
|
38554 |
+
}
|
38555 |
+
};
|
38556 |
+
};
|
38557 |
+
|
38558 |
+
return blockType;
|
38559 |
+
}
|
38560 |
+
|
38561 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes);
|
38562 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/font/addSaveProps', font_size_addSaveProps);
|
38563 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addEditProps', font_size_addEditProps);
|
38564 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles);
|
38565 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/font-size/addTransforms', font_size_addTransforms);
|
38566 |
+
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font-size/addEditPropsForFluidCustomFontSizes', addEditPropsForFluidCustomFontSizes, // Run after 'core/style/addEditProps' so that the style object has already
|
38567 |
+
// been translated into inline CSS.
|
38568 |
+
11);
|
38569 |
|
38570 |
;// CONCATENATED MODULE: ./packages/icons/build-module/library/reset.js
|
38571 |
|
39319 |
* External dependencies
|
39320 |
*/
|
39321 |
|
|
|
39322 |
/**
|
39323 |
* WordPress dependencies
|
39324 |
*/
|
39431 |
const renamedFeatures = {
|
39432 |
gradients: 'gradient'
|
39433 |
};
|
39434 |
+
/**
|
39435 |
+
* A utility function used to remove one or more paths from a style object.
|
39436 |
+
* Works in a way similar to Lodash's `omit()`. See unit tests and examples below.
|
39437 |
+
*
|
39438 |
+
* It supports a single string path:
|
39439 |
+
*
|
39440 |
+
* ```
|
39441 |
+
* omitStyle( { color: 'red' }, 'color' ); // {}
|
39442 |
+
* ```
|
39443 |
+
*
|
39444 |
+
* or an array of paths:
|
39445 |
+
*
|
39446 |
+
* ```
|
39447 |
+
* omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}
|
39448 |
+
* ```
|
39449 |
+
*
|
39450 |
+
* It also allows you to specify paths at multiple levels in a string.
|
39451 |
+
*
|
39452 |
+
* ```
|
39453 |
+
* omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}
|
39454 |
+
* ```
|
39455 |
+
*
|
39456 |
+
* You can remove multiple paths at the same time:
|
39457 |
+
*
|
39458 |
+
* ```
|
39459 |
+
* omitStyle(
|
39460 |
+
* {
|
39461 |
+
* typography: {
|
39462 |
+
* textDecoration: 'underline',
|
39463 |
+
* textTransform: 'uppercase',
|
39464 |
+
* }
|
39465 |
+
* },
|
39466 |
+
* [
|
39467 |
+
* 'typography.textDecoration',
|
39468 |
+
* 'typography.textTransform',
|
39469 |
+
* ]
|
39470 |
+
* );
|
39471 |
+
* // {}
|
39472 |
+
* ```
|
39473 |
+
*
|
39474 |
+
* You can also specify nested paths as arrays:
|
39475 |
+
*
|
39476 |
+
* ```
|
39477 |
+
* omitStyle(
|
39478 |
+
* {
|
39479 |
+
* typography: {
|
39480 |
+
* textDecoration: 'underline',
|
39481 |
+
* textTransform: 'uppercase',
|
39482 |
+
* }
|
39483 |
+
* },
|
39484 |
+
* [
|
39485 |
+
* [ 'typography', 'textDecoration' ],
|
39486 |
+
* [ 'typography', 'textTransform' ],
|
39487 |
+
* ]
|
39488 |
+
* );
|
39489 |
+
* // {}
|
39490 |
+
* ```
|
39491 |
+
*
|
39492 |
+
* With regards to nesting of styles, infinite depth is supported:
|
39493 |
+
*
|
39494 |
+
* ```
|
39495 |
+
* omitStyle(
|
39496 |
+
* {
|
39497 |
+
* border: {
|
39498 |
+
* radius: {
|
39499 |
+
* topLeft: '10px',
|
39500 |
+
* topRight: '0.5rem',
|
39501 |
+
* }
|
39502 |
+
* }
|
39503 |
+
* },
|
39504 |
+
* [
|
39505 |
+
* [ 'border', 'radius', 'topRight' ],
|
39506 |
+
* ]
|
39507 |
+
* );
|
39508 |
+
* // { border: { radius: { topLeft: '10px' } } }
|
39509 |
+
* ```
|
39510 |
+
*
|
39511 |
+
* The third argument, `preserveReference`, defines how to treat the input style object.
|
39512 |
+
* It is mostly necessary to properly handle mutation when recursively handling the style object.
|
39513 |
+
* Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.
|
39514 |
+
* However, when recursing, we change that value to `true` in order to work with a single copy
|
39515 |
+
* of the original style object.
|
39516 |
+
*
|
39517 |
+
* @see https://lodash.com/docs/4.17.15#omit
|
39518 |
+
*
|
39519 |
+
* @param {Object} style Styles object.
|
39520 |
+
* @param {Array|string} paths Paths to remove.
|
39521 |
+
* @param {boolean} preserveReference True to mutate the `style` object, false otherwise.
|
39522 |
+
* @return {Object} Styles object with the specified paths removed.
|
39523 |
+
*/
|
39524 |
+
|
39525 |
+
function omitStyle(style, paths) {
|
39526 |
+
let preserveReference = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
39527 |
+
|
39528 |
+
if (!style) {
|
39529 |
+
return style;
|
39530 |
+
}
|
39531 |
+
|
39532 |
+
let newStyle = style;
|
39533 |
+
|
39534 |
+
if (!preserveReference) {
|
39535 |
+
newStyle = JSON.parse(JSON.stringify(style));
|
39536 |
+
}
|
39537 |
+
|
39538 |
+
if (!Array.isArray(paths)) {
|
39539 |
+
paths = [paths];
|
39540 |
+
}
|
39541 |
+
|
39542 |
+
paths.forEach(path => {
|
39543 |
+
if (!Array.isArray(path)) {
|
39544 |
+
path = path.split('.');
|
39545 |
+
}
|
39546 |
+
|
39547 |
+
if (path.length > 1) {
|
39548 |
+
const [firstSubpath, ...restPath] = path;
|
39549 |
+
omitStyle(newStyle[firstSubpath], [restPath], true);
|
39550 |
+
} else if (path.length === 1) {
|
39551 |
+
delete newStyle[path[0]];
|
39552 |
+
}
|
39553 |
+
});
|
39554 |
+
return newStyle;
|
39555 |
+
}
|
39556 |
/**
|
39557 |
* Override props assigned to save component to inject the CSS variables definition.
|
39558 |
*
|
39579 |
const skipSerialization = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, indicator);
|
39580 |
|
39581 |
if (skipSerialization === true) {
|
39582 |
+
style = omitStyle(style, path);
|
39583 |
}
|
39584 |
|
39585 |
if (Array.isArray(skipSerialization)) {
|
39586 |
skipSerialization.forEach(featureName => {
|
39587 |
const feature = renamedFeatures[featureName] || featureName;
|
39588 |
+
style = omitStyle(style, [[...path, feature]]);
|
39589 |
});
|
39590 |
}
|
39591 |
});
|
40859 |
*/
|
40860 |
|
40861 |
|
40862 |
+
|
40863 |
// This utility is intended to assist where the serialization of the typography
|
40864 |
// block support is being skipped for a block but the typography related CSS
|
40865 |
// styles still need to be generated so they can be applied to inner elements.
|
40868 |
* Provides the CSS class names and inline styles for a block's typography support
|
40869 |
* attributes.
|
40870 |
*
|
40871 |
+
* @param {Object} attributes Block attributes.
|
40872 |
+
* @param {boolean} isFluidFontSizeActive Whether the function should try to convert font sizes to fluid values.
|
40873 |
*
|
40874 |
* @return {Object} Typography block support derived CSS classes & styles.
|
40875 |
*/
|
40876 |
|
40877 |
+
function getTypographyClassesAndStyles(attributes, isFluidFontSizeActive) {
|
40878 |
var _attributes$style;
|
40879 |
|
40880 |
+
let typographyStyles = (attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.typography) || {};
|
40881 |
+
|
40882 |
+
if (isFluidFontSizeActive) {
|
40883 |
+
var _attributes$style2, _attributes$style2$ty;
|
40884 |
+
|
40885 |
+
typographyStyles = { ...typographyStyles,
|
40886 |
+
fontSize: getComputedFluidTypographyValue({
|
40887 |
+
fontSize: attributes === null || attributes === void 0 ? void 0 : (_attributes$style2 = attributes.style) === null || _attributes$style2 === void 0 ? void 0 : (_attributes$style2$ty = _attributes$style2.typography) === null || _attributes$style2$ty === void 0 ? void 0 : _attributes$style2$ty.fontSize
|
40888 |
+
})
|
40889 |
+
};
|
40890 |
+
}
|
40891 |
+
|
40892 |
const style = getInlineStyles({
|
40893 |
typography: typographyStyles
|
40894 |
});
|
41333 |
|
41334 |
|
41335 |
|
41336 |
+
|
41337 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/duotone/index.js
|
41338 |
|
41339 |
|
43190 |
* 'inside' refers to nesting as an inner block.
|
43191 |
*/
|
43192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43193 |
/**
|
43194 |
* Determines whether the user positioning the dragged block to nest as an
|
43195 |
* inner block.
|
43201 |
* @param {DOMRect} rect The rectangle.
|
43202 |
*/
|
43203 |
|
|
|
43204 |
function isNestingGesture(point, rect) {
|
43205 |
const blockCenterX = rect.left + rect.width / 2;
|
43206 |
return point.x > blockCenterX;
|
43731 |
|
43732 |
|
43733 |
|
43734 |
+
|
43735 |
/**
|
43736 |
* Internal dependencies
|
43737 |
*/
|
43739 |
|
43740 |
|
43741 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43742 |
const block_styles_noop = () => {}; // Block Styles component for the Settings Sidebar.
|
43743 |
|
43744 |
|
43745 |
+
function BlockStyles(_ref) {
|
43746 |
let {
|
43747 |
clientId,
|
43748 |
onSwitch = block_styles_noop,
|
43749 |
+
onHoverClassName = block_styles_noop
|
43750 |
+
} = _ref;
|
|
|
43751 |
const {
|
43752 |
onSelect,
|
43753 |
stylesToRender,
|
43759 |
onSwitch
|
43760 |
});
|
43761 |
const [hoveredStyle, setHoveredStyle] = (0,external_wp_element_namespaceObject.useState)(null);
|
|
|
43762 |
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
|
|
|
|
|
|
|
|
|
|
|
43763 |
|
43764 |
if (!stylesToRender || stylesToRender.length === 0) {
|
43765 |
return null;
|
43809 |
numberOfLines: 1,
|
43810 |
className: "block-editor-block-styles__item-text"
|
43811 |
}, buttonText));
|
43812 |
+
})), hoveredStyle && !isMobileViewport && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
|
43813 |
+
placement: "left-start",
|
43814 |
+
offset: 20
|
43815 |
+
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
43816 |
className: "block-editor-block-styles__preview-panel",
|
|
|
|
|
|
|
43817 |
onMouseLeave: () => styleItemHandler(null)
|
43818 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockStylesPreviewPanel, {
|
43819 |
activeStyle: activeStyle,
|
43820 |
className: previewClassName,
|
43821 |
genericPreviewBlock: genericPreviewBlock,
|
43822 |
style: hoveredStyle
|
43823 |
+
}))));
|
43824 |
}
|
43825 |
|
|
|
43826 |
/* harmony default export */ const block_styles = (BlockStyles);
|
43827 |
|
43828 |
+
BlockStyles.Slot = () => {
|
43829 |
+
external_wp_deprecated_default()('BlockStyles.Slot', {
|
43830 |
+
version: '6.4',
|
43831 |
+
since: '6.2'
|
43832 |
+
});
|
43833 |
+
return null;
|
43834 |
+
};
|
43835 |
+
|
43836 |
;// CONCATENATED MODULE: ./packages/icons/build-module/library/layout.js
|
43837 |
|
43838 |
|
44600 |
batch
|
44601 |
} = (0,external_wp_data_namespaceObject.useRegistry)();
|
44602 |
|
44603 |
+
if ((0,external_lodash_namespaceObject.isEmpty)(colors) && (0,external_lodash_namespaceObject.isEmpty)(gradients) && disableCustomColors && disableCustomGradients && settings !== null && settings !== void 0 && settings.every(setting => (0,external_lodash_namespaceObject.isEmpty)(setting.colors) && (0,external_lodash_namespaceObject.isEmpty)(setting.gradients) && (setting.disableCustomColors === undefined || setting.disableCustomColors) && (setting.disableCustomGradients === undefined || setting.disableCustomGradients))) {
|
44604 |
return null;
|
44605 |
}
|
44606 |
|
44656 |
};
|
44657 |
|
44658 |
const PanelColorGradientSettings = props => {
|
44659 |
+
if (panel_color_gradient_settings_colorsAndGradientKeys.every(key => props.hasOwnProperty(key))) {
|
44660 |
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, props);
|
44661 |
}
|
44662 |
|
51672 |
xmlns: "http://www.w3.org/2000/svg",
|
51673 |
viewBox: "0 0 24 24"
|
51674 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
51675 |
+
d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"
|
51676 |
}));
|
51677 |
/* harmony default export */ const arrow_left = (arrowLeft);
|
51678 |
|
52053 |
function PreviewOptions(_ref) {
|
52054 |
let {
|
52055 |
children,
|
52056 |
+
viewLabel,
|
52057 |
className,
|
52058 |
isEnabled = true,
|
52059 |
deviceType,
|
52069 |
variant: 'tertiary',
|
52070 |
className: 'block-editor-post-preview__button-toggle',
|
52071 |
disabled: !isEnabled,
|
52072 |
+
children: viewLabel
|
|
|
|
|
52073 |
};
|
52074 |
const menuProps = {
|
52075 |
'aria-label': (0,external_wp_i18n_namespaceObject.__)('View options')
|
52364 |
function useContentBlocks(blockTypes, block) {
|
52365 |
const contenBlocksObjectAux = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
52366 |
return blockTypes.reduce((result, blockType) => {
|
52367 |
+
if (blockType.name !== 'core/list-item' && Object.entries(blockType.attributes).some(_ref => {
|
52368 |
let [, {
|
52369 |
__experimentalRole
|
52370 |
}] = _ref;
|
52474 |
getSelectedBlockClientId,
|
52475 |
getSelectedBlockCount,
|
52476 |
getBlockName,
|
52477 |
+
__unstableGetContentLockingParent,
|
52478 |
+
getTemplateLock
|
52479 |
} = select(store);
|
52480 |
|
52481 |
const _selectedBlockClientId = getSelectedBlockClientId();
|
52489 |
selectedBlockClientId: _selectedBlockClientId,
|
52490 |
selectedBlockName: _selectedBlockName,
|
52491 |
blockType: _blockType,
|
52492 |
+
topLevelLockedBlock: __unstableGetContentLockingParent(_selectedBlockClientId) || (getTemplateLock(_selectedBlockClientId) === 'contentOnly' ? _selectedBlockClientId : undefined)
|
52493 |
};
|
52494 |
}, []);
|
52495 |
|
52560 |
}), hasBlockStyles && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
|
52561 |
title: (0,external_wp_i18n_namespaceObject.__)('Styles')
|
52562 |
}, (0,external_wp_element_namespaceObject.createElement)(block_styles, {
|
|
|
52563 |
clientId: clientId
|
52564 |
}), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'defaultStylePicker', true) && (0,external_wp_element_namespaceObject.createElement)(DefaultStylePicker, {
|
52565 |
blockName: blockName
|
53788 |
|
53789 |
|
53790 |
|
|
|
53791 |
|
53792 |
|
53793 |
|
build/block-editor/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '9199e0071b2b6a59d119');
|
build/block-editor/index.min.js
CHANGED
@@ -1,116 +1,114 @@
|
|
1 |
-
(()=>{var e={6411:function(e,t){var n,o;n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default},void 0===(o=n.apply(t,[e,t]))||(e.exports=o)},4403:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function g(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,f=m&&0<=g&&g<c;if(h||f){if(!h||f&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),g=i.extractCommon(l,t,e,n),l.newPos+1>=a&&g+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();g()||e()}),0)}();else for(;u<=d;){var h=g();if(h)return h}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:(e,t,n)=>{"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:(e,t,n)=>{"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),g=o.offset(e),h=o.outerHeight(e),f=o.outerWidth(e),v=void 0,b=void 0,_=void 0,k=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:g.left-S.left-c,top:g.top-S.top-a},E={left:g.left+f-(S.left+w)+d,top:g.top+h-(S.top+B)+u},k=S):(v=o.offset(t),b=t.clientHeight,_=t.clientWidth,k={left:t.scrollLeft,top:t.scrollTop},y={left:g.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:g.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:g.left+f-(v.left+_+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:g.top+h-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,k.top+y.top):!1===i?o.scrollTop(t,k.top+E.top):y.top<0?o.scrollTop(t,k.top+y.top):o.scrollTop(t,k.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,k.top+y.top):o.scrollTop(t,k.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,k.left+y.left):!1===s?o.scrollLeft(t,k.left+E.left):y.left<0?o.scrollLeft(t,k.left+y.left):o.scrollLeft(t,k.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,k.left+y.left):o.scrollLeft(t,k.left+E.left)))}},5425:(e,t,n)=>{"use strict";e.exports=n(1345)},5022:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function g(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function h(e){return null!=e&&e==e.window}var f={};function v(e,t,n){if(h(e))return"width"===t?f.viewportWidth(e):f.viewportHeight(e);if(9===e.nodeType)return"width"===t?f.docWidth(e):f.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){f["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],f["viewport"+e](n))},f["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function _(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function k(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&k(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);f["outer"+t]=function(t,n){return t&&_(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&_(t,e,-1):t?(c(t),d(t)&&(o+=g(t,["padding","border"],n)),k(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===k(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(k(e,l))||0,o[l]=r+t[l]-n[l]);k(e,o)}(e,t)},isWindow:h,each:u,css:k,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},f)},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:(e,t,n)=>{var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},7970:(e,t,n)=>{e.exports=n(195)},3110:e=>{"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},3812:e=>{var t,n,o,r,l,i,s,a,c,u,d,p,m,g,h,f=!1;function v(){if(!f){f=!0;var e=navigator.userAgent,v=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),b=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),g=/FBAN\/\w+;/i.exec(e),h=/Mobile/i.exec(e),d=!!/Win64/.exec(e),v){(t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var _=/(?:Trident\/(\d+.\d+))/.exec(e);i=_?parseFloat(_[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,o=v[3]?parseFloat(v[3]):NaN,(r=v[4]?parseFloat(v[4]):NaN)?(v=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=v&&v[1]?parseFloat(v[1]):NaN):l=NaN}else t=n=o=l=r=NaN;if(b){if(b[1]){var k=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!k||parseFloat(k[1].replace("_","."))}else s=!1;a=!!b[2],c=!!b[3]}else s=a=c=!1}}var b={ie:function(){return v()||t},ieCompatibilityMode:function(){return v()||i>t},ie64:function(){return b.ie()&&d},firefox:function(){return v()||n},opera:function(){return v()||o},webkit:function(){return v()||r},safari:function(){return b.webkit()},chrome:function(){return v()||l},windows:function(){return v()||a},osx:function(){return v()||s},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||m||u||h},nativeApp:function(){return v()||g},android:function(){return v()||u},ipad:function(){return v()||m}};e.exports=b},7939:(e,t,n)=>{"use strict";var o,r=n(3110);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,l=n in document;if(!l){var i=document.createElement("div");i.setAttribute(n,"return;"),l="function"==typeof i[n]}return!l&&o&&"wheel"===e&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}},195:(e,t,n)=>{"use strict";var o=n(3812),r=n(7939);function l(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),o&&!t&&(t=o<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:r}}l.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=l},5372:(e,t,n)=>{"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:(e,t,n)=>{e.exports=n(5372)()},9567:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:(e,t,n)=>{"use strict";var o=n(5438);t.Z=o.TextareaAutosize},4793:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),r=new RegExp(n,""),l=function(e){return e.replace(o,(function(e){return t[e]}))};e.exports=l,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=l},3124:e=>{var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},g=!0,h={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(g=!1)},delete:function(e){delete h.parent.node[h.key],e&&(g=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(g=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){g=!1}};if(!u)return h;function f(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}f();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),g?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),f(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:e=>{"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>u_,AlignmentToolbar:()=>d_,Autocomplete:()=>E_,BlockAlignmentControl:()=>Ll,BlockAlignmentToolbar:()=>Rl,BlockBreadcrumb:()=>x_,BlockColorsStyleSelector:()=>M_,BlockContextProvider:()=>Kl,BlockControls:()=>ko,BlockEdit:()=>Zl,BlockEditorKeyboardShortcuts:()=>RC,BlockEditorProvider:()=>Fu,BlockFormatControls:()=>_o,BlockIcon:()=>Ru,BlockInspector:()=>IC,BlockList:()=>tf,BlockMover:()=>tg,BlockNavigationDropdown:()=>ek,BlockPreview:()=>vp,BlockSelectionClearer:()=>Gu,BlockSettingsMenu:()=>ph,BlockSettingsMenuControls:()=>sh,BlockStyles:()=>lk,BlockTitle:()=>Um,BlockToolbar:()=>yh,BlockTools:()=>NC,BlockVerticalAlignmentControl:()=>Yr,BlockVerticalAlignmentToolbar:()=>Qr,ButtonBlockAppender:()=>Pm,ButtonBlockerAppender:()=>Nm,ColorPalette:()=>Ek,ColorPaletteControl:()=>Ck,ContrastChecker:()=>Zf,CopyHandler:()=>Gg,DefaultBlockAppender:()=>xm,FontSizePicker:()=>Ov,InnerBlocks:()=>Qh,Inserter:()=>Im,InspectorAdvancedControls:()=>fr,InspectorControls:()=>vr,JustifyContentControl:()=>Jr,JustifyToolbar:()=>el,LineHeightControl:()=>_v,MediaPlaceholder:()=>gE,MediaReplaceFlow:()=>aE,MediaUpload:()=>rE,MediaUploadCheck:()=>lE,MultiSelectScrollIntoView:()=>AC,NavigableToolbar:()=>rg,ObserveTyping:()=>FC,PanelColorSettings:()=>hE,PlainText:()=>YE,RichText:()=>$E,RichTextShortcut:()=>XE,RichTextToolbarButton:()=>JE,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>vC,ToolSelector:()=>nC,Typewriter:()=>UC,URLInput:()=>Cy,URLInputButton:()=>iC,URLPopover:()=>dE,Warning:()=>Jl,WritingFlow:()=>nd,__experimentalBlockAlignmentMatrixControl:()=>B_,__experimentalBlockFullHeightAligmentControl:()=>S_,__experimentalBlockPatternSetup:()=>vk,__experimentalBlockPatternsList:()=>Fp,__experimentalBlockVariationPicker:()=>sk,__experimentalBlockVariationTransforms:()=>kk,__experimentalBorderRadiusControl:()=>ff,__experimentalColorGradientControl:()=>$f,__experimentalColorGradientSettingsDropdown:()=>Qf,__experimentalDateFormatPicker:()=>Bk,__experimentalDuotoneControl:()=>Sb,__experimentalFontAppearanceControl:()=>bv,__experimentalFontFamilyControl:()=>Tv,__experimentalGetBorderClassesAndStyles:()=>Hb,__experimentalGetColorClassesAndStyles:()=>Ub,__experimentalGetElementClassName:()=>ZC,__experimentalGetGapCSSValue:()=>Vr,__experimentalGetGradientClass:()=>Af,__experimentalGetGradientObjectByGradientValue:()=>Of,__experimentalGetMatchingVariation:()=>JC,__experimentalGetSpacingClassesAndStyles:()=>$b,__experimentalImageEditingProvider:()=>ny,__experimentalImageEditor:()=>py,__experimentalImageSizeControl:()=>hy,__experimentalImageURLInputUI:()=>gC,__experimentalInspectorPopoverHeader:()=>qC,__experimentalLayoutStyle:()=>El,__experimentalLetterSpacingControl:()=>ib,__experimentalLibrary:()=>MC,__experimentalLinkControl:()=>eE,__experimentalLinkControlSearchInput:()=>jy,__experimentalLinkControlSearchItem:()=>My,__experimentalLinkControlSearchResults:()=>zy,__experimentalListView:()=>X_,__experimentalPanelColorGradientSettings:()=>Mk,__experimentalPreviewOptions:()=>hC,__experimentalPublishDateTimePicker:()=>YC,__experimentalRecursionProvider:()=>jC,__experimentalResponsiveBlockControl:()=>ZE,__experimentalSpacingSizesControl:()=>rr,__experimentalTextDecorationControl:()=>qv,__experimentalTextTransformControl:()=>nb,__experimentalUnitControl:()=>oC,__experimentalUseBlockOverlayActive:()=>Eu,__experimentalUseBlockPreview:()=>bp,__experimentalUseBorderProps:()=>Gb,__experimentalUseColorProps:()=>jb,__experimentalUseCustomSides:()=>Dr,__experimentalUseGradient:()=>Ff,__experimentalUseHasRecursion:()=>$C,__experimentalUseMultipleOriginColorsAndGradients:()=>Ef,__experimentalUseOnBlockDrop:()=>Vh,__experimentalUseResizeCanvas:()=>fC,__experimentaluseLayoutClasses:()=>Mb,__experimentaluseLayoutStyles:()=>Lb,__unstableBlockNameContext:()=>kh,__unstableBlockSettingsMenuFirstItem:()=>Yg,__unstableBlockToolbarLastItem:()=>Dg,__unstableDuotoneFilter:()=>dp,__unstableDuotoneStylesheet:()=>cp,__unstableDuotoneUnsetStylesheet:()=>up,__unstableEditorStyles:()=>sp,__unstableGetValuesFromColors:()=>ap,__unstableIframe:()=>ld,__unstableInserterMenuExtension:()=>fm,__unstablePresetDuotoneFilter:()=>pp,__unstableRichTextInputEvent:()=>eC,__unstableUseBlockSelectionClearer:()=>Hu,__unstableUseClipboardHandler:()=>Hg,__unstableUseMouseMoveTypingReset:()=>OC,__unstableUseTypewriter:()=>GC,__unstableUseTypingObserver:()=>zC,createCustomColorsHOC:()=>Jb,getColorClassName:()=>kf,getColorObjectByAttributeValues:()=>bf,getColorObjectByColorValue:()=>_f,getFontSize:()=>Rv,getFontSizeClass:()=>Dv,getFontSizeObjectByValue:()=>Av,getGradientSlugByValue:()=>zf,getGradientValueBySlug:()=>Df,getPxFromCssUnit:()=>cS,getTypographyClassesAndStyles:()=>Kb,store:()=>co,storeConfig:()=>ao,transformStyles:()=>rp,useBlockDisplayInformation:()=>Hm,useBlockEditContext:()=>go,useBlockProps:()=>Cu,useCachedTruthy:()=>qb,useInnerBlocksProps:()=>Yh,useSetting:()=>Yo,withColorContext:()=>yk,withColors:()=>e_,withFontSizes:()=>o_});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Vt,__experimentalGetAllowedBlocks:()=>_t,__experimentalGetAllowedPatterns:()=>Ct,__experimentalGetBlockListSettingsForBlocks:()=>Tt,__experimentalGetDirectInsertBlock:()=>kt,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Mt,__experimentalGetParsedPattern:()=>yt,__experimentalGetPatternTransformItems:()=>wt,__experimentalGetPatternsByBlockTypes:()=>St,__experimentalGetReusableBlockTitle:()=>Nt,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Q,__unstableGetContentLockingParent:()=>Wt,__unstableGetEditorMode:()=>At,__unstableGetSelectedBlocksWithPartialSelection:()=>Re,__unstableGetTemporarilyEditingAsBlocks:()=>jt,__unstableGetVisibleBlocks:()=>Ut,__unstableHasActiveBlockOverlayActive:()=>$t,__unstableIsFullySelected:()=>Ne,__unstableIsLastBlockChangeIgnored:()=>Pt,__unstableIsSelectionCollapsed:()=>Pe,__unstableIsSelectionMergeable:()=>Le,__unstableIsWithinBlockOverlay:()=>Kt,__unstableSelectionHasUnmergeableBlock:()=>Me,areInnerBlocksControlled:()=>Ft,canEditBlock:()=>ct,canInsertBlockType:()=>ot,canInsertBlocks:()=>rt,canLockBlockType:()=>ut,canMoveBlock:()=>st,canMoveBlocks:()=>at,canRemoveBlock:()=>lt,canRemoveBlocks:()=>it,didAutomaticChange:()=>Ot,getAdjacentBlockClientId:()=>fe,getBlock:()=>$,getBlockAttributes:()=>j,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>De,getBlockInsertionPoint:()=>Qe,getBlockListSettings:()=>Bt,getBlockMode:()=>Ue,getBlockName:()=>U,getBlockOrder:()=>Ae,getBlockParents:()=>pe,getBlockParentsByBlockName:()=>me,getBlockRootClientId:()=>de,getBlockSelectionEnd:()=>ie,getBlockSelectionStart:()=>le,getBlockTransformItems:()=>vt,getBlocks:()=>q,getBlocksByClientId:()=>te,getClientIdsOfDescendants:()=>Z,getClientIdsWithDescendants:()=>X,getDraggedBlockClientIds:()=>$e,getFirstMultiSelectedBlockClientId:()=>Ce,getGlobalBlockCount:()=>J,getInserterItems:()=>ft,getLastMultiSelectedBlockClientId:()=>Se,getLowestCommonAncestorWithSelectedBlock:()=>he,getMultiSelectedBlockClientIds:()=>ye,getMultiSelectedBlocks:()=>Ee,getMultiSelectedBlocksEndClientId:()=>Te,getMultiSelectedBlocksStartClientId:()=>xe,getNextBlockClientId:()=>be,getPreviousBlockClientId:()=>ve,getSelectedBlock:()=>ue,getSelectedBlockClientId:()=>ce,getSelectedBlockClientIds:()=>ke,getSelectedBlockCount:()=>se,getSelectedBlocksInitialCaretPosition:()=>_e,getSelectionEnd:()=>re,getSelectionStart:()=>oe,getSettings:()=>It,getTemplate:()=>Je,getTemplateLock:()=>et,hasBlockMovingClientId:()=>Dt,hasInserterItems:()=>bt,hasMultiSelection:()=>Ve,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>ze,isAncestorBeingDragged:()=>qe,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>Ke,isBlockHighlighted:()=>zt,isBlockInsertionPointVisible:()=>Ze,isBlockMultiSelected:()=>Be,isBlockSelected:()=>Oe,isBlockValid:()=>W,isBlockVisible:()=>Gt,isBlockWithinSelection:()=>Fe,isCaretWithinFormattedText:()=>Ye,isDraggingBlocks:()=>je,isFirstMultiSelectedBlock:()=>we,isLastBlockChangePersistent:()=>xt,isMultiSelecting:()=>He,isNavigationMode:()=>Rt,isSelectionEnabled:()=>Ge,isTyping:()=>We,isValidTemplate:()=>Xe,wasBlockJustInserted:()=>Ht});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:()=>xn,__unstableExpandSelection:()=>Nn,__unstableMarkAutomaticChange:()=>Yn,__unstableMarkLastChangeAsPersistent:()=>Kn,__unstableMarkNextChangeAsNotPersistent:()=>qn,__unstableSaveReusableBlock:()=>$n,__unstableSetEditorMode:()=>Zn,__unstableSetTemporarilyEditingAsBlocks:()=>io,__unstableSplitSelection:()=>Tn,clearSelectedBlock:()=>dn,duplicateBlocks:()=>Jn,enterFormattedText:()=>Vn,exitFormattedText:()=>Hn,flashBlock:()=>oo,hideInsertionPoint:()=>wn,insertAfterBlock:()=>to,insertBeforeBlock:()=>eo,insertBlock:()=>En,insertBlocks:()=>Cn,insertDefaultBlock:()=>Un,mergeBlocks:()=>Pn,moveBlockToPosition:()=>yn,moveBlocksDown:()=>vn,moveBlocksToPosition:()=>kn,moveBlocksUp:()=>bn,multiSelect:()=>un,receiveBlocks:()=>tn,removeBlock:()=>Ln,removeBlocks:()=>Mn,replaceBlock:()=>hn,replaceBlocks:()=>gn,replaceInnerBlocks:()=>Rn,resetBlocks:()=>Xt,resetSelection:()=>en,selectBlock:()=>rn,selectNextBlock:()=>sn,selectPreviousBlock:()=>ln,selectionChange:()=>Gn,setBlockMovingClientId:()=>Xn,setBlockVisibility:()=>lo,setHasControlledInnerBlocks:()=>ro,setNavigationMode:()=>Qn,setTemplateValidity:()=>Bn,showInsertionPoint:()=>Sn,startDraggingBlocks:()=>zn,startMultiSelect:()=>an,startTyping:()=>Dn,stopDraggingBlocks:()=>Fn,stopMultiSelect:()=>cn,stopTyping:()=>On,synchronizeTemplate:()=>In,toggleBlockHighlight:()=>no,toggleBlockMode:()=>An,toggleSelection:()=>pn,updateBlock:()=>on,updateBlockAttributes:()=>nn,updateBlockListSettings:()=>Wn,updateSettings:()=>jn,validateBlocksToTemplate:()=>Jt});const r=window.wp.blocks,l=window.wp.hooks;function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i.apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));const s=window.wp.element;var a=n(4403),c=n.n(a);const u=window.lodash,d=window.wp.compose,p=window.wp.data,m=window.wp.components,g={default:(0,m.createSlotFill)("BlockControls"),block:(0,m.createSlotFill)("BlockControlsBlock"),inline:(0,m.createSlotFill)("BlockFormatControls"),other:(0,m.createSlotFill)("BlockControlsOther"),parent:(0,m.createSlotFill)("BlockControlsParent")},h=window.wp.i18n,f={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,h.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,h.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,h.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,h.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,h.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,h.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,h.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,h.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function _(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}const k=e=>e;function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,y(r,o))})),n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},E(n.innerBlocks,n.clientId))),{})}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function S(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return C(e,(e=>e.attributes))}function B(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function I(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const T=(0,d.pipe)(p.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.keys((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})},l.tree={...l.tree,...(0,u.reduce)(o,((e,n,o)=>{const r=`controlled||${o}`;return t.tree[r]&&(e[r]=t.tree[r]),e}),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:S(n.blocks),attributes:w(n.blocks),order:y(n.blocks),parents:E(n.blocks),controlledInnerBlocks:{}},o=I(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!B(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...w(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...w(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=y(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=y(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:_(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e[o];if(!l.length||r===l[0])return e;const i=l.indexOf(r);return{...e,[o]:_(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e[o];if(!i.length||l===i[i.length-1])return e;const s=i.indexOf(r);return{...e,[o]:_(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=y(t.blocks);return(0,d.pipe)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,d.pipe)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...E(t.blocks)};case"INSERT_BLOCKS":return{...e,...E(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...E(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function N(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const P=(0,p.combineReducers)({blocks:T,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:N(r.selectionStart,l),selectionEnd:N(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,p.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},editorMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"edit",t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"SET_BLOCK_VISIBILITY":case"START_TYPING":case"STOP_TYPING":case"UPDATE_BLOCK_LIST_SETTINGS":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t},temporarilyEditingAsBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});var M={};function L(e){return[e]}function R(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function A(e,t){var n,o=t||L;function r(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(M)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(M,l)),s.get(M)}function l(){n=new WeakMap}function i(){var t,n,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for((t=r(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!R(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(R(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=l,l(),i}const D=window.wp.primitives,O=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),z=window.wp.richText,F=window.wp.deprecated;var V=n.n(F);function H(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const G=[];function U(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function W(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function j(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function $(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const K=A(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:j(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function q(e,t){var n;const o=t&&Ft(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||G}const Y=A(((e,t)=>({clientId:t,innerBlocks:Q(e,t)})),(e=>[e.blocks.order])),Q=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Ae(e,t),(t=>Y(e,t)))}),(e=>[e.blocks.order])),Z=A(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...Z(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Ae(e))t.push(n,...Z(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=A(((e,t)=>{if(!t)return G;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:G}),(e=>[e.blocks.order,e.blocks.byClientId])),te=A(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>$(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function ne(e,t){return Ae(e,t).length}function oe(e){return e.selection.selectionStart}function re(e){return e.selection.selectionEnd}function le(e){return e.selection.selectionStart.clientId}function ie(e){return e.selection.selectionEnd.clientId}function se(e){return ye(e).length||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ue(e){const t=ce(e);return t?$(e,t):null}function de(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const pe=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),me=A((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=pe(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:U(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ge(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function he(e,t){const n=ce(e),o=[...pe(e,t),t],r=[...pe(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(e)),!t)return null;const o=de(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function ve(e,t){return fe(e,t,-1)}function be(e,t){return fe(e,t,1)}function _e(e){return e.initialPosition}const ke=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return G;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return G;const r=Ae(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?G:ke(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>$(e,t))):G}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ce(e){return ye(e)[0]||null}function Se(e){const t=ye(e);return t[t.length-1]||null}function we(e,t){return Ce(e)===t}function Be(e,t){return-1!==ye(e).indexOf(t)}const Ie=A(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=de(e,n),o=Be(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ne(e){const t=oe(e),n=re(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pe(e){const t=oe(e),n=re(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Me(e){return ke(e).some((t=>{const n=U(e,t);return!(0,r.getBlockType)(n).merge}))}function Le(e,t){const n=oe(e),o=re(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=de(e,n.clientId);if(l!==de(e,o.clientId))return!1;const i=Ae(e,l);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=U(e,c);if(!(0,r.getBlockType)(d).merge)return!1;const p=$(e,u);if(p.name===d)return!0;const m=(0,r.switchToBlockType)(p,d);return m&&m.length}const Re=e=>{const t=oe(e),n=re(e);if(t.clientId===n.clientId)return G;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return G;const o=de(e,t.clientId);if(o!==de(e,n.clientId))return G;const l=Ae(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=$(e,a.clientId),d=(0,r.getBlockType)(u.name),p=$(e,c.clientId),m=(0,r.getBlockType)(p.name),g=u.attributes[a.attributeKey],h=p.attributes[c.attributeKey],f=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:g,...H(f)}),_=(0,z.create)({html:h,...H(v)});return b=(0,z.remove)(b,0,a.offset),_=(0,z.remove)(_,c.offset,_.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,z.toHTMLString)({value:b,...H(f)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:_,...H(v)})}}]};function Ae(e,t){return e.blocks.order[t||""]||G}function De(e,t){return Ae(e,de(e,t)).indexOf(t)}function Oe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Ae(e,t),(t=>Oe(e,t)||Be(e,t)||n&&ze(e,t,n)))}function Fe(e,t){if(!t)return!1;const n=ye(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function He(e){return e.isMultiSelecting}function Ge(e){return e.isSelectionEnabled}function Ue(e,t){return e.blocksMode[t]||"visual"}function We(e){return e.isTyping}function je(e){return!!e.draggedBlocks.length}function $e(e){return e.draggedBlocks}function Ke(e,t){return e.draggedBlocks.includes(t)}function qe(e,t){if(!je(e))return!1;const n=pe(e,t);return(0,u.some)(n,(t=>Ke(e,t)))}function Ye(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=de(e,l)||void 0,n=De(e,r.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Xe(e){return e.template.isValid}function Je(e){return e.settings.template}function et(e,t){if(!t)return e.settings.templateLock;const n=Bt(e,t);return n?n.templateLock:void 0}const tt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},nt=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=It(e),s=tt(i,t,!0);if(!s)return!1;const a=!!et(e,o);if(a)return!1;const c=Bt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=tt(d,t),m=n.parent,g=U(e,o),h=tt(m,g);let f=!0;const v=n.ancestor;if(v){const t=[o,...pe(e,o)];f=(0,u.some)(t,(t=>tt(v,U(e,t))))}const b=f&&(null===p&&null===h||!0===p||!0===h);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:$.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):b},ot=A(nt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,U(e,t),n)))}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=j(e,t);if(null===o)return!0;const{lock:r}=o,l=!!et(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>lt(e,t,n)))}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=j(e,t);if(null===o)return;const{lock:r}=o,l="all"===et(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function at(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>st(e,t,n)))}function ct(e,t){const n=j(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ut(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function dt(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const pt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&nt(e,t.name,n),mt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=dt(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:gt(r,l)}},gt=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},ht=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(te(e,X(e)),{name:t.name}));const{time:i,count:s=0}=dt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:gt(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},ft=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=ht(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=O;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=dt(e,l)||{},c=gt(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>pt(e,n,t))).map(n),a=nt(e,"core/block",t)?Lt(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=mt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),vt=A((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=(0,u.castArray)(t),[i]=l,s=ht(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>pt(e,t,o))).map(s),c=Object.fromEntries(Object.entries(a).map((e=>{let[,t]=e;return[t.name,t]})));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,r.getPossibleBlockTransformations)(l).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),bt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>pt(e,n,t)));if(n)return!0;const o=nt(e,"core/block",t)&&Lt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),_t=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>pt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),kt=A((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l($(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),yt=A(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Et=A((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=It(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return yt(e,n)})),r=o.filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!tt(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return r}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Ct=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Et(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return ot(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),St=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;const o=Ct(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...Ct.getDependants(e,t)])),wt=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ft(e,n)})))return G;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return St(e,o,n)}),((e,t)=>[...St.getDependants(e,t)]));function Bt(e,t){return e.blockListSettings[t]}function It(e){return e.settings}function xt(e){return e.blocks.isPersistentChange}const Tt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Nt=A(((e,t)=>{var n;const o=(0,u.find)(Lt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Lt(e)]));function Pt(e){return e.blocks.isIgnoredChange}function Mt(e){return e.lastBlockAttributesChange}function Lt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:G}function Rt(e){return"navigation"===e.editorMode}function At(e){return e.editorMode}function Dt(e){return e.hasBlockMovingClientId}function Ot(e){return!!e.automaticChangeStatus}function zt(e,t){return e.highlightedBlock===t}function Ft(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Vt=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(U(e,n)))return n;const o=ye(e),r=me(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ht(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Gt(e,t){var n,o;return null===(n=null===(o=e.blockVisibility)||void 0===o?void 0:o[t])||void 0===n||n}const Ut=A((e=>new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])))),(e=>[e.blockVisibility])),Wt=A(((e,t)=>{let n,o=t;for(;e.blocks.parents[o];)o=e.blocks.parents[o],"contentOnly"===et(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function jt(e){return e.temporarilyEditingAsBlocks}function $t(e,t){if(!ct(e,t))return!0;const n=At(e);if("zoom-out"===n&&t&&!de(e,t))return!0;const o=(0,r.hasBlockSupport)(U(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Ft(e,t))&&!Oe(e,t)&&!ze(e,t,!0)}function Kt(e,t){let n=e.blocks.parents[t];for(;n;){if($t(e,n))return!0;n=e.blocks.parents[n]}return!1}const qt=window.wp.a11y,Yt="";function Qt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Yt)}))}const Zt=e=>Array.isArray(e)?e:[e],Xt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Jt(e))},Jt=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function en(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function tn(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function nn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Zt(e),attributes:t,uniqueByBlock:n}}function on(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function rn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const ln=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},sn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function an(){return{type:"START_MULTI_SELECT"}}function cn(){return{type:"STOP_MULTI_SELECT"}}const un=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,qt.speak)((0,h.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
-
(0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function dn(){return{type:"CLEAR_SELECTED_BLOCK"}}function pn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function mn(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const gn=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=Zt(e),t=mn(Zt(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function hn(e,t){return gn(e,t)}const fn=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:Zt(t),rootClientId:n})},vn=fn("MOVE_BLOCKS_DOWN"),bn=fn("MOVE_BLOCKS_UP"),kn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function yn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return kn([e],t,n,o)}function En(e,t,n,o,r){return Cn([e],t,n,o,0,r)}const Cn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;null!==r&&"object"==typeof r&&(l=r,r=0,V()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=mn(Zt(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function Sn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function wn(){return{type:"HIDE_INSERTION_POINT"}}function Bn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const In=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},xn=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(u=s,d=i):(u=i,d=s);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,r.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,r.getBlockType)(v.name),_=o.getBlock(f.clientId),k=(0,r.getBlockType)(_.name),y=v.attributes[h.attributeKey],E=_.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=k.attributes[f.attributeKey];let w=(0,z.create)({html:y,...H(C)}),B=(0,z.create)({html:E,...H(S)});w=(0,z.remove)(w,h.offset,w.text.length),B=(0,z.insert)(B,Yt,0,f.offset);const I=(0,r.cloneBlock)(v,{[h.attributeKey]:(0,z.toHTMLString)({value:w,...H(C)})}),x=(0,r.cloneBlock)(_,{[f.attributeKey]:(0,z.toHTMLString)({value:B,...H(S)})}),T=e?I:x,N=v.name===_.name?[T]:(0,r.switchToBlockType)(T,g.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=g.merge(e.attributes,x.attributes)}else{const e=N.shift();P=g.merge(I.attributes,e.attributes)}const M=Qt(P),L=P[M],R=(0,z.create)({html:L,...H(g.attributes[M])}),A=R.text.indexOf(Yt),D=(0,z.remove)(R,A,A+1),O=(0,z.toHTMLString)({value:D,...H(g.attributes[M])});P[M]=O;const F=o.getSelectedBlockClientIds(),V=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{l.selectionChange(m.clientId,M,A,A),l.replaceBlocks(F,V,0,o.getSelectedBlocksInitialCaretPosition())}))},Tn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,r.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],_=h.attributes[d.attributeKey];let k=(0,z.create)({html:f,...H(b)}),y=(0,z.create)({html:v,...H(_)});k=(0,z.remove)(k,u.offset,k.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:k,...H(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...H(_)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Nn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},Pn=(e,t)=>n=>{let{registry:o,select:l,dispatch:i}=n;const s=[e,t];i({type:"MERGE_BLOCKS",blocks:s});const[a,c]=s,u=l.getBlock(a),d=(0,r.getBlockType)(u.name);if(!d)return;const p=l.getBlock(c);if(d&&!d.merge){const e=(0,r.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void i.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void i.selectBlock(u.clientId):void o.batch((()=>{i.insertBlocks(t.innerBlocks,void 0,a),i.removeBlock(c),i.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,r.getBlockType)(p.name),{clientId:g,attributeKey:h,offset:f}=l.getSelectionStart(),v=(g===a?d:m).attributes[h],b=(g===a||g===c)&&void 0!==h&&void 0!==f&&!!v;v||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const _=(0,r.cloneBlock)(u),k=(0,r.cloneBlock)(p);if(b){const e=g===a?_:k,t=e.attributes[h],n=(0,z.insert)((0,z.create)({html:t,...H(v)}),Yt,f,f);e.attributes[h]=(0,z.toHTMLString)({value:n,...H(v)})}const y=u.name===p.name?[k]:(0,r.switchToBlockType)(k,u.name);if(!y||!y.length)return;const E=d.merge(_.attributes,y[0].attributes);if(b){const e=Qt(E),t=E[e],n=(0,z.create)({html:t,...H(d.attributes[e])}),o=n.text.indexOf(Yt),r=(0,z.remove)(n,o,o+1),l=(0,z.toHTMLString)({value:r,...H(d.attributes[e])});E[e]=l,i.selectionChange(u.clientId,e,o,o)}i.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},Mn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=Zt(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function Ln(e,t){return Mn([e],t)}function Rn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function An(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Dn(){return{type:"START_TYPING"}}function On(){return{type:"STOP_TYPING"}}function zn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Fn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Vn(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Hn(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Gn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Un=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function Wn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function jn(e){return{type:"UPDATE_SETTINGS",settings:e}}function $n(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Kn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function qn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Yn=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Qn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},Zn=e=>t=>{let{dispatch:n,select:o}=t;if("zoom-out"===e){const e=o.getBlockSelectionStart();e&&n.selectBlock(o.getBlockHierarchyRootClientId(e))}n({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,qt.speak)((0,h.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,qt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,qt.speak)((0,h.__)("You are currently in zoom-out mode."))},Xn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,qt.speak)((0,h.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},Jn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if(i.some((e=>!e)))return;const s=i.map((e=>e.name));if(s.some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const a=o.getBlockRootClientId(e[0]),c=Zt(e),u=o.getBlockIndex(c[c.length-1]),d=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(d,u+1,a,t),d.length>1&&t&&l.multiSelect(d[0].clientId,d[d.length-1].clientId),d.map((e=>e.clientId))}},eo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},to=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function no(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const oo=e=>async t=>{let{dispatch:n}=t;n(no(e,!0)),await new Promise((e=>setTimeout(e,150))),n(no(e,!1))};function ro(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function lo(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function io(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const so="core/block-editor",ao={reducer:P,selectors:e,actions:t},co=(0,p.createReduxStore)(so,{...ao,persist:["preferences"]});(0,p.registerStore)(so,{...ao,persist:["preferences"]});const uo={name:"",isSelected:!1},po=(0,s.createContext)(uo),{Provider:mo}=po;function go(){return(0,s.useContext)(po)}function ho(){const{isSelected:e,clientId:t,name:n}=go();return(0,p.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(co);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function fo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=ho(),{clientId:o}=go(),l=(0,p.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(co),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:l?g.parent.Fill:null}(t,l);return i?(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(m.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(m.ToolbarGroup,{controls:n}),o)}))):null}function vo(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(m.__experimentalToolbarContext),r=g[t].Slot,l=(0,m.__experimentalUseSlotFills)(r.__unstableName);return Boolean(l&&l.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const bo=fo;bo.Slot=vo;const _o=e=>(0,s.createElement)(fo,i({group:"inline"},e));_o.Slot=e=>(0,s.createElement)(vo,i({group:"inline"},e));const ko=bo,yo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),Eo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),Co=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),So=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),wo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),Bo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function Io(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function xo(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${Io(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function To(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
o.none=(0,h.sprintf)((0,h.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
-
o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n)),o}const No=(0,s.createContext)({refs:new Map,callbacks:new Map});function Po(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(No.Provider,{value:n},t)}function Mo(e){const{refs:t,callbacks:n}=(0,s.useContext)(No),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,
|
8 |
-
(0,h.sprintf)((0,h.__)("Custom (%s)"),
|
9 |
-
(0,h.__)("%1$s %2$s"),Fo[r],null==a?void 0:a.toLowerCase()),N=g&&!v&&void 0!==B;return(0,s.createElement)(s.Fragment,null,"all"!==r&&(0,s.createElement)(m.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,s.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__side-label"},Fo[r]),N&&(0,s.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},B)),"all"===r&&N&&(0,s.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},B),!f&&(0,s.createElement)(m.Button,{label:v?(0,h.__)("Use size preset"):(0,h.__)("Set custom size"),icon:jo,onClick:()=>{b(!v)},isPressed:v,isSmall:!0,className:c()({"components-spacing-sizes-control__custom-toggle-all":"all"===r,"components-spacing-sizes-control__custom-toggle-single":"all"!==r}),iconSize:24}),v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.__experimentalUnitControl,{onChange:e=>l((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:k,units:_,min:u,placeholder:w,disableUnits:i,label:T,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",style:{gridColumn:"1"}}),(0,s.createElement)(m.RangeControl,{value:C,min:0,max:100,withInputField:!1,onChange:e=>{l([e,y].join(""))},className:"components-spacing-sizes-control__custom-value-range"})),g&&!v&&(0,s.createElement)(m.RangeControl,{className:"components-spacing-sizes-control__range-control",value:k,onChange:e=>l(S(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===o&&l("0")},withInputField:!1,"aria-valuenow":k,"aria-valuetext":null===(t=n[k])||void 0===t?void 0:t.name,renderTooltipContent:E,min:0,max:n.length-1,marks:x,label:T,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),!g&&!v&&(0,s.createElement)(m.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:I.find((e=>e.key===k))||"",onChange:e=>{l(S(e.selectedItem.key,"selectList"))},options:I,label:T,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0}))}function Zo(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Go(Object.values(e))}(n),c=Wo(n)&&Uo(n,o);return(0,s.createElement)(Qo,{value:a,onChange:e=>{const r=(0,m.__experimentalApplyValueToSides)(n,e,o);t(r)},side:"all",spacingSizes:r,isMixed:c,type:l,minimumCustomValue:i})}function Xo(e){let{values:t,sides:n,onChange:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const a=null!=n&&n.length?Ho.filter((e=>n.includes(e))):Ho,c=e=>n=>{const r={...t};r[e]=n,o(r)};return(0,s.createElement)(s.Fragment,null,a.map((e=>(0,s.createElement)(Qo,{value:t[e],label:Fo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:c(e),spacingSizes:r,type:l,minimumCustomValue:i}))))}const Jo=["vertical","horizontal"];function er(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const a=e=>o=>{if(!t)return;const r={...n};"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},c=null!=o&&o.length?Jo.filter((e=>o.includes(e))):Jo;return(0,s.createElement)(s.Fragment,null,c.map((e=>{const t="vertical"===e?n.top:n.left;return(0,s.createElement)(Qo,{value:t,onChange:a(e),label:Fo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:r,type:l,minimumCustomValue:i})})))}const tr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),nr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function or(e){let{isLinked:t,onClick:n}=e;const o=t?(0,h.__)("Unlink sides"):(0,h.__)("Link sides");return(0,s.createElement)(m.Tooltip,{text:o},(0,s.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,s.createElement)(m.Button,{isSmall:!0,icon:t?tr:nr,iconSize:24,"aria-label":o,onClick:n})))}function rr(e){let{inputProps:t,onChange:n,label:o=(0,h.__)("Spacing Control"),values:r,sides:l,splitOnAxis:a=!1,useSelect:u,minimumCustomValue:d=0}=e;const p=[{name:0,slug:"0",size:0},...Yo("spacing.spacingSizes")||[]];p.length>8&&p.unshift({name:(0,h.__)("Default"),slug:"default",size:void 0});const g=r||Vo,f=Wo(r),v=1===(null==l?void 0:l.length),[b,_]=(0,s.useState)(!f||!Uo(g,l)||v),k={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:b,sides:l,values:g,spacingSizes:p,useSelect:u,type:o,minimumCustomValue:d};return(0,s.createElement)("fieldset",{role:"region",className:c()("component-spacing-sizes-control",{"is-unlinked":!b})},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},o),!v&&(0,s.createElement)(or,{onClick:()=>{_(!b)},isLinked:b}),b&&(0,s.createElement)(Zo,i({"aria-label":o},k)),!b&&a&&(0,s.createElement)(er,k),!b&&!a&&(0,s.createElement)(Xo,k))}window.wp.warning;const lr={default:(0,m.createSlotFill)("InspectorControls"),advanced:(0,m.createSlotFill)("InspectorAdvancedControls"),border:(0,m.createSlotFill)("InspectorControlsBorder"),color:(0,m.createSlotFill)("InspectorControlsColor"),dimensions:(0,m.createSlotFill)("InspectorControlsDimensions"),typography:(0,m.createSlotFill)("InspectorControlsTypography")};function ir(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=ho(),l=null===(t=lr[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(m.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const sr=e=>e,ar=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,ar),sr);return(0,u.isEmpty)(t)?void 0:t};function cr(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function ur(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return Object.entries(e).forEach((e=>{let[n,o]=e;o&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:cr(c.attributes,e,t)})}))})),c}function dr(e,t,n){const o=(0,r.getBlockSupport)(e,t),l=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(l)?l.includes(n):l}function pr(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,p.useDispatch)(co),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,p.useSelect)(co),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:ar(r.style)},t[n]=r})),r(n,t,!0)}),[ar,l,i,c,u,r]);return(0,s.createElement)(m.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function mr(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(m.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function gr(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=lr[n])||void 0===t?void 0:t.Slot,a=(0,m.__experimentalUseSlot)(null==l?void 0:l.__unstableName),c=(0,m.__experimentalUseSlotFills)(null==l?void 0:l.__unstableName);return l&&a?Boolean(c&&c.length)?o?(0,s.createElement)(pr,{group:n,label:o},(0,s.createElement)(mr,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const hr=ir;hr.Slot=gr;const fr=e=>(0,s.createElement)(ir,i({},e,{__experimentalGroup:"advanced"}));fr.Slot=e=>(0,s.createElement)(gr,i({},e,{__experimentalGroup:"advanced"})),fr.slotName="InspectorAdvancedControls";const vr=hr,br=window.wp.isShallowEqual;var _r=n.n(br);const kr=function(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])},yr=Number.MAX_SAFE_INTEGER,Er=(0,s.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:r,__unstableRefreshSize:l,__unstableCoverTarget:a=!1,__unstablePopoverSlot:u,__unstableContentRef:p,...g}=e;const h=Ro(n),f=Ro(null!=o?o:n),v=(0,d.useMergeRefs)([t,kr(p)]),[b,_]=(0,s.useReducer)((e=>(e+1)%yr),0);(0,s.useLayoutEffect)((()=>{if(!h)return;const e=new window.MutationObserver(_);return e.observe(h,{attributes:!0}),()=>{e.disconnect()}}),[h]);const k=(0,s.useMemo)((()=>b<0||!h||f!==h?{}:{position:"absolute",width:h.offsetWidth,height:h.offsetHeight}),[h,f,l,b]),y=(0,s.useMemo)((()=>{if(!(b<0||!h||o&&!f))return{getBoundingClientRect(){var e,t,n,o;const r=h.getBoundingClientRect(),l=null==f?void 0:f.getBoundingClientRect(),i=Math.min(r.left,null!==(e=null==l?void 0:l.left)&&void 0!==e?e:1/0),s=Math.min(r.top,null!==(t=null==l?void 0:l.top)&&void 0!==t?t:1/0),a=Math.max(r.right,null!==(n=l.right)&&void 0!==n?n:-1/0)-i,c=Math.max(r.bottom,null!==(o=l.bottom)&&void 0!==o?o:-1/0)-s;return new window.DOMRect(i,s,a,c)},ownerDocument:h.ownerDocument}}),[o,f,h,b]);return!h||o&&!f?null:(0,s.createElement)(m.Popover,i({ref:v,animate:!1,focusOnMount:!1,anchor:y,__unstableSlotName:u||null,placement:"top-start",resize:!1,flip:!1,shift:!0},g,{className:c()("block-editor-block-popover",g.className)}),a&&(0,s.createElement)("div",{style:k},r),!a&&r)}));function Cr(e){const t=(0,r.getBlockSupport)(e,Pr);return!!(!0===t||null!=t&&t.margin)}function Sr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.margin"),n=!Or(e,"margin");return!Cr(e)||t||n}function wr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Dr(o,"margin"),u=c&&c.some((e=>Lr.includes(e)));if(Sr(e))return null;const d=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};l({style:ar(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:d,label:(0,h.__)("Margin"),sides:c,units:a,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,s.createElement)(rr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.margin,onChange:d,label:(0,h.__)("Margin"),sides:c,units:a,allowReset:!1,splitOnAxis:!1})),native:null})}function Br(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=Yo("spacing.spacingSizes"),a=(0,s.useMemo)((()=>{const e=null!=l&&l.top?Do(null==l?void 0:l.top,i):0,t=null!=l&&l.right?Do(null==l?void 0:l.right,i):0,n=null!=l&&l.bottom?Do(null==l?void 0:l.bottom,i):0,o=null!=l&&l.left?Do(null==l?void 0:l.left,i):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:0!==e?`-${e}`:0,right:0!==t?`-${t}`:0,bottom:0!==n?`-${n}`:0,left:0!==o?`-${o}`:0}}),[l]),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(l),p=(0,s.useRef)(),m=()=>{p.current&&window.clearTimeout(p.current)};return(0,s.useEffect)((()=>(_r()(l,d.current)||(u(!0),d.current=l,m(),p.current=setTimeout((()=>{u(!1)}),400)),()=>m())),[l]),c?(0,s.createElement)(Er,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function Ir(e){const t=(0,r.getBlockSupport)(e,Pr);return!!(!0===t||null!=t&&t.padding)}function xr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.padding"),n=!Or(e,"padding");return!Ir(e)||t||n}function Tr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Dr(o,"padding"),u=c&&c.some((e=>Lr.includes(e)));if(xr(e))return null;const d=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};l({style:ar(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:d,label:(0,h.__)("Padding"),sides:c,units:a,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,s.createElement)(rr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.padding,onChange:d,label:(0,h.__)("Padding"),sides:c,units:a,allowReset:!1,splitOnAxis:u})),native:null})}function Nr(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>({borderTopWidth:Ao(null==l?void 0:l.top)?Oo(null==l?void 0:l.top):null==l?void 0:l.top,borderRightWidth:Ao(null==l?void 0:l.right)?Oo(null==l?void 0:l.right):null==l?void 0:l.right,borderBottomWidth:Ao(null==l?void 0:l.bottom)?Oo(null==l?void 0:l.bottom):null==l?void 0:l.bottom,borderLeftWidth:Ao(null==l?void 0:l.left)?Oo(null==l?void 0:l.left):null==l?void 0:l.left})),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(_r()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(Er,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const Pr="spacing",Mr=["top","right","bottom","left"],Lr=["vertical","horizontal"];function Rr(e){const t=Hr(e),n=xr(e),o=Sr(e),l=Ar(e),i=(u=e.name,"web"===s.Platform.OS&&(zr(u)||Ir(u)||Cr(u))),a=Yo("spacing.spacingSizes");var u;if(l||!i)return null;const d=(0,r.getBlockSupport)(e.name,[Pr,"__experimentalDefaultControls"]),p=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}},g=c()({"tools-panel-item-spacing":a&&a.length>0});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(vr,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,h.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ar({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:p("padding"),isShownByDefault:null==d?void 0:d.padding,panelId:e.clientId},(0,s.createElement)(Tr,e)),!o&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,h.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ar({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:p("margin"),isShownByDefault:null==d?void 0:d.margin,panelId:e.clientId},(0,s.createElement)(wr,e)),!t&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,h.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:p("blockGap"),isShownByDefault:null==d?void 0:d.blockGap,panelId:e.clientId},(0,s.createElement)(Gr,e))),!n&&(0,s.createElement)(Nr,e),!o&&(0,s.createElement)(Br,e))}const Ar=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Hr(e),n=xr(e),o=Sr(e);return t&&n&&o};function Dr(e,t){var n;const o=(0,r.getBlockSupport)(e,Pr);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function Or(e,t){const n=Dr(e,t);return!(n&&n.some((e=>Mr.includes(e)))&&n.some((e=>Lr.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function zr(e){const t=(0,r.getBlockSupport)(e,Pr);return!!(!0===t||null!=t&&t.blockGap)}function Fr(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function Vr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=Fr(e);if(!n)return null;const o=Oo(null==n?void 0:n.top)||t,r=Oo(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}function Hr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.blockGap");return!zr(e)||t}function Gr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Dr(r,"blockGap"),u=Lo(n);if(Hr(e))return null;const d=c&&c.some((e=>Lr.includes(e))),p=e=>{var t;let n=e;e&&d?n={...Fr(e)}:null!=e&&e.hasOwnProperty("top")&&(n=e.top);const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:ar(r)});const i=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;u.current&&i&&(null===(s=u.current.parentNode)||void 0===s||s.replaceChild(u.current,u.current))},g=Fr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=d?{...g,right:null==g?void 0:g.left,bottom:null==g?void 0:g.top}:{top:null==g?void 0:g.top};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(d?(0,s.createElement)(m.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:p,units:a,sides:c,values:f,allowReset:!1,splitOnAxis:d}):(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:p,units:a,value:f})),(null==i?void 0:i.length)>0&&(0,s.createElement)(rr,{values:f,onChange:p,label:(0,h.__)("Block spacing"),sides:d?c:["top"],units:a,allowReset:!1,splitOnAxis:d})),native:null})}const Ur=(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Wr=(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),jr={top:{icon:(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:Wr,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Ur,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},$r=["top","center","bottom"],Kr={isAlternate:!0},qr=function(e){let{value:t,onChange:n,controls:o=$r,isCollapsed:r=!0,isToolbar:l}=e;const a=jr[t],c=jr.top,u=l?m.ToolbarGroup:m.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{popoverProps:{POPOVER_PROPS:Kr}};return(0,s.createElement)(u,i({icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...jr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},Yr=e=>(0,s.createElement)(qr,i({},e,{isToolbar:!1})),Qr=e=>(0,s.createElement)(qr,i({},e,{isToolbar:!0})),Zr={left:yo,center:Eo,right:Co,"space-between":So},Xr=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?Zr[r]:Zr.left,d=[{name:"left",icon:yo,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:Eo,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:Co,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:So,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],p=a?m.ToolbarGroup:m.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(p,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},Jr=e=>(0,s.createElement)(Xr,i({},e,{isToolbar:!1})),el=e=>(0,s.createElement)(Xr,i({},e,{isToolbar:!0})),tl={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},nl={left:"flex-start",right:"flex-end",center:"center"},ol={top:"flex-start",center:"center",bottom:"flex-end"},rl=["wrap","nowrap"],ll={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Flex,null,(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(sl,{layout:t,onChange:n})),(0,s.createElement)(m.FlexItem,null,r&&(0,s.createElement)(cl,{layout:t,onChange:n}))),(0,s.createElement)(al,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(sl,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(il,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!dr(i,"spacing","blockGap")?Vr(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=tl[r.justifyContent],p=rl.includes(r.flexWrap)?r.flexWrap:"wrap",m=ol[r.verticalAlignment],g=nl[r.justifyContent]||nl.left;let h="";const f=[];return p&&"wrap"!==p&&f.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&f.push(`align-items: ${m}`),d&&f.push(`justify-content: ${d}`)):(f.push("flex-direction: column"),f.push(`align-items: ${g}`)),f.length&&(h=`${Io(o)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),s&&u&&(h+=xo(o,a,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function il(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=ol.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(Yr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(m.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function sl(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(Jr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:yo,label:(0,h.__)("Justify items left")},{value:"center",icon:Eo,label:(0,h.__)("Justify items center")},{value:"right",icon:Co,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:So,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(m.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function al(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(m.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function cl(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,h.__)("Orientation")),(0,s.createElement)(m.Button,{label:(0,h.__)("Horizontal"),icon:wo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(m.Button,{label:(0,h.__)("Vertical"),icon:Bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}const ul={name:"default",label:(0,h.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:o,blockName:r,hasBlockGapSupport:l,layoutDefinitions:i}=e;const s=Vr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let a="";dr(r,"spacing","blockGap")||(null!=s&&s.top?a=Vr(null==s?void 0:s.top):"string"==typeof s&&(a=Vr(s)));let c="";return l&&a&&(c+=xo(n,i,"default",a)),c},getOrientation:()=>"vertical",getAlignments(e){const t=To(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},dl=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},pl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),ml=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),gl=window.wp.styleEngine,hl={name:"constrained",label:(0,h.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r,justifyContent:l="center"}=t,i=[{value:"left",icon:yo,label:(0,h.__)("Justify items left")},{value:"center",icon:Eo,label:(0,h.__)("Justify items center")},{value:"right",icon:Co,label:(0,h.__)("Justify items right")}],a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,s.createElement)(dl,{icon:pl})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,s.createElement)(dl,{icon:ml}))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")),(0,s.createElement)(m.__experimentalToggleGroupControl,{__experimentalIsBorderless:!0,label:(0,h.__)("Justification"),value:l,onChange:e=>{n({...t,justifyContent:e})}},i.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})}))))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r={},style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{contentSize:c,wideSize:u,justifyContent:d}=r,p=Vr(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap);let m="";dr(i,"spacing","blockGap")||(null!=p&&p.top?m=Vr(null==p?void 0:p.top):"string"==typeof p&&(m=Vr(p)));const g="left"===d?"0 !important":"auto !important",h="right"===d?"0 !important":"auto !important";let f=c||u?`\n\t\t\t\t\t${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: ${g};\n\t\t\t\t\t\tmargin-right: ${h};\n\t\t\t\t\t}\n\t\t\t\t\t${Io(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===d?f+=`${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${g}; }`:"right"===d&&(f+=`${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding&&(0,gl.getCSSRules)(l).forEach((e=>{"paddingRight"===e.key?f+=`\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(f+=`\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),s&&m&&(f+=xo(o,a,"constrained",m)),f},getOrientation:()=>"vertical",getAlignments(e){const t=To(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},fl=[ul,ll,hl];function vl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return fl.find((t=>t.name===e))}const bl={type:"default"},_l=(0,s.createContext)(bl),kl=_l.Provider;function yl(){return(0,s.useContext)(_l)}function El(e){let{layout:t={},css:n,...o}=e;const r=vl(t.type),l=null!==Yo("spacing.blockGap");if(r){var i;if(n)return(0,s.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,s.createElement)("style",null,e)}return null}const Cl=["none","left","center","right","wide","full"],Sl=["wide","full"];function wl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Cl;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,p.useSelect)((e=>{const{getSettings:t}=e(co),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=yl(),r=vl(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name&&"constrained"!==r.name)return[];const{alignments:i=Cl}=o,s=e.filter((e=>(o.alignments||t||!Sl.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Bl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Il=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),xl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),Tl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),Nl={none:{icon:Bl,title:(0,h._x)("None","Alignment option")},left:{icon:Il,title:(0,h.__)("Align left")},center:{icon:pl,title:(0,h.__)("Align center")},right:{icon:xl,title:(0,h.__)("Align right")},wide:{icon:ml,title:(0,h.__)("Wide width")},full:{icon:Tl,title:(0,h.__)("Full width")}},Pl={isAlternate:!0},Ml=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=wl(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Nl[t],p=Nl.none,g=r?m.ToolbarGroup:m.ToolbarDropdownMenu,f={icon:d?d.icon:p.icon,label:(0,h.__)("Align")},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...Nl[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{toggleProps:{describedBy:(0,h.__)("Change alignment")},popoverProps:Pl,children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Nl[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(m.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(g,i({},f,v))},Ll=e=>(0,s.createElement)(Ml,i({},e,{isToolbar:!1})),Rl=e=>(0,s.createElement)(Ml,i({},e,{isToolbar:!0})),Al=["left","center","right","wide","full"],Dl=["wide","full"];function Ol(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Al.filter((t=>e.includes(t))):!0===e?[...Al]:[],!o||!0===e&&!n?(0,u.without)(t,...Dl):t}const zl=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,s.createElement)(e,t),{name:o}=t,l=wl(Ol((0,r.getBlockSupport)(o,"align"),(0,r.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),i=(0,p.useSelect)((e=>e(co).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return!l.length||i?n:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Ll,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:l})),n)}),"withToolbarControls"),Fl=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=wl(Ol((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Al,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Fl),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",zl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Ol((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Vl=/[\s#]/g,Hl={type:"string",source:"attribute",attribute:"id",selector:"*"},Gl=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(m.TextControl,{className:"html-anchor-control",label:(0,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(m.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(Vl,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(vr,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(vr,null,(0,s.createElement)(m.PanelBody,{title:(0,h.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Hl}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Gl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Ul={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,l.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,r.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Ul}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Wl=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(vr,{__experimentalGroup:"advanced"},(0,s.createElement)(m.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Wl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const jl=window.wp.dom,$l=(0,s.createContext)({});function Kl(e){let{value:t,children:n}=e;const o=(0,s.useContext)($l),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)($l.Provider,{value:r,children:n})}const ql=$l,Yl={},Ql=(0,m.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(ql),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):Yl),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className,e.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function Zl(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(mo,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(Ql,e))}const Xl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),Jl=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:Xl,label:(0,h.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(m.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))};var ei=n(1973);function ti(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,jl.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(m.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}const ni=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,g=a,(0,ei.Kx)(m,g).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,g;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(ti,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(ti,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))},oi=e=>(0,r.rawHandler)({HTML:e.originalContent}),ri=(0,d.compose)([(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(co).getBlock(n)}})),(0,p.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(co);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,oi(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),p=(0,s.useCallback)((()=>u(!1)),[]),g=(0,s.useMemo)((()=>[{
|
10 |
// translators: Button to fix block content
|
11 |
-
title:(0,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(
|
12 |
-
(0,h.__)("Resolve Block"),onRequestClose:p,className:"block-editor-block-compare"},(0,s.createElement)(ni,{block:i,onKeep:t,onConvert:n,convertor:oi,convertButtonText:(0,h.__)("Convert to Blocks")})))})),li=(0,s.createElement)(Jl,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),ii=()=>li;class si extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const ai=si;var ci=n(773);const ui=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,p.useSelect)((e=>e(co).getBlock(t)),[t]),{updateBlock:i}=(0,p.useDispatch)(co);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(ci.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),[c]=n?(0,r.validateBlock)({...l,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let di=Ii();const pi=e=>Ci(e,di);let mi=Ii();pi.write=e=>Ci(e,mi);let gi=Ii();pi.onStart=e=>Ci(e,gi);let hi=Ii();pi.onFrame=e=>Ci(e,hi);let fi=Ii();pi.onFinish=e=>Ci(e,fi);let vi=[];pi.setTimeout=(e,t)=>{let n=pi.now()+t,o=()=>{let e=vi.findIndex((e=>e.cancel==o));~e&&vi.splice(e,1),yi-=~e?1:0},r={time:n,handler:e,cancel:o};return vi.splice(bi(n),0,r),yi+=1,Si(),r};let bi=e=>~(~vi.findIndex((t=>t.time>e))||~vi.length);pi.cancel=e=>{gi.delete(e),hi.delete(e),fi.delete(e),di.delete(e),mi.delete(e)},pi.sync=e=>{Ei=!0,pi.batchedUpdates(e),Ei=!1},pi.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,pi.onStart(n)}return o.handler=e,o.cancel=()=>{gi.delete(n),t=null},o};let _i="undefined"!=typeof window?window.requestAnimationFrame:()=>{};pi.use=e=>_i=e,pi.now="undefined"!=typeof performance?()=>performance.now():Date.now,pi.batchedUpdates=e=>e(),pi.catch=console.error,pi.frameLoop="always",pi.advance=()=>{"demand"!==pi.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Bi()};let ki=-1,yi=0,Ei=!1;function Ci(e,t){Ei?(t.delete(e),e(0)):(t.add(e),Si())}function Si(){ki<0&&(ki=0,"demand"!==pi.frameLoop&&_i(wi))}function wi(){~ki&&(_i(wi),pi.batchedUpdates(Bi))}function Bi(){let e=ki;ki=pi.now();let t=bi(ki);t&&(xi(vi.splice(0,t),(e=>e.handler())),yi-=t),yi?(gi.flush(),di.flush(e?Math.min(64,ki-e):16.667),hi.flush(),mi.flush(),fi.flush()):ki=-1}function Ii(){let e=new Set,t=e;return{add(n){yi+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(yi-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,yi-=t.size,xi(t,(t=>t(n)&&e.add(t))),yi+=e.size,t=e)}}}function xi(e,t){e.forEach((e=>{try{t(e)}catch(e){pi.catch(e)}}))}var Ti=n(9196),Ni=n.n(Ti);function Pi(){}const Mi={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Li(e,t){if(Mi.arr(e)){if(!Mi.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Ri=(e,t)=>e.forEach(t);function Ai(e,t,n){if(Mi.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Di=e=>Mi.und(e)?[]:Mi.arr(e)?e:[e];function Oi(e,t){if(e.size){const n=Array.from(e);e.clear(),Ri(n,t)}}const zi=(e,...t)=>Oi(e,(e=>e(...t))),Fi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Vi,Hi,Gi=null,Ui=!1,Wi=Pi;var ji=Object.freeze({__proto__:null,get createStringInterpolator(){return Vi},get to(){return Hi},get colors(){return Gi},get skipAnimation(){return Ui},get willAdvance(){return Wi},assign:e=>{e.to&&(Hi=e.to),e.now&&(pi.now=e.now),void 0!==e.colors&&(Gi=e.colors),null!=e.skipAnimation&&(Ui=e.skipAnimation),e.createStringInterpolator&&(Vi=e.createStringInterpolator),e.requestAnimationFrame&&pi.use(e.requestAnimationFrame),e.batchedUpdates&&(pi.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Wi=e.willAdvance),e.frameLoop&&(pi.frameLoop=e.frameLoop)}});const $i=new Set;let Ki=[],qi=[],Yi=0;const Qi={get idle(){return!$i.size&&!Ki.length},start(e){Yi>e.priority?($i.add(e),pi.onStart(Zi)):(Xi(e),pi(es))},advance:es,sort(e){if(Yi)pi.onFrame((()=>Qi.sort(e)));else{const t=Ki.indexOf(e);~t&&(Ki.splice(t,1),Ji(e))}},clear(){Ki=[],$i.clear()}};function Zi(){$i.forEach(Xi),$i.clear(),pi(es)}function Xi(e){Ki.includes(e)||Ji(e)}function Ji(e){Ki.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(Ki),0,e)}function es(e){const t=qi;for(let n=0;n<Ki.length;n++){const o=Ki[n];Yi=o.priority,o.idle||(Wi(o),o.advance(e),o.idle||t.push(o))}return Yi=0,qi=Ki,qi.length=0,Ki=t,Ki.length>0}const ts="[-+]?\\d*\\.?\\d+",ns=ts+"%";function os(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const rs=new RegExp("rgb"+os(ts,ts,ts)),ls=new RegExp("rgba"+os(ts,ts,ts,ts)),is=new RegExp("hsl"+os(ts,ns,ns)),ss=new RegExp("hsla"+os(ts,ns,ns,ts)),as=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,cs=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,us=/^#([0-9a-fA-F]{6})$/,ds=/^#([0-9a-fA-F]{8})$/;function ps(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ms(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=ps(r,o,e+1/3),i=ps(r,o,e),s=ps(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function gs(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function hs(e){return(parseFloat(e)%360+360)%360/360}function fs(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function vs(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function bs(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=us.exec(e))?parseInt(t[1]+"ff",16)>>>0:Gi&&void 0!==Gi[e]?Gi[e]:(t=rs.exec(e))?(gs(t[1])<<24|gs(t[2])<<16|gs(t[3])<<8|255)>>>0:(t=ls.exec(e))?(gs(t[1])<<24|gs(t[2])<<16|gs(t[3])<<8|fs(t[4]))>>>0:(t=as.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ds.exec(e))?parseInt(t[1],16)>>>0:(t=cs.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=is.exec(e))?(255|ms(hs(t[1]),vs(t[2]),vs(t[3])))>>>0:(t=ss.exec(e))?(ms(hs(t[1]),vs(t[2]),vs(t[3]))|fs(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const _s=(e,t,n)=>{if(Mi.fun(e))return e;if(Mi.arr(e))return _s({range:e,output:t,extrapolate:n});if(Mi.str(e.output[0]))return Vi(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function ks(){return ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ks.apply(this,arguments)}const ys=Symbol.for("FluidValue.get"),Es=Symbol.for("FluidValue.observers"),Cs=e=>Boolean(e&&e[ys]),Ss=e=>e&&e[ys]?e[ys]():e,ws=e=>e[Es]||null;function Bs(e,t){let n=e[Es];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Is{constructor(e){if(this[ys]=void 0,this[Es]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");xs(this,e)}}const xs=(e,t)=>Ps(e,ys,t);function Ts(e,t){if(e[ys]){let n=e[Es];n||Ps(e,Es,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Ns(e,t){let n=e[Es];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Es]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Ps=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ms=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ls=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Rs=new RegExp(`(${Ms.source})(%|[a-z]+)`,"i"),As=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ds=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Os=e=>{const[t,n]=zs(e);if(!t||Fi())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&Ds.test(n)?Os(n):n||e},zs=e=>{const t=Ds.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let Fs;const Vs=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Hs=e=>{Fs||(Fs=Gi?new RegExp(`(${Object.keys(Gi).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Ss(e).replace(Ds,Os).replace(Ls,bs).replace(Fs,bs))),n=t.map((e=>e.match(Ms).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))),r=o.map((t=>_s(ks({},e,{output:t}))));return e=>{var n;const o=!Rs.test(t[0])&&(null==(n=t.find((e=>Rs.test(e))))?void 0:n.replace(Ms,""));let l=0;return t[0].replace(Ms,(()=>`${r[l++](e)}${o||""}`)).replace(As,Vs)}},Gs="react-spring: ",Us=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Gs}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Ws=Us(console.warn),js=Us(console.warn);function $s(e){return Mi.str(e)&&("#"==e[0]||/\d/.test(e)||!Fi()&&Ds.test(e)||e in(Gi||{}))}const Ks=Fi()?Ti.useEffect:Ti.useLayoutEffect;function qs(){const e=(0,Ti.useState)()[1],t=(()=>{const e=(0,Ti.useRef)(!1);return Ks((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const Ys=e=>(0,Ti.useEffect)(e,Qs),Qs=[];function Zs(e){const t=(0,Ti.useRef)();return(0,Ti.useEffect)((()=>{t.current=e})),t.current}const Xs=Symbol.for("Animated:node"),Js=e=>e&&e[Xs],ea=(e,t)=>{return n=e,o=Xs,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ta=e=>e&&e[Xs]&&e[Xs].getPayload();class na{constructor(){this.payload=void 0,ea(this,this)}getPayload(){return this.payload||[]}}class oa extends na{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,Mi.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new oa(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Mi.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Mi.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class ra extends oa{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=_s({output:[e,e]})}static create(e){return new ra(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Mi.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=_s({output:[this.getValue(),e]})),this._value=0,super.reset()}}const la={dependencies:null};class ia extends na{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ai(this.source,((n,o)=>{var r;(r=n)&&r[Xs]===r?t[o]=n.getValue(e):Cs(n)?t[o]=Ss(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Ri(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Ai(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){la.dependencies&&Cs(e)&&la.dependencies.add(e);const t=ta(e);t&&Ri(t,(e=>this.add(e)))}}class sa extends ia{constructor(e){super(e)}static create(e){return new sa(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(aa)),!0)}}function aa(e){return($s(e)?ra:oa).create(e)}function ca(e){const t=Js(e);return t?t.constructor:Mi.arr(e)?sa:$s(e)?ra:oa}function ua(){return ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ua.apply(this,arguments)}const da=(e,t)=>{const n=!Mi.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ti.forwardRef)(((o,r)=>{const l=(0,Ti.useRef)(null),i=n&&(0,Ti.useCallback)((e=>{l.current=function(e,t){return e&&(Mi.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return la.dependencies=n,e.style&&(e=ua({},e,{style:t.createAnimatedStyle(e.style)})),e=new ia(e),la.dependencies=null,[e,n]}(o,t),c=qs(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new pa(u,a),p=(0,Ti.useRef)();Ks((()=>(p.current=d,Ri(a,(e=>Ts(e,d))),()=>{p.current&&(Ri(p.current.deps,(e=>Ns(e,p.current))),pi.cancel(p.current.update))}))),(0,Ti.useEffect)(u,[]),Ys((()=>()=>{const e=p.current;Ri(e.deps,(t=>Ns(t,e)))}));const m=t.getComponentProps(s.getValue());return Ti.createElement(e,ua({},m,{ref:i}))}))};class pa{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&pi.write(this.update)}}const ma=Symbol.for("AnimatedComponent"),ga=e=>Mi.str(e)?e:e&&Mi.str(e.displayName)?e.displayName:Mi.fun(e)&&e.name||null;function ha(){return ha=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ha.apply(this,arguments)}function fa(e,...t){return Mi.fun(e)?e(...t):e}const va=(e,t)=>!0===e||!!(t&&e&&(Mi.fun(e)?e(t):Di(e).includes(t))),ba=(e,t)=>Mi.obj(e)?t&&e[t]:e,_a=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,ka=e=>e,ya=(e,t=ka)=>{let n=Ea;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);Mi.und(n)||(o[r]=n)}return o},Ea=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Ca={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Sa(e){const t=function(e){const t={};let n=0;if(Ai(e,((e,o)=>{Ca[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Ai(e,((e,o)=>o in t||(n[o]=e))),n}return ha({},e)}function wa(e){return e=Ss(e),Mi.arr(e)?e.map(wa):$s(e)?ji.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ba(e){for(const t in e)return!0;return!1}function Ia(e){return Mi.fun(e)||Mi.arr(e)&&Mi.obj(e[0])}function xa(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Ta(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Na=1.70158,Pa=1.525*Na,Ma=Na+1,La=2*Math.PI/3,Ra=2*Math.PI/4.5,Aa=e=>{const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},Da={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>Ma*e*e*e-Na*e*e,easeOutBack:e=>1+Ma*Math.pow(e-1,3)+Na*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-Pa)/2:(Math.pow(2*e-2,2)*((Pa+1)*(2*e-2)+Pa)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*La),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*La)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Ra)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Ra)/2+1,easeInBounce:e=>1-Aa(1-e),easeOutBounce:Aa,easeInOutBounce:e=>e<.5?(1-Aa(1-2*e))/2:(1+Aa(2*e-1))/2},Oa=ha({},{tension:170,friction:26},{mass:1,damping:1,easing:Da.linear,clamp:!1});class za{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Oa)}}function Fa(e,t){if(Mi.und(t.decay)){const n=!Mi.und(t.tension)||!Mi.und(t.friction);!n&&Mi.und(t.frequency)&&Mi.und(t.damping)&&Mi.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Va=[];class Ha{constructor(){this.changed=!1,this.values=Va,this.toValues=null,this.fromValues=Va,this.to=void 0,this.from=void 0,this.config=new za,this.immediate=!1}}function Ga(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=va(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{Mi.und(n.pause)||(r.paused=va(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||va(e,t)),c=fa(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-pi.now()}function m(){c>0&&!ji.skipAnimation?(r.delayed=!0,u=pi.setTimeout(g,c),r.pauseQueue.add(p),r.timeouts.add(u)):g()}function g(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(ha({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Ua=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?$a(e.get()):t.every((e=>e.noop))?Wa(e.get()):ja(e.get(),t.every((e=>e.finished))),Wa=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),ja=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),$a=e=>({value:e,cancelled:!0,finished:!1});function Ka(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=ya(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&$a(o)||r!==n.asyncId&&ja(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new Ya,i=new Qa;return(async()=>{if(ji.skipAnimation)throw qa(n),i.result=ja(o,!1),d(i),i;m(l);const s=Mi.obj(e)?ha({},e):ha({},t,{to:e});s.parentId=r,Ai(c,((e,t)=>{Mi.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(ji.skipAnimation)return qa(n),ja(o,!1);try{let t;t=Mi.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=ja(o.get(),!0,!1)}catch(e){if(e instanceof Ya)h=e.result;else{if(!(e instanceof Qa))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Mi.fun(i)&&pi.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function qa(e,t){Oi(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Ya extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class Qa extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Za=e=>e instanceof Ja;let Xa=1;class Ja extends Is{constructor(...e){super(...e),this.id=Xa++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Js(this);return e&&e.getValue()}to(...e){return ji.to(this,e)}interpolate(...e){return Ws(`${Gs}The "interpolate" function is deprecated in v9 (use "to" instead)`),ji.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Bs(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Qi.sort(this),Bs(this,{type:"priority",parent:this,priority:e})}}const ec=Symbol.for("SpringPhase"),tc=e=>(1&e[ec])>0,nc=e=>(2&e[ec])>0,oc=e=>(4&e[ec])>0,rc=(e,t)=>t?e[ec]|=3:e[ec]&=-3,lc=(e,t)=>t?e[ec]|=4:e[ec]&=-5;class ic extends Ja{constructor(e,t){if(super(),this.key=void 0,this.animation=new Ha,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Mi.und(e)||!Mi.und(t)){const n=Mi.obj(e)?ha({},e):ha({},t,{from:e});Mi.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(nc(this)||this._state.asyncTo)||oc(this)}get goal(){return Ss(this.animation.to)}get velocity(){const e=Js(this);return e instanceof oa?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return tc(this)}get isAnimating(){return nc(this)}get isPaused(){return oc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=ta(o.to);!i&&Cs(o.to)&&(l=Di(Ss(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==ra?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=Mi.arr(r.velocity)?r.velocity[a]:r.velocity;let i;const p=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n)));if(Mi.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<=p,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.restVelocity||p/10,o=r.clamp?0:r.bounce,a=!Mi.und(o),m=n==c?s.v0>0:n<c;let g,h=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(i)>t,g||(u=Math.abs(c-d)<=p,!u));++e)a&&(h=d==c||d>c==m,h&&(i=-i*o,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*f,d+=i*f}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=Js(this),a=s.getValue();if(t){const e=Ss(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return pi.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(nc(this)){const{to:e,config:t}=this.animation;pi.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Mi.und(e)?(n=this.queue||[],this.queue=[]):n=[Mi.obj(e)?e:ha({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Ua(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),qa(this._state,e&&this._lastCallId),pi.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=Mi.obj(n)?n[t]:n,(null==n||Ia(n))&&(n=void 0),o=Mi.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return tc(this)||(e.reverse&&([n,o]=[o,n]),o=Ss(o),Mi.und(o)?Js(this)||this._set(n):this._set(o)),r}_update(e,t){let n=ha({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,ya(n,((e,t)=>/^on/.test(t)?ba(e,o):e))),mc(this,n,"onProps"),gc(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return Ga(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{oc(this)||(lc(this,!0),zi(i.pauseQueue),gc(this,"onPause",ja(this,sc(this,this.animation.to)),this))},resume:()=>{oc(this)&&(lc(this,!1),nc(this)&&this._resume(),zi(i.resumeQueue),gc(this,"onResume",ja(this,sc(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=ac(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n($a(this));const o=!Mi.und(e.to),r=!Mi.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n($a(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!Mi.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Li(d,c);p&&(s.from=d),d=Ss(d);const m=!Li(u,a);m&&this._focus(u);const g=Ia(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(Fa(n=ha({},n),t),t=ha({},n,t)),Fa(e,t),Object.assign(e,t);for(const t in Oa)null==e[t]&&(e[t]=Oa[t]);let{mass:o,frequency:r,damping:l}=e;Mi.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(h,fa(t.config,l),t.config!==i.config?fa(i.config,l):void 0);let b=Js(this);if(!b||Mi.und(u))return n(ja(this,!0));const _=Mi.und(t.reset)?r&&!t.default:!Mi.und(d)&&va(t.reset,l),k=_?d:this.get(),y=wa(u),E=Mi.num(y)||Mi.arr(y)||$s(y),C=!g&&(!E||va(i.immediate||t.immediate,l));if(m){const e=ca(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=Cs(u),B=!1;if(!w){const e=_||!tc(this)&&p;(m||e)&&(B=Li(wa(k),y),w=!B),(Li(s.immediate,C)||C)&&Li(h.decay,f)&&Li(h.velocity,v)||(w=!0)}if(B&&nc(this)&&(s.changed&&!_?w=!0:w||this._stop(a)),!g&&((w||Cs(a))&&(s.values=b.getPayload(),s.toValues=Cs(u)?null:S==ra?[1]:Di(y)),s.immediate!=C&&(s.immediate=C,C||_||this._set(a)),w)){const{onRest:e}=s;Ri(pc,(e=>mc(this,t,e)));const o=ja(this,sc(this,a));zi(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&pi.batchedUpdates((()=>{s.changed=!_,null==e||e(o,this),_?fa(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}_&&this._set(k),g?n(Ka(t.to,t,this._state,this)):w?this._start():nc(this)&&!m?this._pendingCalls.add(n):n(Wa(k))}_focus(e){const t=this.animation;e!==t.to&&(ws(this)&&this._detach(),t.to=e,ws(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Cs(t)&&(Ts(t,this),Za(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Cs(e)&&Ns(e,this)}_set(e,t=!0){const n=Ss(e);if(!Mi.und(n)){const e=Js(this);if(!e||!Li(n,e.getValue())){const o=ca(n);e&&e.constructor==o?e.setValue(n):ea(this,o.create(n)),e&&pi.batchedUpdates((()=>{this._onChange(n,t)}))}}return Js(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,gc(this,"onStart",ja(this,sc(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),fa(this.animation.onChange,e,this)),fa(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Js(this).reset(Ss(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),nc(this)||(rc(this,!0),oc(this)||this._resume())}_resume(){ji.skipAnimation?this.finish():Qi.start(this)}_stop(e,t){if(nc(this)){rc(this,!1);const n=this.animation;Ri(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Bs(this,{type:"idle",parent:this});const o=t?$a(this.get()):ja(this.get(),sc(this,null!=e?e:n.to));zi(this._pendingCalls,o),n.changed&&(n.changed=!1,gc(this,"onRest",o,this))}}}function sc(e,t){const n=wa(t);return Li(wa(e.get()),n)}function ac(e,t=e.loop,n=e.to){let o=fa(t);if(o){const r=!0!==o&&Sa(o),l=(r||e).reverse,i=!r||r.reset;return cc(ha({},e,{loop:t,default:!1,pause:void 0,to:!l||Ia(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function cc(e){const{to:t,from:n}=e=Sa(e),o=new Set;return Mi.obj(t)&&dc(t,o),Mi.obj(n)&&dc(n,o),e.keys=o.size?Array.from(o):null,e}function uc(e){const t=cc(e);return Mi.und(t.default)&&(t.default=ya(t)),t}function dc(e,t){Ai(e,((e,n)=>null!=e&&t.add(n)))}const pc=["onStart","onRest","onChange","onPause","onResume"];function mc(e,t,n){e.animation[n]=t[n]!==_a(t,n)?ba(t[n],e.key):void 0}function gc(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const hc=["onStart","onChange","onRest"];let fc=1;class vc{constructor(e,t){this.id=fc++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(ha({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];Mi.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(cc(e)),this}start(e){let{queue:t}=this;return e?t=Di(e).map(cc):this.queue=[],this._flush?this._flush(this,t):(Sc(this,t),bc(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Ri(Di(t),(t=>n[t].stop(!!e)))}else qa(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Mi.und(e))this.start({pause:!0});else{const t=this.springs;Ri(Di(e),(e=>t[e].pause()))}return this}resume(e){if(Mi.und(e))this.start({pause:!1});else{const t=this.springs;Ri(Di(e),(e=>t[e].resume()))}return this}each(e){Ai(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,Oi(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&Oi(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Oi(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}pi.onFrame(this._onFrame)}}function bc(e,t){return Promise.all(t.map((t=>_c(e,t)))).then((t=>Ua(e,t)))}async function _c(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Mi.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Mi.arr(r)||Mi.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Ri(hc,(n=>{const o=t[n];if(Mi.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,zi(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===_a(t,"cancel");(u||m&&d.asyncId)&&p.push(Ga(++e._lastAsyncId,{props:t,state:d,actions:{pause:Pi,resume:Pi,start(t,n){m?(qa(d,e._lastAsyncId),n($a(e))):(t.onRest=s,n(Ka(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=Ua(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=ac(t,i,r);if(n)return Sc(e,[n]),_c(e,n,!0)}return a&&pi.batchedUpdates((()=>a(g,e,e.item))),g}function kc(e,t){const n=ha({},e.springs);return t&&Ri(Di(t),(e=>{Mi.und(e.keys)&&(e=cc(e)),Mi.obj(e.to)||(e=ha({},e,{to:void 0})),Cc(n,e,(e=>Ec(e)))})),yc(e,n),n}function yc(e,t){Ai(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Ts(t,e))}))}function Ec(e,t){const n=new ic;return n.key=e,t&&Ts(n,t),n}function Cc(e,t,n){t.keys&&Ri(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Sc(e,t){Ri(t,(t=>{Cc(e.springs,t,(t=>Ec(t,e)))}))}const wc=["children"],Bc=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,wc);const o=(0,Ti.useContext)(Ic),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Ti.useState)((()=>({inputs:t,result:e()}))),o=(0,Ti.useRef)(),r=o.current;let l=r;if(l){const n=Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs));n||(l={inputs:t,result:e()})}else l=n;return(0,Ti.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Ic;return Ti.createElement(i,{value:n},t)},Ic=(xc=Bc,Tc={},Object.assign(xc,Ti.createContext(Tc)),xc.Provider._context=xc,xc.Consumer._context=xc,xc);var xc,Tc;Bc.Provider=Ic.Provider,Bc.Consumer=Ic.Consumer;const Nc=()=>{const e=[],t=function(t){js(`${Gs}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Ri(e,((e,r)=>{if(Mi.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Ri(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Ri(e,(e=>e.resume(...arguments))),this},t.set=function(t){Ri(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Ri(e,((e,o)=>{if(Mi.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Ri(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Ri(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Mi.fun(e)?e(n,t):e};return t._getProps=n,t};function Pc(e,t,n){const o=Mi.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ti.useMemo)((()=>o||3==arguments.length?Nc():void 0),[]),l=(0,Ti.useRef)(0),i=qs(),s=(0,Ti.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=kc(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?bc(e,t):new Promise((o=>{yc(e,n),s.queue.push((()=>{o(bc(e,t))})),i()}))}})),[]),a=(0,Ti.useRef)([...s.ctrls]),c=[],u=Zs(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new vc(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=uc(n))}}(0,Ti.useMemo)((()=>{Ri(a.current.slice(e,u),(e=>{xa(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Ti.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>kc(e,c[t]))),m=(0,Ti.useContext)(Bc),g=Zs(m),h=m!==g&&Ba(m);Ks((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Ri(e,(e=>e()))),Ri(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(Ta(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ys((()=>()=>{Ri(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>ha({},e)));return r?[f,r]:f}let Mc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Mc||(Mc={}));class Lc extends Ja{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=_s(...t);const n=this._get(),o=ca(n);ea(this,o.create(n))}advance(e){const t=this._get();Li(t,this.get())||(Js(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ac(this._active)&&Dc(this)}_get(){const e=Mi.arr(this.source)?this.source.map(Ss):Di(Ss(this.source));return this.calc(...e)}_start(){this.idle&&!Ac(this._active)&&(this.idle=!1,Ri(ta(this),(e=>{e.done=!1})),ji.skipAnimation?(pi.batchedUpdates((()=>this.advance())),Dc(this)):Qi.start(this))}_attach(){let e=1;Ri(Di(this.source),(t=>{Cs(t)&&Ts(t,this),Za(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Ri(Di(this.source),(e=>{Cs(e)&&Ns(e,this)})),this._active.clear(),Dc(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Di(this.source).reduce(((e,t)=>Math.max(e,(Za(t)?t.priority:0)+1)),0))}}function Rc(e){return!1!==e.idle}function Ac(e){return!e.size||Array.from(e).every(Rc)}function Dc(e){e.idle||(e.idle=!0,Ri(ta(e),(e=>{e.done=!0})),Bs(e,{type:"idle",parent:e}))}ji.assign({createStringInterpolator:Hs,to:(e,t)=>new Lc(e,t)}),Qi.advance;const Oc=window.ReactDOM;function zc(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const Fc=["style","children","scrollTop","scrollLeft"],Vc=/^--/;function Hc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Vc.test(e)||Uc.hasOwnProperty(e)&&Uc[e]?(""+t).trim():t+"px"}const Gc={};let Uc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Wc=["Webkit","Ms","Moz","O"];Uc=Object.keys(Uc).reduce(((e,t)=>(Wc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Uc);const jc=["x","y","z"],$c=/^(matrix|translate|scale|rotate|skew)/,Kc=/^(translate)/,qc=/^(rotate|skew)/,Yc=(e,t)=>Mi.num(e)&&0!==e?e+t:e,Qc=(e,t)=>Mi.arr(e)?e.every((e=>Qc(e,t))):Mi.num(e)?e===t:parseFloat(e)===t;class Zc extends ia{constructor(e){let{x:t,y:n,z:o}=e,r=zc(e,jc);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Yc(e,"px"))).join(",")})`,Qc(e,0)]))),Ai(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if($c.test(t)){if(delete r[t],Mi.und(e))return;const n=Kc.test(t)?"px":qc.test(t)?"deg":"";l.push(Di(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Yc(r,n)})`,Qc(r,0)]:e=>[`${t}(${e.map((e=>Yc(e,n))).join(",")})`,Qc(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Xc(l,i)),super(r)}}class Xc extends Is{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Ri(this.inputs,((n,o)=>{const r=Ss(n[0]),[l,i]=this.transforms[o](Mi.arr(r)?r:n.map(Ss));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Ri(this.inputs,(e=>Ri(e,(e=>Cs(e)&&Ts(e,this)))))}observerRemoved(e){0==e&&Ri(this.inputs,(e=>Ri(e,(e=>Cs(e)&&Ns(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Bs(this,e)}}const Jc=["scrollTop","scrollLeft"];ji.assign({batchedUpdates:Oc.unstable_batchedUpdates,createStringInterpolator:Hs,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const eu=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ia(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=ga(e)||"Anonymous";return(e=Mi.str(e)?l[e]||(l[e]=da(e,r)):e[ma]||(e[ma]=da(e,r))).displayName=`Animated(${t})`,e};return Ai(e,((t,n)=>{Mi.arr(e)&&(n=ga(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=zc(o,Fc),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Gc[t]||(Gc[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=Hc(t,r[t]);Vc.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new Zc(e),getComponentProps:e=>zc(e,Jc)}),tu=eu.animated,nu=e=>e+1,ou=e=>({top:e.offsetTop,left:e.offsetLeft}),ru=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(nu,0),[u,p]=(0,s.useReducer)(nu,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?ou(l.current):null),[r]),f=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,jl.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();l.current.style.transform=void 0;const e=ou(l.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),function(e,t){const n=Mi.fun(e),[[o],r]=Pc(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:function(e){let{value:n}=e;if(!l.current)return;let{x:o,y:r}=n;o=Math.round(o),r=Math.round(r);const i=0===o&&0===r;l.current.style.transformOrigin="center center",l.current.style.transform=i?void 0:`translate3d(${o}px,${r}px,0)`,l.current.style.zIndex=t?"1":"",f()}}),l},lu=".block-editor-block-list__block",iu=".block-list-appender",su=".block-editor-button-block-appender";function au(e,t){return t.closest([lu,iu,su].join(","))===e}function cu(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(lu);return t?t.id.slice("block-".length):void 0}function uu(e){const t=(0,s.useRef)(),n=function(e){return(0,p.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t(co);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,p.useSelect)(co);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(au(t.current,l.activeElement))return;const i=jl.focus.tabbable.find(t.current).filter((e=>(0,jl.isTextField)(e))),s=-1===n,a=i[s?i.length-1:0]||t.current;if(au(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=jl.focus.tabbable.findNext(t.current);if(e&&au(t.current,e)&&(0,jl.isFormElement)(e))return void e.focus()}(0,jl.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function du(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function pu(){const e=(0,p.useSelect)((e=>{const{getSettings:t}=e(co);return t().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",du),t.addEventListener("mouseover",du),()=>{t.removeEventListener("mouseout",du),t.removeEventListener("mouseover",du),t.classList.remove("is-hovered")}}),[e])}function mu(e){return(0,p.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p,__unstableSelectionHasUnmergeableBlock:m}=t(co),{outlineMode:g}=a(),h=n(e),f=l(e),v=s(e),b=u(e,!0),_=i(e);return c()({"is-selected":f,"is-highlighted":o(e),"is-multi-selected":_,"is-partially-selected":_&&!p()&&!m(),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":h,"has-child-selected":b,"remove-outline":f&&g&&d()})}),[e])}function gu(e){return(0,p.useSelect)((t=>{const n=t(co).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function hu(e){return(0,p.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(co),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function fu(e){return(0,p.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(co);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function vu(e){const{isBlockSelected:t}=(0,p.useSelect)(co),{selectBlock:n,selectionChange:o}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):au(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}const bu=window.wp.keycodes;function _u(e){const t=(0,p.useSelect)((t=>t(co).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,p.useSelect)(co),{insertDefaultBlock:r,removeBlock:l}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==bu.ENTER&&s!==bu.BACKSPACE&&s!==bu.DELETE||a!==i||(0,jl.isTextField)(a)||(t.preventDefault(),s===bu.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function ku(e){const{isNavigationMode:t,isBlockSelected:n}=(0,p.useSelect)(co),{setNavigationMode:o,selectBlock:r}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function yu(){const e=(0,s.useContext)(Xh);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Eu(e){return(0,p.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(co);return n(e)}),[e])}function Cu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,s.useContext)(Su),{index:a,mode:u,name:m,blockApiVersion:g,blockTitle:f,isPartOfSelection:v,adjustScrolling:b,enableAnimation:_}=(0,p.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:l,getBlockName:i,isTyping:s,getGlobalBlockCount:a,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p}=e(co),{getActiveBlockVariation:m}=e(r.store),g=c(n),h=u(n)||d(n),f=i(n),v=(0,r.getBlockType)(f),b=m(f,t(n));return{index:o(n),mode:l(n),name:f,blockApiVersion:(null==v?void 0:v.apiVersion)||1,blockTitle:(null==b?void 0:b.title)||(null==v?void 0:v.title),isPartOfSelection:g||h,adjustScrolling:g||p(n),enableAnimation:!s()&&a()<=200}}),[n]),k=Eu(n),y=(0,h.sprintf)((0,h.__)("Block: %s"),f),E="html"!==u||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,uu(n),Mo(n),vu(n),_u(n),ku(n),pu(),yu(),ru({isSelected:v,adjustScrolling:b,enableAnimation:_,triggerAnimationOnChange:a}),(0,d.useDisabled)({isDisabled:!k})]),S=go();return g<2&&n===S.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...l,...e,ref:C,id:`block-${n}${E}`,role:"document","aria-label":y,"data-block":n,"data-type":m,"data-title":f,className:c()(c()("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":k}),o,e.className,l.className,mu(n),gu(n),hu(n),fu(n)),style:{...l.style,...e.style}}}Cu.save=r.__unstableGetBlockProps;const Su=(0,s.createContext)();function wu(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Cu(o,{__unstableIsHtml:n}),t)}const Bu=(0,p.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(co),d=a(n),p=r(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),Iu=(0,p.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(co);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(co),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(co),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n,rootClientId:l}=t,{getPreviousBlockClientId:i,getNextBlockClientId:c,getBlock:u}=o(co);if(e){const e=c(n);e&&s(n,e)}else{const e=i(n);if(e)s(e,n);else if(l){const e=(0,r.switchToBlockType)(u(l),"*");e&&e.length&&a(l,e,0)}}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}})),xu=(0,d.compose)(d.pure,Bu,Iu,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,m.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:u,isSelectionEnabled:d,className:m,name:g,isValid:h,attributes:f,wrapperProps:v,setAttributes:b,onReplace:_,onInsertBlocksAfter:k,onMerge:y,toggleSelection:E}=e;const{themeSupportsLayout:C,hasContentLockedParent:S,isContentBlock:w,isContentLocking:B,isTemporarilyEditingAsBlocks:I}=(0,p.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:l}=e(co),i=!!n(a);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(r.store).__experimentalHasContentRoleAttribute(g),hasContentLockedParent:i,isContentLocking:"contentOnly"===o(a)&&!i,isTemporarilyEditingAsBlocks:l()===a}}),[g,a]),{removeBlock:x}=(0,p.useDispatch)(co),T=(0,s.useCallback)((()=>x(a)),[a]);let N=(0,s.createElement)(Zl,{name:g,isSelected:u,attributes:f,setAttributes:b,insertBlocksAfter:l?void 0:k,onReplace:i?_:void 0,onRemove:i?T:void 0,mergeBlocks:i?y:void 0,clientId:a,isSelectionEnabled:d,toggleSelection:E});const P=(0,r.getBlockType)(g);S&&!w&&(v={...v,tabIndex:-1}),null!=P&&P.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=c()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(v,P.getEditWrapperProps(f)));const M=v&&!!v["data-align"]&&!C;let L;if(M&&(N=(0,s.createElement)("div",{className:"wp-block","data-align":v["data-align"]},N)),h)L="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},N),(0,s.createElement)(wu,{isHtml:!0},(0,s.createElement)(ui,{clientId:a}))):(null==P?void 0:P.apiVersion)>1?N:(0,s.createElement)(wu,v,N);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(P,f);L=(0,s.createElement)(wu,{className:"has-warning"},(0,s.createElement)(ri,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,jl.safeHTML)(e)))}const{"data-align":R,...A}=null!==(t=v)&&void 0!==t?t:{},D={clientId:a,className:c()({"is-content-locked":B,"is-content-locked-temporarily-editing-as-blocks":I,"is-content-block":S&&w},R&&C&&`align${R}`,m),wrapperProps:A,isAligned:M},O=(0,s.useMemo)((()=>D),Object.values(D));return(0,s.createElement)(Su.Provider,{value:O},(0,s.createElement)(ai,{fallback:(0,s.createElement)(wu,{className:"has-warning"},(0,s.createElement)(ii,null))},L))})),Tu=window.wp.htmlEntities,Nu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),Pu=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")],Mu=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Pu.length));return(0,s.createElement)(m.Tip,null,Pu[e])},Lu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),Ru=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:Lu});const l=(0,s.createElement)(m.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)})),Au=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(V()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(Ru,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))},Du=(0,d.createHigherOrderComponent)((e=>(0,p.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,p.createRegistry)({},o);e.registerStore(so,ao),a(e)}),[o]),l?(0,s.createElement)(p.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider"),Ou=()=>{};function zu(e){let{clientId:t=null,value:n,selection:o,onChange:l=Ou,onInput:i=Ou}=e;const a=(0,p.useRegistry)(),{resetBlocks:c,resetSelection:u,replaceInnerBlocks:d,setHasControlledInnerBlocks:m,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(co),{getBlockName:h,getBlocks:f}=a.select(co),v=(0,p.useSelect)((e=>!t||e(co).areInnerBlocksControlled(t)),[t]),b=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),k=()=>{n&&(g(),t?a.batch((()=>{m(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(b.current.incoming=e),g(),d(t,e)})):(_.current&&(b.current.incoming=n),c(n)))},y=(0,s.useRef)(i),E=(0,s.useRef)(l);(0,s.useEffect)((()=>{y.current=i,E.current=l}),[i,l]),(0,s.useEffect)((()=>{b.current.outgoing.includes(n)?b.current.outgoing[b.current.outgoing.length-1]===n&&(b.current.outgoing=[]):f(t)!==n&&(b.current.outgoing=[],k(),o&&u(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{v||(b.current.outgoing=[],k())}),[v]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(co);let s=f(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=r(),d=f(t),p=d!==s;if(s=d,p&&(b.current.incoming||l()))return b.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,b.current.outgoing.push(s),(c?E.current:y.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}const Fu=Du((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,p.useDispatch)(co);return(0,s.useEffect)((()=>{o(n)}),[n]),zu(e),(0,s.createElement)(Po,null,t)}));function Vu(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(m.Disabled,null,(0,s.createElement)(tf,null)))}function Hu(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,p.useSelect)(co),{clearSelectedBlock:n}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Gu(e){return(0,s.createElement)("div",i({ref:Hu()},e))}function Uu(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(co);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Wu(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,p.useSelect)(Uu,[]);return(0,d.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||l&&(r.contentEditable=!0,r.focus(),s.getSelection().removeAllRanges())}),[o,t,n,r,e,l])}function ju(e,t,n,o){let r,l=jl.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(lu)===t.closest(lu)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!jl.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}}))}function $u(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,p.useSelect)(co),{selectBlock:l}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:g}=a,h=c===bu.UP,f=c===bu.DOWN,v=c===bu.LEFT,b=c===bu.RIGHT,_=h||v,k=v||b,y=h||f,E=k||y,C=d||p||m||g,S=y?jl.isVerticalEdge:jl.isHorizontalEdge,{ownerDocument:w}=i,{defaultView:B}=w;if(o()){if(!r())return;if(a.defaultPrevented)return;if(!E)return;if(d)return;return a.preventDefault(),void(_?l(e()):l(t(),-1))}if(y?s||(s=(0,jl.computeCaretRect)(B)):s=null,a.defaultPrevented)return;if(!E)return;if(!function(e,t,n){if((t===bu.UP||t===bu.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"===o?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==o}(u,c,C))return;const I=(0,jl.isRTL)(u)?!_:_,{keepCaretInsideBlock:x}=n();if(d)(function(e,t){const n=ju(e,t,i);return n&&cu(n)})(u,_)&&S(u,_)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,jl.isVerticalEdge)(u,_)||m&&!(0,jl.isHorizontalEdge)(u,I)||x){if(k&&B.getSelection().isCollapsed&&(0,jl.isHorizontalEdge)(u,I)&&!x){const e=ju(u,I,i);(0,jl.placeCaretAtHorizontalEdge)(e,_),a.preventDefault()}}else{const e=ju(u,_,i,!0);e&&((0,jl.placeCaretAtVerticalEdge)(e,m?!_:_,m?void 0:s),a.preventDefault())}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}const Ku=window.wp.keyboardShortcuts;function qu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,p.useSelect)(co),{multiSelect:o,selectBlock:r}=(0,p.useDispatch)(co),l=(0,Ku.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((i=>{function s(s){if(!l("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,jl.isEntirelySelected)(s.target))return;s.preventDefault();const[c]=a,u=n(c),d=e(u);a.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[])}function Yu(e,t){e.contentEditable=t,t&&e.focus()}function Qu(){const{startMultiSelect:e,stopMultiSelect:t}=(0,p.useDispatch)(co),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,p.useSelect)(co);return(0,d.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:s}=i;let a,c;function u(){t(),s.removeEventListener("mouseup",u),c=s.requestAnimationFrame((()=>{if(o())return;Yu(l,!1);const e=s.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function d(t){let{buttons:o,target:c}=t;r()||1===o&&c.getAttribute("contenteditable")&&n()&&(a=i.activeElement,e(),s.addEventListener("mouseup",u),Yu(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),s.removeEventListener("mouseup",u),s.cancelAnimationFrame(c)}}),[e,t,n,o])}function Zu(e,t){e.contentEditable=t,t&&e.focus()}function Xu(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,p.useDispatch)(co),{getBlockParents:o,getBlockSelectionStart:r}=(0,p.useSelect)(co);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return;const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void Zu(n,!1);let c=cu(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(s)),u=cu(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(s));if(a){const e=r(),t=cu(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}else Zu(n,!1)}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function Ju(){const{selectBlock:e}=(0,p.useDispatch)(co),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,p.useSelect)(co);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=cu(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function ed(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,p.useSelect)(co),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===bu.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===bu.BACKSPACE||d.keyCode===bu.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===bu.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===bu.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function td(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,p.useSelect)(co),{setNavigationMode:a}=(0,p.useDispatch)(co),c=(0,p.useSelect)((e=>e(co).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function m(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";jl.focus.tabbable[n](t.target).focus()}}const g=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:m}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:m}),f=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===bu.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==bu.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,jl.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,jl.isFormElement)(jl.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==bu.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=jl.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[g,(0,d.useMergeRefs)([e,f]),h]}(),o=(0,p.useSelect)((e=>e(co).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,ed(),Qu(),Xu(),Ju(),Wu(),qu(),$u(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}const nd=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=td();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)})),od="editor-styles-wrapper";function rd(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const ld=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,isZoomedOut:u,...p}=e;const[,g]=(0,s.useReducer)((()=>({}))),[f,v]=(0,s.useState)(),[b,_]=(0,s.useState)([]),k=rd(null==a?void 0:a.styles),y=rd(null==a?void 0:a.scripts),E=Hu(),[C,S,w]=td(),[B,{height:I}]=(0,d.useResizeObserver)(),x=(0,d.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{readyState:l,documentElement:i}=o;return t=o,("interactive"===l||"complete"===l)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(o),v(o),E(i),_(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir,i.removeChild(o.head),i.removeChild(o.body),t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),!0)}return e.addEventListener("load",o),()=>{var r,l;e.removeEventListener("load",o),null===(r=t)||void 0===r||r.removeEventListener("dragover",n),null===(l=t)||void 0===l||l.removeEventListener("drop",n)}}),[]),T=(0,d.useRefEffect)((e=>{y.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{g()}))}),[]),N=(0,d.useMergeRefs)([n,E,S]),P=(0,d.useRefEffect)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(`.${od}`)||n.includes(".wp-block"))}))}(o)&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&C,(0,s.createElement)("iframe",i({},p,{ref:(0,d.useMergeRefs)([t,x]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:T},r,(0,s.createElement)("style",null,`html { transition: background 5s; ${u?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,s.createElement)("body",{ref:N,className:c()("block-editor-iframe__body",od,...b,{"is-zoomed-out":u}),style:u?{marginBottom:`-${.55*I-100}px`}:{}},B,(0,s.createElement)("div",{style:{display:"none"},ref:P}),(0,s.createElement)(m.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&w)}));var id={grad:.9,turn:360,rad:360/(2*Math.PI)},sd=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},ad=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},cd=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},ud=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},dd=function(e){return{r:cd(e.r,0,255),g:cd(e.g,0,255),b:cd(e.b,0,255),a:cd(e.a)}},pd=function(e){return{r:ad(e.r),g:ad(e.g),b:ad(e.b),a:ad(e.a,3)}},md=/^#([0-9a-f]{3,8})$/i,gd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},hd=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},fd=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},vd=function(e){return{h:ud(e.h),s:cd(e.s,0,100),l:cd(e.l,0,100),a:cd(e.a)}},bd=function(e){return{h:ad(e.h),s:ad(e.s),l:ad(e.l),a:ad(e.a,3)}},_d=function(e){return fd((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},kd=function(e){return{h:(t=hd(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},yd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ed=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Cd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Sd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wd={string:[[function(e){var t=md.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?ad(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?ad(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Cd.exec(e)||Sd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:dd({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=yd.exec(e)||Ed.exec(e);if(!t)return null;var n,o,r=vd({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(id[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return _d(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return sd(t)&&sd(n)&&sd(o)?dd({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!sd(t)||!sd(n)||!sd(o))return null;var i=vd({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return _d(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!sd(t)||!sd(n)||!sd(o))return null;var i=function(e){return{h:ud(e.h),s:cd(e.s,0,100),v:cd(e.v,0,100),a:cd(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return fd(i)},"hsv"]]},Bd=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},Id=function(e,t){var n=kd(e);return{h:n.h,s:cd(n.s+100*t,0,100),l:n.l,a:n.a}},xd=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Td=function(e,t){var n=kd(e);return{h:n.h,s:n.s,l:cd(n.l+100*t,0,100),a:n.a}},Nd=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Bd(e.trim(),wd.string):"object"==typeof e&&null!==e?Bd(e,wd.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return ad(xd(this.rgba),2)},e.prototype.isDark=function(){return xd(this.rgba)<.5},e.prototype.isLight=function(){return xd(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=pd(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?gd(ad(255*r)):"","#"+gd(t)+gd(n)+gd(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return pd(this.rgba)},e.prototype.toRgbString=function(){return t=(e=pd(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return bd(kd(this.rgba))},e.prototype.toHslString=function(){return t=(e=bd(kd(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=hd(this.rgba),{h:ad(e.h),s:ad(e.s),v:ad(e.v),a:ad(e.a,3)};var e},e.prototype.invert=function(){return Pd({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),Pd(Id(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Pd(Id(this.rgba,-e))},e.prototype.grayscale=function(){return Pd(Id(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Pd(Td(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Pd(Td(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?Pd({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):ad(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=kd(this.rgba);return"number"==typeof e?Pd({h:e,s:t.s,l:t.l,a:t.a}):ad(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Pd(e).toHex()},e}(),Pd=function(e){return e instanceof Nd?e:new Nd(e)},Md=[],Ld=function(e){e.forEach((function(e){Md.indexOf(e)<0&&(e(Nd,wd),Md.push(e))}))};function Rd(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Ad=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Dd=function(e){return.2126*Ad(e.r)+.7152*Ad(e.g)+.0722*Ad(e.b)};function Od(e){e.prototype.luminance=function(){return e=Dd(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=Dd(l))>(a=Dd(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var zd=n(3124),Fd=n.n(zd);const Vd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Hd(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function f(){const e=p(/^([^{]+)/);if(e)return Gd(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Gd(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Vd,""),value:n?Gd(n[0]).replace(Vd,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:a("missing '}'")}function _(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const k=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=g();for(;r=_();)i.push(r),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Gd(t[1]);if(!c())return a("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Gd(t[1]),media:Gd(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Gd(t[1]);if(!c())return a("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||k()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Gd(t[1]),o=Gd(t[2]);if(!c())return a("@document missing '{'");const r=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=f()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Ud(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Gd(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Ud(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){Ud(e,o)})):n&&"object"==typeof n&&Ud(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Wd=n(8575),jd=n.n(Wd);const $d=Kd;function Kd(e){this.options=e||{}}Kd.prototype.emit=function(e){return e},Kd.prototype.visit=function(e){return this[e.type](e)},Kd.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};const qd=Yd;function Yd(e){$d.call(this,e)}jd()(Yd,$d),Yd.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Yd.prototype.comment=function(e){return this.emit("",e.position)},Yd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Yd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Yd.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Yd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Yd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Yd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Yd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Yd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Yd.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Yd.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Yd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Yd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Yd.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},Yd.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const Qd=Zd;function Zd(e){e=e||{},$d.call(this,e),this.indentation=e.indent}jd()(Zd,$d),Zd.prototype.compile=function(e){return this.stylesheet(e)},Zd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Zd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Zd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Zd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Zd.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Zd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Zd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Zd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Zd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},Zd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},Zd.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},Zd.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},Zd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Zd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Zd.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},Zd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Zd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const Xd=function(e,t){try{const r=Hd(e),l=Fd().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return n=l,((o=o||{}).compress?new qd(o):new Qd(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function Jd(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function ep(e,t){return new URL(e,t).toString()}const tp=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};Jd(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+ep(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t},np=/^(body|html|:root).*$/,op=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(np)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},rp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(op(t)),o&&r.push(tp(o)),r.length?Xd(n,(0,d.compose)(r)):n}))},lp=".editor-styles-wrapper";function ip(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(lp);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Pd(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function sp(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>rp(t,lp)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:ip(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function ap(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Pd(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function cp(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function up(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function dp(e){let{id:t,colors:n}=e;const o=ap(n);return(0,s.createElement)(m.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:t},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function pp(e){let{preset:t}=e;return(0,s.createElement)(dp,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let mp;Ld([Rd,Od]);const gp=2e3;function hp(e){let{viewportWidth:t,containerWidth:n,__experimentalPadding:o,__experimentalMinHeight:r}=e;const[l,{height:i}]=(0,d.useResizeObserver)(),{styles:a,assets:c,duotone:u}=(0,p.useSelect)((e=>{var t,n;const o=e(co).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),g=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]),h=(0,s.useMemo)((()=>{var e,t;return[...null!==(e=null==u?void 0:u.default)&&void 0!==e?e:[],...null!==(t=null==u?void 0:u.theme)&&void 0!==t?t:[]]}),[u]);mp=mp||(0,d.pure)(tf);const f=n/t;return(0,s.createElement)(m.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${f})`,height:i*f,maxHeight:i>gp?gp*f:void 0,minHeight:r}},(0,s.createElement)(ld,{head:(0,s.createElement)(sp,{styles:g}),assets:c,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=o+"px",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:gp,minHeight:0!==f&&f<1&&r?r/f:r}},l,h.map((e=>(0,s.createElement)(pp,{preset:e,key:e.slug}))),(0,s.createElement)(mp,{renderAppender:!1})))}function fp(e){const[t,{width:n}]=(0,d.useResizeObserver)();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,s.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,s.createElement)(hp,i({},e,{containerWidth:n}))))}const vp=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const a=(0,p.useSelect)((e=>e(co).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Fu,{value:d,settings:c},r?(0,s.createElement)(Vu,{onClick:l}):(0,s.createElement)(fp,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function bp(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,p.useSelect)((e=>e(co).getSettings()),[]),l=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),m=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),g=(0,s.createElement)(Fu,{value:m,settings:a},(0,s.createElement)(of,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?g:null}}const _p=function(e){var t;let{item:n}=e;const{name:o,title:l,icon:i,description:a,initialAttributes:c,example:u}=n,d=(0,r.isReusableBlock)(n);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},d||u?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(vp,{__experimentalPadding:16,viewportWidth:null!==(t=null==u?void 0:u.viewportWidth)&&void 0!==t?t:500,blocks:u?(0,r.getBlockFromExample)(o,{attributes:{...u.attributes,...c},innerBlocks:u.innerBlocks}):(0,r.createBlock)(o,c)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!d&&(0,s.createElement)(Au,{title:l,icon:i,description:a}))},kp=(0,s.createContext)(),yp=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(kp);return(0,s.createElement)(m.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(m.Button,t,r)}))})),Ep=(0,s.createElement)(D.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Cp(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,s.createElement)(m.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(m.FlexItem,null,n?(0,s.createElement)(Ru,{icon:n}):(0,h.sprintf)(
|
13 |
/* translators: %d: Number of blocks. */
|
14 |
-
(0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(
|
15 |
/* translators: %s: block pattern title. */
|
16 |
-
(0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[o,n,i]};function
|
17 |
-
(0,h._n)("%d block added.","%d blocks added.",(0,
|
18 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
19 |
-
(0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const
|
20 |
/* translators: %d: number of results. */
|
21 |
-
(0,h._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,
|
22 |
/* translators: %d: number of results. */
|
23 |
-
(0,h._n)("%d result found.","%d results found.",e),e);_(n)}),[t,_]);const P=(0,
|
24 |
/* translators: Blocks tab title in the block inserter. */
|
25 |
-
title:(0,h.__)("Blocks")},
|
26 |
/* translators: Patterns tab title in the block inserter. */
|
27 |
-
title:(0,h.__)("Patterns")},
|
28 |
/* translators: Reusable blocks tab title in the block inserter. */
|
29 |
-
title:(0,h.__)("Reusable")},
|
30 |
-
(0,h._x)("Add %s","directly add the only allowed block"),l):u?(0,h.__)("Add pattern"):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:d,...p}=c;return(0,s.createElement)(m.Button,i({icon:
|
31 |
-
(0,h.__)("%s block added"),a.title);(0,qt.speak)(m)}}})),(0,
|
32 |
-
(0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const g=!p;let f=(0,s.createElement)(m.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":g?"true":void 0,"aria-expanded":g?u:void 0,disabled:a,label:n},!p&&(0,s.createElement)(m.VisuallyHidden,{as:"span"},n),(0,s.createElement)(dl,{icon:Nu}));return(g||p)&&(f=(0,s.createElement)(m.Tooltip,{text:n},f)),f},isAppender:!0})}const Nm=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Tm(e,t)))),Pm=(0,s.forwardRef)(Tm),Mm=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:l="div"}=e;const{hideInserter:i,canInsertDefaultBlock:a,selectedBlockClientId:u}=(0,p.useSelect)((e=>{const{canInsertBlockType:n,getTemplateLock:o,getSelectedBlockClientId:l,__unstableGetEditorMode:i}=e(co);return{hideInserter:!!o(t)||"zoom-out"===i(),canInsertDefaultBlock:n((0,r.getDefaultBlockName)(),t),selectedBlockClientId:l()}}),[t]);if(i||!1===n)return null;let d;if(n)d=(0,s.createElement)(n,null);else{if(u!==t&&(t||u))return null;d=a?(0,s.createElement)(xm,{rootClientId:t}):(0,s.createElement)(Pm,{rootClientId:t,className:"block-list-appender__toggle"})}return(0,s.createElement)(l,{tabIndex:-1,className:c()("block-list-appender wp-block",o),contentEditable:!1,"data-block":!0},d)},Lm=Number.MAX_SAFE_INTEGER;(0,s.createContext)();const Rm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const[u,d]=(0,s.useReducer)((e=>(e+1)%Lm),0),{orientation:g,rootClientId:f,isVisible:v}=(0,p.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(co),s=l(null!=t?t:n);return{orientation:(null===(o=r(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t,n]),b=Ro(t),_=Ro(n),k="vertical"===g,y=(0,s.useMemo)((()=>{if(u<0||!b&&!_||!v)return{};const e=b?b.getBoundingClientRect():null,t=_?_.getBoundingClientRect():null;if(k)return{width:e?e.width:t.width,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:e?e.height:t.height}}),[b,_,k,u,v]),E=(0,s.useMemo)((()=>{if(u<0||!b&&!_||!v)return;const{ownerDocument:e}=b||_;return{ownerDocument:e,getBoundingClientRect(){const e=b?b.getBoundingClientRect():null,t=_?_.getBoundingClientRect():null;let n=0,o=0;return k?(o=e?e.bottom:t.top,n=(0,h.isRTL)()?e?e.right:t.right:e?e.left:t.left):(o=e?e.top:t.top,n=(0,h.isRTL)()?e?e.left:t.right:e?e.right:t.left),new window.DOMRect(n,o,0,0)}}}),[b,_,u,k,v]),C=kr(l);return(0,s.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(d);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,s.useLayoutEffect)((()=>{if(!_)return;const e=new window.MutationObserver(d);return e.observe(_,{attributes:!0}),()=>{e.disconnect()}}),[_]),(0,s.useLayoutEffect)((()=>{if(b)return b.ownerDocument.defaultView.addEventListener("resize",d),()=>{var e;null===(e=b.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",d)}}),[b]),(b||_)&&v?(0,s.createElement)(m.Popover,i({ref:C,animate:!1,anchor:E,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+f},a,{className:c()("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"bottom-start"}),(0,s.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null},Am=(0,s.createContext)();function Dm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,p.useDispatch)(co),l=(0,s.useContext)(Am),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:g,rootClientId:h,isInserterShown:f}=(0,p.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(co),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),v="vertical"===a,b=(0,d.useReducedMotion)(),_={start:{...v?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:f?.1:0,type:"tween"}},hover:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.1,type:"tween"}}},k={start:{scale:b?1:0},rest:{scale:1,transition:{type:"tween"}}},y=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(Rm,{previousClientId:u,nextClientId:g,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(m.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&g&&o(g,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(m.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,s.createElement)(m.__unstableMotion.div,{variants:k,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Im,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Om(e){return(0,p.useSelect)((e=>e(co).isBlockInsertionPointVisible()),[])&&(0,s.createElement)(Dm,e)}function zm(){const e=(0,s.useContext)(Am),t=(0,p.useSelect)((e=>e(co).getSettings().hasReducedUI||"zoom-out"===e(co).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c,__unstableIsWithinBlockOverlay:u}=(0,p.useSelect)(co),{showInsertionPoint:m,hideInsertionPoint:g}=(0,p.useDispatch)(co),h=(0,d.useDebounce)(m,500,{trailing:!0});return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return h.cancel(),void(l()&&g());let s;if(t.target.classList.contains("is-root-container")||(s=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(s))return;const d=(null===(o=n(s))||void 0===o?void 0:o.orientation)||"vertical",p=t.clientY,m=t.clientX;let f=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===d&&t.top>p||e.classList.contains("wp-block")&&"horizontal"===d&&t.left>m}));if(!f)return;if(!f.id&&(f=f.firstElementChild,!f))return;const v=f.id.slice("block-".length);if(!v||u(v))return;if(a().includes(v))return;const b=f.getBoundingClientRect();if("horizontal"===d&&(t.clientY>b.bottom||t.clientY<b.top)||"vertical"===d&&(t.clientX>b.right||t.clientX<b.left))return h.cancel(),void(l()&&g());const _=r(v);if(0===_)return h.cancel(),void(l()&&g());h(s,_,{__unstableWithInserter:!0})}}),[e,n,o,r,l,i,m,g,a,t])}const Fm="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Vm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Hm(e){return(0,p.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(co),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description,anchor:null==c?void 0:c.anchor}:d}),[e])}function Gm(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:l,name:i,reusableBlockTitle:s}=(0,p.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(co),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),a=Hm(t);if(!i||!a)return null;const c=(0,r.getBlockType)(i),u=c?(0,r.__experimentalGetBlockLabel)(c,l,o):null,d=s||u,m=d&&d!==c.title?d:a.title;if(n&&n>0&&m.length>n){const e="...";return m.slice(0,n-e.length)+e}return m}function Um(e){let{clientId:t,maximumLength:n,context:o}=e;return Gm({clientId:t,maximumLength:n,context:o})}const Wm=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,p.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(co),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[g,h,f]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,jl.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,p.useDispatch)(co);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({draggable:!1});const _={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(m.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:_,onDragStart:e=>{v(n),d.current=!0,g(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Cp,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},jm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),$m=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Km=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),qm=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),Ym=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,h.isRTL)()?"left":"right":"down":null;const Qm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?jm:$m:Km:"down"===e?"horizontal"===t?(0,h.isRTL)()?$m:jm:qm:null,Zm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,Xm=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const u=(0,d.useInstanceId)(Xm),g=Array.isArray(n)?n:[n],f=g.length,{blockType:v,isDisabled:b,rootClientId:_,isFirst:k,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,p.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:i,getBlock:s,getBlockListSettings:a}=e(co),c=g[0],u=n(c),d=t(c),p=t(g[g.length-1]),m=i(u),h=s(c),f=0===d,v=p===m.length-1,{orientation:b}=a(u)||{};return{blockType:h?(0,r.getBlockType)(h.name):null,isDisabled:"up"===o?f:v,rootClientId:u,firstIndex:d,isFirst:f,isLast:v,orientation:l||b}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,p.useDispatch)(co),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${u}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Qm(o,C),label:Zm(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,_),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(m.VisuallyHidden,{id:I},function(e,t,n,o,r,l,i){const s=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,h.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=Ym("down",l);if("down"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
33 |
(0,h.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
34 |
(0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
35 |
-
(0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=
|
36 |
(0,h.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
37 |
(0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
38 |
-
(0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=
|
39 |
-
(0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=
|
40 |
(0,h.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
41 |
(0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
42 |
-
(0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(l>0&&r){const e=
|
43 |
(0,h.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,h.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
-
(0,h.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=
|
46 |
(0,h.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
47 |
(0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
48 |
-
(0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=
|
49 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
50 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
51 |
-
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(f,v&&v.title,E,k,y,"up"===o?-1:1,C)))})),
|
52 |
/* translators: %s: Name of the block's parent. */
|
53 |
-
(0,h.__)("Select %s"),null==a?void 0:a.title),showTooltip:!0,icon:(0,s.createElement)(
|
54 |
/* translators: %s: block title. */
|
55 |
(0,h.__)("%s: Change block type or style"),f):(0,h.sprintf)(
|
56 |
/* translators: %d: number of blocks. */
|
57 |
-
(0,h._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||_||k;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(m.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(
|
58 |
(0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
59 |
(0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
|
60 |
(0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
|
61 |
-
(0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function
|
62 |
/* translators: %s: Name of the block. */
|
63 |
-
(0,h.__)("Lock %s"),k.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,s.createElement)("p",null,(0,h.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),_([t],{lock:o,templateLock:v?
|
64 |
/* translators: %s: block name */
|
65 |
-
(0,h.__)("Remove %s"),x),P=1===g?N:(0,h.__)("Remove blocks"),M=(0,s.useRef)(),{gestures:L}=
|
66 |
/* translators: %s: Name of the block's parent. */
|
67 |
-
(0,h.__)("Select parent block (%s)"),k.title)),1===g&&(0,s.createElement)(
|
68 |
/* translators: %s: block name */
|
69 |
-
(0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(
|
70 |
-
/* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(yh,{hideDragHandle:n}))},Ch={placement:"top-start"},Sh={...Ch,flip:!1,shift:!0},wh={...Ch,flip:!0,shift:!1};function Bh(e,t,n){if(!e||!t)return Sh;const o=t.getBoundingClientRect(),r=e.getBoundingClientRect(),l=e.ownerDocument.documentElement.clientHeight,i=o.top-r.top>n,s=o.height>l-n;return i||s?Sh:wh}function Ih(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(co);return{editorMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function xh(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:a}=e;const{editorMode:u,isMultiSelecting:m,isTyping:g,hasFixedToolbar:h,lastClientId:f}=(0,p.useSelect)(Ih,[]),v=(0,p.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(co);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),b=(0,d.useViewportMatch)("medium"),_=(0,s.useRef)(!1),{stopTyping:k}=(0,p.useDispatch)(co),y="navigation"===u||"zoom-out"===u,E="edit"===u&&!h&&b&&!m&&!(!g&&"edit"===u&&o)&&!g,C="edit"===u&&!E&&!h&&!o;(0,Ku.useShortcut)("core/block-editor/focus-toolbar",(()=>{_.current=!0,k(!0)}),{isDisabled:!C}),(0,s.useEffect)((()=>{_.current=!1}));const S=(0,s.useRef)(),w=function(e){let{contentElement:t,clientId:n}=e;const o=Ro(n),[r,l]=(0,s.useState)(0),[i,a]=(0,s.useState)((()=>Bh(t,o,r))),c=(0,p.useSelect)((e=>e(co).getBlockIndex(n)),[n]),u=(0,d.useRefEffect)((e=>{l(e.offsetHeight)}),[]),m=(0,s.useCallback)((()=>a(Bh(t,o,r))),[t,o,r]);return(0,s.useLayoutEffect)(m,[c,m]),(0,s.useLayoutEffect)((()=>{var e,n,r;if(!t||!o)return;const l=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let i;null==l||null===(n=l.addEventHandler)||void 0===n||n.call(l,"resize",m);const s=null==o||null===(r=o.ownerDocument)||void 0===r?void 0:r.defaultView;return s.ResizeObserver&&(i=new s.ResizeObserver(m),i.observe(o)),()=>{var e;null==l||null===(e=l.removeEventHandler)||void 0===e||e.call(l,"resize",m),i&&i.disconnect()}}),[m,t,o]),{...i,ref:u}}({contentElement:null==a?void 0:a.current,clientId:t});return y||E?(0,s.createElement)(Er,i({clientId:r||t,bottomClientId:f,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":v}),__unstablePopoverSlot:l,__unstableContentRef:a,resize:!1},w),E&&(0,s.createElement)(Eh,{focusOnMount:_.current,__experimentalInitialIndex:S.current,__experimentalOnIndexChange:e=>{S.current=e},key:t}),y&&(0,s.createElement)(ng,{clientId:t,rootClientId:n})):null}function Th(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(co),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),g=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Nh(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,p.useSelect)(Th,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(xh,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Ph(e){let{children:t}=e;const n=(0,s.useContext)(Am),o=(0,s.useContext)(m.Disabled.Context);return n||o?t:(V()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Om,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Nh,{__unstablePopoverSlot:"block-toolbar"}),t))}const Mh=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=go();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Lh=Mh((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Pm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Rh=(0,d.compose)([Mh,(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(co),r=o(n);return{lastBlockClientId:r[r.length-1]}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(xm,{rootClientId:t})})),Ah=new WeakMap,Dh=new WeakMap;function Oh(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const e=p.map((e=>(0,r.cloneBlock)(e)));i(e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,i&&r<t?t-s:t)}}}function zh(e,t,n,o,l,i){return t=>{if(!n)return;const s=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(n=>"files"===n.type&&l(n.blockName,e)&&n.isMatch(t)));if(s){const e=s.transform(t,o);i(e)}}}function Fh(e,t,n){return e=>{const t=(0,r.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}function Vh(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{action:o="insert"}=n,r=(0,p.useSelect)((e=>e(co).getSettings().mediaUpload),[]),{canInsertBlockType:l,getBlockIndex:i,getClientIdsOfDescendants:a,getBlockOrder:c,getBlocksByClientId:u}=(0,p.useSelect)(co),{insertBlocks:d,moveBlocksToPosition:m,updateBlockAttributes:g,clearSelectedBlock:h,replaceBlocks:f,removeBlocks:v}=(0,p.useDispatch)(co),b=(0,p.useRegistry)(),_=(0,s.useCallback)((function(n){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("replace"===o){const o=c(e)[t];f(o,n,void 0,l)}else d(n,t,e,r,l)}),[o,c,d,f,t,e]),k=(0,s.useCallback)(((n,r,l)=>{if("replace"===o){const o=u(n),r=c(e)[t];b.batch((()=>{v(n,!1),f(r,o,void 0,0)}))}else m(n,r,e,l)}),[o,c,u,d,m,v,t,e]),y=Oh(e,t,i,a,k,_,h),E=zh(e,0,r,g,l,_),C=Fh(0,0,_);return e=>{const t=(0,jl.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?E(t):y(e)}}function Hh(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function Gh(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Hh(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function Uh(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=Gh(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function Wh(e){return!!e&&"core/paragraph"===e.dataset.type&&"true"===e.dataset.empty}function jh(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,p.useSelect)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:o,__unstableHasActiveBlockOverlayActive:r}=t(co),l=n(e);return["all","contentOnly"].some((e=>e===l))||r(e)||o(e)}),[e]),{getBlockListSettings:r}=(0,p.useSelect)(co),{showInsertionPoint:l,hideInsertionPoint:i}=(0,p.useDispatch)(co),a=Vh(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),a=Uh(s,{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);if(n(void 0===a?0:a),void 0!==a){const t=s[a],n=s[a-1];if(Wh(t)||Wh(n))return;l(e,a)}}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function $h(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:g,renderAppender:h,orientation:f,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,p.useDispatch)(co),u=(0,p.useRegistry)(),{blockListSettings:d,parentLock:m}=(0,p.useSelect)((t=>{const n=t(co).getBlockRootClientId(e);return{blockListSettings:t(co).getBlockListSettings(e),parentLock:t(co).getTemplateLock(n)}}),[e]),g=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:g,templateLock:void 0===r||"contentOnly"===m?m:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=vl(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),_r()(d,t)||(Ah.get(u)||Ah.set(u,[]),Ah.get(u).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=Ah.get(u))&&void 0!==e&&e.length&&u.batch((()=>{Ah.get(u).forEach((e=>{c(...e)})),Ah.set(u,[])}))})))}),[e,d,g,n,o,r,m,l,i,c,a,u])}(t,n,o,l,a,m,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,p.useSelect)(co),{replaceInnerBlocks:i}=(0,p.useDispatch)(co),a=(0,p.useSelect)((t=>t(co).getBlocks(e)),[e]),{getBlocks:c}=(0,p.useSelect)(co),d=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{window.queueMicrotask((()=>{const s=c(e),a=0===s.length||"all"===n||"contentOnly"===n,p=!(0,u.isEqual)(t,d.current);if(!a||!p)return;d.current=t;const m=(0,r.synchronizeBlocksWithTemplate)(s,t);(0,u.isEqual)(m,s)||i(e,m,0===s.length&&o&&0!==m.length,l())}))}),[a,t,n,e])}(t,i,a,d);const _=(0,p.useSelect)((e=>{const n=e(co).getBlock(t);if(!n)return;const o=(0,r.getBlockType)(n.name);return o&&o.providesContext?function(e,t){Dh.has(t)||Dh.set(t,new WeakMap);const n=Dh.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o):void 0}),[t]);return(0,s.createElement)(Kl,{value:_},(0,s.createElement)(of,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Kh(e){return zu(e),(0,s.createElement)($h,e)}const qh=(0,s.forwardRef)(((e,t)=>{const n=Yh({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function Yh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=go(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,p.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,__unstableGetEditorMode:s}=e(co),a=t(n),c="navigation"===s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,jh({rootClientId:n})]),m={__experimentalCaptureToolbars:l,...t},g=m.value&&m.onChange?Kh:$h;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(g,i({},m,{clientId:n})):(0,s.createElement)(of,t)}}Yh.save=r.__unstableGetInnerBlocksProps,qh.DefaultBlockAppender=Rh,qh.ButtonBlockAppender=Lh,qh.Content=()=>Yh.save().children;const Qh=qh,Zh=(0,s.createContext)(),Xh=(0,s.createContext)(),Jh=new WeakMap;function ef(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,editorMode:u}=(0,p.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(co),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),m=(0,p.useRegistry)(),{setBlockVisibility:g}=(0,p.useDispatch)(co),h=(0,d.useDebounce)((0,s.useCallback)((()=>{const e={};Jh.get(m).forEach((t=>{let[n,o]=t;e[n]=o})),g(e)}),[m]),300,{trailing:!0}),f=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{Jh.get(m)||Jh.set(m,[]);for(const t of e){const e=t.target.getAttribute("data-block");Jh.get(m).push([e,t.isIntersecting])}h()}))}),[]),v=Yh({ref:(0,d.useMergeRefs)([Hu(),zm(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":"navigation"===u})},n);return(0,s.createElement)(Zh.Provider,{value:o},(0,s.createElement)(Xh.Provider,{value:f},(0,s.createElement)("div",v)))}function tf(e){return function(){const e=(0,p.useSelect)((e=>e(co).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,p.select)(co).__experimentalGetParsedPattern(e[n].name),t=Fm(o))};return t=Fm(o),()=>Vm(t)}),[e])}(),(0,s.createElement)(Ph,null,(0,s.createElement)(mo,{value:uo},(0,s.createElement)(ef,e)))}function nf(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=bl}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,p.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(co);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,s.createElement)(kl,{value:l},i.map((e=>(0,s.createElement)(p.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(xu,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(Mm,{tagName:r,rootClientId:n,renderAppender:o}))}function of(e){return(0,s.createElement)(p.AsyncModeProvider,{value:!1},(0,s.createElement)(nf,e))}function rf(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function lf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||rf(Object.values(n).filter(Boolean))||"px"}function sf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=rf(o),i=0===r||r?`${r}${l}`:void 0;return i}function af(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=sf(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function cf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function uf(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,a=sf(r);void 0===a&&(a=lf(n));const c=cf(r)&&af(r),u=c?(0,h.__)("Mixed"):null;return(0,s.createElement)(m.__experimentalUnitControl,i({},l,{"aria-label":(0,h.__)("Border radius"),disableUnits:c,isOnly:!0,value:a,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:u}))}tf.__unstableElementContext=Zh;const df={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function pf(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e;const a=e=>n=>{if(!t)return;const o=isNaN(parseFloat(n))?void 0:n;t({...c,[e]:o})},c="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(df).map((e=>{let[t,r]=e;const[u,d]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(c[t]),p=c[t]?d:n[t]||n.flat;return(0,s.createElement)(m.Tooltip,{text:r,position:"top",key:t},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(m.__experimentalUnitControl,i({},l,{"aria-label":r,value:[u,p].join(""),onChange:a(t),onUnitChange:(g=t,e=>{const t={...n};t[g]=e,o(t)})}))));var g})))}function mf(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink radii"):(0,h.__)("Link radii");return(0,s.createElement)(m.Tooltip,{text:o},(0,s.createElement)("span",null,(0,s.createElement)(m.Button,i({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?tr:nr,iconSize:24,"aria-label":o}))))}const gf={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},hf={px:100,em:20,rem:20};function ff(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!cf(n)||!af(n)),[l,i]=(0,s.useState)({flat:"string"==typeof n?(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"]}),c=lf(l),u=a&&a.find((e=>e.value===c)),d=(null==u?void 0:u.step)||1,[p]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(sf(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(uf,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,units:a}),(0,s.createElement)(m.RangeControl,{label:(0,h.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:0,max:hf[c],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${c}`:void 0)},step:d})):(0,s.createElement)(pf,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||gf,units:a}),(0,s.createElement)(mf,{onClick:()=>r(!o),isLinked:o})))}function vf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(ff,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=ar({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}Ld([Rd,Od]);const bf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},_f=(e,t)=>(0,u.find)(e,{color:t});function kf(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function yf(){return{disableCustomColors:!Yo("color.custom"),disableCustomGradients:!Yo("color.customGradient")}}function Ef(){const e=yf(),t=Yo("color.palette.custom"),n=Yo("color.palette.theme"),o=Yo("color.palette.default"),r=Yo("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=Yo("color.gradients.custom"),i=Yo("color.gradients.theme"),a=Yo("color.gradients.default"),c=Yo("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const Cf="__experimentalBorder",Sf=["top","right","bottom","left"],wf=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},Bf=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},If=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Bf(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return Bf(t,"color",o)||{color:o}};function xf(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Tf(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Ef(),a=Nf(e.name),c=Yo("border.color")&&Nf(e.name,"color"),u=Yo("border.radius")&&Nf(e.name,"radius"),d=Yo("border.style")&&Nf(e.name,"style"),p=Yo("border.width")&&Nf(e.name,"width");if([!c,!u,!d,!p].every(Boolean)||!a)return null;const g=(0,r.getBlockSupport)(e.name,[Cf,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=If({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Sf.forEach((e=>{var n;const o=xf(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=If({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(vr,{__experimentalGroup:"border"},(p||c)&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,m.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,h.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:ar({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:f,resetAllFilter:wf,panelId:n},(0,s.createElement)(m.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,r={...e};if((0,m.__experimentalHasSplitBorders)(e))r={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},Sf.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=If({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(r[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=If({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=ar({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Pf(o,"radius")})}(e),isShownByDefault:null==g?void 0:g.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(vf,e)))}function Nf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,Cf);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function Pf(e,t){return ar({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Mf(e,t,n){if(!Nf(t,"color")||dr(t,Cf,"color"))return e;const o=Lf(n),r=c()(e.className,o);return e.className=r||void 0,e}function Lf(e){var t;const{borderColor:n,style:o}=e,r=kf("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const Rf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=Ef();if(!Nf(m,"color")||dr(m,Cf,"color"))return(0,s.createElement)(e,t);const{color:b}=If({colors:v,namedColor:h}),{color:_}=If({colors:v,namedColor:xf(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:k}=If({colors:v,namedColor:xf(null==f||null===(r=f.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=If({colors:v,namedColor:xf(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=If({colors:v,namedColor:xf(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:_||b,borderRightColor:k||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function Af(e){if(e)return`has-${e}-gradient-background`}function Df(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Of(e,t){return(0,u.find)(e,["gradient",t])}function zf(e,t){const n=Of(e,t);return n&&n.slug}function Ff(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=go(),o=Yo("color.gradients.custom"),r=Yo("color.gradients.theme"),l=Yo("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,p.useSelect)((o=>{const{getBlockAttributes:r}=o(co),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,p.useDispatch)(co),d=(0,s.useCallback)((o=>{const r=zf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),m=Af(a);let g;return g=a?Df(i,a):c,{gradientClass:m,gradientValue:g,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Nf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Mf),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Nf(e,"color")||dr(e,Cf,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Mf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Rf);const Vf=["colors","disableCustomColors","gradients","disableCustomGradients"],Hf={name:"color",title:"Solid",value:"color"},Gf={name:"gradient",title:"Gradient",value:"gradient"},Uf=[Hf,Gf];function Wf(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:p,onGradientChange:g,colorValue:h,gradientValue:f,clearable:v,showTitle:b=!0,enableAlpha:_}=e;const k=p&&(!(0,u.isEmpty)(t)||!o),y=g&&(!(0,u.isEmpty)(n)||!r);if(!k&&!y)return null;const E={[Hf.value]:(0,s.createElement)(m.ColorPalette,{value:h,onChange:y?e=>{p(e),g()}:p,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:_}),[Gf.value]:(0,s.createElement)(m.GradientPicker,{__nextHasNoMargin:!0,value:f,onChange:k?e=>{g(e),p()}:g,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v})},C=e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__panel"},E[e]);return(0,s.createElement)(m.BaseControl,{__nextHasNoMarginBottom:!0,className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(m.__experimentalVStack,{spacing:1},b&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(m.BaseControl.VisualLabel,null,d))),k&&y&&(0,s.createElement)(m.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Uf,initialTabName:f?Gf.value:!!k&&Hf.value},(e=>C(e.value))),!y&&C(Hf.value),!k&&C(Gf.value))))}function jf(e){const t={};return t.colors=Yo("color.palette"),t.gradients=Yo("color.gradients"),t.disableCustomColors=!Yo("color.custom"),t.disableCustomGradients=!Yo("color.customGradient"),(0,s.createElement)(Wf,i({},t,e))}const $f=function(e){return(0,u.every)(Vf,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Wf,e):(0,s.createElement)(jf,e)},Kf=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,s.createElement)(m.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},qf=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(m.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(m.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},Yf=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(m.Button,i,(0,s.createElement)(qf,{colorValue:r,label:l}))};function Qf(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...p}=e;return d&&(t={placement:"left-start",offset:36,shift:!0}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var g;const h={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},f={colorValue:null!==(g=e.gradientValue)&&void 0!==g?g:e.colorValue,label:e.label};return e&&(0,s.createElement)(Kf,i({key:c,setting:e},p),(0,s.createElement)(m.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:Yf(f),renderContent:()=>(0,s.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,s.createElement)($f,h)))}))})))}Ld([Rd,Od]);const Zf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const p=a||o,g=c||r;if(!p&&!g)return null;const f=[{color:p,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=Pd(d),b=v.alpha()<1,_=v.brightness(),k={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of f){if(!e.color)continue;const t=Pd(e.color),n=t.isReadable(v,k),o=t.alpha()<1;if(!n){if(b||o)continue;y=_<t.brightness()?(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
71 |
(0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
72 |
-
(0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,qt.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(m.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function
|
73 |
/* translators: 1: Font weight name. 2: Font style name. */
|
74 |
-
(0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return
|
75 |
(0,h.__)("Currently selected font appearance: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
|
76 |
(0,h.__)("Currently selected font style: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
|
77 |
-
(0,h.__)("Currently selected font weight: %s"),g.name):(0,h.__)("No selected font appearance"),options:p,value:g,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const _v=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px",...l}=e;const a=function(e){return void 0!==e&&""!==e}(t),c=a?t:"";o||V()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const u=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:u},(0,s.createElement)(m.__experimentalNumberControl,i({},l,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(a)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,h.__)("Line height"),placeholder:1.5,step:.1,value:c,min:0})))},kv="typography.lineHeight";function yv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(_v,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:ar(t)})},size:"__unstable-large"})}function Ev(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,kv)||t}const Cv="typography.__experimentalFontStyle",Sv="typography.__experimentalFontWeight";function wv(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Bv(e),i=!Iv(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(bv,{onChange:e=>{r({style:ar({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c},size:"__unstable-large"})}function Bv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Cv),n=Yo("typography.fontStyle");return!t||!n}function Iv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Sv),n=Yo("typography.fontWeight");return!t||!n}function xv(e){const t=Bv(e),n=Iv(e);return t&&n}function Tv(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=Yo("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,h.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(m.SelectControl,i({label:(0,h.__)("Font"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Nv="typography.__experimentalFontFamily";function Pv(e,t,n){if(!(0,r.hasBlockSupport)(t,Nv))return e;if(dr(t,ub,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(_g())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function Mv(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Yo("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(Tv,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Lv(e){let{name:t}=e;const n=Yo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Nv)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Nv)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Pv),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Nv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Pv(o,e,n)},e}));const Rv=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Av(e,t){return(0,u.find)(e,{size:t})||{size:t}}function Dv(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}const Ov=function(e){const t=Yo("typography.fontSizes"),n=!Yo("typography.customFontSize");return(0,s.createElement)(m.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},zv="typography.fontSize";function Fv(e,t,n){if(!(0,r.hasBlockSupport)(t,zv))return e;if(dr(t,ub,"fontSize"))return e;const o=new(_g())(e.className);o.add(Dv(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Vv(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=Yo("typography.fontSizes"),a=Rv(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(Ov,{onChange:e=>{const t=Av(i,e).slug;l({style:ar({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Hv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Yo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,zv)||!n}const Gv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=Yo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,zv)||dr(i,ub,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=Rv(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles"),Uv={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,zv)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Fv),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,zv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Fv(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Gv),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return ur({fontSize:(0,r.hasBlockSupport)(l,zv)},Uv,e,t,n,o)}));const Wv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 11.5h10V13H7z"})),jv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),$v=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})),Kv=[{name:(0,h.__)("None"),value:"none",icon:Wv},{name:(0,h.__)("Underline"),value:"underline",icon:jv},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:$v}];function qv(e){let{value:t,onChange:n,className:o}=e;return(0,s.createElement)("fieldset",{className:c()("block-editor-text-decoration-control",o)},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},Kv.map((e=>(0,s.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const Yv="typography.__experimentalTextDecoration";function Qv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(qv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:ar({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})},size:"__unstable-large"})}function Zv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Yv),n=Yo("typography.textDecoration");return t||!n}const Xv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),Jv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),eb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})),tb=[{name:(0,h.__)("None"),value:"none",icon:Wv},{name:(0,h.__)("Uppercase"),value:"uppercase",icon:Xv},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:Jv},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:eb}];function nb(e){let{className:t,value:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:c()("block-editor-text-transform-control",t)},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},tb.map((e=>(0,s.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{o(e.value===n?void 0:e.value)}})))))}const ob="typography.__experimentalTextTransform";function rb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(nb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:ar({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})},size:"__unstable-large"})}function lb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,ob),n=Yo("typography.textTransform");return t||!n}function ib(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(m.__experimentalUnitControl,i({},r,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n}))}const sb="typography.__experimentalLetterSpacing";function ab(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(ib,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:ar({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%",size:"__unstable-large"})}function cb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,sb),n=Yo("typography.letterSpacing");return t||!n}const ub="typography",db=[kv,zv,Cv,Sv,Nv,Yv,ob,sb];function pb(e){const{clientId:t}=e,n=Lv(e),o=Hv(e),l=xv(e),i=Ev(e),a=Zv(e),c=lb(e),u=cb(e),d=!Bv(e),p=!Iv(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[xv(e),Hv(e),Ev(e),Lv(e),Zv(e),lb(e),cb(e)];return t.filter(Boolean).length===t.length}(e),f=mb(e.name);if(g||!f)return null;const v=(0,r.getBlockSupport)(e.name,[ub,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(vr,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(Mv,e)),!o&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e)
|
78 |
-
/* translators: Ensure translation is distinct from "Letter case" */,label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:
|
79 |
-
/* translators: Ensure translation is distinct from "Font size" */,label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ar({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(rb,e)))}const mb=e=>db.some((t=>(0,r.hasBlockSupport)(e,t))),gb=[...db,Cf,ev,Pr],hb=e=>gb.some((t=>(0,r.hasBlockSupport)(e,t)));function fb(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,gl.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const vb={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[ev],[`${ub}.__experimentalSkipSerialization`]:[ub],[`${Pr}.__experimentalSkipSerialization`]:["spacing"]},bb={...vb,[`${Pr}`]:["spacing.blockGap"]},_b={gradients:"gradient"};function kb(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:bb;if(!hb(t))return e;let{style:l}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,r.getBlockSupport)(t,n);!0===i&&(l=(0,u.omit)(l,o)),Array.isArray(i)&&i.forEach((e=>{const t=_b[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...fb(l),...e.style},e}const yb=(0,d.createHigherOrderComponent)((e=>t=>{const n=ho();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pv,t),(0,s.createElement)(pb,t),(0,s.createElement)(Tf,t),(0,s.createElement)(Rr,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Eb=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=dr(t.name,ev,"link"),u=(0,s.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:a||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=(0,gl.compileCSS)(n,{selector:`.editor-styles-wrapper .${l} ${r.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),p=(0,s.useContext)(tf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,u&&p&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:u}}),p),(0,s.createElement)(e,i({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return hb(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",kb),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!hb(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),kb(o,e,n,vb)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",yb),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Eb),(0,l.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,r.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));const Cb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),Sb=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,s.createElement)(m.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,s.createElement)(m.DuotoneSwatch,{values:i}):(0,s.createElement)(dl,{icon:Cb}),(0,s.createElement)(m.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(m.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==bu.DOWN||(e.preventDefault(),o())},label:(0,h.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,s.createElement)(m.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(m.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})},wb=[];function Bb(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,s.createElement)(up,{selector:t}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(dp,{id:n,colors:o}),(0,s.createElement)(cp,{id:n,selector:t}))}function Ib(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Yo(n),r=Yo(`${t}.custom`)||wb,l=Yo(`${t}.theme`)||wb,i=Yo(`${t}.default`)||wb;return(0,s.useMemo)((()=>[...r,...l,...o?wb:i]),[o,r,l,i])}function xb(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=Ib({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Ib({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Yo("color.custom"),u=!Yo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Sb,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}Ld([Rd]);const Tb=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,p.useSelect)((e=>e(co).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&!o&&(0,s.createElement)(xb,t))}),"withDuotoneControls"),Nb=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),g=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(tf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(Bb,{selector:m,id:p,colors:u}),h),(0,s.createElement)(e,i({},t,{className:g})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Tb),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Nb);const Pb="__experimentalLayout";function Mb(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=(0,p.useSelect)((e=>{var t;const{getSettings:n}=e(co);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),l=Yo("layout")||{},{attributes:i={},name:s}=n,{layout:a}=i,{default:c}=(0,r.getBlockSupport)(s,Pb)||{},d=null!=a&&a.inherit||null!=a&&a.contentSize||null!=a&&a.wideSize?{...a,type:"constrained"}:a||c||{},m=[];var g,h;return null!=l&&null!==(e=l.definitions)&&void 0!==e&&null!==(t=e[(null==d?void 0:d.type)||"default"])&&void 0!==t&&t.className&&m.push(null==l||null===(g=l.definitions)||void 0===g||null===(h=g[(null==d?void 0:d.type)||"default"])||void 0===h?void 0:h.className),(null!=d&&d.inherit||null!=d&&d.contentSize||"constrained"===(null==d?void 0:d.type))&&o&&m.push("has-global-padding"),null!=d&&d.orientation&&m.push(`is-${(0,u.kebabCase)(d.orientation)}`),null!=d&&d.justifyContent&&m.push(`is-content-justification-${(0,u.kebabCase)(d.justifyContent)}`),null!=d&&d.flexWrap&&"nowrap"===d.flexWrap&&m.push("is-nowrap"),m}function Lb(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const{attributes:o={},name:r}=t,{layout:l={},style:i={}}=o,s=null!=l&&l.inherit||null!=l&&l.contentSize||null!=l&&l.wideSize?{...l,type:"constrained"}:l||{},a=vl((null==s?void 0:s.type)||"default"),c=Yo("layout")||{},u=Yo("spacing.blockGap"),d=null!==u,p=null==a||null===(e=a.getLayoutStyle)||void 0===e?void 0:e.call(a,{blockName:r,selector:n,layout:l,layoutDefinitions:null==c?void 0:c.definitions,style:i,hasBlockGapSupport:d});return p}function Rb(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=Yo("layout"),a=(0,p.useSelect)((e=>{const{getSettings:t}=e(co);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Pb,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:g=!0,default:f}=c;if(!d)return null;const v=!(!g||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&"constrained"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||f||{},{inherit:_=!1,type:k="default",contentSize:y=null}=b;if(("default"===k||"constrained"===k)&&!a)return null;const E=vl(k),C=vl("constrained"),S=!b.type&&(y||_),w=!!_||!!y,B=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(vr,null,(0,s.createElement)(m.PanelBody,{title:(0,h.__)("Layout")},v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.ToggleControl,{className:"block-editor-hooks__toggle-control",label:(0,h.__)("Inner blocks use content width"),checked:"constrained"===(null==E?void 0:E.name)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(0,h.__)("Nested blocks use content width with options for full and wide widths."):(0,h.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!_&&u&&(0,s.createElement)(Ab,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,s.createElement)(E.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}),C&&S&&(0,s.createElement)(C.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}))),!_&&E&&(0,s.createElement)(E.toolBarControls,{layout:b,onChange:B,layoutBlockSupport:c}))}function Ab(e){let{type:t,onChange:n}=e;return(0,s.createElement)(m.ButtonGroup,null,fl.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(m.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const Db=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Pb)&&(0,s.createElement)(Rb,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Ob=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:l}=t,a=(0,r.hasBlockSupport)(n,Pb),u=(0,p.useSelect)((e=>{const{getSettings:t}=e(co);return!!t().disableLayoutStyles})),m=a&&!u,g=(0,d.useInstanceId)(e),h=Yo("layout")||{},f=(0,s.useContext)(tf.__unstableElementContext),{layout:v}=o,{default:b}=(0,r.getBlockSupport)(n,Pb)||{},_=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},k=a?Mb(l):null,y=`.${(0,r.getBlockDefaultClassName)(n)}.wp-container-${g}`,E=null!==Yo("spacing.blockGap");let C;if(m){var S;const e=vl((null==_?void 0:_.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:_,layoutDefinitions:null==h?void 0:h.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=c()(null==t?void 0:t.className,{[`wp-container-${g}`]:m&&!!C},k);return(0,s.createElement)(s.Fragment,null,m&&f&&!!C&&(0,s.createPortal)((0,s.createElement)(El,{blockName:n,selector:y,css:C,layout:_,style:null==o?void 0:o.style}),f),(0,s.createElement)(e,i({},t,{className:w})))}));function zb(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,p.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(co);return n(t)||o(t,!0)}),[t]);return(0,s.useEffect)((()=>{o||n()}),[o]),null}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||(0,r.hasBlockSupport)(e,Pb)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Ob),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Db);const Fb=(0,d.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,p.useSelect)(co),r=(0,s.useRef)(),{templateLock:l,isLockedByParent:a,isEditingAsBlocks:u}=(0,p.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(co);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:r()===t.clientId}}),[t.clientId]),{updateSettings:d,updateBlockListSettings:g,__unstableSetTemporarilyEditingAsBlocks:f}=(0,p.useDispatch)(co),v=!a&&"contentOnly"===l,{__unstableMarkNextChangeAsNotPersistent:b,updateBlockAttributes:_}=(0,p.useDispatch)(co),k=(0,s.useCallback)((()=>{b(),_(t.clientId,{templateLock:"contentOnly"}),g(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),d({focusMode:r.current}),f()}),[t.clientId,r,d,g,n,b,_,f]);return v||u?(0,s.createElement)(s.Fragment,null,u&&!v&&(0,s.createElement)(zb,{clientId:t.clientId,stopEditingAsBlock:k}),(0,s.createElement)(ko,{group:"other"},(0,s.createElement)(m.ToolbarButton,{onClick:()=>{u&&!v?k():(b(),_(t.clientId,{templateLock:void 0}),g(t.clientId,{...n(t.clientId),templateLock:!1}),r.current=o().focusMode,d({focusMode:!0}),f(t.clientId))}},u&&!v?(0,h.__)("Done"):(0,h.__)("Modify"))),(0,s.createElement)(e,i({},t,{className:c()(t.className,u&&"is-content-locked-editing-as-blocks")}))):(0,s.createElement)(e,t)}),"withToolbarControls");(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Fb);function Vb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=(0,r.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function Hb(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Lf(e)||void 0,style:fb({border:n})}}function Gb(e){const{colors:t}=Ef(),n=Hb(e),{borderColor:o}=e;if(o){const e=If({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function Ub(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=kf("background-color",s),m=kf("color",a),g=Af(u),h=g||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,g,{[p]:!h&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:fb({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.metadata)&&void 0!==n&&n.type||Vb(e,"name",!1)&&(e.attributes={...e.attributes,metadata:{type:"object"}}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return Vb(t)&&(e.metadata=n.metadata),e})),(0,l.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||Vb(e,"name",!1)&&(e.__experimentalLabel=(e,t)=>{let{context:n}=t;const{metadata:o}=e;if("list-view"===n&&null!=o&&o.name)return o.name}),e}));const Wb={};function jb(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Yo("color.palette.custom")||[],l=Yo("color.palette.theme")||[],i=Yo("color.palette.default")||[],a=Yo("color.gradients")||Wb,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=Ub(e);if(t){const e=bf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Df(u,o)),n){const e=bf(c,n);d.style.color=e.color}return d}function $b(e){const{style:t}=e;return{style:fb({spacing:(null==t?void 0:t.spacing)||{}})}}function Kb(e){var t;const n=fb({typography:(null==e||null===(t=e.style)||void 0===t?void 0:t.typography)||{}}),o=null!=e&&e.fontFamily?`has-${(0,u.kebabCase)(e.fontFamily)}-font-family`:"";return{className:c()(o,Dv(null==e?void 0:e.fontSize)),style:n}}function qb(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Yb=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},Qb=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Zb=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=Yo("color.palette.custom"),o=Yo("color.palette.theme"),r=Yo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function Xb(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,..."string"==typeof t?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Pd(t),o=e=>{let{color:t}=e;return n.contrast(t)},r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=Yb(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=_f(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=bf(r,o[l],o[`custom${Yb(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:kf(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Jb(e){return function(){const t=Qb(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(Xb(o,t),"withCustomColors")}}function e_(){const e=Zb();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(Xb(n,e),"withColors")}const t_=[],n_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},o_=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${n_(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=Yo("typography.fontSizes")||t_;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${n_(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=Rv(r,l,n[t]);return e[o]={...i,class:Dv(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},r_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),l_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),i_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"})),s_=[{icon:r_,title:(0,h.__)("Align text left"),align:"left"},{icon:l_,title:(0,h.__)("Align text center"),align:"center"},{icon:i_,title:(0,h.__)("Align text right"),align:"right"}],a_={position:"bottom right",isAlternate:!0},c_=function(e){let{value:t,onChange:n,alignmentControls:o=s_,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const p=(0,u.find)(o,(e=>e.align===t)),g=c?m.ToolbarGroup:m.ToolbarDropdownMenu,f=c?{isCollapsed:a}:{toggleProps:{describedBy:l},popoverProps:a_};return(0,s.createElement)(g,i({icon:p?p.icon:(0,h.isRTL)()?i_:r_,label:r,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},f))},u_=e=>(0,s.createElement)(c_,i({},e,{isToolbar:!1})),d_=e=>(0,s.createElement)(c_,i({},e,{isToolbar:!0})),p_=()=>{},m_={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,p.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(co),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Np(t,p_),i=(0,s.useMemo)((()=>(e.trim()?nm(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]),a=(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ru,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[a]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},g_=window.wp.apiFetch;var h_=n.n(g_);const f_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),v_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),b_={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await h_()({path:(0,dm.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(dl,{key:"icon",icon:"page"===e.subtype?f_:v_}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)},k_=[];function y_(e){let{completers:t=k_}=e;const{name:n}=go();return(0,s.useMemo)((()=>{let e=[...t,b_];return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,m_]),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}const E_=function(e){return(0,s.createElement)(m.Autocomplete,i({},e,{completers:y_(e)}))},C_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),S_=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(m.ToolbarButton,{isActive:t,icon:C_,label:n,onClick:()=>o(!t),disabled:r})},w_=()=>{},B_=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=w_,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(m.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(m.Dropdown,{position:"bottom right",popoverProps:{isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(m.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==bu.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(m.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},I_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),x_=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,p.useDispatch)(co),{clientId:r,parents:l,hasSelection:i}=(0,p.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(co),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,h.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(dl,{icon:I_,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Um,{clientId:e,maximumLength:35})),(0,s.createElement)(dl,{icon:I_,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Um,{clientId:r,maximumLength:35})))},T_=()=>(0,s.createElement)(m.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(m.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),N_=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(T_,null)))},P_=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==bu.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(N_,null)))}))}},M_=e=>{let{children:t,...n}=e;return V()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(m.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:P_(n),renderContent:()=>t})},L_=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),R_=tu(m.__experimentalTreeGridRow);function A_(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=ru({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(R_,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}const D_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function O_(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(dl,{icon:(0,h.isRTL)()?D_:I_}))}const z_=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:p}=e;const g=Hm(o),h=Gm({clientId:o,context:"list-view"}),{isLocked:f}=Xg(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==bu.ENTER&&e.keyCode!==bu.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:p,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(O_,{onClick:l}),(0,s.createElement)(Ru,{icon:null==g?void 0:g.icon,showColors:!0}),(0,s.createElement)(m.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(m.__experimentalTruncate,{ellipsizeMode:"auto"},h)),(null==g?void 0:g.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,s.createElement)(m.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},g.anchor)),f&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(dl,{icon:eh})))))})),F_=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:m,selectedClientIds:g,...h}=e;const{clientId:f}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,p.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(co);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[f]),_=v&&b===f,k=c()("block-editor-list-view-block-contents",{"is-dropping-before":_}),y=g.includes(f)?g:[f];return(0,s.createElement)(Wm,{clientIds:y},(e=>{let{draggable:c,onDragStart:p,onDragEnd:g}=e;return(0,s.createElement)(z_,i({ref:t,className:k,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:p,onDragEnd:g,isExpanded:m},h))}))})),V_=F_,H_=(0,s.createContext)({}),G_=()=>(0,s.useContext)(H_),U_=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:l,isBranchSelected:i,selectBlock:a,position:u,level:g,rowCount:f,siblingBlockCount:v,showBlockMovers:b,path:_,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,{isLocked:I,isContentLocked:x}=Xg(B),T=(0,p.useSelect)((e=>!l&&!!x&&e(co).hasSelectedInnerBlock(B,!0)),[x,B,l]),N=T||l&&y[0]===B,P=T||l&&y[y.length-1]===B,{toggleBlockHighlight:M}=(0,p.useDispatch)(co),L=Hm(B),R=(0,p.useSelect)((e=>e(co).getBlockName(B)),[B]),A=(0,r.hasBlockSupport)(R,"__experimentalToolbar",!0),D=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,O=((e,t,n)=>(0,h.sprintf)(
|
80 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
81 |
-
(0,h.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(
|
82 |
(0,h.__)("%s link (locked)"),L.title):(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
|
83 |
(0,h.__)("%s link"),L.title));const F=L?(0,h.sprintf)(// translators: %s: The title of the block.
|
84 |
-
(0,h.__)("Options for %s block"),L.title):(0,h.__)("Options"),{isTreeGridMounted:V,expand:H,collapse:G}=
|
85 |
/* translators: %s: block name */
|
86 |
(0,h.__)("%s deselected."),e))}else S.length>1&&(w=(0,h.sprintf)(
|
87 |
/* translators: %s: number of deselected blocks */
|
88 |
-
(0,h.__)("%s blocks deselected."),S.length));w&&(0,qt.speak)(w)}),[e,o,m,l,i,a,c,u,
|
89 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}const
|
90 |
/* translators: %s: Name of the block variation */
|
91 |
-
(0,h.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function _k(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,s.createElement)(m.DropdownMenu,{className:t,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:qm,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${t}__container`},(0,s.createElement)(m.MenuGroup,null,(0,s.createElement)(m.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}const kk=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,p.useDispatch)(co),{activeBlockVariation:o,variations:l}=(0,p.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(co),s=t&&l(t);return{activeBlockVariation:n(s,i(t)),variations:s&&o(s,"transform")}}),[t]),i=null==o?void 0:o.name,a=(0,s.useMemo)((()=>{const e=new Set;return!!l&&(l.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===l.length)}),[l]);if(null==l||!l.length)return null;const c=a?bk:_k;return(0,s.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...l.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:l})},yk=(0,d.createHigherOrderComponent)((e=>t=>{const n=Yo("color.palette"),o=!Yo("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),Ek=yk(m.ColorPalette);function Ck(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)($f,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}const Sk=window.wp.date,wk=new Date(2022,0,25);function Bk(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(m.VisuallyHidden,{as:"legend"},(0,h.__)("Date format")),(0,s.createElement)(m.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,Sk.dateI18n)(n,wk))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(Ik,{format:t,onChange:o}))}function Ik(e){var t;let{format:n,onChange:o}=e;const r=[...new Set(["Y-m-d",(0,h._x)("n/j/Y","short date format"),(0,h._x)("n/j/Y g:i A","short date format with time"),(0,h._x)("M j, Y","medium date format"),(0,h._x)("M j, Y g:i A","medium date format with time"),(0,h._x)("F j, Y","long date format"),(0,h._x)("M j","short date format without the year")])],l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,Sk.dateI18n)(e,wk),format:e}))),i={key:"custom",name:(0,h.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,h.__)("Enter your own date format")},[a,c]=(0,s.useState)((()=>!!n&&!r.includes(n)));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,s.createElement)(m.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,h.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?c(!0):(c(!1),o(t.format))}})),a&&(0,s.createElement)(m.TextControl,{label:(0,h.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,h.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(m.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const xk=["colors","disableCustomColors","gradients","disableCustomGradients"],Tk=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:a,title:g,showTitle:h=!0,__experimentalHasMultipleOrigins:f,__experimentalIsRenderedInSidebar:v,enableAlpha:b}=e;const _=(0,d.useInstanceId)(Tk),{batch:k}=(0,p.useRegistry)();return(0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(a,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,s.createElement)(m.__experimentalToolsPanel,{className:c()("block-editor-panel-color-gradient-settings",t),label:h?g:void 0,resetAll:()=>{k((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:_,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,s.createElement)(Qf,{settings:a,panelId:_,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:f,__experimentalIsRenderedInSidebar:v,enableAlpha:b}),!!i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.__experimentalSpacer,{marginY:4})," ",i))},Nk=e=>{const t=yf();return t.colors=Yo("color.palette"),t.gradients=Yo("color.gradients"),(0,s.createElement)(Tk,i({},t,e))},Pk=e=>{const t=Ef();return(0,s.createElement)(Tk,i({},t,e))},Mk=e=>(0,u.every)(xk,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Tk,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Pk,e):(0,s.createElement)(Nk,e);var Lk=function(e,t){return Lk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Lk(e,t)},Rk=function(){return Rk=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Rk.apply(this,arguments)};Object.create,Object.create;var Ak=n(7970),Dk=n.n(Ak);function Ok(e,t,n,o,r,l){void 0===l&&(l=0);var i=qk(e,t,l),s=i.width,a=i.height,c=Math.min(s,n),u=Math.min(a,o);return c>u*r?{width:u*r,height:u}:{width:c,height:c/r}}function zk(e,t,n,o,r){void 0===r&&(r=0);var l=qk(t.width,t.height,r),i=l.width,s=l.height;return{x:Fk(e.x,i,n.width,o),y:Fk(e.y,s,n.height,o)}}function Fk(e,t,n,o){var r=t*o/2-n/2;return Yk(e,-r,r)}function Vk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Hk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Gk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i?Uk:Wk,a=qk(t.width,t.height,l),c=qk(t.naturalWidth,t.naturalHeight,l),u={x:s(100,((a.width-n.width/r)/2-e.x/r)/a.width*100),y:s(100,((a.height-n.height/r)/2-e.y/r)/a.height*100),width:s(100,n.width/a.width*100/r),height:s(100,n.height/a.height*100/r)},d=Math.round(s(c.width,u.width*c.width/100)),p=Math.round(s(c.height,u.height*c.height/100)),m=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:Rk(Rk({},m),{x:Math.round(s(c.width-m.width,u.x*c.width/100)),y:Math.round(s(c.height-m.height,u.y*c.height/100))})}}function Uk(e,t){return Math.min(e,Math.max(0,t))}function Wk(e,t){return t}function jk(e,t,n,o,r,l){var i=qk(t.width,t.height,n),s=Yk(o.width/i.width*(100/e.width),r,l);return{crop:{x:s*i.width/2-o.width/2-i.width*s*(e.x/100),y:s*i.height/2-o.height/2-i.height*s*(e.y/100)},zoom:s}}function $k(e,t,n,o,r,l){void 0===n&&(n=0);var i=qk(t.naturalWidth,t.naturalHeight,n),s=Yk(function(e,t,n){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}(e,t,o),r,l),a=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*a,y:((i.height-e.height)/2-e.y)*a},zoom:s}}function Kk(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function qk(e,t,n){var o=n*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function Yk(e,t,n){return Math.min(Math.max(e,t),n)}function Qk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var Zk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=Ni().createRef(),n.videoRef=Ni().createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=document,n.currentWindow=window,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=jk(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),o=t.crop,r=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}else if(n.props.initialCroppedAreaPixels){var l=$k(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=l.crop,r=l.zoom,n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,l,i,s=n.imageRef.current||n.videoRef.current;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var a=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(o=n.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef.current)||void 0===r?void 0:r.videoHeight)||0,d=c/u,p=void 0;if(s.offsetWidth<c||s.offsetHeight<u)switch(n.props.objectFit){default:case"contain":p=a>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:s.offsetWidth,height:s.offsetHeight};n.mediaSize=Rk(Rk({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:Ok(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===m.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0])))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=Rk({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?zk(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(!n.props.onWheelRequest||n.props.onWheelRequest(e)){e.preventDefault();var o=t.getMousePoint(e),r=Dk()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,l=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var i=n.getPointOnContainer(t),s=n.getPointOnMedia(i),a=Yk(e,n.props.minZoom,n.props.maxZoom),c={x:s.x*a-i.x,y:s.y*a-i.y};if(l){var u=n.props.restrictPosition?zk(c,n.mediaSize,n.state.cropSize,a,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(a)}},n.getCropData=function(){return n.state.cropSize?Gk(n.props.restrictPosition?zk(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?zk(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}Lk(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef)},t.prototype.componentWillUnmount=function(){var e;this.currentWindow.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,o,r,l,i,s,a,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(l=e.crop)||void 0===l?void 0:l.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(a=this.props.crop)||void 0===a?void 0:a.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=Vk(n,o),this.lastPinchRotation=Hk(n,o),this.onDragStart(Kk(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Kk(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=Vk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=Hk(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.transform,i=t.crop,s=i.x,a=i.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,g=m.containerStyle,h=m.cropAreaStyle,f=m.mediaStyle,v=t.classes,b=v.containerClassName,_=v.cropAreaClassName,k=v.mediaClassName,y=t.objectFit;return Ni().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:Qk("reactEasyCrop_Container",b)},n?Ni().createElement("img",Rk({alt:"",className:Qk("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},r,{src:n,ref:this.imageRef,style:Rk(Rk({},f),{transform:l||"translate("+s+"px, "+a+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&Ni().createElement("video",Rk({autoPlay:!0,loop:!0,muted:!0,className:Qk("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Rk(Rk({},f),{transform:l||"translate("+s+"px, "+a+"px) rotate("+c+"deg) scale("+u+")"}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return Ni().createElement("source",Rk({key:e.src},e))}))),this.state.cropSize&&Ni().createElement("div",{style:Rk(Rk({},h),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Qk("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",_)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(Ni().Component);const Xk=Zk,Jk={position:"bottom right",isAlternate:!0};const ey=(0,s.createContext)({}),ty=()=>(0,s.useContext)(ey);function ny(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[g,h]=(0,s.useState)(),[f,v]=(0,s.useState)(),[b,_]=(0,s.useState)(),k=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),h(0),v(n/o),_(n/o)}),[n,o,d,m,h,v,_]),y=(0,s.useCallback)((()=>{const e=(g+90)%360;let r=n/o;if(g%180==90&&(r=o/n),0===e)return i(),h(e),v(n/o),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),h(e),v(n.width/n.height),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[g,n,o,i,h,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,r
|
1 |
+
(()=>{var e={6411:function(e,t){var n,o;n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default},void 0===(o=n.apply(t,[e,t]))||(e.exports=o)},4403:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function g(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,f=m&&0<=g&&g<c;if(h||f){if(!h||f&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),g=i.extractCommon(l,t,e,n),l.newPos+1>=a&&g+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();g()||e()}),0)}();else for(;u<=d;){var h=g();if(h)return h}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:(e,t,n)=>{"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:(e,t,n)=>{"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),g=o.offset(e),h=o.outerHeight(e),f=o.outerWidth(e),v=void 0,b=void 0,_=void 0,k=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:g.left-S.left-c,top:g.top-S.top-a},E={left:g.left+f-(S.left+w)+d,top:g.top+h-(S.top+B)+u},k=S):(v=o.offset(t),b=t.clientHeight,_=t.clientWidth,k={left:t.scrollLeft,top:t.scrollTop},y={left:g.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:g.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:g.left+f-(v.left+_+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:g.top+h-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,k.top+y.top):!1===i?o.scrollTop(t,k.top+E.top):y.top<0?o.scrollTop(t,k.top+y.top):o.scrollTop(t,k.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,k.top+y.top):o.scrollTop(t,k.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,k.left+y.left):!1===s?o.scrollLeft(t,k.left+E.left):y.left<0?o.scrollLeft(t,k.left+y.left):o.scrollLeft(t,k.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,k.left+y.left):o.scrollLeft(t,k.left+E.left)))}},5425:(e,t,n)=>{"use strict";e.exports=n(1345)},5022:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function g(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function h(e){return null!=e&&e==e.window}var f={};function v(e,t,n){if(h(e))return"width"===t?f.viewportWidth(e):f.viewportHeight(e);if(9===e.nodeType)return"width"===t?f.docWidth(e):f.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){f["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],f["viewport"+e](n))},f["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function _(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function k(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&k(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);f["outer"+t]=function(t,n){return t&&_(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&_(t,e,-1):t?(c(t),d(t)&&(o+=g(t,["padding","border"],n)),k(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===k(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(k(e,l))||0,o[l]=r+t[l]-n[l]);k(e,o)}(e,t)},isWindow:h,each:u,css:k,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},f)},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:(e,t,n)=>{var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},7970:(e,t,n)=>{e.exports=n(195)},3110:e=>{"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},3812:e=>{var t,n,o,r,l,i,s,a,c,u,d,p,m,g,h,f=!1;function v(){if(!f){f=!0;var e=navigator.userAgent,v=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),b=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),g=/FBAN\/\w+;/i.exec(e),h=/Mobile/i.exec(e),d=!!/Win64/.exec(e),v){(t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var _=/(?:Trident\/(\d+.\d+))/.exec(e);i=_?parseFloat(_[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,o=v[3]?parseFloat(v[3]):NaN,(r=v[4]?parseFloat(v[4]):NaN)?(v=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=v&&v[1]?parseFloat(v[1]):NaN):l=NaN}else t=n=o=l=r=NaN;if(b){if(b[1]){var k=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!k||parseFloat(k[1].replace("_","."))}else s=!1;a=!!b[2],c=!!b[3]}else s=a=c=!1}}var b={ie:function(){return v()||t},ieCompatibilityMode:function(){return v()||i>t},ie64:function(){return b.ie()&&d},firefox:function(){return v()||n},opera:function(){return v()||o},webkit:function(){return v()||r},safari:function(){return b.webkit()},chrome:function(){return v()||l},windows:function(){return v()||a},osx:function(){return v()||s},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||m||u||h},nativeApp:function(){return v()||g},android:function(){return v()||u},ipad:function(){return v()||m}};e.exports=b},7939:(e,t,n)=>{"use strict";var o,r=n(3110);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,l=n in document;if(!l){var i=document.createElement("div");i.setAttribute(n,"return;"),l="function"==typeof i[n]}return!l&&o&&"wheel"===e&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}},195:(e,t,n)=>{"use strict";var o=n(3812),r=n(7939);function l(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),o&&!t&&(t=o<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:r}}l.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=l},5372:(e,t,n)=>{"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:(e,t,n)=>{e.exports=n(5372)()},9567:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:(e,t,n)=>{"use strict";var o=n(5438);t.Z=o.TextareaAutosize},4793:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),r=new RegExp(n,""),l=function(e){return e.replace(o,(function(e){return t[e]}))};e.exports=l,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=l},3124:e=>{var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},g=!0,h={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(g=!1)},delete:function(e){delete h.parent.node[h.key],e&&(g=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(g=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){g=!1}};if(!u)return h;function f(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}f();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),g?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),f(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:e=>{"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>I_,AlignmentToolbar:()=>x_,Autocomplete:()=>z_,BlockAlignmentControl:()=>Rl,BlockAlignmentToolbar:()=>Al,BlockBreadcrumb:()=>W_,BlockColorsStyleSelector:()=>q_,BlockContextProvider:()=>ql,BlockControls:()=>ko,BlockEdit:()=>Xl,BlockEditorKeyboardShortcuts:()=>qC,BlockEditorProvider:()=>Vu,BlockFormatControls:()=>_o,BlockIcon:()=>Au,BlockInspector:()=>HC,BlockList:()=>af,BlockMover:()=>ig,BlockNavigationDropdown:()=>hk,BlockPreview:()=>bp,BlockSelectionClearer:()=>Uu,BlockSettingsMenu:()=>bh,BlockSettingsMenuControls:()=>mh,BlockStyles:()=>_k,BlockTitle:()=>Qm,BlockToolbar:()=>Ih,BlockTools:()=>WC,BlockVerticalAlignmentControl:()=>Qr,BlockVerticalAlignmentToolbar:()=>Zr,ButtonBlockAppender:()=>Dm,ButtonBlockerAppender:()=>Am,ColorPalette:()=>Dk,ColorPaletteControl:()=>Ok,ContrastChecker:()=>ov,CopyHandler:()=>Kg,DefaultBlockAppender:()=>Lm,FontSizePicker:()=>Uv,InnerBlocks:()=>nf,Inserter:()=>Mm,InspectorAdvancedControls:()=>vr,InspectorControls:()=>br,JustifyContentControl:()=>el,JustifyToolbar:()=>tl,LineHeightControl:()=>wv,MediaPlaceholder:()=>xE,MediaReplaceFlow:()=>EE,MediaUpload:()=>bE,MediaUploadCheck:()=>_E,MultiSelectScrollIntoView:()=>YC,NavigableToolbar:()=>cg,ObserveTyping:()=>JC,PanelColorSettings:()=>TE,PlainText:()=>cC,RichText:()=>iC,RichTextShortcut:()=>pC,RichTextToolbarButton:()=>mC,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>PC,ToolSelector:()=>fC,Typewriter:()=>oS,URLInput:()=>Oy,URLInputButton:()=>kC,URLPopover:()=>wE,Warning:()=>ei,WritingFlow:()=>od,__experimentalBlockAlignmentMatrixControl:()=>G_,__experimentalBlockFullHeightAligmentControl:()=>V_,__experimentalBlockPatternSetup:()=>Pk,__experimentalBlockPatternsList:()=>Hp,__experimentalBlockVariationPicker:()=>yk,__experimentalBlockVariationTransforms:()=>Rk,__experimentalBorderRadiusControl:()=>Ef,__experimentalColorGradientControl:()=>Xf,__experimentalColorGradientSettingsDropdown:()=>nv,__experimentalDateFormatPicker:()=>Vk,__experimentalDuotoneControl:()=>Vb,__experimentalFontAppearanceControl:()=>Sv,__experimentalFontFamilyControl:()=>Av,__experimentalGetBorderClassesAndStyles:()=>o_,__experimentalGetColorClassesAndStyles:()=>l_,__experimentalGetElementClassName:()=>dS,__experimentalGetGapCSSValue:()=>Hr,__experimentalGetGradientClass:()=>Hf,__experimentalGetGradientObjectByGradientValue:()=>Uf,__experimentalGetMatchingVariation:()=>mS,__experimentalGetSpacingClassesAndStyles:()=>a_,__experimentalImageEditingProvider:()=>fy,__experimentalImageEditor:()=>By,__experimentalImageSizeControl:()=>Ty,__experimentalImageURLInputUI:()=>xC,__experimentalInspectorPopoverHeader:()=>aS,__experimentalLayoutStyle:()=>Cl,__experimentalLetterSpacingControl:()=>yb,__experimentalLibrary:()=>jC,__experimentalLinkControl:()=>gE,__experimentalLinkControlSearchInput:()=>lE,__experimentalLinkControlSearchItem:()=>jy,__experimentalLinkControlSearchResults:()=>Xy,__experimentalListView:()=>mk,__experimentalPanelColorGradientSettings:()=>jk,__experimentalPreviewOptions:()=>TC,__experimentalPublishDateTimePicker:()=>cS,__experimentalRecursionProvider:()=>lS,__experimentalResponsiveBlockControl:()=>dC,__experimentalSpacingSizesControl:()=>lr,__experimentalTextDecorationControl:()=>cb,__experimentalTextTransformControl:()=>vb,__experimentalUnitControl:()=>vC,__experimentalUseBlockOverlayActive:()=>Cu,__experimentalUseBlockPreview:()=>_p,__experimentalUseBorderProps:()=>r_,__experimentalUseColorProps:()=>s_,__experimentalUseCustomSides:()=>Or,__experimentalUseGradient:()=>$f,__experimentalUseHasRecursion:()=>iS,__experimentalUseMultipleOriginColorsAndGradients:()=>xf,__experimentalUseResizeCanvas:()=>NC,__experimentaluseLayoutClasses:()=>qb,__experimentaluseLayoutStyles:()=>Yb,__unstableBlockNameContext:()=>Bh,__unstableBlockSettingsMenuFirstItem:()=>eh,__unstableBlockToolbarLastItem:()=>Hg,__unstableDuotoneFilter:()=>pp,__unstableDuotoneStylesheet:()=>up,__unstableDuotoneUnsetStylesheet:()=>dp,__unstableEditorStyles:()=>ap,__unstableGetValuesFromColors:()=>cp,__unstableIframe:()=>id,__unstableInserterMenuExtension:()=>ym,__unstablePresetDuotoneFilter:()=>mp,__unstableRichTextInputEvent:()=>gC,__unstableUseBlockSelectionClearer:()=>Gu,__unstableUseClipboardHandler:()=>jg,__unstableUseMouseMoveTypingReset:()=>ZC,__unstableUseTypewriter:()=>nS,__unstableUseTypingObserver:()=>XC,createCustomColorsHOC:()=>h_,getColorClassName:()=>Bf,getColorObjectByAttributeValues:()=>Sf,getColorObjectByColorValue:()=>wf,getComputedFluidTypographyValue:()=>Qv,getFontSize:()=>Vv,getFontSizeClass:()=>Gv,getFontSizeObjectByValue:()=>Hv,getGradientSlugByValue:()=>Wf,getGradientValueBySlug:()=>Gf,getPxFromCssUnit:()=>CS,getTypographyClassesAndStyles:()=>c_,store:()=>co,storeConfig:()=>ao,transformStyles:()=>lp,useBlockDisplayInformation:()=>qm,useBlockEditContext:()=>go,useBlockProps:()=>Su,useCachedTruthy:()=>u_,useInnerBlocksProps:()=>tf,useSetting:()=>Yo,withColorContext:()=>Ak,withColors:()=>f_,withFontSizes:()=>k_});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Vt,__experimentalGetAllowedBlocks:()=>_t,__experimentalGetAllowedPatterns:()=>Ct,__experimentalGetBlockListSettingsForBlocks:()=>Tt,__experimentalGetDirectInsertBlock:()=>kt,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Mt,__experimentalGetParsedPattern:()=>yt,__experimentalGetPatternTransformItems:()=>wt,__experimentalGetPatternsByBlockTypes:()=>St,__experimentalGetReusableBlockTitle:()=>Nt,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Q,__unstableGetContentLockingParent:()=>Wt,__unstableGetEditorMode:()=>At,__unstableGetSelectedBlocksWithPartialSelection:()=>Re,__unstableGetTemporarilyEditingAsBlocks:()=>$t,__unstableGetVisibleBlocks:()=>Ut,__unstableHasActiveBlockOverlayActive:()=>jt,__unstableIsFullySelected:()=>Ne,__unstableIsLastBlockChangeIgnored:()=>Pt,__unstableIsSelectionCollapsed:()=>Pe,__unstableIsSelectionMergeable:()=>Le,__unstableIsWithinBlockOverlay:()=>Kt,__unstableSelectionHasUnmergeableBlock:()=>Me,areInnerBlocksControlled:()=>Ft,canEditBlock:()=>ct,canInsertBlockType:()=>ot,canInsertBlocks:()=>rt,canLockBlockType:()=>ut,canMoveBlock:()=>st,canMoveBlocks:()=>at,canRemoveBlock:()=>lt,canRemoveBlocks:()=>it,didAutomaticChange:()=>Ot,getAdjacentBlockClientId:()=>fe,getBlock:()=>j,getBlockAttributes:()=>$,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>De,getBlockInsertionPoint:()=>Qe,getBlockListSettings:()=>Bt,getBlockMode:()=>Ue,getBlockName:()=>U,getBlockOrder:()=>Ae,getBlockParents:()=>pe,getBlockParentsByBlockName:()=>me,getBlockRootClientId:()=>de,getBlockSelectionEnd:()=>ie,getBlockSelectionStart:()=>le,getBlockTransformItems:()=>vt,getBlocks:()=>q,getBlocksByClientId:()=>te,getClientIdsOfDescendants:()=>Z,getClientIdsWithDescendants:()=>X,getDraggedBlockClientIds:()=>je,getFirstMultiSelectedBlockClientId:()=>Ce,getGlobalBlockCount:()=>J,getInserterItems:()=>ft,getLastMultiSelectedBlockClientId:()=>Se,getLowestCommonAncestorWithSelectedBlock:()=>he,getMultiSelectedBlockClientIds:()=>ye,getMultiSelectedBlocks:()=>Ee,getMultiSelectedBlocksEndClientId:()=>Te,getMultiSelectedBlocksStartClientId:()=>xe,getNextBlockClientId:()=>be,getPreviousBlockClientId:()=>ve,getSelectedBlock:()=>ue,getSelectedBlockClientId:()=>ce,getSelectedBlockClientIds:()=>ke,getSelectedBlockCount:()=>se,getSelectedBlocksInitialCaretPosition:()=>_e,getSelectionEnd:()=>re,getSelectionStart:()=>oe,getSettings:()=>It,getTemplate:()=>Je,getTemplateLock:()=>et,hasBlockMovingClientId:()=>Dt,hasInserterItems:()=>bt,hasMultiSelection:()=>Ve,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>ze,isAncestorBeingDragged:()=>qe,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>Ke,isBlockHighlighted:()=>zt,isBlockInsertionPointVisible:()=>Ze,isBlockMultiSelected:()=>Be,isBlockSelected:()=>Oe,isBlockValid:()=>W,isBlockVisible:()=>Gt,isBlockWithinSelection:()=>Fe,isCaretWithinFormattedText:()=>Ye,isDraggingBlocks:()=>$e,isFirstMultiSelectedBlock:()=>we,isLastBlockChangePersistent:()=>xt,isMultiSelecting:()=>He,isNavigationMode:()=>Rt,isSelectionEnabled:()=>Ge,isTyping:()=>We,isValidTemplate:()=>Xe,wasBlockJustInserted:()=>Ht});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:()=>xn,__unstableExpandSelection:()=>Nn,__unstableMarkAutomaticChange:()=>Yn,__unstableMarkLastChangeAsPersistent:()=>Kn,__unstableMarkNextChangeAsNotPersistent:()=>qn,__unstableSaveReusableBlock:()=>jn,__unstableSetEditorMode:()=>Zn,__unstableSetTemporarilyEditingAsBlocks:()=>io,__unstableSplitSelection:()=>Tn,clearSelectedBlock:()=>dn,duplicateBlocks:()=>Jn,enterFormattedText:()=>Vn,exitFormattedText:()=>Hn,flashBlock:()=>oo,hideInsertionPoint:()=>wn,insertAfterBlock:()=>to,insertBeforeBlock:()=>eo,insertBlock:()=>En,insertBlocks:()=>Cn,insertDefaultBlock:()=>Un,mergeBlocks:()=>Pn,moveBlockToPosition:()=>yn,moveBlocksDown:()=>vn,moveBlocksToPosition:()=>kn,moveBlocksUp:()=>bn,multiSelect:()=>un,receiveBlocks:()=>tn,removeBlock:()=>Ln,removeBlocks:()=>Mn,replaceBlock:()=>hn,replaceBlocks:()=>gn,replaceInnerBlocks:()=>Rn,resetBlocks:()=>Xt,resetSelection:()=>en,selectBlock:()=>rn,selectNextBlock:()=>sn,selectPreviousBlock:()=>ln,selectionChange:()=>Gn,setBlockMovingClientId:()=>Xn,setBlockVisibility:()=>lo,setHasControlledInnerBlocks:()=>ro,setNavigationMode:()=>Qn,setTemplateValidity:()=>Bn,showInsertionPoint:()=>Sn,startDraggingBlocks:()=>zn,startMultiSelect:()=>an,startTyping:()=>Dn,stopDraggingBlocks:()=>Fn,stopMultiSelect:()=>cn,stopTyping:()=>On,synchronizeTemplate:()=>In,toggleBlockHighlight:()=>no,toggleBlockMode:()=>An,toggleSelection:()=>pn,updateBlock:()=>on,updateBlockAttributes:()=>nn,updateBlockListSettings:()=>Wn,updateSettings:()=>$n,validateBlocksToTemplate:()=>Jt});const r=window.wp.blocks,l=window.wp.hooks;function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i.apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));const s=window.wp.element;var a=n(4403),c=n.n(a);const u=window.wp.compose,d=window.wp.data,p=window.lodash,m=window.wp.components,g={default:(0,m.createSlotFill)("BlockControls"),block:(0,m.createSlotFill)("BlockControlsBlock"),inline:(0,m.createSlotFill)("BlockFormatControls"),other:(0,m.createSlotFill)("BlockControlsOther"),parent:(0,m.createSlotFill)("BlockControlsParent")},h=window.wp.i18n,f={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalClearBlockSelection:!0,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,generateAnchors:!1,gradients:[{name:(0,h.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,h.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,h.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,h.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,h.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,h.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,h.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,h.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,p.castArray)(t),...e.slice(n)]}function _(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}const k=e=>e;function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,y(r,o))})),n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},E(n.innerBlocks,n.clientId))),{})}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function S(e){return C(e,(e=>(0,p.omit)(e,"attributes")))}function w(e){return C(e,(e=>e.attributes))}function B(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,p.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,p.isEqual)(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function I(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const T=(0,u.pipe)(d.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,p.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(o,{...(0,p.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,p.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.entries(o.attributes).filter((e=>{let[t,r]=e;return"core/block"===o.byClientId[t].name&&r.ref===n.updatedId})).map((e=>{let[t]=e;return t}));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,p.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})},l.tree={...l.tree,...(0,p.reduce)(o,((e,n,o)=>{const r=`controlled||${o}`;return t.tree[r]&&(e[r]=t.tree[r]),e}),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:S(n.blocks),attributes:w(n.blocks),order:y(n.blocks),parents:E(n.blocks),controlledInnerBlocks:{}},o=I(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!B(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,p.omit)(t.updates,"attributes");return(0,p.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,p.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,p.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...w(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,p.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,p.omit)(e,t.replacedClientIds),...w(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,p.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=y(t.blocks);return{...e,...(0,p.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=y(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{var n,o;const{fromRootClientId:r="",toRootClientId:l="",clientIds:i}=t,{index:s=e[l].length}=t;if(r===l){const t=e[l].indexOf(i[0]);return{...e,[l]:_(e[l],t,s,i.length)}}return{...e,[r]:null!==(n=null===(o=e[r])||void 0===o?void 0:o.filter((e=>!i.includes(e))))&&void 0!==n?n:[],[l]:b(e[l],i,s)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e[o];if(!l.length||r===l[0])return e;const i=l.indexOf(r);return{...e,[o]:_(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e[o];if(!i.length||l===i[i.length-1])return e;const s=i.indexOf(r);return{...e,[o]:_(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=y(t.blocks);return(0,u.pipe)([e=>(0,p.omit)(e,t.replacedClientIds),e=>({...e,...(0,p.omit)(o,"")}),e=>(0,p.mapValues)(e,(e=>(0,p.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.pipe)([e=>(0,p.omit)(e,t.removedClientIds),e=>(0,p.mapValues)(e,(e=>{var n;return null!==(n=null==e?void 0:e.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==n?n:[]}))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...E(t.blocks)};case"INSERT_BLOCKS":return{...e,...E(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,p.omit)(e,t.replacedClientIds),...E(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,p.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function N(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const P=(0,d.combineReducers)({blocks:T,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:N(r.selectionStart,l),selectionEnd:N(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,p.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,p.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,p.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:r,operation:l}=t,i={rootClientId:n,index:o,__unstableWithInserter:r,operation:l};return(0,p.isEqual)(e,i)?e:i}case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,d.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},editorMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"edit",t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"SET_BLOCK_VISIBILITY":case"START_TYPING":case"STOP_TYPING":case"UPDATE_BLOCK_LIST_SETTINGS":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t},temporarilyEditingAsBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});var M={};function L(e){return[e]}function R(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function A(e,t){var n,o=t||L;function r(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(M)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(M,l)),s.get(M)}function l(){n=new WeakMap}function i(){var t,n,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for((t=r(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!R(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(R(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=l,l(),i}const D=window.wp.primitives,O=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),z=window.wp.richText,F=window.wp.deprecated;var V=n.n(F);function H(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const G=[];function U(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function W(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function $(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function j(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const K=A(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:$(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function q(e,t){var n;const o=t&&Ft(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||G}const Y=A(((e,t)=>({clientId:t,innerBlocks:Q(e,t)})),(e=>[e.blocks.order])),Q=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,p.map)(Ae(e,t),(t=>Y(e,t)))}),(e=>[e.blocks.order])),Z=A(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...Z(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Ae(e))t.push(n,...Z(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(e);return t?(0,p.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=A(((e,t)=>{if(!t)return G;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:G}),(e=>[e.blocks.order,e.blocks.byClientId])),te=A(((e,t)=>(0,p.map)((0,p.castArray)(t),(t=>j(e,t)))),((e,t)=>(0,p.map)((0,p.castArray)(t),(t=>e.blocks.tree[t]))));function ne(e,t){return Ae(e,t).length}function oe(e){return e.selection.selectionStart}function re(e){return e.selection.selectionEnd}function le(e){return e.selection.selectionStart.clientId}function ie(e){return e.selection.selectionEnd.clientId}function se(e){return ye(e).length||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ue(e){const t=ce(e);return t?j(e,t):null}function de(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const pe=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),me=A((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=pe(e,t,o);return(0,p.map)((0,p.filter)((0,p.map)(r,(t=>({id:t,name:U(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ge(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function he(e,t){const n=ce(e),o=[...pe(e,t),t],r=[...pe(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(e)),!t)return null;const o=de(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function ve(e,t){return fe(e,t,-1)}function be(e,t){return fe(e,t,1)}function _e(e){return e.initialPosition}const ke=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return G;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return G;const r=Ae(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?G:ke(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>j(e,t))):G}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ce(e){return ye(e)[0]||null}function Se(e){const t=ye(e);return t[t.length-1]||null}function we(e,t){return Ce(e)===t}function Be(e,t){return-1!==ye(e).indexOf(t)}const Ie=A(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=de(e,n),o=Be(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ne(e){const t=oe(e),n=re(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pe(e){const t=oe(e),n=re(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Me(e){return ke(e).some((t=>{const n=U(e,t);return!(0,r.getBlockType)(n).merge}))}function Le(e,t){const n=oe(e),o=re(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=de(e,n.clientId);if(l!==de(e,o.clientId))return!1;const i=Ae(e,l);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=U(e,c);if(!(0,r.getBlockType)(d).merge)return!1;const p=j(e,u);if(p.name===d)return!0;const m=(0,r.switchToBlockType)(p,d);return m&&m.length}const Re=e=>{const t=oe(e),n=re(e);if(t.clientId===n.clientId)return G;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return G;const o=de(e,t.clientId);if(o!==de(e,n.clientId))return G;const l=Ae(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=j(e,a.clientId),d=(0,r.getBlockType)(u.name),p=j(e,c.clientId),m=(0,r.getBlockType)(p.name),g=u.attributes[a.attributeKey],h=p.attributes[c.attributeKey],f=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:g,...H(f)}),_=(0,z.create)({html:h,...H(v)});return b=(0,z.remove)(b,0,a.offset),_=(0,z.remove)(_,c.offset,_.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,z.toHTMLString)({value:b,...H(f)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:_,...H(v)})}}]};function Ae(e,t){return e.blocks.order[t||""]||G}function De(e,t){return Ae(e,de(e,t)).indexOf(t)}function Oe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,p.some)(Ae(e,t),(t=>Oe(e,t)||Be(e,t)||n&&ze(e,t,n)))}function Fe(e,t){if(!t)return!1;const n=ye(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function He(e){return e.isMultiSelecting}function Ge(e){return e.isSelectionEnabled}function Ue(e,t){return e.blocksMode[t]||"visual"}function We(e){return e.isTyping}function $e(e){return!!e.draggedBlocks.length}function je(e){return e.draggedBlocks}function Ke(e,t){return e.draggedBlocks.includes(t)}function qe(e,t){if(!$e(e))return!1;const n=pe(e,t);return(0,p.some)(n,(t=>Ke(e,t)))}function Ye(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=de(e,l)||void 0,n=De(e,r.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Xe(e){return e.template.isValid}function Je(e){return e.settings.template}function et(e,t){if(!t)return e.settings.templateLock;const n=Bt(e,t);return n?n.templateLock:void 0}const tt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},nt=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=It(e),s=tt(i,t,!0);if(!s)return!1;const a=!!et(e,o);if(a)return!1;const c=Bt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=tt(u,t),m=n.parent,g=U(e,o),h=tt(m,g);let f=!0;const v=n.ancestor;if(v){const t=[o,...pe(e,o)];f=(0,p.some)(t,(t=>tt(v,U(e,t))))}const b=f&&(null===d&&null===h||!0===d||!0===h);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:j.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):b},ot=A(nt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,U(e,t),n)))}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return!0;const{lock:r}=o,l=!!et(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>lt(e,t,n)))}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return;const{lock:r}=o,l="all"===et(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function at(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>st(e,t,n)))}function ct(e,t){const n=$(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ut(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function dt(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const pt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&nt(e,t.name,n),mt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=dt(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:gt(r,l)}},gt=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},ht=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,p.some)(te(e,X(e)),{name:t.name}));const{time:i,count:s=0}=dt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:gt(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},ft=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=ht(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=O;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=dt(e,l)||{},c=gt(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>pt(e,n,t))).map(n),a=nt(e,"core/block",t)?Lt(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=mt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),vt=A((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=(0,p.castArray)(t),[i]=l,s=ht(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>pt(e,t,o))).map(s),c=Object.fromEntries(Object.entries(a).map((e=>{let[,t]=e;return[t.name,t]})));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const u=(0,r.getPossibleBlockTransformations)(l).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,p.orderBy)(u,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),bt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,p.some)((0,r.getBlockTypes)(),(n=>pt(e,n,t)));if(n)return!0;const o=nt(e,"core/block",t)&&Lt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),_t=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,p.filter)((0,r.getBlockTypes)(),(n=>pt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),kt=A((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(j(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),yt=A(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Et=A((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=It(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return yt(e,n)})),r=o.filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!tt(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return r}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Ct=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Et(e),o=(0,p.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return ot(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),St=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;const o=Ct(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...Ct.getDependants(e,t)])),wt=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ft(e,n)})))return G;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return St(e,o,n)}),((e,t)=>[...St.getDependants(e,t)]));function Bt(e,t){return e.blockListSettings[t]}function It(e){return e.settings}function xt(e){return e.blocks.isPersistentChange}const Tt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Nt=A(((e,t)=>{var n;const o=(0,p.find)(Lt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Lt(e)]));function Pt(e){return e.blocks.isIgnoredChange}function Mt(e){return e.lastBlockAttributesChange}function Lt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:G}function Rt(e){return"navigation"===e.editorMode}function At(e){return e.editorMode}function Dt(e){return e.hasBlockMovingClientId}function Ot(e){return!!e.automaticChangeStatus}function zt(e,t){return e.highlightedBlock===t}function Ft(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Vt=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(U(e,n)))return n;const o=ye(e),r=me(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ht(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Gt(e,t){var n,o;return null===(n=null===(o=e.blockVisibility)||void 0===o?void 0:o[t])||void 0===n||n}const Ut=A((e=>new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])))),(e=>[e.blockVisibility])),Wt=A(((e,t)=>{let n,o=t;for(;e.blocks.parents[o];)o=e.blocks.parents[o],"contentOnly"===et(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function $t(e){return e.temporarilyEditingAsBlocks}function jt(e,t){if(!ct(e,t))return!0;const n=At(e);if("zoom-out"===n&&t&&!de(e,t))return!0;const o=(0,r.hasBlockSupport)(U(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Ft(e,t))&&!Oe(e,t)&&!ze(e,t,!0)}function Kt(e,t){let n=e.blocks.parents[t];for(;n;){if(jt(e,n))return!0;n=e.blocks.parents[n]}return!1}const qt=window.wp.a11y,Yt="";function Qt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Yt)}))}const Zt=e=>Array.isArray(e)?e:[e],Xt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Jt(e))},Jt=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function en(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function tn(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function nn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Zt(e),attributes:t,uniqueByBlock:n}}function on(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function rn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const ln=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},sn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function an(){return{type:"START_MULTI_SELECT"}}function cn(){return{type:"STOP_MULTI_SELECT"}}const un=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,qt.speak)((0,h.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
+
(0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function dn(){return{type:"CLEAR_SELECTED_BLOCK"}}function pn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function mn(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const gn=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=Zt(e),t=mn(Zt(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function hn(e,t){return gn(e,t)}const fn=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:Zt(t),rootClientId:n})},vn=fn("MOVE_BLOCKS_DOWN"),bn=fn("MOVE_BLOCKS_UP"),kn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function yn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return kn([e],t,n,o)}function En(e,t,n,o,r){return Cn([e],t,n,o,0,r)}const Cn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;null!==r&&"object"==typeof r&&(l=r,r=0,V()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=mn(Zt(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function Sn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o,operation:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r}}const wn=()=>e=>{let{select:t,dispatch:n}=e;t.isBlockInsertionPointVisible()&&n({type:"HIDE_INSERTION_POINT"})};function Bn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const In=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},xn=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(u=s,d=i):(u=i,d=s);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,r.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,r.getBlockType)(v.name),_=o.getBlock(f.clientId),k=(0,r.getBlockType)(_.name),y=v.attributes[h.attributeKey],E=_.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=k.attributes[f.attributeKey];let w=(0,z.create)({html:y,...H(C)}),B=(0,z.create)({html:E,...H(S)});w=(0,z.remove)(w,h.offset,w.text.length),B=(0,z.insert)(B,Yt,0,f.offset);const I=(0,r.cloneBlock)(v,{[h.attributeKey]:(0,z.toHTMLString)({value:w,...H(C)})}),x=(0,r.cloneBlock)(_,{[f.attributeKey]:(0,z.toHTMLString)({value:B,...H(S)})}),T=e?I:x,N=v.name===_.name?[T]:(0,r.switchToBlockType)(T,g.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=g.merge(e.attributes,x.attributes)}else{const e=N.shift();P=g.merge(I.attributes,e.attributes)}const M=Qt(P),L=P[M],R=(0,z.create)({html:L,...H(g.attributes[M])}),A=R.text.indexOf(Yt),D=(0,z.remove)(R,A,A+1),O=(0,z.toHTMLString)({value:D,...H(g.attributes[M])});P[M]=O;const F=o.getSelectedBlockClientIds(),V=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{l.selectionChange(m.clientId,M,A,A),l.replaceBlocks(F,V,0,o.getSelectedBlocksInitialCaretPosition())}))},Tn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,r.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],_=h.attributes[d.attributeKey];let k=(0,z.create)({html:f,...H(b)}),y=(0,z.create)({html:v,...H(_)});k=(0,z.remove)(k,u.offset,k.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:k,...H(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...H(_)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Nn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},Pn=(e,t)=>n=>{let{registry:o,select:l,dispatch:i}=n;const s=[e,t];i({type:"MERGE_BLOCKS",blocks:s});const[a,c]=s,u=l.getBlock(a),d=(0,r.getBlockType)(u.name);if(!d)return;const p=l.getBlock(c);if(d&&!d.merge){const e=(0,r.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void i.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void i.selectBlock(u.clientId):void o.batch((()=>{i.insertBlocks(t.innerBlocks,void 0,a),i.removeBlock(c),i.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,r.getBlockType)(p.name),{clientId:g,attributeKey:h,offset:f}=l.getSelectionStart(),v=(g===a?d:m).attributes[h],b=(g===a||g===c)&&void 0!==h&&void 0!==f&&!!v;v||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const _=(0,r.cloneBlock)(u),k=(0,r.cloneBlock)(p);if(b){const e=g===a?_:k,t=e.attributes[h],n=(0,z.insert)((0,z.create)({html:t,...H(v)}),Yt,f,f);e.attributes[h]=(0,z.toHTMLString)({value:n,...H(v)})}const y=u.name===p.name?[k]:(0,r.switchToBlockType)(k,u.name);if(!y||!y.length)return;const E=d.merge(_.attributes,y[0].attributes);if(b){const e=Qt(E),t=E[e],n=(0,z.create)({html:t,...H(d.attributes[e])}),o=n.text.indexOf(Yt),r=(0,z.remove)(n,o,o+1),l=(0,z.toHTMLString)({value:r,...H(d.attributes[e])});E[e]=l,i.selectionChange(u.clientId,e,o,o)}i.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},Mn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=Zt(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function Ln(e,t){return Mn([e],t)}function Rn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function An(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Dn(){return{type:"START_TYPING"}}function On(){return{type:"STOP_TYPING"}}function zn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Fn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Vn(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Hn(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Gn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Un=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function Wn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function $n(e){return{type:"UPDATE_SETTINGS",settings:e}}function jn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Kn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function qn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Yn=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Qn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},Zn=e=>t=>{let{dispatch:n,select:o}=t;if("zoom-out"===e){const e=o.getBlockSelectionStart();e&&n.selectBlock(o.getBlockHierarchyRootClientId(e))}n({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,qt.speak)((0,h.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,qt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,qt.speak)((0,h.__)("You are currently in zoom-out mode."))},Xn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,qt.speak)((0,h.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},Jn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if(i.some((e=>!e)))return;const s=i.map((e=>e.name));if(s.some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const a=o.getBlockRootClientId(e[0]),c=Zt(e),u=o.getBlockIndex(c[c.length-1]),d=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(d,u+1,a,t),d.length>1&&t&&l.multiSelect(d[0].clientId,d[d.length-1].clientId),d.map((e=>e.clientId))}},eo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},to=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function no(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const oo=e=>async t=>{let{dispatch:n}=t;n(no(e,!0)),await new Promise((e=>setTimeout(e,150))),n(no(e,!1))};function ro(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function lo(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function io(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const so="core/block-editor",ao={reducer:P,selectors:e,actions:t},co=(0,d.createReduxStore)(so,{...ao,persist:["preferences"]});(0,d.registerStore)(so,{...ao,persist:["preferences"]});const uo={name:"",isSelected:!1},po=(0,s.createContext)(uo),{Provider:mo}=po;function go(){return(0,s.useContext)(po)}function ho(){const{isSelected:e,clientId:t,name:n}=go();return(0,d.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(co);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function fo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=ho(),{clientId:o}=go(),l=(0,d.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(co),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:l?g.parent.Fill:null}(t,l);return i?(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(i,null,(e=>{const r=(0,p.isEmpty)(e)?null:e;return(0,s.createElement)(m.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(m.ToolbarGroup,{controls:n}),o)}))):null}function vo(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(m.__experimentalToolbarContext),r=g[t].Slot,l=(0,m.__experimentalUseSlotFills)(r.__unstableName);return Boolean(l&&l.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const bo=fo;bo.Slot=vo;const _o=e=>(0,s.createElement)(fo,i({group:"inline"},e));_o.Slot=e=>(0,s.createElement)(vo,i({group:"inline"},e));const ko=bo,yo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),Eo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),Co=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),So=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),wo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})),Bo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"}));function Io(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function xo(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${Io(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function To(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
o.none=(0,h.sprintf)((0,h.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
+
o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n)),o}const No=(0,s.createContext)({refs:new Map,callbacks:new Map});function Po(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(No.Provider,{value:n},t)}function Mo(e){const{refs:t,callbacks:n}=(0,s.useContext)(No),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,u.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function Lo(e){const{refs:t}=(0,s.useContext)(No),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Ro(e){const{callbacks:t}=(0,s.useContext)(No),n=Lo(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function Ao(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function Do(e,t){if(!Ao(e))return e;const n=zo(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}function Oo(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function zo(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}const Fo={all:(0,h.__)("All sides"),top:(0,h.__)("Top"),bottom:(0,h.__)("Bottom"),left:(0,h.__)("Left"),right:(0,h.__)("Right"),mixed:(0,h.__)("Mixed"),vertical:(0,h.__)("Vertical"),horizontal:(0,h.__)("Horizontal")},Vo={top:void 0,right:void 0,bottom:void 0,left:void 0},Ho=["top","right","bottom","left"];function Go(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function Uo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ho;return Object.values(e).length>=1&&Object.values(e).length<t.length||new Set(Object.values(e)).size>1}function Wo(e){return null!=e&&!(0,p.isEmpty)(Object.values(e).filter((e=>!!e)))}const $o=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"})),jo=["color","border","typography","spacing"],Ko={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},qo={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function Yo(e){const{name:t,clientId:n}=go();return(0,d.useSelect)((o=>{if(jo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>qo[e]||e)(e),s=[n,...o(co).getBlockParents(n,!0)];for(const e of s){const n=o(co).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var a;const n=o(co).getBlockAttributes(e);if(l=null!==(a=(0,p.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==a?a:(0,p.get)(n,`settings.${i}`),void 0!==l)break}}const c=o(co).getSettings();if(void 0===l){var u;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;l=null!==(u=(0,p.get)(c,n))&&void 0!==u?u:(0,p.get)(c,e)}var d,m;if(void 0!==l)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(m=l.custom)&&void 0!==m?m:l.theme)&&void 0!==d?d:l.default:l;const g=Ko[i]?Ko[i](c):void 0;return void 0!==g?g:"typography.dropCap"===i||void 0}),[t,n,e])}const Qo={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1}};function Zo(e){var t,n,o,r,l;let{spacingSizes:i,value:a,side:u,onChange:p,isMixed:g=!1,type:f,minimumCustomValue:v}=e;a=function(e,t){if(Ao(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(a,i);let b=i;const _=i.length<=8,k=(0,d.useSelect)((e=>{const t=e(co).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[y,E]=(0,s.useState)(!k&&void 0!==a&&!Ao(a)),C=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"]});let S=null;_||y||void 0===a||!(!Ao(a)||Ao(a)&&g)?g||(S=y?Do(a,i):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":zo(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(a,i)):(b=[...i,{name:g?(0,h.__)("Mixed"):// translators: A custom measurement, eg. a number followed by a unit like 12px.
|
8 |
+
(0,h.sprintf)((0,h.__)("Custom (%s)"),a),slug:"custom",size:a}],S=b.length-1);const w=(0,s.useMemo)((()=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(S)),[S])[1]||C[0].value,B=e=>{var t;return void 0===a||null===(t=i[e])||void 0===t?void 0:t.name},I=parseFloat(S,10),x=(e,t)=>{var n;const o=parseInt(e,10);if("selectList"===t){if(0===o)return;if(1===o)return"0"}else if(0===o)return"0";return`var:preset|spacing|${null===(n=i[e])||void 0===n?void 0:n.slug}`},T=g?(0,h.__)("Mixed"):null,N=g?(0,h.__)("Mixed"):B(S),P=b.map(((e,t)=>({key:t,name:e.name}))),M=i.map(((e,t)=>({value:t,label:void 0}))),L=(0,h.sprintf)(// translators: 1: The side of the block being modified (top, bottom, left, etc.). 2. Type of spacing being modified (Padding, margin, etc)
|
9 |
+
(0,h.__)("%1$s %2$s"),Fo[u],null==f?void 0:f.toLowerCase()),R=_&&!y&&void 0!==N;return(0,s.createElement)(s.Fragment,null,"all"!==u&&(0,s.createElement)(m.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,s.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__side-label"},Fo[u]),R&&(0,s.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},N)),"all"===u&&R&&(0,s.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},N),!k&&(0,s.createElement)(m.Button,{label:y?(0,h.__)("Use size preset"):(0,h.__)("Set custom size"),icon:$o,onClick:()=>{E(!y)},isPressed:y,isSmall:!0,className:c()({"components-spacing-sizes-control__custom-toggle-all":"all"===u,"components-spacing-sizes-control__custom-toggle-single":"all"!==u}),iconSize:24}),y&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.__experimentalUnitControl,{onChange:e=>p((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:S,units:C,min:v,placeholder:T,disableUnits:g,label:L,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",style:{gridColumn:"1"},size:"__unstable-large"}),(0,s.createElement)(m.RangeControl,{value:I,min:0,max:null!==(t=null===(n=Qo[w])||void 0===n?void 0:n.max)&&void 0!==t?t:10,step:null!==(o=null===(r=Qo[w])||void 0===r?void 0:r.steps)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{p([e,w].join(""))},className:"components-spacing-sizes-control__custom-value-range"})),_&&!y&&(0,s.createElement)(m.RangeControl,{className:"components-spacing-sizes-control__range-control",value:S,onChange:e=>p(x(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===a&&p("0")},withInputField:!1,"aria-valuenow":S,"aria-valuetext":null===(l=i[S])||void 0===l?void 0:l.name,renderTooltipContent:B,min:0,max:i.length-1,marks:M,label:L,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),!_&&!y&&(0,s.createElement)(m.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:P.find((e=>e.key===S))||"",onChange:e=>{p(x(e.selectedItem.key,"selectList"))},options:P,label:L,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large"}))}function Xo(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Go(Object.values(e))}(n),c=Wo(n)&&Uo(n,o);return(0,s.createElement)(Zo,{value:a,onChange:e=>{const r=(0,m.__experimentalApplyValueToSides)(n,e,o);t(r)},side:"all",spacingSizes:r,isMixed:c,type:l,minimumCustomValue:i})}function Jo(e){let{values:t,sides:n,onChange:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const a=null!=n&&n.length?Ho.filter((e=>n.includes(e))):Ho,c=e=>n=>{const r={...t};r[e]=n,o(r)};return(0,s.createElement)(s.Fragment,null,a.map((e=>(0,s.createElement)(Zo,{value:t[e],label:Fo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:c(e),spacingSizes:r,type:l,minimumCustomValue:i}))))}const er=["vertical","horizontal"];function tr(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const a=e=>o=>{if(!t)return;const r={...n};"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},c=null!=o&&o.length?er.filter((e=>o.includes(e))):er;return(0,s.createElement)(s.Fragment,null,c.map((e=>{const t="vertical"===e?n.top:n.left;return(0,s.createElement)(Zo,{value:t,onChange:a(e),label:Fo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:r,type:l,minimumCustomValue:i})})))}const nr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),or=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function rr(e){let{isLinked:t,onClick:n}=e;const o=t?(0,h.__)("Unlink sides"):(0,h.__)("Link sides");return(0,s.createElement)(m.Tooltip,{text:o},(0,s.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,s.createElement)(m.Button,{isSmall:!0,icon:t?nr:or,iconSize:24,"aria-label":o,onClick:n})))}function lr(e){let{inputProps:t,onChange:n,label:o=(0,h.__)("Spacing Control"),values:r,sides:l,splitOnAxis:a=!1,useSelect:u,minimumCustomValue:d=0}=e;const p=[{name:0,slug:"0",size:0},...Yo("spacing.spacingSizes")||[]];p.length>8&&p.unshift({name:(0,h.__)("Default"),slug:"default",size:void 0});const g=r||Vo,f=Wo(r),v=1===(null==l?void 0:l.length),[b,_]=(0,s.useState)(!f||!Uo(g,l)||v),k={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:b,sides:l,values:g,spacingSizes:p,useSelect:u,type:o,minimumCustomValue:d};return(0,s.createElement)("fieldset",{role:"region",className:c()("component-spacing-sizes-control",{"is-unlinked":!b})},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},o),!v&&(0,s.createElement)(rr,{onClick:()=>{_(!b)},isLinked:b}),b&&(0,s.createElement)(Xo,i({"aria-label":o},k)),!b&&a&&(0,s.createElement)(tr,k),!b&&!a&&(0,s.createElement)(Jo,k))}window.wp.warning;const ir={default:(0,m.createSlotFill)("InspectorControls"),advanced:(0,m.createSlotFill)("InspectorAdvancedControls"),border:(0,m.createSlotFill)("InspectorControlsBorder"),color:(0,m.createSlotFill)("InspectorControlsColor"),dimensions:(0,m.createSlotFill)("InspectorControlsDimensions"),typography:(0,m.createSlotFill)("InspectorControlsTypography")};function sr(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=ho(),l=null===(t=ir[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(l,null,(e=>{const t=(0,p.isEmpty)(e)?null:e;return(0,s.createElement)(m.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const ar=e=>e,cr=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,p.pickBy)((0,p.mapValues)(e,cr),ar);return(0,p.isEmpty)(t)?void 0:t};function ur(e,t,n){return(0,p.setWith)(e?(0,p.clone)(e):{},t,n,p.clone)}function dr(e,t,n,o,r,l){var i;if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return Object.entries(e).forEach((e=>{let[n,o]=e;o&&t[n].forEach((e=>{const t=(0,p.get)(s,e);t&&(c={...c,attributes:ur(c.attributes,e,t)})}))})),c}function pr(e,t,n){const o=(0,r.getBlockSupport)(e,t),l=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(l)?l.includes(n):l}function mr(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,d.useDispatch)(co),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,d.useSelect)(co),u=a(),p=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:cr(r.style)},t[n]=r})),r(n,t,!0)}),[cr,l,i,c,u,r]);return(0,s.createElement)(m.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:p,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function gr(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(m.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function hr(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=ir[n])||void 0===t?void 0:t.Slot,a=(0,m.__experimentalUseSlot)(null==l?void 0:l.__unstableName),c=(0,m.__experimentalUseSlotFills)(null==l?void 0:l.__unstableName);return l&&a?Boolean(c&&c.length)?o?(0,s.createElement)(mr,{group:n,label:o},(0,s.createElement)(gr,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const fr=sr;fr.Slot=hr;const vr=e=>(0,s.createElement)(sr,i({},e,{__experimentalGroup:"advanced"}));vr.Slot=e=>(0,s.createElement)(hr,i({},e,{__experimentalGroup:"advanced"})),vr.slotName="InspectorAdvancedControls";const br=fr,_r=window.wp.isShallowEqual;var kr=n.n(_r);const yr=function(e){return(0,u.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])},Er=Number.MAX_SAFE_INTEGER,Cr=(0,s.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:r,__unstableRefreshSize:l,__unstableCoverTarget:a=!1,__unstablePopoverSlot:d,__unstableContentRef:p,shift:g=!0,...h}=e;const f=Ro(n),v=Ro(null!=o?o:n),b=(0,u.useMergeRefs)([t,yr(p)]),[_,k]=(0,s.useReducer)((e=>(e+1)%Er),0);(0,s.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(k);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]);const y=(0,s.useMemo)((()=>_<0||!f||v!==f?{}:{position:"absolute",width:f.offsetWidth,height:f.offsetHeight}),[f,v,l,_]),E=(0,s.useMemo)((()=>{if(!(_<0||!f||o&&!v))return{getBoundingClientRect(){var e,t,n,o;const r=f.getBoundingClientRect(),l=null==v?void 0:v.getBoundingClientRect(),i=Math.min(r.left,null!==(e=null==l?void 0:l.left)&&void 0!==e?e:1/0),s=Math.min(r.top,null!==(t=null==l?void 0:l.top)&&void 0!==t?t:1/0),a=Math.max(r.right,null!==(n=l.right)&&void 0!==n?n:-1/0)-i,c=Math.max(r.bottom,null!==(o=l.bottom)&&void 0!==o?o:-1/0)-s;return new window.DOMRect(i,s,a,c)},ownerDocument:f.ownerDocument}}),[o,v,f,_]);return!f||o&&!v?null:(0,s.createElement)(m.Popover,i({ref:b,animate:!1,focusOnMount:!1,anchor:E,__unstableSlotName:d||null,placement:"top-start",resize:!1,flip:!1,shift:g},h,{className:c()("block-editor-block-popover",h.className)}),a&&(0,s.createElement)("div",{style:y},r),!a&&r)}));function Sr(e){const t=(0,r.getBlockSupport)(e,Mr);return!!(!0===t||null!=t&&t.margin)}function wr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.margin"),n=!zr(e,"margin");return!Sr(e)||t||n}function Br(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Or(o,"margin"),u=c&&c.some((e=>Rr.includes(e)));if(wr(e))return null;const d=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};l({style:cr(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:d,label:(0,h.__)("Margin"),sides:c,units:a,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,s.createElement)(lr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.margin,onChange:d,label:(0,h.__)("Margin"),sides:c,units:a,allowReset:!1,splitOnAxis:!1})),native:null})}function Ir(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=Yo("spacing.spacingSizes"),a=(0,s.useMemo)((()=>{const e=null!=l&&l.top?Do(null==l?void 0:l.top,i):0,t=null!=l&&l.right?Do(null==l?void 0:l.right,i):0,n=null!=l&&l.bottom?Do(null==l?void 0:l.bottom,i):0,o=null!=l&&l.left?Do(null==l?void 0:l.left,i):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:0!==e?`calc(${e} * -1)`:0,right:0!==t?`calc(${t} * -1)`:0,bottom:0!==n?`calc(${n} * -1)`:0,left:0!==o?`calc(${o} * -1)`:0}}),[l]),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(l),p=(0,s.useRef)(),m=()=>{p.current&&window.clearTimeout(p.current)};return(0,s.useEffect)((()=>(kr()(l,d.current)||(u(!0),d.current=l,m(),p.current=setTimeout((()=>{u(!1)}),400)),()=>m())),[l]),c?(0,s.createElement)(Cr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l,shift:!1},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function xr(e){const t=(0,r.getBlockSupport)(e,Mr);return!!(!0===t||null!=t&&t.padding)}function Tr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.padding"),n=!zr(e,"padding");return!xr(e)||t||n}function Nr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Or(o,"padding"),u=c&&c.some((e=>Rr.includes(e)));if(Tr(e))return null;const d=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};l({style:cr(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:d,label:(0,h.__)("Padding"),sides:c,units:a,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,s.createElement)(lr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.padding,onChange:d,label:(0,h.__)("Padding"),sides:c,units:a,allowReset:!1,splitOnAxis:u})),native:null})}function Pr(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>({borderTopWidth:Ao(null==l?void 0:l.top)?Oo(null==l?void 0:l.top):null==l?void 0:l.top,borderRightWidth:Ao(null==l?void 0:l.right)?Oo(null==l?void 0:l.right):null==l?void 0:l.right,borderBottomWidth:Ao(null==l?void 0:l.bottom)?Oo(null==l?void 0:l.bottom):null==l?void 0:l.bottom,borderLeftWidth:Ao(null==l?void 0:l.left)?Oo(null==l?void 0:l.left):null==l?void 0:l.left})),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(kr()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(Cr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l,shift:!1},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const Mr="spacing",Lr=["top","right","bottom","left"],Rr=["vertical","horizontal"];function Ar(e){const t=Gr(e),n=Tr(e),o=wr(e),l=Dr(e),i=(u=e.name,"web"===s.Platform.OS&&(Fr(u)||xr(u)||Sr(u))),a=Yo("spacing.spacingSizes");var u;if(l||!i)return null;const d=(0,r.getBlockSupport)(e.name,[Mr,"__experimentalDefaultControls"]),p=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}},g=c()({"tools-panel-item-spacing":a&&a.length>0});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(br,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,h.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cr({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:p("padding"),isShownByDefault:null==d?void 0:d.padding,panelId:e.clientId},(0,s.createElement)(Nr,e)),!o&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,h.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cr({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:p("margin"),isShownByDefault:null==d?void 0:d.margin,panelId:e.clientId},(0,s.createElement)(Br,e)),!t&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,h.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:p("blockGap"),isShownByDefault:null==d?void 0:d.blockGap,panelId:e.clientId},(0,s.createElement)(Ur,e))),!n&&(0,s.createElement)(Pr,e),!o&&(0,s.createElement)(Ir,e))}const Dr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Gr(e),n=Tr(e),o=wr(e);return t&&n&&o};function Or(e,t){var n;const o=(0,r.getBlockSupport)(e,Mr);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function zr(e,t){const n=Or(e,t);return!(n&&n.some((e=>Lr.includes(e)))&&n.some((e=>Rr.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function Fr(e){const t=(0,r.getBlockSupport)(e,Mr);return!!(!0===t||null!=t&&t.blockGap)}function Vr(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function Hr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=Vr(e);if(!n)return null;const o=Oo(null==n?void 0:n.top)||t,r=Oo(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}function Gr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.blockGap");return!Fr(e)||t}function Ur(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Or(r,"blockGap"),u=Lo(n);if(Gr(e))return null;const d=c&&c.some((e=>Rr.includes(e))),p=e=>{var t;let n=e;e&&d?n={...Vr(e)}:null!=e&&e.hasOwnProperty("top")&&(n=e.top);const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:cr(r)});const i=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;u.current&&i&&(null===(s=u.current.parentNode)||void 0===s||s.replaceChild(u.current,u.current))},g=Vr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=d?{...g,right:null==g?void 0:g.left,bottom:null==g?void 0:g.top}:{top:null==g?void 0:g.top};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(d?(0,s.createElement)(m.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:p,units:a,sides:c,values:f,allowReset:!1,splitOnAxis:d}):(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:p,units:a,value:f})),(null==i?void 0:i.length)>0&&(0,s.createElement)(lr,{values:f,onChange:p,label:(0,h.__)("Block spacing"),sides:d?c:["top"],units:a,allowReset:!1,splitOnAxis:d})),native:null})}const Wr=(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),$r=(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),jr={top:{icon:(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:$r,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Wr,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},Kr=["top","center","bottom"],qr={isAlternate:!0},Yr=function(e){let{value:t,onChange:n,controls:o=Kr,isCollapsed:r=!0,isToolbar:l}=e;const a=jr[t],c=jr.top,u=l?m.ToolbarGroup:m.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{popoverProps:{POPOVER_PROPS:qr}};return(0,s.createElement)(u,i({icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...jr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},Qr=e=>(0,s.createElement)(Yr,i({},e,{isToolbar:!1})),Zr=e=>(0,s.createElement)(Yr,i({},e,{isToolbar:!0})),Xr={left:yo,center:Eo,right:Co,"space-between":So},Jr=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?Xr[r]:Xr.left,d=[{name:"left",icon:yo,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:Eo,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:Co,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:So,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],p=a?m.ToolbarGroup:m.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(p,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},el=e=>(0,s.createElement)(Jr,i({},e,{isToolbar:!1})),tl=e=>(0,s.createElement)(Jr,i({},e,{isToolbar:!0})),nl={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},ol={left:"flex-start",right:"flex-end",center:"center"},rl={top:"flex-start",center:"center",bottom:"flex-end"},ll=["wrap","nowrap"],il={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Flex,null,(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(al,{layout:t,onChange:n})),(0,s.createElement)(m.FlexItem,null,r&&(0,s.createElement)(ul,{layout:t,onChange:n}))),(0,s.createElement)(cl,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(al,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(sl,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!pr(i,"spacing","blockGap")?Hr(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=nl[r.justifyContent],p=ll.includes(r.flexWrap)?r.flexWrap:"wrap",m=rl[r.verticalAlignment],g=ol[r.justifyContent]||ol.left;let h="";const f=[];return p&&"wrap"!==p&&f.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&f.push(`align-items: ${m}`),d&&f.push(`justify-content: ${d}`)):(f.push("flex-direction: column"),f.push(`align-items: ${g}`)),f.length&&(h=`${Io(o)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),s&&u&&(h+=xo(o,a,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function sl(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=rl.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(Qr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(m.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function al(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(el,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:yo,label:(0,h.__)("Justify items left")},{value:"center",icon:Eo,label:(0,h.__)("Justify items center")},{value:"right",icon:Co,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:So,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(m.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function cl(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(m.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function ul(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,h.__)("Orientation")),(0,s.createElement)(m.Button,{label:(0,h.__)("Horizontal"),icon:wo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(m.Button,{label:(0,h.__)("Vertical"),icon:Bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}const dl={name:"default",label:(0,h.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:o,blockName:r,hasBlockGapSupport:l,layoutDefinitions:i}=e;const s=Hr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let a="";pr(r,"spacing","blockGap")||(null!=s&&s.top?a=Hr(null==s?void 0:s.top):"string"==typeof s&&(a=Hr(s)));let c="";return l&&a&&(c+=xo(n,i,"default",a)),c},getOrientation:()=>"vertical",getAlignments(e){const t=To(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},pl=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},ml=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),gl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),hl=window.wp.styleEngine,fl={name:"constrained",label:(0,h.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r,justifyContent:l="center"}=t,i=[{value:"left",icon:yo,label:(0,h.__)("Justify items left")},{value:"center",icon:Eo,label:(0,h.__)("Justify items center")},{value:"right",icon:Co,label:(0,h.__)("Justify items right")}],a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,s.createElement)(pl,{icon:ml})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,s.createElement)(pl,{icon:gl}))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")),(0,s.createElement)(m.__experimentalToggleGroupControl,{__experimentalIsBorderless:!0,label:(0,h.__)("Justification"),value:l,onChange:e=>{n({...t,justifyContent:e})}},i.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})}))))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r={},style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{contentSize:c,wideSize:u,justifyContent:d}=r,p=Hr(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap);let m="";pr(i,"spacing","blockGap")||(null!=p&&p.top?m=Hr(null==p?void 0:p.top):"string"==typeof p&&(m=Hr(p)));const g="left"===d?"0 !important":"auto !important",h="right"===d?"0 !important":"auto !important";let f=c||u?`\n\t\t\t\t\t${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: ${g};\n\t\t\t\t\t\tmargin-right: ${h};\n\t\t\t\t\t}\n\t\t\t\t\t${Io(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===d?f+=`${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${g}; }`:"right"===d&&(f+=`${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding&&(0,hl.getCSSRules)(l).forEach((e=>{"paddingRight"===e.key?f+=`\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(f+=`\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),s&&m&&(f+=xo(o,a,"constrained",m)),f},getOrientation:()=>"vertical",getAlignments(e){const t=To(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},vl=[dl,il,fl];function bl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return vl.find((t=>t.name===e))}const _l={type:"default"},kl=(0,s.createContext)(_l),yl=kl.Provider;function El(){return(0,s.useContext)(kl)}function Cl(e){let{layout:t={},css:n,...o}=e;const r=bl(t.type),l=null!==Yo("spacing.blockGap");if(r){var i;if(n)return(0,s.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,s.createElement)("style",null,e)}return null}const Sl=["none","left","center","right","wide","full"],wl=["wide","full"];function Bl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sl;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,d.useSelect)((e=>{const{getSettings:t}=e(co),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=El(),r=bl(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name&&"constrained"!==r.name)return[];const{alignments:i=Sl}=o,s=e.filter((e=>(o.alignments||t||!wl.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Il=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),xl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Tl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),Nl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),Pl={none:{icon:Il,title:(0,h._x)("None","Alignment option")},left:{icon:xl,title:(0,h.__)("Align left")},center:{icon:ml,title:(0,h.__)("Align center")},right:{icon:Tl,title:(0,h.__)("Align right")},wide:{icon:gl,title:(0,h.__)("Wide width")},full:{icon:Nl,title:(0,h.__)("Full width")}},Ml={isAlternate:!0},Ll=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Bl(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Pl[t],p=Pl.none,g=r?m.ToolbarGroup:m.ToolbarDropdownMenu,f={icon:d?d.icon:p.icon,label:(0,h.__)("Align")},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...Pl[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{toggleProps:{describedBy:(0,h.__)("Change alignment")},popoverProps:Ml,children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Pl[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(m.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(g,i({},f,v))},Rl=e=>(0,s.createElement)(Ll,i({},e,{isToolbar:!1})),Al=e=>(0,s.createElement)(Ll,i({},e,{isToolbar:!0})),Dl=["left","center","right","wide","full"],Ol=["wide","full"];function zl(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Dl.filter((t=>e.includes(t))):!0===e?[...Dl]:[],!o||!0===e&&!n?t.filter((e=>!Ol.includes(e))):t}const Fl=(0,u.createHigherOrderComponent)((e=>t=>{const n=(0,s.createElement)(e,t),{name:o}=t,l=Bl(zl((0,r.getBlockSupport)(o,"align"),(0,r.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),i=(0,d.useSelect)((e=>e(co).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return!l.length||i?n:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Rl,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:l})),n)}),"withToolbarControls"),Vl=(0,u.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Bl(zl((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Dl,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Vl),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Fl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return zl((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Hl=/[\s#]/g,Gl={type:"string",source:"attribute",attribute:"id",selector:"*"},Ul=(0,u.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(m.TextControl,{className:"html-anchor-control",label:(0,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(m.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(Hl,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(br,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(br,null,(0,s.createElement)(m.PanelBody,{title:(0,h.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Gl}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Ul),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Wl={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,l.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,r.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Wl}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const $l=(0,u.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(br,{__experimentalGroup:"advanced"},(0,s.createElement)(m.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",$l),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const jl=window.wp.dom,Kl=(0,s.createContext)({});function ql(e){let{value:t,children:n}=e;const o=(0,s.useContext)(Kl),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(Kl.Provider,{value:r,children:n})}const Yl=Kl,Ql={},Zl=(0,m.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(Yl),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,p.pick)(l,o.usesContext):Ql),[o,l]);if(!o)return null;const u=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(u,i({},e,{context:a}));const d=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(d,t.className,e.className);return(0,s.createElement)(u,i({},e,{context:a,className:m}))}));function Xl(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(mo,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(Zl,e))}const Jl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),ei=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:Jl,label:(0,h.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(m.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))};var ti=n(1973);function ni(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,jl.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(m.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}const oi=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(u=l(t),(0,p.castArray)(u).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var u;const d=(m=t.originalContent,g=a,(0,ti.Kx)(m,g).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,g;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(ni,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(ni,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:d,renderedContent:a}))},ri=e=>(0,r.rawHandler)({HTML:e.originalContent}),li=(0,u.compose)([(0,d.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(co).getBlock(n)}})),(0,d.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(co);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,ri(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),p=(0,s.useCallback)((()=>u(!1)),[]),g=(0,s.useMemo)((()=>[{
|
10 |
// translators: Button to fix block content
|
11 |
+
title:(0,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ei,{actions:[(0,s.createElement)(m.Button,{key:"recover",onClick:l,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:g},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(m.Modal,{title:// translators: Dialog title to fix block content
|
12 |
+
(0,h.__)("Resolve Block"),onRequestClose:p,className:"block-editor-block-compare"},(0,s.createElement)(oi,{block:i,onKeep:t,onConvert:n,convertor:ri,convertButtonText:(0,h.__)("Convert to Blocks")})))})),ii=(0,s.createElement)(ei,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),si=()=>ii;class ai extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const ci=ai;var ui=n(773);const di=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,d.useSelect)((e=>e(co).getBlock(t)),[t]),{updateBlock:i}=(0,d.useDispatch)(co);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(ui.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),[c]=n?(0,r.validateBlock)({...l,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let pi=xi();const mi=e=>Si(e,pi);let gi=xi();mi.write=e=>Si(e,gi);let hi=xi();mi.onStart=e=>Si(e,hi);let fi=xi();mi.onFrame=e=>Si(e,fi);let vi=xi();mi.onFinish=e=>Si(e,vi);let bi=[];mi.setTimeout=(e,t)=>{let n=mi.now()+t,o=()=>{let e=bi.findIndex((e=>e.cancel==o));~e&&bi.splice(e,1),Ei-=~e?1:0},r={time:n,handler:e,cancel:o};return bi.splice(_i(n),0,r),Ei+=1,wi(),r};let _i=e=>~(~bi.findIndex((t=>t.time>e))||~bi.length);mi.cancel=e=>{hi.delete(e),fi.delete(e),vi.delete(e),pi.delete(e),gi.delete(e)},mi.sync=e=>{Ci=!0,mi.batchedUpdates(e),Ci=!1},mi.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,mi.onStart(n)}return o.handler=e,o.cancel=()=>{hi.delete(n),t=null},o};let ki="undefined"!=typeof window?window.requestAnimationFrame:()=>{};mi.use=e=>ki=e,mi.now="undefined"!=typeof performance?()=>performance.now():Date.now,mi.batchedUpdates=e=>e(),mi.catch=console.error,mi.frameLoop="always",mi.advance=()=>{"demand"!==mi.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ii()};let yi=-1,Ei=0,Ci=!1;function Si(e,t){Ci?(t.delete(e),e(0)):(t.add(e),wi())}function wi(){yi<0&&(yi=0,"demand"!==mi.frameLoop&&ki(Bi))}function Bi(){~yi&&(ki(Bi),mi.batchedUpdates(Ii))}function Ii(){let e=yi;yi=mi.now();let t=_i(yi);t&&(Ti(bi.splice(0,t),(e=>e.handler())),Ei-=t),Ei?(hi.flush(),pi.flush(e?Math.min(64,yi-e):16.667),fi.flush(),gi.flush(),vi.flush()):yi=-1}function xi(){let e=new Set,t=e;return{add(n){Ei+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Ei-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Ei-=t.size,Ti(t,(t=>t(n)&&e.add(t))),Ei+=e.size,t=e)}}}function Ti(e,t){e.forEach((e=>{try{t(e)}catch(e){mi.catch(e)}}))}var Ni=n(9196),Pi=n.n(Ni);function Mi(){}const Li={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Ri(e,t){if(Li.arr(e)){if(!Li.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Ai=(e,t)=>e.forEach(t);function Di(e,t,n){if(Li.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Oi=e=>Li.und(e)?[]:Li.arr(e)?e:[e];function zi(e,t){if(e.size){const n=Array.from(e);e.clear(),Ai(n,t)}}const Fi=(e,...t)=>zi(e,(e=>e(...t))),Vi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Hi,Gi,Ui=null,Wi=!1,$i=Mi;var ji=Object.freeze({__proto__:null,get createStringInterpolator(){return Hi},get to(){return Gi},get colors(){return Ui},get skipAnimation(){return Wi},get willAdvance(){return $i},assign:e=>{e.to&&(Gi=e.to),e.now&&(mi.now=e.now),void 0!==e.colors&&(Ui=e.colors),null!=e.skipAnimation&&(Wi=e.skipAnimation),e.createStringInterpolator&&(Hi=e.createStringInterpolator),e.requestAnimationFrame&&mi.use(e.requestAnimationFrame),e.batchedUpdates&&(mi.batchedUpdates=e.batchedUpdates),e.willAdvance&&($i=e.willAdvance),e.frameLoop&&(mi.frameLoop=e.frameLoop)}});const Ki=new Set;let qi=[],Yi=[],Qi=0;const Zi={get idle(){return!Ki.size&&!qi.length},start(e){Qi>e.priority?(Ki.add(e),mi.onStart(Xi)):(Ji(e),mi(ts))},advance:ts,sort(e){if(Qi)mi.onFrame((()=>Zi.sort(e)));else{const t=qi.indexOf(e);~t&&(qi.splice(t,1),es(e))}},clear(){qi=[],Ki.clear()}};function Xi(){Ki.forEach(Ji),Ki.clear(),mi(ts)}function Ji(e){qi.includes(e)||es(e)}function es(e){qi.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(qi),0,e)}function ts(e){const t=Yi;for(let n=0;n<qi.length;n++){const o=qi[n];Qi=o.priority,o.idle||($i(o),o.advance(e),o.idle||t.push(o))}return Qi=0,Yi=qi,Yi.length=0,qi=t,qi.length>0}const ns="[-+]?\\d*\\.?\\d+",os=ns+"%";function rs(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const ls=new RegExp("rgb"+rs(ns,ns,ns)),is=new RegExp("rgba"+rs(ns,ns,ns,ns)),ss=new RegExp("hsl"+rs(ns,os,os)),as=new RegExp("hsla"+rs(ns,os,os,ns)),cs=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,us=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ds=/^#([0-9a-fA-F]{6})$/,ps=/^#([0-9a-fA-F]{8})$/;function ms(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function gs(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=ms(r,o,e+1/3),i=ms(r,o,e),s=ms(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function hs(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function fs(e){return(parseFloat(e)%360+360)%360/360}function vs(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function bs(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function _s(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ds.exec(e))?parseInt(t[1]+"ff",16)>>>0:Ui&&void 0!==Ui[e]?Ui[e]:(t=ls.exec(e))?(hs(t[1])<<24|hs(t[2])<<16|hs(t[3])<<8|255)>>>0:(t=is.exec(e))?(hs(t[1])<<24|hs(t[2])<<16|hs(t[3])<<8|vs(t[4]))>>>0:(t=cs.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ps.exec(e))?parseInt(t[1],16)>>>0:(t=us.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ss.exec(e))?(255|gs(fs(t[1]),bs(t[2]),bs(t[3])))>>>0:(t=as.exec(e))?(gs(fs(t[1]),bs(t[2]),bs(t[3]))|vs(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const ks=(e,t,n)=>{if(Li.fun(e))return e;if(Li.arr(e))return ks({range:e,output:t,extrapolate:n});if(Li.str(e.output[0]))return Hi(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function ys(){return ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ys.apply(this,arguments)}const Es=Symbol.for("FluidValue.get"),Cs=Symbol.for("FluidValue.observers"),Ss=e=>Boolean(e&&e[Es]),ws=e=>e&&e[Es]?e[Es]():e,Bs=e=>e[Cs]||null;function Is(e,t){let n=e[Cs];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class xs{constructor(e){if(this[Es]=void 0,this[Cs]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Ts(this,e)}}const Ts=(e,t)=>Ms(e,Es,t);function Ns(e,t){if(e[Es]){let n=e[Cs];n||Ms(e,Cs,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Ps(e,t){let n=e[Cs];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Cs]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Ms=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ls=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Rs=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,As=new RegExp(`(${Ls.source})(%|[a-z]+)`,"i"),Ds=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Os=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,zs=e=>{const[t,n]=Fs(e);if(!t||Vi())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&Os.test(n)?zs(n):n||e},Fs=e=>{const t=Os.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let Vs;const Hs=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Gs=e=>{Vs||(Vs=Ui?new RegExp(`(${Object.keys(Ui).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>ws(e).replace(Os,zs).replace(Rs,_s).replace(Vs,_s))),n=t.map((e=>e.match(Ls).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))),r=o.map((t=>ks(ys({},e,{output:t}))));return e=>{var n;const o=!As.test(t[0])&&(null==(n=t.find((e=>As.test(e))))?void 0:n.replace(Ls,""));let l=0;return t[0].replace(Ls,(()=>`${r[l++](e)}${o||""}`)).replace(Ds,Hs)}},Us="react-spring: ",Ws=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Us}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},$s=Ws(console.warn),js=Ws(console.warn);function Ks(e){return Li.str(e)&&("#"==e[0]||/\d/.test(e)||!Vi()&&Os.test(e)||e in(Ui||{}))}const qs=Vi()?Ni.useEffect:Ni.useLayoutEffect;function Ys(){const e=(0,Ni.useState)()[1],t=(()=>{const e=(0,Ni.useRef)(!1);return qs((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const Qs=e=>(0,Ni.useEffect)(e,Zs),Zs=[];function Xs(e){const t=(0,Ni.useRef)();return(0,Ni.useEffect)((()=>{t.current=e})),t.current}const Js=Symbol.for("Animated:node"),ea=e=>e&&e[Js],ta=(e,t)=>{return n=e,o=Js,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},na=e=>e&&e[Js]&&e[Js].getPayload();class oa{constructor(){this.payload=void 0,ta(this,this)}getPayload(){return this.payload||[]}}class ra extends oa{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,Li.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new ra(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Li.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Li.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class la extends ra{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=ks({output:[e,e]})}static create(e){return new la(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Li.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=ks({output:[this.getValue(),e]})),this._value=0,super.reset()}}const ia={dependencies:null};class sa extends oa{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Di(this.source,((n,o)=>{var r;(r=n)&&r[Js]===r?t[o]=n.getValue(e):Ss(n)?t[o]=ws(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Ai(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Di(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){ia.dependencies&&Ss(e)&&ia.dependencies.add(e);const t=na(e);t&&Ai(t,(e=>this.add(e)))}}class aa extends sa{constructor(e){super(e)}static create(e){return new aa(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(ca)),!0)}}function ca(e){return(Ks(e)?la:ra).create(e)}function ua(e){const t=ea(e);return t?t.constructor:Li.arr(e)?aa:Ks(e)?la:ra}function da(){return da=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},da.apply(this,arguments)}const pa=(e,t)=>{const n=!Li.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ni.forwardRef)(((o,r)=>{const l=(0,Ni.useRef)(null),i=n&&(0,Ni.useCallback)((e=>{l.current=function(e,t){return e&&(Li.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return ia.dependencies=n,e.style&&(e=da({},e,{style:t.createAnimatedStyle(e.style)})),e=new sa(e),ia.dependencies=null,[e,n]}(o,t),c=Ys(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new ma(u,a),p=(0,Ni.useRef)();qs((()=>(p.current=d,Ai(a,(e=>Ns(e,d))),()=>{p.current&&(Ai(p.current.deps,(e=>Ps(e,p.current))),mi.cancel(p.current.update))}))),(0,Ni.useEffect)(u,[]),Qs((()=>()=>{const e=p.current;Ai(e.deps,(t=>Ps(t,e)))}));const m=t.getComponentProps(s.getValue());return Ni.createElement(e,da({},m,{ref:i}))}))};class ma{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&mi.write(this.update)}}const ga=Symbol.for("AnimatedComponent"),ha=e=>Li.str(e)?e:e&&Li.str(e.displayName)?e.displayName:Li.fun(e)&&e.name||null;function fa(){return fa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},fa.apply(this,arguments)}function va(e,...t){return Li.fun(e)?e(...t):e}const ba=(e,t)=>!0===e||!!(t&&e&&(Li.fun(e)?e(t):Oi(e).includes(t))),_a=(e,t)=>Li.obj(e)?t&&e[t]:e,ka=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,ya=e=>e,Ea=(e,t=ya)=>{let n=Ca;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);Li.und(n)||(o[r]=n)}return o},Ca=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Sa={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function wa(e){const t=function(e){const t={};let n=0;if(Di(e,((e,o)=>{Sa[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Di(e,((e,o)=>o in t||(n[o]=e))),n}return fa({},e)}function Ba(e){return e=ws(e),Li.arr(e)?e.map(Ba):Ks(e)?ji.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ia(e){for(const t in e)return!0;return!1}function xa(e){return Li.fun(e)||Li.arr(e)&&Li.obj(e[0])}function Ta(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Na(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Pa=1.70158,Ma=1.525*Pa,La=Pa+1,Ra=2*Math.PI/3,Aa=2*Math.PI/4.5,Da=e=>{const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},Oa={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>La*e*e*e-Pa*e*e,easeOutBack:e=>1+La*Math.pow(e-1,3)+Pa*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-Ma)/2:(Math.pow(2*e-2,2)*((Ma+1)*(2*e-2)+Ma)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Ra),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Ra)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Aa)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Aa)/2+1,easeInBounce:e=>1-Da(1-e),easeOutBounce:Da,easeInOutBounce:e=>e<.5?(1-Da(1-2*e))/2:(1+Da(2*e-1))/2},za=fa({},{tension:170,friction:26},{mass:1,damping:1,easing:Oa.linear,clamp:!1});class Fa{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,za)}}function Va(e,t){if(Li.und(t.decay)){const n=!Li.und(t.tension)||!Li.und(t.friction);!n&&Li.und(t.frequency)&&Li.und(t.damping)&&Li.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Ha=[];class Ga{constructor(){this.changed=!1,this.values=Ha,this.toValues=null,this.fromValues=Ha,this.to=void 0,this.from=void 0,this.config=new Fa,this.immediate=!1}}function Ua(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=ba(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{Li.und(n.pause)||(r.paused=ba(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||ba(e,t)),c=va(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-mi.now()}function m(){c>0&&!ji.skipAnimation?(r.delayed=!0,u=mi.setTimeout(g,c),r.pauseQueue.add(p),r.timeouts.add(u)):g()}function g(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(fa({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Wa=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Ka(e.get()):t.every((e=>e.noop))?$a(e.get()):ja(e.get(),t.every((e=>e.finished))),$a=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),ja=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Ka=e=>({value:e,cancelled:!0,finished:!1});function qa(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=Ea(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&Ka(o)||r!==n.asyncId&&ja(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new Qa,i=new Za;return(async()=>{if(ji.skipAnimation)throw Ya(n),i.result=ja(o,!1),d(i),i;m(l);const s=Li.obj(e)?fa({},e):fa({},t,{to:e});s.parentId=r,Di(c,((e,t)=>{Li.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(ji.skipAnimation)return Ya(n),ja(o,!1);try{let t;t=Li.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=ja(o.get(),!0,!1)}catch(e){if(e instanceof Qa)h=e.result;else{if(!(e instanceof Za))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Li.fun(i)&&mi.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function Ya(e,t){zi(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Qa extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class Za extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Xa=e=>e instanceof ec;let Ja=1;class ec extends xs{constructor(...e){super(...e),this.id=Ja++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=ea(this);return e&&e.getValue()}to(...e){return ji.to(this,e)}interpolate(...e){return $s(`${Us}The "interpolate" function is deprecated in v9 (use "to" instead)`),ji.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Is(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Zi.sort(this),Is(this,{type:"priority",parent:this,priority:e})}}const tc=Symbol.for("SpringPhase"),nc=e=>(1&e[tc])>0,oc=e=>(2&e[tc])>0,rc=e=>(4&e[tc])>0,lc=(e,t)=>t?e[tc]|=3:e[tc]&=-3,ic=(e,t)=>t?e[tc]|=4:e[tc]&=-5;class sc extends ec{constructor(e,t){if(super(),this.key=void 0,this.animation=new Ga,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Li.und(e)||!Li.und(t)){const n=Li.obj(e)?fa({},e):fa({},t,{from:e});Li.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(oc(this)||this._state.asyncTo)||rc(this)}get goal(){return ws(this.animation.to)}get velocity(){const e=ea(this);return e instanceof ra?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return nc(this)}get isAnimating(){return oc(this)}get isPaused(){return rc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=na(o.to);!i&&Ss(o.to)&&(l=Oi(ws(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==la?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=Li.arr(r.velocity)?r.velocity[a]:r.velocity;let i;const p=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n)));if(Li.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<=p,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.restVelocity||p/10,o=r.clamp?0:r.bounce,a=!Li.und(o),m=n==c?s.v0>0:n<c;let g,h=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(i)>t,g||(u=Math.abs(c-d)<=p,!u));++e)a&&(h=d==c||d>c==m,h&&(i=-i*o,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*f,d+=i*f}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=ea(this),a=s.getValue();if(t){const e=ws(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return mi.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(oc(this)){const{to:e,config:t}=this.animation;mi.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Li.und(e)?(n=this.queue||[],this.queue=[]):n=[Li.obj(e)?e:fa({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Wa(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Ya(this._state,e&&this._lastCallId),mi.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=Li.obj(n)?n[t]:n,(null==n||xa(n))&&(n=void 0),o=Li.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return nc(this)||(e.reverse&&([n,o]=[o,n]),o=ws(o),Li.und(o)?ea(this)||this._set(n):this._set(o)),r}_update(e,t){let n=fa({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Ea(n,((e,t)=>/^on/.test(t)?_a(e,o):e))),gc(this,n,"onProps"),hc(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return Ua(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{rc(this)||(ic(this,!0),Fi(i.pauseQueue),hc(this,"onPause",ja(this,ac(this,this.animation.to)),this))},resume:()=>{rc(this)&&(ic(this,!1),oc(this)&&this._resume(),Fi(i.resumeQueue),hc(this,"onResume",ja(this,ac(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=cc(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Ka(this));const o=!Li.und(e.to),r=!Li.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Ka(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!Li.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Ri(d,c);p&&(s.from=d),d=ws(d);const m=!Ri(u,a);m&&this._focus(u);const g=xa(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(Va(n=fa({},n),t),t=fa({},n,t)),Va(e,t),Object.assign(e,t);for(const t in za)null==e[t]&&(e[t]=za[t]);let{mass:o,frequency:r,damping:l}=e;Li.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(h,va(t.config,l),t.config!==i.config?va(i.config,l):void 0);let b=ea(this);if(!b||Li.und(u))return n(ja(this,!0));const _=Li.und(t.reset)?r&&!t.default:!Li.und(d)&&ba(t.reset,l),k=_?d:this.get(),y=Ba(u),E=Li.num(y)||Li.arr(y)||Ks(y),C=!g&&(!E||ba(i.immediate||t.immediate,l));if(m){const e=ua(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=Ss(u),B=!1;if(!w){const e=_||!nc(this)&&p;(m||e)&&(B=Ri(Ba(k),y),w=!B),(Ri(s.immediate,C)||C)&&Ri(h.decay,f)&&Ri(h.velocity,v)||(w=!0)}if(B&&oc(this)&&(s.changed&&!_?w=!0:w||this._stop(a)),!g&&((w||Ss(a))&&(s.values=b.getPayload(),s.toValues=Ss(u)?null:S==la?[1]:Oi(y)),s.immediate!=C&&(s.immediate=C,C||_||this._set(a)),w)){const{onRest:e}=s;Ai(mc,(e=>gc(this,t,e)));const o=ja(this,ac(this,a));Fi(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&mi.batchedUpdates((()=>{s.changed=!_,null==e||e(o,this),_?va(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}_&&this._set(k),g?n(qa(t.to,t,this._state,this)):w?this._start():oc(this)&&!m?this._pendingCalls.add(n):n($a(k))}_focus(e){const t=this.animation;e!==t.to&&(Bs(this)&&this._detach(),t.to=e,Bs(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ss(t)&&(Ns(t,this),Xa(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Ss(e)&&Ps(e,this)}_set(e,t=!0){const n=ws(e);if(!Li.und(n)){const e=ea(this);if(!e||!Ri(n,e.getValue())){const o=ua(n);e&&e.constructor==o?e.setValue(n):ta(this,o.create(n)),e&&mi.batchedUpdates((()=>{this._onChange(n,t)}))}}return ea(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,hc(this,"onStart",ja(this,ac(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),va(this.animation.onChange,e,this)),va(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;ea(this).reset(ws(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),oc(this)||(lc(this,!0),rc(this)||this._resume())}_resume(){ji.skipAnimation?this.finish():Zi.start(this)}_stop(e,t){if(oc(this)){lc(this,!1);const n=this.animation;Ai(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Is(this,{type:"idle",parent:this});const o=t?Ka(this.get()):ja(this.get(),ac(this,null!=e?e:n.to));Fi(this._pendingCalls,o),n.changed&&(n.changed=!1,hc(this,"onRest",o,this))}}}function ac(e,t){const n=Ba(t);return Ri(Ba(e.get()),n)}function cc(e,t=e.loop,n=e.to){let o=va(t);if(o){const r=!0!==o&&wa(o),l=(r||e).reverse,i=!r||r.reset;return uc(fa({},e,{loop:t,default:!1,pause:void 0,to:!l||xa(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function uc(e){const{to:t,from:n}=e=wa(e),o=new Set;return Li.obj(t)&&pc(t,o),Li.obj(n)&&pc(n,o),e.keys=o.size?Array.from(o):null,e}function dc(e){const t=uc(e);return Li.und(t.default)&&(t.default=Ea(t)),t}function pc(e,t){Di(e,((e,n)=>null!=e&&t.add(n)))}const mc=["onStart","onRest","onChange","onPause","onResume"];function gc(e,t,n){e.animation[n]=t[n]!==ka(t,n)?_a(t[n],e.key):void 0}function hc(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const fc=["onStart","onChange","onRest"];let vc=1;class bc{constructor(e,t){this.id=vc++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(fa({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];Li.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(uc(e)),this}start(e){let{queue:t}=this;return e?t=Oi(e).map(uc):this.queue=[],this._flush?this._flush(this,t):(wc(this,t),_c(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Ai(Oi(t),(t=>n[t].stop(!!e)))}else Ya(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Li.und(e))this.start({pause:!0});else{const t=this.springs;Ai(Oi(e),(e=>t[e].pause()))}return this}resume(e){if(Li.und(e))this.start({pause:!1});else{const t=this.springs;Ai(Oi(e),(e=>t[e].resume()))}return this}each(e){Di(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,zi(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&zi(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,zi(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}mi.onFrame(this._onFrame)}}function _c(e,t){return Promise.all(t.map((t=>kc(e,t)))).then((t=>Wa(e,t)))}async function kc(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Li.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Li.arr(r)||Li.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Ai(fc,(n=>{const o=t[n];if(Li.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,Fi(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===ka(t,"cancel");(u||m&&d.asyncId)&&p.push(Ua(++e._lastAsyncId,{props:t,state:d,actions:{pause:Mi,resume:Mi,start(t,n){m?(Ya(d,e._lastAsyncId),n(Ka(e))):(t.onRest=s,n(qa(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=Wa(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=cc(t,i,r);if(n)return wc(e,[n]),kc(e,n,!0)}return a&&mi.batchedUpdates((()=>a(g,e,e.item))),g}function yc(e,t){const n=fa({},e.springs);return t&&Ai(Oi(t),(e=>{Li.und(e.keys)&&(e=uc(e)),Li.obj(e.to)||(e=fa({},e,{to:void 0})),Sc(n,e,(e=>Cc(e)))})),Ec(e,n),n}function Ec(e,t){Di(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Ns(t,e))}))}function Cc(e,t){const n=new sc;return n.key=e,t&&Ns(n,t),n}function Sc(e,t,n){t.keys&&Ai(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function wc(e,t){Ai(t,(t=>{Sc(e.springs,t,(t=>Cc(t,e)))}))}const Bc=["children"],Ic=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,Bc);const o=(0,Ni.useContext)(xc),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Ni.useState)((()=>({inputs:t,result:e()}))),o=(0,Ni.useRef)(),r=o.current;let l=r;if(l){const n=Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs));n||(l={inputs:t,result:e()})}else l=n;return(0,Ni.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=xc;return Ni.createElement(i,{value:n},t)},xc=(Tc=Ic,Nc={},Object.assign(Tc,Ni.createContext(Nc)),Tc.Provider._context=Tc,Tc.Consumer._context=Tc,Tc);var Tc,Nc;Ic.Provider=xc.Provider,Ic.Consumer=xc.Consumer;const Pc=()=>{const e=[],t=function(t){js(`${Us}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Ai(e,((e,r)=>{if(Li.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Ai(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Ai(e,(e=>e.resume(...arguments))),this},t.set=function(t){Ai(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Ai(e,((e,o)=>{if(Li.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Ai(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Ai(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Li.fun(e)?e(n,t):e};return t._getProps=n,t};function Mc(e,t,n){const o=Li.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ni.useMemo)((()=>o||3==arguments.length?Pc():void 0),[]),l=(0,Ni.useRef)(0),i=Ys(),s=(0,Ni.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=yc(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?_c(e,t):new Promise((o=>{Ec(e,n),s.queue.push((()=>{o(_c(e,t))})),i()}))}})),[]),a=(0,Ni.useRef)([...s.ctrls]),c=[],u=Xs(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new bc(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=dc(n))}}(0,Ni.useMemo)((()=>{Ai(a.current.slice(e,u),(e=>{Ta(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Ni.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>yc(e,c[t]))),m=(0,Ni.useContext)(Ic),g=Xs(m),h=m!==g&&Ia(m);qs((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Ai(e,(e=>e()))),Ai(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(Na(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Qs((()=>()=>{Ai(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>fa({},e)));return r?[f,r]:f}let Lc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Lc||(Lc={}));class Rc extends ec{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=ks(...t);const n=this._get(),o=ua(n);ta(this,o.create(n))}advance(e){const t=this._get();Ri(t,this.get())||(ea(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Dc(this._active)&&Oc(this)}_get(){const e=Li.arr(this.source)?this.source.map(ws):Oi(ws(this.source));return this.calc(...e)}_start(){this.idle&&!Dc(this._active)&&(this.idle=!1,Ai(na(this),(e=>{e.done=!1})),ji.skipAnimation?(mi.batchedUpdates((()=>this.advance())),Oc(this)):Zi.start(this))}_attach(){let e=1;Ai(Oi(this.source),(t=>{Ss(t)&&Ns(t,this),Xa(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Ai(Oi(this.source),(e=>{Ss(e)&&Ps(e,this)})),this._active.clear(),Oc(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Oi(this.source).reduce(((e,t)=>Math.max(e,(Xa(t)?t.priority:0)+1)),0))}}function Ac(e){return!1!==e.idle}function Dc(e){return!e.size||Array.from(e).every(Ac)}function Oc(e){e.idle||(e.idle=!0,Ai(na(e),(e=>{e.done=!0})),Is(e,{type:"idle",parent:e}))}ji.assign({createStringInterpolator:Gs,to:(e,t)=>new Rc(e,t)}),Zi.advance;const zc=window.ReactDOM;function Fc(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const Vc=["style","children","scrollTop","scrollLeft"],Hc=/^--/;function Gc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Hc.test(e)||Wc.hasOwnProperty(e)&&Wc[e]?(""+t).trim():t+"px"}const Uc={};let Wc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const $c=["Webkit","Ms","Moz","O"];Wc=Object.keys(Wc).reduce(((e,t)=>($c.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Wc);const jc=["x","y","z"],Kc=/^(matrix|translate|scale|rotate|skew)/,qc=/^(translate)/,Yc=/^(rotate|skew)/,Qc=(e,t)=>Li.num(e)&&0!==e?e+t:e,Zc=(e,t)=>Li.arr(e)?e.every((e=>Zc(e,t))):Li.num(e)?e===t:parseFloat(e)===t;class Xc extends sa{constructor(e){let{x:t,y:n,z:o}=e,r=Fc(e,jc);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Qc(e,"px"))).join(",")})`,Zc(e,0)]))),Di(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Kc.test(t)){if(delete r[t],Li.und(e))return;const n=qc.test(t)?"px":Yc.test(t)?"deg":"";l.push(Oi(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Qc(r,n)})`,Zc(r,0)]:e=>[`${t}(${e.map((e=>Qc(e,n))).join(",")})`,Zc(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Jc(l,i)),super(r)}}class Jc extends xs{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Ai(this.inputs,((n,o)=>{const r=ws(n[0]),[l,i]=this.transforms[o](Li.arr(r)?r:n.map(ws));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Ai(this.inputs,(e=>Ai(e,(e=>Ss(e)&&Ns(e,this)))))}observerRemoved(e){0==e&&Ai(this.inputs,(e=>Ai(e,(e=>Ss(e)&&Ps(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Is(this,e)}}const eu=["scrollTop","scrollLeft"];ji.assign({batchedUpdates:zc.unstable_batchedUpdates,createStringInterpolator:Gs,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const tu=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new sa(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=ha(e)||"Anonymous";return(e=Li.str(e)?l[e]||(l[e]=pa(e,r)):e[ga]||(e[ga]=pa(e,r))).displayName=`Animated(${t})`,e};return Di(e,((t,n)=>{Li.arr(e)&&(n=ha(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=Fc(o,Vc),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Uc[t]||(Uc[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=Gc(t,r[t]);Hc.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new Xc(e),getComponentProps:e=>Fc(e,eu)}),nu=tu.animated,ou=e=>e+1,ru=e=>({top:e.offsetTop,left:e.offsetLeft}),lu=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,u.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(ou,0),[d,p]=(0,s.useReducer)(ou,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?ru(l.current):null),[r]),f=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,jl.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();l.current.style.transform=void 0;const e=ru(l.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),function(e,t){const n=Li.fun(e),[[o],r]=Mc(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==d,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:function(e){let{value:n}=e;if(!l.current)return;let{x:o,y:r}=n;o=Math.round(o),r=Math.round(r);const i=0===o&&0===r;l.current.style.transformOrigin="center center",l.current.style.transform=i?void 0:`translate3d(${o}px,${r}px,0)`,l.current.style.zIndex=t?"1":"",f()}}),l},iu=".block-editor-block-list__block",su=".block-list-appender",au=".block-editor-button-block-appender";function cu(e,t){return t.closest([iu,su,au].join(","))===e}function uu(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(iu);return t?t.id.slice("block-".length):void 0}function du(e){const t=(0,s.useRef)(),n=function(e){return(0,d.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t(co);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,d.useSelect)(co);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(cu(t.current,l.activeElement))return;const i=jl.focus.tabbable.find(t.current).filter((e=>(0,jl.isTextField)(e))),s=-1===n,a=i[s?i.length-1:0]||t.current;if(cu(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=jl.focus.tabbable.findNext(t.current);if(e&&cu(t.current,e)&&(0,jl.isFormElement)(e))return void e.focus()}(0,jl.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function pu(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function mu(){const e=(0,d.useSelect)((e=>{const{getSettings:t}=e(co);return t().outlineMode}),[]);return(0,u.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",pu),t.addEventListener("mouseover",pu),()=>{t.removeEventListener("mouseout",pu),t.removeEventListener("mouseover",pu),t.classList.remove("is-hovered")}}),[e])}function gu(e){return(0,d.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p,__unstableSelectionHasUnmergeableBlock:m}=t(co),{outlineMode:g}=a(),h=n(e),f=l(e),v=s(e),b=u(e,!0),_=i(e);return c()({"is-selected":f,"is-highlighted":o(e),"is-multi-selected":_,"is-partially-selected":_&&!p()&&!m(),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":h,"has-child-selected":b,"remove-outline":f&&g&&d()})}),[e])}function hu(e){return(0,d.useSelect)((t=>{const n=t(co).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function fu(e){return(0,d.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(co),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function vu(e){return(0,d.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(co);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function bu(e){const{isBlockSelected:t}=(0,d.useSelect)(co),{selectBlock:n,selectionChange:o}=(0,d.useDispatch)(co);return(0,u.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):cu(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}const _u=window.wp.keycodes;function ku(e){const t=(0,d.useSelect)((t=>t(co).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,d.useSelect)(co),{insertDefaultBlock:r,removeBlock:l}=(0,d.useDispatch)(co);return(0,u.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==_u.ENTER&&s!==_u.BACKSPACE&&s!==_u.DELETE||a!==i||(0,jl.isTextField)(a)||(t.preventDefault(),s===_u.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function yu(e){const{isNavigationMode:t,isBlockSelected:n}=(0,d.useSelect)(co),{setNavigationMode:o,selectBlock:r}=(0,d.useDispatch)(co);return(0,u.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function Eu(){const e=(0,s.useContext)(rf);return(0,u.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Cu(e){return(0,d.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(co);return n(e)}),[e])}function Su(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,s.useContext)(wu),{index:a,mode:p,name:m,blockApiVersion:g,blockTitle:f,isPartOfSelection:v,adjustScrolling:b,enableAnimation:_}=(0,d.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:l,getBlockName:i,isTyping:s,getGlobalBlockCount:a,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p}=e(co),{getActiveBlockVariation:m}=e(r.store),g=c(n),h=u(n)||d(n),f=i(n),v=(0,r.getBlockType)(f),b=m(f,t(n));return{index:o(n),mode:l(n),name:f,blockApiVersion:(null==v?void 0:v.apiVersion)||1,blockTitle:(null==b?void 0:b.title)||(null==v?void 0:v.title),isPartOfSelection:g||h,adjustScrolling:g||p(n),enableAnimation:!s()&&a()<=200}}),[n]),k=Cu(n),y=(0,h.sprintf)((0,h.__)("Block: %s"),f),E="html"!==p||t?"":"-visual",C=(0,u.useMergeRefs)([e.ref,du(n),Mo(n),bu(n),ku(n),yu(n),mu(),Eu(),lu({isSelected:v,adjustScrolling:b,enableAnimation:_,triggerAnimationOnChange:a}),(0,u.useDisabled)({isDisabled:!k})]),S=go();return g<2&&n===S.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...l,...e,ref:C,id:`block-${n}${E}`,role:"document","aria-label":y,"data-block":n,"data-type":m,"data-title":f,className:c()(c()("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":k}),o,e.className,l.className,gu(n),hu(n),fu(n),vu(n)),style:{...l.style,...e.style}}}Su.save=r.__unstableGetBlockProps;const wu=(0,s.createContext)();function Bu(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Su(o,{__unstableIsHtml:n}),t)}const Iu=(0,d.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(co),d=a(n),p=r(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),xu=(0,d.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:l,mergeBlocks:i,replaceBlocks:s,toggleSelection:a,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d,selectBlock:p}=e(co);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(co),l=r(),{clientId:i}=t,s=l.length?l:[i];o(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;l(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:r}=t,{getBlockIndex:i}=n.select(co),s=i(o);l(e,s+1,r)},onMerge(e){const{clientId:o,rootClientId:l}=t,{getPreviousBlockClientId:a,getNextBlockClientId:c,getBlock:m,getBlockAttributes:g,getBlockName:h,getBlockOrder:f}=n.select(co);if(e){if(l){const e=c(l);if(e){if(h(l)!==h(e))return void i(l,e);{const t=g(l),o=g(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(e),e,l),d(e,!1)}))}}}const e=c(o);if(!e)return;const t=(0,r.switchToBlockType)(m(e),"*");t&&t.length?s(e,t):i(o,e)}else{const e=a(o);if(e)i(e,o);else if(l){const e=a(l);if(e&&h(l)===h(e)){const t=g(l),o=g(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(l),l,e),d(l,!1)}))}const t=(0,r.switchToBlockType)(m(l),"*");t&&t.length&&n.batch((()=>{s(l,t),p(t[0].clientId,0)}))}}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),s([t.clientId],e,n,o)},toggleSelection(e){a(e)}}})),Tu=(0,u.compose)(u.pure,Iu,xu,(0,u.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,m.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:u,isSelectionEnabled:p,className:m,name:g,isValid:h,attributes:f,wrapperProps:v,setAttributes:b,onReplace:_,onInsertBlocksAfter:k,onMerge:y,toggleSelection:E}=e;const{themeSupportsLayout:C,hasContentLockedParent:S,isContentBlock:w,isContentLocking:B,isTemporarilyEditingAsBlocks:I}=(0,d.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:l}=e(co),i=!!n(a);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(r.store).__experimentalHasContentRoleAttribute(g),hasContentLockedParent:i,isContentLocking:"contentOnly"===o(a)&&!i,isTemporarilyEditingAsBlocks:l()===a}}),[g,a]),{removeBlock:x}=(0,d.useDispatch)(co),T=(0,s.useCallback)((()=>x(a)),[a]);let N=(0,s.createElement)(Xl,{name:g,isSelected:u,attributes:f,setAttributes:b,insertBlocksAfter:l?void 0:k,onReplace:i?_:void 0,onRemove:i?T:void 0,mergeBlocks:i?y:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:E});const P=(0,r.getBlockType)(g);S&&!w&&(v={...v,tabIndex:-1}),null!=P&&P.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=c()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(v,P.getEditWrapperProps(f)));const M=v&&!!v["data-align"]&&!C;let L;if(M&&(N=(0,s.createElement)("div",{className:"wp-block","data-align":v["data-align"]},N)),h)L="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},N),(0,s.createElement)(Bu,{isHtml:!0},(0,s.createElement)(di,{clientId:a}))):(null==P?void 0:P.apiVersion)>1?N:(0,s.createElement)(Bu,v,N);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(P,f);L=(0,s.createElement)(Bu,{className:"has-warning"},(0,s.createElement)(li,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,jl.safeHTML)(e)))}const{"data-align":R,...A}=null!==(t=v)&&void 0!==t?t:{},D={clientId:a,className:c()({"is-content-locked":B,"is-content-locked-temporarily-editing-as-blocks":I,"is-content-block":S&&w},R&&C&&`align${R}`,m),wrapperProps:A,isAligned:M},O=(0,s.useMemo)((()=>D),Object.values(D));return(0,s.createElement)(wu.Provider,{value:O},(0,s.createElement)(ci,{fallback:(0,s.createElement)(Bu,{className:"has-warning"},(0,s.createElement)(si,null))},L))})),Nu=window.wp.htmlEntities,Pu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),Mu=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")],Lu=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Mu.length));return(0,s.createElement)(m.Tip,null,Mu[e])},Ru=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),Au=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:Ru});const l=(0,s.createElement)(m.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)})),Du=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(V()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(Au,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))},Ou=(0,u.createHigherOrderComponent)((e=>(0,d.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,d.createRegistry)({},o);e.registerStore(so,ao),a(e)}),[o]),l?(0,s.createElement)(d.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider"),zu=()=>{};function Fu(e){let{clientId:t=null,value:n,selection:o,onChange:l=zu,onInput:i=zu}=e;const a=(0,d.useRegistry)(),{resetBlocks:c,resetSelection:u,replaceInnerBlocks:p,setHasControlledInnerBlocks:m,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(co),{getBlockName:h,getBlocks:f}=a.select(co),v=(0,d.useSelect)((e=>!t||e(co).areInnerBlocksControlled(t)),[t]),b=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),k=()=>{n&&(g(),t?a.batch((()=>{m(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(b.current.incoming=e),g(),p(t,e)})):(_.current&&(b.current.incoming=n),c(n)))},y=(0,s.useRef)(i),E=(0,s.useRef)(l);(0,s.useEffect)((()=>{y.current=i,E.current=l}),[i,l]),(0,s.useEffect)((()=>{b.current.outgoing.includes(n)?b.current.outgoing[b.current.outgoing.length-1]===n&&(b.current.outgoing=[]):f(t)!==n&&(b.current.outgoing=[],k(),o&&u(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{v||(b.current.outgoing=[],k())}),[v]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(co);let s=f(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=r(),d=f(t),p=d!==s;if(s=d,p&&(b.current.incoming||l()))return b.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,b.current.outgoing.push(s),(c?E.current:y.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}const Vu=Ou((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,d.useDispatch)(co);return(0,s.useEffect)((()=>{o(n)}),[n]),Fu(e),(0,s.createElement)(Po,null,t)}));function Hu(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)("div",{inert:"true"},(0,s.createElement)(af,null)))}function Gu(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,d.useSelect)(co),{clearSelectedBlock:o}=(0,d.useDispatch)(co),{__experimentalClearBlockSelection:r}=e();return(0,u.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function Uu(e){return(0,s.createElement)("div",i({ref:Gu()},e))}function Wu(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(co);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function $u(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,d.useSelect)(Wu,[]);return(0,u.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||l&&(r.contentEditable=!0,r.focus(),s.getSelection().removeAllRanges())}),[o,t,n,r,e,l])}function ju(e,t,n,o){let r,l=jl.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(iu)===t.closest(iu)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!jl.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}}))}function Ku(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,d.useSelect)(co),{selectBlock:l}=(0,d.useDispatch)(co);return(0,u.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:g}=a,h=c===_u.UP,f=c===_u.DOWN,v=c===_u.LEFT,b=c===_u.RIGHT,_=h||v,k=v||b,y=h||f,E=k||y,C=d||p||m||g,S=y?jl.isVerticalEdge:jl.isHorizontalEdge,{ownerDocument:w}=i,{defaultView:B}=w;if(o()){if(!r())return;if(a.defaultPrevented)return;if(!E)return;if(d)return;return a.preventDefault(),void(_?l(e()):l(t(),-1))}if(y?s||(s=(0,jl.computeCaretRect)(B)):s=null,a.defaultPrevented)return;if(!E)return;if(!function(e,t,n){if((t===_u.UP||t===_u.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"===o?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==o}(u,c,C))return;const I=(0,jl.isRTL)(u)?!_:_,{keepCaretInsideBlock:x}=n();if(d)(function(e,t){const n=ju(e,t,i);return n&&uu(n)})(u,_)&&S(u,_)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,jl.isVerticalEdge)(u,_)||m&&!(0,jl.isHorizontalEdge)(u,I)||x){if(k&&B.getSelection().isCollapsed&&(0,jl.isHorizontalEdge)(u,I)&&!x){const e=ju(u,I,i);(0,jl.placeCaretAtHorizontalEdge)(e,_),a.preventDefault()}}else{const e=ju(u,_,i,!0);e&&((0,jl.placeCaretAtVerticalEdge)(e,m?!_:_,m?void 0:s),a.preventDefault())}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}const qu=window.wp.keyboardShortcuts;function Yu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,d.useSelect)(co),{multiSelect:o,selectBlock:r}=(0,d.useDispatch)(co),l=(0,qu.__unstableUseShortcutEventMatch)();return(0,u.useRefEffect)((i=>{function s(s){if(!l("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,jl.isEntirelySelected)(s.target))return;s.preventDefault();const[c]=a,u=n(c),d=e(u);a.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[])}function Qu(e,t){e.contentEditable=t,t&&e.focus()}function Zu(){const{startMultiSelect:e,stopMultiSelect:t}=(0,d.useDispatch)(co),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,d.useSelect)(co);return(0,u.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:s}=i;let a,c;function u(){t(),s.removeEventListener("mouseup",u),c=s.requestAnimationFrame((()=>{if(o())return;Qu(l,!1);const e=s.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function d(t){let{buttons:o,target:c}=t;r()||1===o&&c.getAttribute("contenteditable")&&n()&&(a=i.activeElement,e(),s.addEventListener("mouseup",u),Qu(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),s.removeEventListener("mouseup",u),s.cancelAnimationFrame(c)}}),[e,t,n,o])}function Xu(e,t){e.contentEditable=t,t&&e.focus()}function Ju(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,d.useDispatch)(co),{getBlockParents:o,getBlockSelectionStart:r}=(0,d.useSelect)(co);return(0,u.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return;const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void Xu(n,!1);let c=uu(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(s)),u=uu(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(s));if(a){const e=r(),t=uu(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}else Xu(n,!1)}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function ed(){const{selectBlock:e}=(0,d.useDispatch)(co),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,d.useSelect)(co);return(0,u.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=uu(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function td(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,d.useSelect)(co),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,d.useDispatch)(co);return(0,u.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===_u.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===_u.BACKSPACE||d.keyCode===_u.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===_u.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===_u.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function nd(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,d.useSelect)(co),{setNavigationMode:a}=(0,d.useDispatch)(co),c=(0,d.useSelect)((e=>e(co).isNavigationMode()),[])?void 0:"0",p=(0,s.useRef)();function m(t){if(p.current)p.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";jl.focus.tabbable[n](t.target).focus()}}const g=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:m}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:m}),f=(0,u.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===_u.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==_u.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,jl.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,jl.isFormElement)(jl.focus.tabbable[i](e.target)))return;const c=o?t:n;p.current=!0,c.current.focus({preventScroll:!0})}function u(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function d(o){var r;if(o.keyCode!==_u.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=jl.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",d),s.addEventListener("keydown",c),s.addEventListener("focusout",u),()=>{g.removeEventListener("keydown",d),s.removeEventListener("keydown",c),s.removeEventListener("focusout",u)}}),[]);return[g,(0,u.useMergeRefs)([e,f]),h]}(),o=(0,d.useSelect)((e=>e(co).hasMultiSelection()),[]);return[e,(0,u.useMergeRefs)([t,td(),Zu(),Ju(),ed(),$u(),Yu(),Ku(),(0,u.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}const od=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=nd();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,u.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)})),rd="editor-styles-wrapper";function ld(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const id=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,isZoomedOut:d,...p}=e;const[,g]=(0,s.useReducer)((()=>({}))),[f,v]=(0,s.useState)(),[b,_]=(0,s.useState)([]),k=ld(null==a?void 0:a.styles),y=ld(null==a?void 0:a.scripts),E=Gu(),[C,S,w]=nd(),[B,{height:I}]=(0,u.useResizeObserver)(),x=(0,u.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{readyState:l,documentElement:i}=o;return t=o,("interactive"===l||"complete"===l)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(o),v(o),E(i),_(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir,i.removeChild(o.head),i.removeChild(o.body),t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),!0)}return e.addEventListener("load",o),()=>{var r,l;e.removeEventListener("load",o),null===(r=t)||void 0===r||r.removeEventListener("dragover",n),null===(l=t)||void 0===l||l.removeEventListener("drop",n)}}),[]),T=(0,u.useRefEffect)((e=>{y.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{g()}))}),[]),N=(0,u.useMergeRefs)([n,E,S]),P=(0,u.useRefEffect)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(`.${rd}`)||n.includes(".wp-block"))}))}(o)&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&C,(0,s.createElement)("iframe",i({},p,{ref:(0,u.useMergeRefs)([t,x]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:T},r,(0,s.createElement)("style",null,`html { transition: background 5s; ${d?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,s.createElement)("body",{ref:N,className:c()("block-editor-iframe__body",rd,...b,{"is-zoomed-out":d}),style:d?{marginBottom:`-${.55*I-100}px`}:{}},B,(0,s.createElement)("div",{style:{display:"none"},ref:P}),(0,s.createElement)(m.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&w)}));var sd={grad:.9,turn:360,rad:360/(2*Math.PI)},ad=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},cd=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},ud=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},dd=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},pd=function(e){return{r:ud(e.r,0,255),g:ud(e.g,0,255),b:ud(e.b,0,255),a:ud(e.a)}},md=function(e){return{r:cd(e.r),g:cd(e.g),b:cd(e.b),a:cd(e.a,3)}},gd=/^#([0-9a-f]{3,8})$/i,hd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},fd=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},vd=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},bd=function(e){return{h:dd(e.h),s:ud(e.s,0,100),l:ud(e.l,0,100),a:ud(e.a)}},_d=function(e){return{h:cd(e.h),s:cd(e.s),l:cd(e.l),a:cd(e.a,3)}},kd=function(e){return vd((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},yd=function(e){return{h:(t=fd(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},Ed=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Cd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Sd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bd={string:[[function(e){var t=gd.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?cd(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?cd(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Sd.exec(e)||wd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:pd({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Ed.exec(e)||Cd.exec(e);if(!t)return null;var n,o,r=bd({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(sd[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return kd(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return ad(t)&&ad(n)&&ad(o)?pd({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!ad(t)||!ad(n)||!ad(o))return null;var i=bd({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return kd(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!ad(t)||!ad(n)||!ad(o))return null;var i=function(e){return{h:dd(e.h),s:ud(e.s,0,100),v:ud(e.v,0,100),a:ud(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return vd(i)},"hsv"]]},Id=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},xd=function(e,t){var n=yd(e);return{h:n.h,s:ud(n.s+100*t,0,100),l:n.l,a:n.a}},Td=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Nd=function(e,t){var n=yd(e);return{h:n.h,s:n.s,l:ud(n.l+100*t,0,100),a:n.a}},Pd=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Id(e.trim(),Bd.string):"object"==typeof e&&null!==e?Id(e,Bd.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return cd(Td(this.rgba),2)},e.prototype.isDark=function(){return Td(this.rgba)<.5},e.prototype.isLight=function(){return Td(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=md(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?hd(cd(255*r)):"","#"+hd(t)+hd(n)+hd(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return md(this.rgba)},e.prototype.toRgbString=function(){return t=(e=md(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return _d(yd(this.rgba))},e.prototype.toHslString=function(){return t=(e=_d(yd(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=fd(this.rgba),{h:cd(e.h),s:cd(e.s),v:cd(e.v),a:cd(e.a,3)};var e},e.prototype.invert=function(){return Md({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),Md(xd(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Md(xd(this.rgba,-e))},e.prototype.grayscale=function(){return Md(xd(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Md(Nd(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Md(Nd(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?Md({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):cd(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=yd(this.rgba);return"number"==typeof e?Md({h:e,s:t.s,l:t.l,a:t.a}):cd(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Md(e).toHex()},e}(),Md=function(e){return e instanceof Pd?e:new Pd(e)},Ld=[],Rd=function(e){e.forEach((function(e){Ld.indexOf(e)<0&&(e(Pd,Bd),Ld.push(e))}))};function Ad(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Dd=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Od=function(e){return.2126*Dd(e.r)+.7152*Dd(e.g)+.0722*Dd(e.b)};function zd(e){e.prototype.luminance=function(){return e=Od(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=Od(l))>(a=Od(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var Fd=n(3124),Vd=n.n(Fd);const Hd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Gd(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function f(){const e=p(/^([^{]+)/);if(e)return Ud(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Ud(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Hd,""),value:n?Ud(n[0]).replace(Hd,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:a("missing '}'")}function _(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const k=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=g();for(;r=_();)i.push(r),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Ud(t[1]);if(!c())return a("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Ud(t[1]),media:Ud(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Ud(t[1]);if(!c())return a("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||k()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Ud(t[1]),o=Ud(t[2]);if(!c())return a("@document missing '{'");const r=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=f()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Wd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Ud(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Wd(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){Wd(e,o)})):n&&"object"==typeof n&&Wd(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var $d=n(8575),jd=n.n($d);const Kd=qd;function qd(e){this.options=e||{}}qd.prototype.emit=function(e){return e},qd.prototype.visit=function(e){return this[e.type](e)},qd.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};const Yd=Qd;function Qd(e){Kd.call(this,e)}jd()(Qd,Kd),Qd.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Qd.prototype.comment=function(e){return this.emit("",e.position)},Qd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Qd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Qd.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Qd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Qd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Qd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Qd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Qd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Qd.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Qd.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Qd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Qd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Qd.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},Qd.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const Zd=Xd;function Xd(e){e=e||{},Kd.call(this,e),this.indentation=e.indent}jd()(Xd,Kd),Xd.prototype.compile=function(e){return this.stylesheet(e)},Xd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Xd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Xd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Xd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Xd.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Xd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Xd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Xd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Xd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},Xd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},Xd.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},Xd.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},Xd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Xd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Xd.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},Xd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Xd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const Jd=function(e,t){try{const r=Gd(e),l=Vd().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return n=l,((o=o||{}).compress?new Yd(o):new Zd(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function ep(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function tp(e,t){return new URL(e,t).toString()}const np=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};ep(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+tp(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t},op=/^(body|html|:root).*$/,rp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(op)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},lp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,p.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(rp(t)),o&&r.push(np(o)),r.length?Jd(n,(0,u.compose)(r)):n}))},ip=".editor-styles-wrapper";function sp(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(ip);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Md(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function ap(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>lp(t,ip)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:sp(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function cp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Md(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function up(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function dp(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function pp(e){let{id:t,colors:n}=e;const o=cp(n);return(0,s.createElement)(m.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:t},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function mp(e){let{preset:t}=e;return(0,s.createElement)(pp,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let gp;Rd([Ad,zd]);const hp=2e3;function fp(e){let{viewportWidth:t,containerWidth:n,__experimentalPadding:o,__experimentalMinHeight:r}=e;const[l,{height:i}]=(0,u.useResizeObserver)(),{styles:a,assets:c,duotone:p}=(0,d.useSelect)((e=>{var t,n;const o=e(co).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),g=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]),h=(0,s.useMemo)((()=>{var e,t;return[...null!==(e=null==p?void 0:p.default)&&void 0!==e?e:[],...null!==(t=null==p?void 0:p.theme)&&void 0!==t?t:[]]}),[p]);gp=gp||(0,u.pure)(af);const f=n/t;return(0,s.createElement)(m.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${f})`,height:i*f,maxHeight:i>hp?hp*f:void 0,minHeight:r}},(0,s.createElement)(id,{head:(0,s.createElement)(ap,{styles:g}),assets:c,contentRef:(0,u.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=o+"px",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:hp,minHeight:0!==f&&f<1&&r?r/f:r}},l,h.map((e=>(0,s.createElement)(mp,{preset:e,key:e.slug}))),(0,s.createElement)(gp,{renderAppender:!1})))}function vp(e){const[t,{width:n}]=(0,u.useResizeObserver)();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,s.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,s.createElement)(fp,i({},e,{containerWidth:n}))))}const bp=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const a=(0,d.useSelect)((e=>e(co).getSettings()),[]),c=(0,s.useMemo)((()=>({...a,__unstableIsPreviewMode:!0})),[a]),u=(0,s.useMemo)((()=>(0,p.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Vu,{value:u,settings:c},r?(0,s.createElement)(Hu,{onClick:l}):(0,s.createElement)(vp,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function _p(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,d.useSelect)((e=>e(co).getSettings()),[]),l=(0,s.useMemo)((()=>({...r,__unstableIsPreviewMode:!0})),[r]),i=(0,u.useDisabled)(),a=(0,u.useMergeRefs)([n.ref,i]),m=(0,s.useMemo)((()=>(0,p.castArray)(t)),[t]),g=(0,s.createElement)(Vu,{value:m,settings:l},(0,s.createElement)(uf,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:a,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?g:null}}const kp=function(e){var t;let{item:n}=e;const{name:o,title:l,icon:i,description:a,initialAttributes:c,example:u}=n,d=(0,r.isReusableBlock)(n);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},d||u?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(bp,{__experimentalPadding:16,viewportWidth:null!==(t=null==u?void 0:u.viewportWidth)&&void 0!==t?t:500,blocks:u?(0,r.getBlockFromExample)(o,{attributes:{...u.attributes,...c},innerBlocks:u.innerBlocks}):(0,r.createBlock)(o,c)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!d&&(0,s.createElement)(Du,{title:l,icon:i,description:a}))},yp=(0,s.createContext)(),Ep=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(yp);return(0,s.createElement)(m.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(m.Button,t,r)}))})),Cp=(0,s.createElement)(D.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Sp(e){let{count:t,icon:n,isPattern:o}=e;const r=o&&(0,h.__)("Pattern");return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,s.createElement)(m.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(m.FlexItem,null,n?(0,s.createElement)(Au,{icon:n}):r||(0,h.sprintf)(
|
13 |
/* translators: %d: Number of blocks. */
|
14 |
+
(0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(Au,{icon:Cp})))))}const wp=e=>{let{isEnabled:t,blocks:n,icon:o,children:r,isPattern:l}=e;const i={type:"inserter",blocks:n};return(0,s.createElement)(m.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:i,__experimentalDragComponent:(0,s.createElement)(Sp,{count:n.length,icon:o,isPattern:l})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))},Bp=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),g=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},h=(0,s.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(wp,{isEnabled:u&&!o.disabled,blocks:h,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:h}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,h&&h(e)}},(0,s.createElement)(Ep,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,(0,_u.isAppleOS)()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===_u.ENTER&&(e.preventDefault(),l(o,(0,_u.isAppleOS)()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{p.current||a(o)},onMouseEnter:()=>{p.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:g},(0,s.createElement)(Au,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,s.createElement)(m.__experimentalTruncate,{numberOfLines:3},o.title))))}))})),Ip=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,qt.speak)((0,h.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,s.createElement)("div",i({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))})),xp=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(yp);return(0,s.createElement)(m.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),Tp=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(Ip,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let t=0,o=e.length;t<o;t+=3)n.push(e.slice(t,t+3));return n}(t).map(((e,t)=>(0,s.createElement)(xp,{key:t},e.map(((e,l)=>(0,s.createElement)(Bp,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a&&!e.isDisabled,isFirst:0===t&&0===l})))))),l)},Np=function(e){let{title:t,icon:n,children:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,s.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,s.createElement)(m.Icon,{icon:n})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},o))},Pp=(e,t)=>{const{categories:n,collections:o,items:l}=(0,d.useSelect)((t=>{const{getInserterItems:n}=t(co),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,s.useCallback)(((e,n)=>{let{name:o,initialAttributes:l,innerBlocks:i}=e;const s=(0,r.createBlock)(o,l,(0,r.createBlocksFromInnerBlocksTemplate)(i));t(s,void 0,n)}),[t])]},Mp=function(e){let{children:t}=e;const n=(0,m.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(yp.Provider,{value:n},t)},Lp=[],Rp=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=Pp(t,n),d=(0,s.useMemo)((()=>(0,p.orderBy)(l,["frecency"],["desc"]).slice(0,6)),[l]),m=(0,s.useMemo)((()=>l.filter((e=>!e.category))),[l]),g=(0,s.useMemo)((()=>(0,u.pipe)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,p.groupBy)(e,"category")))(l)),[l]),f=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,u.useAsyncList)(i),b=i.length===v.length,_=(0,s.useMemo)((()=>Object.entries(a)),[a]),k=(0,u.useAsyncList)(b?_:Lp);return(0,s.createElement)(Mp,null,(0,s.createElement)("div",null,r&&!!d.length&&(0,s.createElement)(Np,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(Tp,{items:d,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,p.map)(v,(e=>{const t=g[e.slug];return t&&t.length?(0,s.createElement)(Np,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Tp,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Np,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(Tp,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,p.map)(k,(e=>{let[t,n]=e;const r=f[t];return r&&r.length?(0,s.createElement)(Np,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(Tp,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},Ap=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Dp=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Op=window.wp.notices,zp=(e,t)=>{const{patternCategories:n,patterns:o}=(0,d.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(co);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,d.useDispatch)(Op.store),i=(0,s.useCallback)(((t,n)=>{e((0,p.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,h.sprintf)(
|
15 |
/* translators: %s: block pattern title. */
|
16 |
+
(0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[o,n,i]};function Fp(e){let{isDraggable:t,pattern:n,onClick:o,composite:r}=e;const{blocks:l,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,u.useInstanceId)(Fp)}`;return(0,s.createElement)(wp,{isEnabled:t,blocks:l,isPattern:!!n},(e=>{let{draggable:t,onDragStart:u,onDragEnd:d}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:u,onDragEnd:d},(0,s.createElement)(m.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l),"aria-label":n.title,"aria-describedby":n.description?c:void 0}),(0,s.createElement)(bp,{blocks:l,viewportWidth:a}),(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,s.createElement)(m.VisuallyHidden,{id:c},n.description)))}))}function Vp(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const Hp=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,h.__)("Block Patterns")}=e;const c=(0,m.__unstableUseCompositeState)({orientation:l});return(0,s.createElement)(m.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,s.createElement)(Fp,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(Vp,{key:e.name}))))};function Gp(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,s.createElement)(m.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Up(e){let{filterValue:t,setFilterValue:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(m.SearchControl,{onChange:n,value:t,label:(0,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}const Wp=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(Up,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(Gp,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},$p=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(pl,{className:"block-editor-inserter__no-results-icon",icon:Ru}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))},jp=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,d.useSelect)(co),{destinationRootClientId:u,destinationIndex:m}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(co),c=r();let u,d=t;return void 0!==n?u=n:o?u=s(o):!l&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:g,insertBlocks:f,showInsertionPoint:v,hideInsertionPoint:b}=(0,d.useDispatch)(co),_=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!l&&o&&(0,r.isUnmodifiedDefaultBlock)(o)?g(o.clientId,e,null,a||n?0:null,t):f(e,m,u,!0,a||n?0:null,t);const s=(0,h.sprintf)(// translators: %d: the name of the block that has been added
|
17 |
+
(0,h._n)("%d block added.","%d blocks added.",(0,p.castArray)(e).length),(0,p.castArray)(e).length);(0,qt.speak)(s),i&&i()}),[l,c,g,f,u,m,i,a]),k=(0,s.useCallback)((e=>{e?v(u,m):b()}),[v,b,u,m]);return[u,_,k]};var Kp=n(4793),qp=n.n(Kp);const Yp=e=>e.name||"",Qp=e=>e.title,Zp=e=>e.description||"",Xp=e=>e.keywords||[],Jp=e=>e.category,em=()=>null;function tm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=qp()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const nm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,p.words)(tm(e))},om=(e,t)=>e.filter((e=>!nm(t).some((t=>t.includes(e))))),rm=(e,t,n,o)=>0===nm(o).length?e:lm(e,o,{getCategory:e=>{var n;return null===(n=(0,p.find)(t,{slug:e.category}))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}}),lm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=nm(t);if(0===o.length)return e;const r=e.map((e=>[e,im(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),r.map((e=>{let[t]=e;return t}))};function im(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Yp,getTitle:r=Qp,getDescription:l=Zp,getKeywords:i=Xp,getCategory:s=Jp,getCollection:a=em}=n,c=o(e),u=r(e),d=l(e),m=i(e),g=s(e),h=a(e),f=tm(t),v=tm(u);let b=0;if(f===v)b+=30;else if(v.startsWith(f))b+=20;else{const e=[c,u,d,...m,g,h].join(" "),t=(0,p.words)(f);0===om(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function sm(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,s.createElement)(m.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,h.sprintf)(
|
18 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
19 |
+
(0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const am=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,u.useDebounce)(qt.speak,500),[l,i]=jp({shouldFocusBlock:!0}),[a,,c]=zp(i,l),d=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?lm(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!d.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,a]);(0,s.useEffect)((()=>{if(!t)return;const e=p.length,n=(0,h.sprintf)(
|
20 |
/* translators: %d: number of results. */
|
21 |
+
(0,h._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,u.useAsyncList)(p,{step:2}),g=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,s.createElement)(sm,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Mp,null,!g&&(0,s.createElement)($p,null),g&&(0,s.createElement)(Hp,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function cm(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,s.useState)(""),[l,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(Wp,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(am,{filterValue:o,selectedCategory:l,patternCategories:n}))}const um=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(m.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(cm,n))};function dm(){const[e,t]=zp(),n=(0,s.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>t.some((t=>t.name===e))))),[t]);return(0,s.useMemo)((()=>{const o=t.filter((t=>e.some((e=>{var n;return null===(n=e.categories)||void 0===n?void 0:n.includes(t.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].includes("featured")?"featured"===n?-1:1:0}));return e.some((e=>!n(e)))&&!o.find((e=>"uncategorized"===e.name))&&o.push({name:"uncategorized",label:(0,h._x)("Uncategorized")}),o}),[e,t])}function pm(e){let{rootClientId:t,onInsert:n,category:o}=e;const r=(0,s.useRef)();return(0,s.useEffect)((()=>{const e=setTimeout((()=>{const[e]=jl.focus.tabbable.find(r.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[o]),(0,s.createElement)("div",{ref:r,className:"block-editor-inserter__patterns-category-panel"},(0,s.createElement)(mm,{rootClientId:t,onInsert:n,category:o}))}function mm(e){let{rootClientId:t,onInsert:n,category:o}=e;const[r,,l]=zp(n,t),i=dm(),a=(0,s.useMemo)((()=>r.filter((e=>{var t,n,r;return"uncategorized"!==o.name?null===(r=e.categories)||void 0===r?void 0:r.includes(o.name):0===(null!==(t=null===(n=e.categories)||void 0===n?void 0:n.filter((e=>i.find((t=>t.name===e)))))&&void 0!==t?t:[]).length}))),[r,o]),c=(0,u.useAsyncList)(a);return a.length?(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"block-editor-inserter__patterns-category-panel-title"},o.label),(0,s.createElement)("p",null,o.description),(0,s.createElement)(Hp,{shownPatterns:c,blockPatterns:a,onClickPattern:l,label:o.label,orientation:"vertical",category:o.label,isDraggable:!0})):null}function gm(e){let{onInsert:t,rootClientId:n}=e;const o=dm();return(0,s.createElement)(m.__experimentalNavigatorProvider,{initialPath:"/"},(0,s.createElement)(m.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)(m.__experimentalItemGroup,null,o.map((e=>(0,s.createElement)(m.__experimentalNavigatorButton,{key:e.name,path:`/category/${e.name}`,as:m.__experimentalItem,isAction:!0},(0,s.createElement)(m.__experimentalHStack,null,(0,s.createElement)(m.FlexBlock,null,e.label),(0,s.createElement)(pl,{icon:(0,h.isRTL)()?Dp:Ap}))))))),o.map((e=>(0,s.createElement)(m.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,s.createElement)(m.__experimentalNavigatorBackButton,{icon:(0,h.isRTL)()?Ap:Dp,isSmall:!0,"aria-label":(0,h.__)("Navigate to the categories list")},(0,h.__)("Back")),(0,s.createElement)(mm,{category:e,rootClientId:n,onInsert:t})))))}const hm=function(e){let{onSelectCategory:t,selectedCategory:n,onInsert:o,rootClientId:r}=e;const[l,i]=(0,s.useState)(!1),a=dm(),c=(0,u.useViewportMatch)("medium","<");return(0,s.createElement)(s.Fragment,null,!c&&(0,s.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,s.createElement)("nav",{"aria-label":(0,h.__)("Block pattern categories")},(0,s.createElement)(m.__experimentalItemGroup,{role:"list",className:"block-editor-inserter__block-patterns-tabs"},a.map((e=>(0,s.createElement)(m.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>t(e),className:e===n?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":e.label,"aria-current":e===n?"true":void 0},(0,s.createElement)(m.__experimentalHStack,null,(0,s.createElement)(m.FlexBlock,null,e.label),(0,s.createElement)(pl,{icon:Ap}))))),(0,s.createElement)("div",{role:"presentation",className:"block-editor-inserter__patterns-fill-space"}),(0,s.createElement)("div",{role:"listitem"},(0,s.createElement)(m.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary"},(0,h.__)("Explore all patterns")))))),c&&(0,s.createElement)(gm,{onInsert:o,rootClientId:r}),l&&(0,s.createElement)(um,{initialCategory:n,patternCategories:a,onModalClose:()=>i(!1)}))},fm=window.wp.url;function vm(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Pp(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)($p,null):(0,s.createElement)(Np,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(Tp,{items:i,onSelect:l,onHover:t,label:(0,h.__)("Reusable blocks")}))}const bm=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(vm,{onHover:o,onInsert:n,rootClientId:t}),(0,s.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,s.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,fm.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))},{Fill:_m,Slot:km}=(0,m.createSlotFill)("__unstableInserterMenuExtension");_m.Slot=km;const ym=_m,Em=[],Cm=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:d,showBlockDirectory:g=!1,isDraggable:f=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const _=(0,u.useDebounce)(qt.speak,500),[k,y]=jp({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=Pp(k,y),[B,,I]=zp(y,k),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=lm(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=d;b&&x.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=rm((0,p.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,d]);(0,s.useEffect)((()=>{if(!t)return;const e=N.length+x.length,n=(0,h.sprintf)(
|
22 |
/* translators: %d: number of results. */
|
23 |
+
(0,h._n)("%d result found.","%d results found.",e),e);_(n)}),[t,_]);const P=(0,u.useAsyncList)(N,{step:9}),M=(0,u.useAsyncList)(P.length===N.length?x:Em),L=!(0,p.isEmpty)(N)||!(0,p.isEmpty)(x),R=!!N.length&&(0,s.createElement)(Np,{title:(0,s.createElement)(m.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(Tp,{items:P,onSelect:w,onHover:o,label:(0,h.__)("Blocks"),isDraggable:f})),A=!!x.length&&(0,s.createElement)(Np,{title:(0,s.createElement)(m.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Hp,{shownPatterns:M,blockPatterns:x,onClickPattern:I,isDraggable:f})));return(0,s.createElement)(Mp,null,!g&&!L&&(0,s.createElement)($p,null),b?A:R,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?R:A,g&&(0,s.createElement)(ym.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:L,rootClientId:k}},(e=>e.length?e:L?null:(0,s.createElement)($p,null))))},Sm={name:"blocks",
|
24 |
/* translators: Blocks tab title in the block inserter. */
|
25 |
+
title:(0,h.__)("Blocks")},wm={name:"patterns",
|
26 |
/* translators: Patterns tab title in the block inserter. */
|
27 |
+
title:(0,h.__)("Patterns")},Bm={name:"reusable",
|
28 |
/* translators: Reusable blocks tab title in the block inserter. */
|
29 |
+
title:(0,h.__)("Reusable")},Im=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r,prioritizePatterns:l}=e;const i=(0,s.useMemo)((()=>{const e=[];return l&&n&&e.push(wm),e.push(Sm),!l&&n&&e.push(wm),o&&e.push(Bm),e}),[l,Sm,n,wm,o,Bm]);return(0,s.createElement)(m.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:r},t)},xm=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:u,__experimentalFilterValue:p="",shouldFocusBlock:g=!0,prioritizePatterns:f}=e;const[v,b]=(0,s.useState)(p),[_,k]=(0,s.useState)(null),[y,E]=(0,s.useState)(null),[C,S]=(0,s.useState)(null),[w,B,I]=jp({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:g}),{showPatterns:x,hasReusableBlocks:T}=(0,d.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(co);return{showPatterns:!!n(w).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[w]),N=(0,s.useCallback)(((e,t,n)=>{B(e,t,n),i()}),[B,i]),P=(0,s.useCallback)(((e,t)=>{B(e,{patternName:t}),i()}),[B,i]),M=(0,s.useCallback)((e=>{I(!!e),k(e)}),[I,k]),L=(0,s.useCallback)((e=>{E(e)}),[E]),R=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(Rp,{rootClientId:w,onInsert:N,onHover:M,showMostUsedBlocks:u})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(m.VisuallyHidden,{as:"h2"},(0,h.__)("A tip for using the block editor")),(0,s.createElement)(Lu,null)))),[w,N,M,v,u,a]),A=(0,s.useMemo)((()=>(0,s.createElement)(hm,{rootClientId:w,onInsert:P,onSelectCategory:L,selectedCategory:y})),[w,P,L,y]),D=(0,s.useMemo)((()=>(0,s.createElement)(bm,{rootClientId:w,onInsert:N,onHover:M})),[w,N,M]),O=(0,s.useCallback)((e=>"blocks"===e.name?R:"patterns"===e.name?A:D),[R,A,D]),z=(0,s.useRef)();(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{z.current.focus()}})));const F="patterns"===C&&!v&&y,V=!v&&(x||T);return(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:c()("block-editor-inserter__main-area",{"show-as-tabs":V})},(0,s.createElement)(m.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{_&&k(null),b(e)},value:v,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search"),ref:z}),!!v&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,s.createElement)(Cm,{filterValue:v,onSelect:i,onHover:M,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:g})),V&&(0,s.createElement)(Im,{showPatterns:x,showReusableBlocks:T,prioritizePatterns:f,onSelect:S},O),!v&&!V&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},R)),a&&_&&(0,s.createElement)(kp,{item:_}),F&&(0,s.createElement)(pm,{rootClientId:w,onInsert:P,category:y}))}));function Tm(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,a]=(0,s.useState)(""),[u,p]=jp({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[g]=Pp(u,p),[f]=zp(p,u),{setInserterIsOpened:v,insertionIndex:b}=(0,d.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(co),l=t(),i=n(o),s=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),_=f.length&&(!!i||l),k=_&&f.length>6||g.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return _&&(y=l?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":k,"has-expand":v})},k&&(0,s.createElement)(m.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{a(e)},label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(Cm,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l})),v&&(0,s.createElement)(m.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const Nm=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={},prioritizePatterns:u}=e;t=a?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
|
30 |
+
(0,h._x)("Add %s","directly add the only allowed block"),l):u?(0,h.__)("Add pattern"):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:d,...p}=c;return(0,s.createElement)(m.Button,i({icon:Pu,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},p))};class Pm extends s.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=Nm,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:a}=this.props;return i?(0,s.createElement)(Tm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a}):(0,s.createElement)(xm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(m.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Mm=(0,u.compose)([(0,d.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:l}=t;const{getBlockRootClientId:i,hasInserterItems:s,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:c,getSettings:u}=e(co),{getBlockVariations:d}=e(r.store);l=l||i(o)||void 0;const p=a(l),m=c(l),g=u(),h=1===(null==p?void 0:p.length)&&0===(null===(n=d(p[0].name,"inserter"))||void 0===n?void 0:n.length);let f=!1;return h&&(f=p[0]),{hasItems:s(l),hasSingleBlockType:h,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:m,rootClientId:l,prioritizePatterns:g.__experimentalPreferPatternsOnRoot&&!l}})),(0,d.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:l,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!s&&!c)return;const{insertBlock:d}=e(co);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(co);if(!e||!l&&!n)return{};const i={};let s={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var a;const e=t(n);if(null!=e&&null!==(a=e.innerBlocks)&&void 0!==a&&a.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=o(co);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,h.sprintf)(// translators: %s: the name of the block that has been added
|
31 |
+
(0,h.__)("%s block added"),a.title);(0,qt.speak)(m)}}})),(0,u.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Pm),Lm=(0,u.compose)((0,d.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(co),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,d.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(co);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,Nu.decodeEntities)(r)||(0,h.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,h.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{_u.ENTER!==e.keyCode&&_u.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Mm,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Rm(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(Mm,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:u,blockTitle:d,hasSingleBlockType:p}=e;n=p?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
|
32 |
+
(0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const g=!p;let f=(0,s.createElement)(m.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":g?"true":void 0,"aria-expanded":g?u:void 0,disabled:a,label:n},!p&&(0,s.createElement)(m.VisuallyHidden,{as:"span"},n),(0,s.createElement)(pl,{icon:Pu}));return(g||p)&&(f=(0,s.createElement)(m.Tooltip,{text:n},f)),f},isAppender:!0})}const Am=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Rm(e,t)))),Dm=(0,s.forwardRef)(Rm),Om=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:l="div"}=e;const{hideInserter:i,canInsertDefaultBlock:a,selectedBlockClientId:u}=(0,d.useSelect)((e=>{const{canInsertBlockType:n,getTemplateLock:o,getSelectedBlockClientId:l,__unstableGetEditorMode:i}=e(co);return{hideInserter:!!o(t)||"zoom-out"===i(),canInsertDefaultBlock:n((0,r.getDefaultBlockName)(),t),selectedBlockClientId:l()}}),[t]);if(i||!1===n)return null;let p;if(n)p=(0,s.createElement)(n,null);else{if(u!==t&&(t||u))return null;p=a?(0,s.createElement)(Lm,{rootClientId:t}):(0,s.createElement)(Dm,{rootClientId:t,className:"block-list-appender__toggle"})}return(0,s.createElement)(l,{tabIndex:-1,className:c()("block-list-appender wp-block",o),contentEditable:!1,"data-block":!0},p)},zm=Number.MAX_SAFE_INTEGER;(0,s.createContext)();const Fm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const[u,p]=(0,s.useReducer)((e=>(e+1)%zm),0),{orientation:g,rootClientId:f,isVisible:v}=(0,d.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(co),s=l(null!=t?t:n);return{orientation:(null===(o=r(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t,n]),b=Ro(t),_=Ro(n),k="vertical"===g,y=(0,s.useMemo)((()=>{if(u<0||!b&&!_||!v)return{};const e=b?b.getBoundingClientRect():null,t=_?_.getBoundingClientRect():null;if(k)return{width:e?e.width:t.width,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:e?e.height:t.height}}),[b,_,k,u,v]),E=(0,s.useMemo)((()=>{if(u<0||!b&&!_||!v)return;const{ownerDocument:e}=b||_;return{ownerDocument:e,getBoundingClientRect(){const e=b?b.getBoundingClientRect():null,t=_?_.getBoundingClientRect():null;let n=0,o=0;return k?(o=e?e.bottom:t.top,n=(0,h.isRTL)()?e?e.right:t.right:e?e.left:t.left):(o=e?e.top:t.top,n=(0,h.isRTL)()?e?e.left:t.right:e?e.right:t.left),new window.DOMRect(n,o,0,0)}}}),[b,_,u,k,v]),C=yr(l);return(0,s.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(p);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,s.useLayoutEffect)((()=>{if(!_)return;const e=new window.MutationObserver(p);return e.observe(_,{attributes:!0}),()=>{e.disconnect()}}),[_]),(0,s.useLayoutEffect)((()=>{if(b)return b.ownerDocument.defaultView.addEventListener("resize",p),()=>{var e;null===(e=b.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",p)}}),[b]),(b||_)&&v?(0,s.createElement)(m.Popover,i({ref:C,animate:!1,anchor:E,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+f},a,{className:c()("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"bottom-start"}),(0,s.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null},Vm={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}},Hm=function(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{clientId:o}=(0,d.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(co),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),r=(0,u.useReducedMotion)();return(0,s.createElement)(Cr,{clientId:o,__unstableCoverTarget:!0,__unstablePopoverSlot:t,__unstableContentRef:n,className:"block-editor-block-popover__drop-zone"},(0,s.createElement)(m.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?Vm.show:Vm.hide,animate:Vm.show,exit:r?Vm.show:Vm.exit,className:"block-editor-block-popover__drop-zone-foreground"}))},Gm=(0,s.createContext)();function Um(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o}=(0,d.useDispatch)(co),r=(0,s.useContext)(Gm),l=(0,s.useRef)(),{orientation:i,previousClientId:a,nextClientId:p,rootClientId:g,isInserterShown:h,isDistractionFree:f,isNavigationMode:v}=(0,d.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s,getSettings:a,isNavigationMode:c}=e(co),u=r(),d=n(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],m=d[u.index];for(;l(p);)p=i(p);for(;l(m);)m=s(m);const g=a();return{previousClientId:p,nextClientId:m,orientation:(null===(t=o(u.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:u.rootClientId,isNavigationMode:c(),isDistractionFree:g.isDistractionFree,isInserterShown:null==u?void 0:u.__unstableWithInserter}}),[]),b="vertical"===i,_=(0,u.useReducedMotion)(),k={start:{...b?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...b?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:h?.5:0,type:"tween"}},hover:{...b?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.5,type:"tween"}}},y={start:{scale:_?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(f&&!v)return null;const E=c()("block-editor-block-list__insertion-point","is-"+i);return(0,s.createElement)(Fm,{previousClientId:a,nextClientId:p,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(m.__unstableMotion.div,{layout:!_,initial:_?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:l,tabIndex:-1,onClick:function(e){e.target===l.current&&p&&o(p,-1)},onFocus:function(e){e.target!==l.current&&(r.current=!0)},className:c()(E,{"is-with-inserter":h})},(0,s.createElement)(m.__unstableMotion.div,{variants:k,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),h&&(0,s.createElement)(m.__unstableMotion.div,{variants:y,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Mm,{position:"bottom center",clientId:p,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{r.current=e},onSelectOrClose:()=>{r.current=!1}}))))}function Wm(e){const{insertionPoint:t,isVisible:n}=(0,d.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n}=e(co);return{insertionPoint:t(),isVisible:n()}}),[]);return n?"replace"===t.operation?(0,s.createElement)(Hm,i({key:`${t.rootClientId}-${t.index}`},e)):(0,s.createElement)(Um,e):null}function $m(){const e=(0,s.useContext)(Gm),t=(0,d.useSelect)((e=>e(co).getSettings().isDistractionFree||"zoom-out"===e(co).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c,__unstableIsWithinBlockOverlay:p}=(0,d.useSelect)(co),{showInsertionPoint:m,hideInsertionPoint:g}=(0,d.useDispatch)(co);return(0,u.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",l),()=>{o.removeEventListener("mousemove",l)};function l(t){var o;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void g();let l;if(t.target.classList.contains("is-root-container")||(l=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(l))return;const s=(null===(o=n(l))||void 0===o?void 0:o.orientation)||"vertical",u=t.clientY,d=t.clientX;let h=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===s&&t.top>u||e.classList.contains("wp-block")&&"horizontal"===s&&t.left>d}));if(!h)return void g();if(!h.id&&(h=h.firstElementChild,!h))return void g();const f=h.id.slice("block-".length);if(!f||p(f))return;if(a().includes(f))return;const v=h.getBoundingClientRect();if("horizontal"===s&&(t.clientY>v.bottom||t.clientY<v.top)||"vertical"===s&&(t.clientX>v.right||t.clientX<v.left))return void g();const b=r(f);0!==b?m(l,b,{__unstableWithInserter:!0}):g()}}),[e,n,o,r,l,i,m,g,a,t])}const jm="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Km="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function qm(e){return(0,d.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(co),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description,anchor:null==c?void 0:c.anchor}:d}),[e])}function Ym(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:l,name:i,reusableBlockTitle:s}=(0,d.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(co),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),a=qm(t);if(!i||!a)return null;const c=(0,r.getBlockType)(i),u=c?(0,r.__experimentalGetBlockLabel)(c,l,o):null,p=s||u,m=p&&p!==c.title?p:a.title;if(n&&n>0&&m.length>n){const e="...";return m.slice(0,n-e.length)+e}return m}function Qm(e){let{clientId:t,maximumLength:n,context:o}=e;return Ym({clientId:t,maximumLength:n,context:o})}const Zm=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,d.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(co),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),p=(0,s.useRef)(!1),[g,h,f]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,jl.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,d.useDispatch)(co);if((0,s.useEffect)((()=>()=>{p.current&&b()}),[]),!c)return t({draggable:!1});const _={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(m.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:_,onDragStart:e=>{v(n),p.current=!0,g(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),p.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Sp,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Xm=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),Jm=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),eg=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,h.isRTL)()?"left":"right":"down":null;const tg=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?Ap:Dp:Xm:"down"===e?"horizontal"===t?(0,h.isRTL)()?Dp:Ap:Jm:null,ng=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,og=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const p=(0,u.useInstanceId)(og),g=Array.isArray(n)?n:[n],f=g.length,{blockType:v,isDisabled:b,rootClientId:_,isFirst:k,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,d.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:i,getBlock:s,getBlockListSettings:a}=e(co),c=g[0],u=n(c),d=t(c),p=t(g[g.length-1]),m=i(u),h=s(c),f=0===d,v=p===m.length-1,{orientation:b}=a(u)||{};return{blockType:h?(0,r.getBlockType)(h.name):null,isDisabled:"up"===o?f:v,rootClientId:u,firstIndex:d,isFirst:f,isLast:v,orientation:l||b}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,d.useDispatch)(co),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${p}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:tg(o,C),label:ng(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,_),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(m.VisuallyHidden,{id:I},function(e,t,n,o,r,l,i){const s=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,h.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=eg("down",l);if("down"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
33 |
(0,h.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
34 |
(0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
35 |
+
(0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=eg("down",l);if("down"===e)return(0,h.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=eg("up",l);if("up"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
36 |
(0,h.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
37 |
(0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
38 |
+
(0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=eg("up",l);if("up"===e)return(0,h.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,h.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
39 |
+
(0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=eg("down",i);if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
40 |
(0,h.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
41 |
(0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
42 |
+
(0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(l>0&&r){const e=eg("down",i);if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,h.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,h.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
+
(0,h.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=eg("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
46 |
(0,h.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
47 |
(0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
48 |
+
(0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=eg("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
49 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
50 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
51 |
+
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(f,v&&v.title,E,k,y,"up"===o?-1:1,C)))})),rg=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(og,i({direction:"up",ref:t},e)))),lg=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(og,i({direction:"down",ref:t},e)))),ig=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:a,orientation:u}=(0,d.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:s}=e(co),a=Array.isArray(t)?t:[t],c=a[0],u=s(c),d=o(c),p=o(a[a.length-1]),m=i(u);return{canMove:l(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=r(u))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&a&&!r)return null;const p=(0,h.__)("Drag");return(0,s.createElement)(m.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===u})},!n&&(0,s.createElement)(Zm,{clientIds:t},(e=>(0,s.createElement)(m.Button,i({icon:Cp,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:p,tabIndex:"-1"},e)))),(0,s.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(rg,i({clientIds:t},e)))),(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(lg,i({clientIds:t},e))))))},sg=function(e){let{clientId:t,rootClientId:n}=e;const o=qm(t),l=(0,d.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s,__unstableGetEditorMode:a}=e(co),c=l(t),{name:u,attributes:d}=r(t);return{index:c,name:u,attributes:d,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation,editorMode:a()}}),[t,n]),{index:a,name:u,attributes:p,blockMovingMode:g,orientation:f,editorMode:v}=l,{setNavigationMode:b,removeBlock:_}=(0,d.useDispatch)(co),k=(0,s.useRef)(),y=(0,r.getBlockType)(u),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,p,a+1,f);(0,s.useEffect)((()=>{k.current.focus(),(0,qt.speak)(E)}),[E]);const C=Ro(t),{hasBlockMovingClientId:S,getBlockIndex:w,getBlockRootClientId:B,getClientIdsOfDescendants:I,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:T,getPreviousBlockClientId:N,getNextBlockClientId:P}=(0,d.useSelect)(co),{selectBlock:M,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,d.useDispatch)(co),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!g}),O=(0,h.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(m.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(Au,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(m.FlexItem,null,"zoom-out"===v&&(0,s.createElement)(ig,{clientIds:[t],hideDragHandle:!0}),"navigation"===v&&(0,s.createElement)(Zm,{clientIds:[t]},(e=>(0,s.createElement)(m.Button,i({icon:Cp,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{ref:k,onClick:"navigation"===v?()=>b(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,o=n===_u.UP,r=n===_u.DOWN,l=n===_u.LEFT,i=n===_u.RIGHT,s=n===_u.TAB,a=n===_u.ESCAPE,c=n===_u.ENTER,u=n===_u.SPACE,d=e.shiftKey;if(n===_u.BACKSPACE||n===_u.DELETE)return _(t),void e.preventDefault();const p=x(),m=T(),g=N(m||p),h=P(m||p),f=s&&d||o,v=s&&!d||r,b=l,k=i;let y;if(f)y=g;else if(v)y=h;else if(b){var E;y=null!==(E=B(p))&&void 0!==E?E:p}else if(k){var D;y=null!==(D=I([p])[0])&&void 0!==D?D:p}const O=S();if(a&&O&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&O){const e=B(O),t=B(p),n=w(O);let o=w(p);n<o&&e===t&&(o-=1),A(O,e,t,o),M(O),R(null)}if(v||f||b||k)if(y)e.preventDefault(),M(y);else if(s&&p){let t;if(v){t=C;do{t=jl.focus.tabbable.findNext(t)}while(t&&C.contains(t));t||(t=C.ownerDocument.defaultView.frameElement,t=jl.focus.tabbable.findNext(t))}else t=jl.focus.tabbable.findPrevious(C);t&&(e.preventDefault(),t.focus(),L())}},label:E,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(Qm,{clientId:t,maximumLength:35})))))};function ag(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const cg=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!jl.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||V()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=jl.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,qu.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=ag(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=ag(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(m.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(m.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},{clearTimeout:ug,setTimeout:dg}=window,pg=()=>{},mg=200;function gg(e){let{ref:t,isFocused:n,debounceTimeout:o=mg,onChange:r=pg}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},u=()=>{const e=a.current;e&&ug&&ug(e)};return(0,s.useEffect)((()=>()=>{c(!1),u()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),u(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),u(),a.current=dg((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function hg(e){let{ref:t,debounceTimeout:n=mg,onChange:o=pg}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=gg({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),u=(0,s.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),c())};return e&&!u.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),u.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,u,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function fg(){const{selectBlock:e,toggleBlockHighlight:t}=(0,d.useDispatch)(co),{firstParentClientId:n,shouldHide:o,isDistractionFree:l}=(0,d.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(co),{hasBlockSupport:i}=e(r.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,r.getBlockType)(c),d=l();return{firstParentClientId:a,shouldHide:!i(u,"__experimentalParentSelector",!0),isDistractionFree:d.isDistractionFree}}),[]),a=qm(n),c=(0,s.useRef)(),{gestures:u}=hg({ref:c,onChange(e){e&&l||t(n,e)}});return o||void 0===n?null:(0,s.createElement)("div",i({className:"block-editor-block-parent-selector",key:n,ref:c},u),(0,s.createElement)(m.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,h.sprintf)(
|
52 |
/* translators: %s: Name of the block's parent. */
|
53 |
+
(0,h.__)("Select %s"),null==a?void 0:a.title),showTooltip:!0,icon:(0,s.createElement)(Au,{icon:null==a?void 0:a.icon})}))}const vg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function bg(e){let{blocks:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(m.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,h.__)("Preview")),(0,s.createElement)(bp,{viewportWidth:500,blocks:t})))))}function _g(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,s.createElement)(kg,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function kg(e){let{item:t,onSelect:n,setHoveredTransformItemName:o}=e;const{name:l,icon:i,title:a,isDisabled:c}=t;return(0,s.createElement)(m.MenuItem,{className:(0,r.getBlockMenuDefaultClassName)(l),onClick:e=>{e.preventDefault(),n(l)},disabled:c,onMouseLeave:()=>o(null),onMouseEnter:()=>o(l)},(0,s.createElement)(Au,{icon:i,showColors:!0}),a)}const yg=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,a]=(0,s.useState)(),{priorityTextTransformations:c,restTransformations:u}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,s.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort(((e,n)=>{let{name:o}=e,{name:r}=n;return t[o]<t[r]?-1:1})),n}(n),d=c.length&&u.length,p=!!u.length&&(0,s.createElement)(_g,{restTransformations:u,onSelect:o,setHoveredTransformItemName:a});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,{label:(0,h.__)("Transform to"),className:t},i&&(0,s.createElement)(bg,{blocks:(0,r.switchToBlockType)(l,i)}),c.map((e=>(0,s.createElement)(kg,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:a}))),!d&&p),!!d&&(0,s.createElement)(m.MenuGroup,{className:t},p))},Eg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Cg=window.wp.tokenList;var Sg=n.n(Cg);function wg(e,t,n){const o=new(Sg())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Bg(e){return(0,p.find)(e,"isDefault")}function Ig(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,d.useSelect)((e=>{const{getBlock:n}=e(co),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,d.useDispatch)(co),u=function(e){return e&&0!==e.length?Bg(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),m=function(e,t){for(const n of new(Sg())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=(0,p.find)(e,{name:t});if(o)return o}return(0,p.find)(e,"isDefault")}(u,a),g=function(e,t){return(0,s.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,r.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,r.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(l,i);return{onSelect:e=>{const o=wg(a,m,e);c(t,{className:o}),n()},stylesToRender:u,activeStyle:m,genericPreviewBlock:g,className:a}}const xg=()=>{};function Tg(e){let{clientId:t,onSwitch:n=xg}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Ig({clientId:t,onSwitch:n});return r&&0!==r.length?(0,s.createElement)(s.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,s.createElement)(m.MenuItem,{key:e.name,icon:l.name===e.name?Eg:null,onClick:()=>o(e)},(0,s.createElement)(m.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Ng(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(m.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(Tg,{clientId:o,onSwitch:n}))}const Pg=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=Pg(e,t,n);if(o)return o}}},Mg=(e,t)=>{const n=((e,t)=>{const n=(0,r.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function Lg(e){let{patterns:t,onSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(m.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,h.__)("Preview")),(0,s.createElement)(Rg,{patterns:t,onSelect:n})))))}function Rg(e){let{patterns:t,onSelect:n}=e;const o=(0,m.__unstableUseCompositeState)();return(0,s.createElement)(m.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,h.__)("Patterns list")}),t.map((e=>(0,s.createElement)(Ag,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Ag(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,u.useInstanceId)(Ag,`${r}-list__item-description`);return(0,s.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,s.createElement)(m.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,s.createElement)(bp,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,s.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,s.createElement)(m.VisuallyHidden,{id:l},t.description))}const Dg=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[l,i]=(0,s.useState)(!1),a=((e,t)=>(0,s.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,r.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=Pg(r,t.name,o);if(n){e=!0,o.add(n.clientId),Mg(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]))(n,t);return a.length?(0,s.createElement)(m.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},l&&(0,s.createElement)(Lg,{patterns:a,onSelect:o}),(0,s.createElement)(m.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:Ap},(0,h.__)("Patterns"))):null},Og=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,d.useDispatch)(co),l=qm(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:u,patterns:g}=(0,d.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:i,__experimentalGetPatternTransformItems:s}=e(co),{getBlockStyles:a,getBlockType:c}=e(r.store),{canRemoveBlocks:u}=e(co),d=o((0,p.castArray)(t)[0]),[{name:m}]=n,g=1===n.length,h=g&&a(m);let f;var v;g?f=null==l?void 0:l.icon:f=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(v=c(m))||void 0===v?void 0:v.icon:vg;return{possibleBlockTransformations:i(n,d),canRemove:u(t,d),hasBlockStyles:!(null==h||!h.length),icon:f,patterns:s(n,d)}}),[t,n,null==l?void 0:l.icon]),f=Ym({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),_=!!i.length&&a&&!b,k=!(null==g||!g.length)&&a;if(!c&&!_)return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Au,{icon:u,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},f))}));const y=f,E=1===n.length?(0,h.sprintf)(
|
54 |
/* translators: %s: block title. */
|
55 |
(0,h.__)("%s: Change block type or style"),f):(0,h.sprintf)(
|
56 |
/* translators: %d: number of blocks. */
|
57 |
+
(0,h._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||_||k;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(m.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Au,{icon:u,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},f)),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},k&&(0,s.createElement)(Dg,{blocks:n,patterns:g,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),_&&(0,s.createElement)(yg,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{o(t,(0,r.switchToBlockType)(n,e))})(e),l()}}),c&&(0,s.createElement)(Ng,{hoveredBlock:n[0],onSwitch:l}))})))))},zg=e=>{let{clientIds:t}=e;const n=(0,d.useSelect)((e=>e(co).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Og,{clientIds:t,blocks:n})},{Fill:Fg,Slot:Vg}=(0,m.createSlotFill)("__unstableBlockToolbarLastItem");Fg.Slot=Vg;const Hg=Fg,Gg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Ug=window.wp.blob;function Wg(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}function $g(){const{getBlockName:e}=(0,d.useSelect)(co),{getBlockType:t}=(0,d.useSelect)(r.store),{createSuccessNotice:n}=(0,d.useDispatch)(Op.store);return(0,s.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,h.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
|
58 |
(0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
59 |
(0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
|
60 |
(0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
|
61 |
+
(0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function jg(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,d.useSelect)(co),{flashBlock:c,removeBlocks:p,replaceBlocks:m,__unstableDeleteSelection:g,__unstableExpandSelection:h}=(0,d.useDispatch)(co),f=$g();return(0,u.useRefEffect)((u=>{function d(d){const v=t();if(0===v.length)return;if(!n()){const{target:e}=d,{ownerDocument:t}=e;if("copy"===d.type||"cut"===d.type?(0,jl.documentHasUncollapsedSelection)(t):(0,jl.documentHasSelection)(t))return}if(!u.contains(d.target.ownerDocument.activeElement))return;const b=d.defaultPrevented;d.preventDefault();const _=s(),k=i()||l(),y=!k&&!_;if("copy"===d.type||"cut"===d.type)if(1===v.length&&c(v[0]),y)h();else{let t;if(f(d.type,v),k)t=e(v);else{const[n,o]=a();t=[n,...e(v.slice(1,v.length-1)),o]}const n=d.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,r.createBlock)(n,JSON.parse(d.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,r.serialize)(t);d.clipboardData.setData("text/plain",(E=(E=o).replace(/<br>/g,"\n"),(0,jl.__unstableStripHTML)(E).trim().replace(/\n\n+/g,"\n\n"))),d.clipboardData.setData("text/html",o)}var E;if("cut"===d.type)k&&!y?p(v):g();else if("paste"===d.type){if(b)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,jl.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!Wg(r,o)&&(o=r.map((e=>`<img src="${(0,Ug.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(d),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});m(v,l,l.length-1,-1)}}return u.ownerDocument.addEventListener("copy",d),u.ownerDocument.addEventListener("cut",d),u.ownerDocument.addEventListener("paste",d),()=>{u.ownerDocument.removeEventListener("copy",d),u.ownerDocument.removeEventListener("cut",d),u.ownerDocument.removeEventListener("paste",d)}}),[])}const Kg=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:jg()},t)};function qg(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,d.useSelect)(co),{getDefaultBlockName:u,getGroupingBlockName:p}=(0,d.useSelect)(r.store),m=s(t),g=i(t[0]),h=m.every((e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),f=l(u(),g),v=a(t,g),b=c(t,g),{removeBlocks:_,replaceBlocks:k,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I}=(0,d.useDispatch)(co),x=$g();return n({canDuplicate:h,canInsertDefaultBlock:f,canMove:v,canRemove:b,rootClientId:g,blocks:m,onDuplicate:()=>y(t,o),onRemove:()=>_(t,o),onInsertBefore(){const e=Array.isArray(t)?t[0]:e;C(e)},onInsertAfter(){const e=Array.isArray(t)?t[t.length-1]:e;E(e)},onMoveTo(){B(!0),I(t[0]),w(t[0])},onGroup(){if(!m.length)return;const e=p(),n=(0,r.switchToBlockType)(m,e);n&&k(t,n)},onUngroup(){if(!m.length)return;const e=m[0].innerBlocks;e.length&&k(t,e)},onCopy(){const e=m.map((e=>{let{clientId:t}=e;return t}));1===m.length&&S(e[0]),x("copy",e)}})}const Yg=()=>{},Qg=(0,u.compose)([(0,d.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(co),s=o(n),a=i().codeEditingEnabled;return{mode:l(n),blockType:s?(0,r.getBlockType)(s.name):null,isCodeEditingEnabled:a}})),(0,d.withDispatch)(((e,t)=>{let{onToggle:n=Yg,clientId:o}=t;return{onToggleMode(){e(co).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,s.createElement)(m.MenuItem,{onClick:o},!l&&a)})),Zg=(0,u.compose)((0,d.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(co).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,d.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(co).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,h.__)("Convert to Blocks");return(0,s.createElement)(m.MenuItem,{onClick:n},!o&&r)})),{Fill:Xg,Slot:Jg}=(0,m.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Xg.Slot=Jg;const eh=Xg;function th(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,d.useDispatch)(co);return n||o?(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(m.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),a()}},(0,h._x)("Group","verb")),o&&(0,s.createElement)(m.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,h._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function nh(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,d.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(co),{getGroupingBlockName:s}=e(r.store),a=i(),c=s(),u=l(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}function oh(e){return(0,d.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s,getTemplateLock:a}=t(co),c=s(e),u=n(e),d=o(e,c),p=r(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:l(i(e)),isContentLocked:"contentOnly"===a(e),isLocked:!u||!d||!p}}),[e])}const rh=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),lh=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"})),ih=["core/block","core/navigation"];function sh(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function ah(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=oh(t),{allowsEditLocking:p,templateLock:g,hasTemplateLock:f}=(0,d.useSelect)((e=>{var n,o;const{getBlockName:l,getBlockAttributes:i}=e(co),s=l(t),a=(0,r.getBlockType)(s);return{allowsEditLocking:ih.includes(s),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==a||null===(o=a.attributes)||void 0===o||!o.templateLock)}}),[t]),[v,b]=(0,s.useState)(!!g),{updateBlockAttributes:_}=(0,d.useDispatch)(co),k=qm(t),y=(0,u.useInstanceId)(ah,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...p?{edit:!i}:{}})}),[i,a,c,p]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,s.createElement)(m.Modal,{title:(0,h.sprintf)(
|
62 |
/* translators: %s: Name of the block. */
|
63 |
+
(0,h.__)("Lock %s"),k.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,s.createElement)("p",null,(0,h.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),_([t],{lock:o,templateLock:v?sh(o):void 0}),n()}},(0,s.createElement)("div",{role:"group","aria-labelledby":y,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(m.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:y},(0,h.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>l({move:e,remove:e,...p?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},p&&(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Restrict editing"),(0,s.createElement)(m.Icon,{icon:o.edit?lh:rh})),checked:!!o.edit,onChange:e=>l((t=>({...t,edit:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Disable movement"),(0,s.createElement)(m.Icon,{icon:o.move?lh:rh})),checked:o.move,onChange:e=>l((t=>({...t,move:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Prevent removal"),(0,s.createElement)(m.Icon,{icon:o.remove?lh:rh})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))}))),f&&(0,s.createElement)(m.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,h.__)("Apply to all blocks inside"),checked:v,disabled:o.move&&!o.remove,onChange:()=>b(!v)})),(0,s.createElement)(m.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{variant:"tertiary",onClick:n},(0,h.__)("Cancel"))),(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{variant:"primary",type:"submit"},(0,h.__)("Apply"))))))}function ch(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=oh(t),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,h.__)("Unlock"):(0,h.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuItem,{icon:o?rh:lh,onClick:l},i),r&&(0,s.createElement)(ah,{clientId:t,onClose:l}))}const{Fill:uh,Slot:dh}=(0,m.createSlotFill)("BlockSettingsMenuControls");function ph(e){let{...t}=e;return(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(uh,t))}ph.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:o}=e;const{selectedBlocks:r,selectedClientIds:l,canRemove:a}=(0,d.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(co),l=null!==n?n:o();return{selectedBlocks:(0,p.map)(t(l).filter(Boolean),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:c}=oh(l[0]),u=1===l.length&&c,g=nh(),{isGroupable:h,isUngroupable:f}=g,v=(h||f)&&a;return(0,s.createElement)(dh,{fillProps:{...t,__unstableDisplayLocation:o,selectedBlocks:r,selectedClientIds:l}},(e=>!(null!=e&&e.length)>0&&!v&&!u?null:(0,s.createElement)(m.MenuGroup,null,u&&(0,s.createElement)(ch,{clientId:l[0]}),e,v&&(0,s.createElement)(th,i({},g,{onClose:null==t?void 0:t.onClose})))))};const mh=ph,gh=()=>{},hh={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function fh(e){let{blocks:t,onCopy:n}=e;const o=(0,u.useCopyToClipboard)((()=>(0,r.serialize)(t)),n),l=t.length>1?(0,h.__)("Copy blocks"):(0,h.__)("Copy block");return(0,s.createElement)(m.MenuItem,{ref:o},l)}const vh=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:l,...a}=e;const c=(0,p.castArray)(t),g=c.length,f=c[0],{firstParentClientId:v,isDistractionFree:b,onlyBlock:_,parentBlockType:k,previousBlockClientId:y,nextBlockClientId:E,selectedBlockClientIds:C}=(0,d.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a,getBlockAttributes:c}=e(co),{getActiveBlockVariation:u}=e(r.store),d=o(f),p=d&&n(d);return{firstParentClientId:d,isDistractionFree:a().isDistractionFree,onlyBlock:1===t(d),parentBlockType:d&&(u(p,c(d))||(0,r.getBlockType)(p)),previousBlockClientId:l(f),nextBlockClientId:i(f),selectedBlockClientIds:s()}}),[f]),S=(0,d.useSelect)((e=>{const{getShortcutRepresentation:t}=e(qu.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:w,toggleBlockHighlight:B}=(0,d.useDispatch)(co),I=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:gh,[n]),x=Ym({clientId:f,maximumLength:25}),T=(0,s.useCallback)(n?()=>{const e=y||E;e&&C.includes(f)&&!C.includes(e)&&n(e)}:gh,[n,y,E,C]),N=(0,h.sprintf)(
|
64 |
/* translators: %s: block name */
|
65 |
+
(0,h.__)("Remove %s"),x),P=1===g?N:(0,h.__)("Remove blocks"),M=(0,s.useRef)(),{gestures:L}=hg({ref:M,onChange(e){e&&b||B(v,e)}});return(0,s.createElement)(qg,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:c,canRemove:d,onDuplicate:p,onInsertAfter:b,onInsertBefore:y,onRemove:E,onCopy:C,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(m.DropdownMenu,i({icon:Gg,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:hh,noIcons:!0},a),(e=>{let{onClose:a}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,null,(0,s.createElement)(eh.Slot,{fillProps:{onClose:a}}),!!v&&(0,s.createElement)(m.MenuItem,i({},L,{ref:M,icon:(0,s.createElement)(Au,{icon:k.icon}),onClick:()=>w(v)}),(0,h.sprintf)(
|
66 |
/* translators: %s: Name of the block's parent. */
|
67 |
+
(0,h.__)("Select parent block (%s)"),k.title)),1===g&&(0,s.createElement)(Zg,{clientId:f}),(0,s.createElement)(fh,{blocks:x,onCopy:C}),n&&(0,s.createElement)(m.MenuItem,{onClick:(0,u.pipe)(a,p,I),shortcut:S.duplicate},(0,h.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuItem,{onClick:(0,u.pipe)(a,y),shortcut:S.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(m.MenuItem,{onClick:(0,u.pipe)(a,b),shortcut:S.insertAfter},(0,h.__)("Insert after"))),c&&!_&&(0,s.createElement)(m.MenuItem,{onClick:(0,u.pipe)(a,B)},(0,h.__)("Move to")),1===g&&(0,s.createElement)(Qg,{clientId:f,onToggle:a})),(0,s.createElement)(mh.Slot,{fillProps:{onClose:a},clientIds:t,__unstableDisplayLocation:l}),"function"==typeof o?o({onClose:a}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:a}))),d&&(0,s.createElement)(m.MenuGroup,null,(0,s.createElement)(m.MenuItem,{onClick:(0,u.pipe)(a,E,T),shortcut:S.remove},P)))}))}))},bh=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(vh,i({clientIds:t,toggleProps:e},n)))))};function _h(e){let{clientId:t}=e;const n=qm(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=oh(t),[a,c]=(0,s.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(m.ToolbarButton,{icon:lh,label:(0,h.sprintf)(
|
68 |
/* translators: %s: block name */
|
69 |
+
(0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(ah,{clientId:t,onClose:c})):null}const kh=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),yh=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),Eh=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"})),Ch={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}},Sh=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=nh(),{replaceBlocks:l}=(0,d.useDispatch)(co),{canRemove:i,variations:a}=(0,d.useSelect)((e=>{const{canRemoveBlocks:o}=e(co),{getBlockVariations:l}=e(r.store);return{canRemove:o(t),variations:l(n,"transform")}}),[t,n]),c=o=>{const i=(0,r.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),i&&i.length>0&&(i[0].attributes.layout=Ch[o],l(t,i))};if(!o||!i)return null;const u=!!a.find((e=>{let{name:t}=e;return"group-row"===t})),p=!!a.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{icon:kh,label:(0,h._x)("Group","verb"),onClick:c}),u&&(0,s.createElement)(m.ToolbarButton,{icon:yh,label:(0,h._x)("Row","single horizontal line"),onClick:()=>c("row")}),p&&(0,s.createElement)(m.ToolbarButton,{icon:Eh,label:(0,h._x)("Stack","verb"),onClick:()=>c("stack")}))};function wh(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,d.useSelect)((e=>!!n&&"html"===e(co).getBlockMode(n)),[n]),{toggleBlockMode:r}=(0,d.useDispatch)(co);return o?(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{onClick:()=>{r(n)}},(0,h.__)("Edit visually"))):null}const Bh=(0,s.createContext)(""),Ih=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,isDistractionFree:p,isValid:g,isVisual:h,isContentLocked:f}=(0,d.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s,__unstableGetContentLockingParent:a}=e(co),c=o(),u=c[0],d=i(u),p=s();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,r.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,isDistractionFree:p.isDistractionFree,rootClientId:d,isValid:c.every((e=>l(e))),isVisual:c.every((e=>"visual"===n(e))),isContentLocked:!!a(u)}}),[]),{toggleBlockHighlight:v}=(0,d.useDispatch)(co),b=(0,s.useRef)(),{showMovers:_,gestures:k}=hg({ref:b,onChange(e){e&&p||v(o,e)}}),y=(0,u.useViewportMatch)("medium","<")||a;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const E=y||_;if(0===n.length)return null;const C=g&&h,S=n.length>1,w=c()("block-editor-block-toolbar",E&&"is-showing-movers");return(0,s.createElement)("div",{className:w},!S&&!y&&!f&&(0,s.createElement)(fg,null),(0,s.createElement)("div",i({ref:b},k),(C||S)&&!f&&(0,s.createElement)(m.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(zg,{clientIds:n}),!S&&(0,s.createElement)(_h,{clientId:n[0]}),(0,s.createElement)(ig,{clientIds:n,hideDragHandle:t}))),C&&S&&(0,s.createElement)(Sh,null),C&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ko.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Bh.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(Hg.Slot,null))),(0,s.createElement)(wh,{clientIds:n}),!f&&(0,s.createElement)(bh,{clientIds:n}))},xh=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:a,showParentSelector:u}=(0,d.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,__unstableGetContentLockingParent:l}=e(co),{getBlockType:i}=e(r.store),s=o(),a=s[0],c=n(a),u=i(t(c[c.length-1]));return{blockType:a&&i(t(a)),hasParents:c.length,showParentSelector:u&&(0,r.hasBlockSupport)(u,"__experimentalParentSelector",!0)&&s.length<=1&&!l(a)}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const p=c()("block-editor-block-contextual-toolbar",{"has-parent":a&&u,"is-fixed":n});return(0,s.createElement)(cg,i({focusOnMount:t,className:p
|
70 |
+
/* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(Ih,{hideDragHandle:n}))},Th={placement:"top-start"},Nh={...Th,flip:!1,shift:!0},Ph={...Th,flip:!0,shift:!1};function Mh(e,t,n){if(!e||!t)return Nh;const o=t.getBoundingClientRect(),r=e.getBoundingClientRect(),l=e.ownerDocument.documentElement.clientHeight,i=o.top-r.top>n,s=o.height>l-n;return i||s?Nh:Ph}function Lh(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(co);return{editorMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,isDistractionFree:l().isDistractionFree,lastClientId:o()?i():null}}function Rh(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,showContents:r,capturingClientId:l,__unstablePopoverSlot:a,__unstableContentRef:p}=e;const{editorMode:m,isMultiSelecting:g,isTyping:h,hasFixedToolbar:f,isDistractionFree:v,lastClientId:b}=(0,d.useSelect)(Lh,[]),_=(0,d.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(co);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),k=(0,u.useViewportMatch)("medium"),y=(0,s.useRef)(!1),{stopTyping:E}=(0,d.useDispatch)(co),C="navigation"===m||"zoom-out"===m,S="edit"===m&&!f&&k&&!g&&!(!h&&"edit"===m&&o)&&!h,w=!("edit"!==m||S||f||v||o);(0,qu.useShortcut)("core/block-editor/focus-toolbar",(()=>{y.current=!0,E(!0)}),{isDisabled:!w}),(0,s.useEffect)((()=>{y.current=!1}));const B=(0,s.useRef)(),I=function(e){let{contentElement:t,clientId:n}=e;const o=Ro(n),[r,l]=(0,s.useState)(0),[i,a]=(0,s.useState)((()=>Mh(t,o,r))),c=(0,d.useSelect)((e=>e(co).getBlockIndex(n)),[n]),p=(0,u.useRefEffect)((e=>{l(e.offsetHeight)}),[]),m=(0,s.useCallback)((()=>a(Mh(t,o,r))),[t,o,r]);return(0,s.useLayoutEffect)(m,[c,m]),(0,s.useLayoutEffect)((()=>{var e,n,r;if(!t||!o)return;const l=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let i;null==l||null===(n=l.addEventHandler)||void 0===n||n.call(l,"resize",m);const s=null==o||null===(r=o.ownerDocument)||void 0===r?void 0:r.defaultView;return s.ResizeObserver&&(i=new s.ResizeObserver(m),i.observe(o)),()=>{var e;null==l||null===(e=l.removeEventHandler)||void 0===e||e.call(l,"resize",m),i&&i.disconnect()}}),[m,t,o]),{...i,ref:p}}({contentElement:null==p?void 0:p.current,clientId:t});return C||S?(0,s.createElement)(Cr,i({clientId:l||t,bottomClientId:b,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstablePopoverSlot:a,__unstableContentRef:p,resize:!1},I),S&&r&&(0,s.createElement)(xh,{focusOnMount:y.current,__experimentalInitialIndex:B.current,__experimentalOnIndexChange:e=>{B.current=e},key:t}),C&&(0,s.createElement)(sg,{clientId:t,rootClientId:n})):null}function Ah(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,getSettings:s,isNavigationMode:a,__experimentalGetBlockListSettingsForBlocks:c}=e(co),u=t()||n();if(!u)return;const{name:d,attributes:m={}}=l(u)||{},g=i(u),h=c(g),f=(0,p.find)(g,(e=>{var t;return null===(t=h[e])||void 0===t?void 0:t.__experimentalCaptureToolbars})),v=s();return{clientId:u,rootClientId:o(u),name:d,isDistractionFree:v.isDistractionFree,isNavigationMode:a(),isEmptyDefaultBlock:d&&(0,r.isUnmodifiedDefaultBlock)({name:d,attributes:m}),capturingClientId:f}}function Dh(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,d.useSelect)(Ah,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c,isDistractionFree:u,isNavigationMode:p}=o;return i?(0,s.createElement)(Rh,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,showContents:!u||p,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Oh(e){let{children:t}=e;const n=(0,s.useContext)(Gm),o=(0,s.useContext)(m.Disabled.Context);return n||o?t:(V()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8",version:"6.3"}),(0,s.createElement)(Wm,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Dh,{__unstablePopoverSlot:"block-toolbar"}),t))}const zh=(0,u.createHigherOrderComponent)((e=>t=>{const{clientId:n}=go();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Fh=zh((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Dm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Vh=(0,u.compose)([zh,(0,d.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(co),r=o(n);return{lastBlockClientId:r[r.length-1]}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Lm,{rootClientId:t})})),Hh=new WeakMap,Gh=new WeakMap;function Uh(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const e=p.map((e=>(0,r.cloneBlock)(e)));i(e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,i&&r<t?t-s:t)}}}function Wh(e,t,n,o,l,i){return t=>{if(!n)return;const s=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(n=>"files"===n.type&&l(n.blockName,e)&&n.isMatch(t)));if(s){const e=s.transform(t,o);i(e)}}}function $h(e,t,n){return e=>{const t=(0,r.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}function jh(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{operation:o="insert"}=n,r=(0,d.useSelect)((e=>e(co).getSettings().mediaUpload),[]),{canInsertBlockType:l,getBlockIndex:i,getClientIdsOfDescendants:a,getBlockOrder:c,getBlocksByClientId:u}=(0,d.useSelect)(co),{insertBlocks:p,moveBlocksToPosition:m,updateBlockAttributes:g,clearSelectedBlock:h,replaceBlocks:f,removeBlocks:v}=(0,d.useDispatch)(co),b=(0,d.useRegistry)(),_=(0,s.useCallback)((function(n){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("replace"===o){const o=c(e)[t];f(o,n,void 0,l)}else p(n,t,e,r,l)}),[o,c,p,f,t,e]),k=(0,s.useCallback)(((n,r,l)=>{if("replace"===o){const o=u(n),r=c(e)[t];b.batch((()=>{v(n,!1),f(r,o,void 0,0)}))}else m(n,r,e,l)}),[o,c,u,p,m,v,t,e]),y=Uh(e,t,i,a,k,_,h),E=Wh(e,0,r,g,l,_),C=$h(0,0,_);return e=>{const t=(0,jl.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?E(t):y(e)}}function Kh(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function qh(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Kh(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function Yh(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}function Qh(e,t){var n,o;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const l="horizontal"===r?["left","right"]:["top","bottom"],i=(0,h.isRTL)();let s=0,a="before",c=1/0;e.forEach((e=>{let{isUnmodifiedDefaultBlock:n,getBoundingClientRect:o,blockIndex:r}=e;const u=o();let[d,p]=qh(t,u,l);n&&Yh(t,u)&&(d=0),d<c&&(a="bottom"===p||!i&&"right"===p||i&&"left"===p?"after":"before",c=d,s=r)}));const u=s+("after"===a?1:-1),d=!(null===(n=e[s])||void 0===n||!n.isUnmodifiedDefaultBlock),p=!(null===(o=e[u])||void 0===o||!o.isUnmodifiedDefaultBlock);return d||p?[d?s:u,"replace"]:["after"===a?s+1:s,"insert"]}function Zh(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)({index:null,operation:"insert"}),o=(0,d.useSelect)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:o,__unstableHasActiveBlockOverlayActive:r}=t(co),l=n(e);return["all","contentOnly"].some((e=>e===l))||r(e)||o(e)}),[e]),{getBlockListSettings:l,getBlocks:i,getBlockIndex:a}=(0,d.useSelect)(co),{showInsertionPoint:c,hideInsertionPoint:p}=(0,d.useDispatch)(co),m=jh(e,t.index,{operation:t.operation}),g=(0,u.useThrottle)((0,s.useCallback)(((t,o)=>{var s;const u=i(e);if(0===u.length)return void n({index:0,operation:"insert"});const d=u.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,r.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>o.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:a(t)}})),[p,m]=Qh(d,{x:t.clientX,y:t.clientY},null===(s=l(e))||void 0===s?void 0:s.orientation);n({index:p,operation:m}),c(e,p,{operation:m})}),[e]),200);return(0,u.__experimentalUseDropZone)({isDisabled:o,onDrop:m,onDragOver(e){g(e,e.currentTarget.ownerDocument)},onDragLeave(){g.cancel(),p()},onDragEnd(){g.cancel(),p()}})}function Xh(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:u,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:g,renderAppender:h,orientation:f,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,d.useDispatch)(co),u=(0,d.useRegistry)(),{blockListSettings:p,parentLock:m}=(0,d.useSelect)((t=>{const n=t(co).getBlockRootClientId(e);return{blockListSettings:t(co).getBlockListSettings(e),parentLock:t(co).getTemplateLock(n)}}),[e]),g=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:g,templateLock:void 0===r||"contentOnly"===m?m:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=bl(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),kr()(p,t)||(Hh.get(u)||Hh.set(u,[]),Hh.get(u).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=Hh.get(u))&&void 0!==e&&e.length&&u.batch((()=>{Hh.get(u).forEach((e=>{c(...e)})),Hh.set(u,[])}))})))}),[e,p,g,n,o,r,m,l,i,c,a,u])}(t,n,o,l,a,m,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l,isBlockSelected:i}=(0,d.useSelect)(co),{replaceInnerBlocks:a}=(0,d.useDispatch)(co),c=(0,d.useSelect)((t=>t(co).getBlocks(e)),[e]),{getBlocks:u}=(0,d.useSelect)(co),m=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{window.queueMicrotask((()=>{const s=u(e),c=0===s.length||"all"===n||"contentOnly"===n,d=!(0,p.isEqual)(t,m.current);if(!c||!d)return;m.current=t;const g=(0,r.synchronizeBlocksWithTemplate)(s,t);(0,p.isEqual)(g,s)||a(e,g,0===s.length&&o&&0!==g.length&&i(e),l())}))}),[c,t,n,e])}(t,i,a,u);const _=(0,d.useSelect)((e=>{const n=e(co).getBlock(t);if(!n)return;const o=(0,r.getBlockType)(n.name);return o&&o.providesContext?function(e,t){Gh.has(t)||Gh.set(t,new WeakMap);const n=Gh.get(t);if(!n.has(e)){const o=(0,p.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o):void 0}),[t]);return(0,s.createElement)(ql,{value:_},(0,s.createElement)(uf,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Jh(e){return Fu(e),(0,s.createElement)(Xh,e)}const ef=(0,s.forwardRef)(((e,t)=>{const n=tf({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function tf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=go(),o=(0,u.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,d.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,__unstableGetEditorMode:s}=e(co),a=t(n),c="navigation"===s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),p=(0,u.useMergeRefs)([e.ref,Zh({rootClientId:n})]),m={__experimentalCaptureToolbars:l,...t},g=m.value&&m.onChange?Jh:Xh;return{...e,ref:p,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(g,i({},m,{clientId:n})):(0,s.createElement)(uf,t)}}tf.save=r.__unstableGetInnerBlocksProps,ef.DefaultBlockAppender=Vh,ef.ButtonBlockAppender=Fh,ef.Content=()=>tf.save().children;const nf=ef,of=(0,s.createContext)(),rf=(0,s.createContext)(),lf=new WeakMap;function sf(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,u.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,editorMode:p}=(0,d.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(co),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),m=(0,d.useRegistry)(),{setBlockVisibility:g}=(0,d.useDispatch)(co),h=(0,u.useDebounce)((0,s.useCallback)((()=>{const e={};lf.get(m).forEach((t=>{let[n,o]=t;e[n]=o})),g(e)}),[m]),300,{trailing:!0}),f=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{lf.get(m)||lf.set(m,[]);for(const t of e){const e=t.target.getAttribute("data-block");lf.get(m).push([e,t.isIntersecting])}h()}))}),[]),v=tf({ref:(0,u.useMergeRefs)([Gu(),$m(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":"navigation"===p})},n);return(0,s.createElement)(of.Provider,{value:o},(0,s.createElement)(rf.Provider,{value:f},(0,s.createElement)("div",v)))}function af(e){return function(){const{patterns:e,isPreviewMode:t}=(0,d.useSelect)((e=>{const{__experimentalBlockPatterns:t,__unstableIsPreviewMode:n}=e(co).getSettings();return{patterns:t,isPreviewMode:n}}),[]);(0,s.useEffect)((()=>{if(t)return;if(null==e||!e.length)return;let n,o=-1;const r=()=>{o++,o>=e.length||((0,d.select)(co).__experimentalGetParsedPattern(e[o].name),n=jm(r))};return n=jm(r),()=>Km(n)}),[e,t])}(),(0,s.createElement)(Oh,null,(0,s.createElement)(mo,{value:uo},(0,s.createElement)(sf,e)))}function cf(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=_l}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,d.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(co);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,s.createElement)(yl,{value:l},i.map((e=>(0,s.createElement)(d.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(Tu,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(Om,{tagName:r,rootClientId:n,renderAppender:o}))}function uf(e){return(0,s.createElement)(d.AsyncModeProvider,{value:!1},(0,s.createElement)(cf,e))}function df(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function pf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||df(Object.values(n).filter(Boolean))||"px"}function mf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=df(o),i=0===r||r?`${r}${l}`:void 0;return i}function gf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=mf(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function hf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function ff(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,a=mf(r);void 0===a&&(a=pf(n));const c=hf(r)&&gf(r),u=c?(0,h.__)("Mixed"):null;return(0,s.createElement)(m.__experimentalUnitControl,i({},l,{"aria-label":(0,h.__)("Border radius"),disableUnits:c,isOnly:!0,value:a,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:u}))}af.__unstableElementContext=of;const vf={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function bf(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e;const a=e=>n=>{if(!t)return;const o=isNaN(parseFloat(n))?void 0:n;t({...c,[e]:o})},c="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(vf).map((e=>{let[t,r]=e;const[u,d]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(c[t]),p=c[t]?d:n[t]||n.flat;return(0,s.createElement)(m.Tooltip,{text:r,position:"top",key:t},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(m.__experimentalUnitControl,i({},l,{"aria-label":r,value:[u,p].join(""),onChange:a(t),onUnitChange:(g=t,e=>{const t={...n};t[g]=e,o(t)})}))));var g})))}function _f(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink radii"):(0,h.__)("Link radii");return(0,s.createElement)(m.Tooltip,{text:o},(0,s.createElement)("span",null,(0,s.createElement)(m.Button,i({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?nr:or,iconSize:24,"aria-label":o}))))}const kf={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},yf={px:100,em:20,rem:20};function Ef(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!hf(n)||!gf(n)),[l,i]=(0,s.useState)({flat:"string"==typeof n?(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"]}),c=pf(l),u=a&&a.find((e=>e.value===c)),d=(null==u?void 0:u.step)||1,[p]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(mf(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ff,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,units:a}),(0,s.createElement)(m.RangeControl,{label:(0,h.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:0,max:yf[c],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${c}`:void 0)},step:d})):(0,s.createElement)(bf,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||kf,units:a}),(0,s.createElement)(_f,{onClick:()=>r(!o),isLinked:o})))}function Cf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ef,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=cr({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}Rd([Ad,zd]);const Sf=(e,t,n)=>{if(t){const n=(0,p.find)(e,{slug:t});if(n)return n}return{color:n}},wf=(e,t)=>(0,p.find)(e,{color:t});function Bf(e,t){if(e&&t)return`has-${(0,p.kebabCase)(t)}-${e}`}function If(){return{disableCustomColors:!Yo("color.custom"),disableCustomGradients:!Yo("color.customGradient")}}function xf(){const e=If(),t=Yo("color.palette.custom"),n=Yo("color.palette.theme"),o=Yo("color.palette.default"),r=Yo("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=Yo("color.gradients.custom"),i=Yo("color.gradients.theme"),a=Yo("color.gradients.default"),c=Yo("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const Tf="__experimentalBorder",Nf=["top","right","bottom","left"],Pf=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},Mf=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Lf=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Mf(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return Mf(t,"color",o)||{color:o}};function Rf(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Af(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=xf(),a=Df(e.name),c=Yo("border.color")&&Df(e.name,"color"),u=Yo("border.radius")&&Df(e.name,"radius"),d=Yo("border.style")&&Df(e.name,"style"),p=Yo("border.width")&&Df(e.name,"width");if([!c,!u,!d,!p].every(Boolean)||!a)return null;const g=(0,r.getBlockSupport)(e.name,[Tf,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=Lf({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Nf.forEach((e=>{var n;const o=Rf(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=Lf({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(br,{__experimentalGroup:"border"},(p||c)&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,m.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,h.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:cr({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:f,resetAllFilter:Pf,panelId:n},(0,s.createElement)(m.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,r={...e};if((0,m.__experimentalHasSplitBorders)(e))r={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},Nf.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=Lf({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(r[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=Lf({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=cr({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Of(o,"radius")})}(e),isShownByDefault:null==g?void 0:g.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(Cf,e)))}function Df(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,Tf);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function Of(e,t){return cr({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function zf(e,t,n){if(!Df(t,"color")||pr(t,Tf,"color"))return e;const o=Ff(n),r=c()(e.className,o);return e.className=r||void 0,e}function Ff(e){var t;const{borderColor:n,style:o}=e,r=Bf("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const Vf=(0,u.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=xf();if(!Df(m,"color")||pr(m,Tf,"color"))return(0,s.createElement)(e,t);const{color:b}=Lf({colors:v,namedColor:h}),{color:_}=Lf({colors:v,namedColor:Rf(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:k}=Lf({colors:v,namedColor:Rf(null==f||null===(r=f.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=Lf({colors:v,namedColor:Rf(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=Lf({colors:v,namedColor:Rf(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:_||b,borderRightColor:k||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function Hf(e){if(e)return`has-${e}-gradient-background`}function Gf(e,t){const n=(0,p.find)(e,["slug",t]);return n&&n.gradient}function Uf(e,t){return(0,p.find)(e,["gradient",t])}function Wf(e,t){const n=Uf(e,t);return n&&n.slug}function $f(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=go(),o=Yo("color.gradients.custom"),r=Yo("color.gradients.theme"),l=Yo("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,d.useSelect)((o=>{const{getBlockAttributes:r}=o(co),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,d.useDispatch)(co),p=(0,s.useCallback)((o=>{const r=Wf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),m=Hf(a);let g;return g=a?Gf(i,a):c,{gradientClass:m,gradientValue:g,setGradient:p}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Df(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",zf),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Df(e,"color")||pr(e,Tf,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),zf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Vf);const jf=["colors","disableCustomColors","gradients","disableCustomGradients"],Kf={name:"color",title:"Solid",value:"color"},qf={name:"gradient",title:"Gradient",value:"gradient"},Yf=[Kf,qf];function Qf(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:u,onColorChange:d,onGradientChange:g,colorValue:h,gradientValue:f,clearable:v,showTitle:b=!0,enableAlpha:_}=e;const k=d&&(!(0,p.isEmpty)(t)||!o),y=g&&(!(0,p.isEmpty)(n)||!r);if(!k&&!y)return null;const E={[Kf.value]:(0,s.createElement)(m.ColorPalette,{value:h,onChange:y?e=>{d(e),g()}:d,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:_}),[qf.value]:(0,s.createElement)(m.GradientPicker,{__nextHasNoMargin:!0,value:f,onChange:k?e=>{g(e),d()}:g,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v})},C=e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__panel"},E[e]);return(0,s.createElement)(m.BaseControl,{__nextHasNoMarginBottom:!0,className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(m.__experimentalVStack,{spacing:1},b&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(m.BaseControl.VisualLabel,null,u))),k&&y&&(0,s.createElement)(m.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Yf,initialTabName:f?qf.value:!!k&&Kf.value},(e=>C(e.value))),!y&&C(Kf.value),!k&&C(qf.value))))}function Zf(e){const t={};return t.colors=Yo("color.palette"),t.gradients=Yo("color.gradients"),t.disableCustomColors=!Yo("color.custom"),t.disableCustomGradients=!Yo("color.customGradient"),(0,s.createElement)(Qf,i({},t,e))}const Xf=function(e){return jf.every((t=>e.hasOwnProperty(t)))?(0,s.createElement)(Qf,e):(0,s.createElement)(Zf,e)},Jf=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,s.createElement)(m.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},ev=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(m.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(m.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},tv=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(m.Button,i,(0,s.createElement)(ev,{colorValue:r,label:l}))};function nv(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...p}=e;return d&&(t={placement:"left-start",offset:36,shift:!0}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var g;const h={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},f={colorValue:null!==(g=e.gradientValue)&&void 0!==g?g:e.colorValue,label:e.label};return e&&(0,s.createElement)(Jf,i({key:c,setting:e},p),(0,s.createElement)(m.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:tv(f),renderContent:()=>(0,s.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,s.createElement)(Xf,h)))}))})))}Rd([Ad,zd]);const ov=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const p=a||o,g=c||r;if(!p&&!g)return null;const f=[{color:p,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=Md(d),b=v.alpha()<1,_=v.brightness(),k={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of f){if(!e.color)continue;const t=Md(e.color),n=t.isReadable(v,k),o=t.alpha()<1;if(!n){if(b||o)continue;y=_<t.brightness()?(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
71 |
(0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
72 |
+
(0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,qt.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(m.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function rv(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function lv(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.useState)(),m=Lo(o),g=n.filter((e=>null==e?void 0:e.colorValue));(0,s.useEffect)((()=>{var e;if(!r||!g.length)return;if(!m.current)return;u(rv(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(rv(t).color);let n=m.current,o=rv(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=rv(n).backgroundColor;a(o)}));const h=xf();return(0,s.createElement)(br,{__experimentalGroup:"color"},(0,s.createElement)(nv,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},h)),r&&(0,s.createElement)(ov,{backgroundColor:l,textColor:c,enableAlphaChecker:t,linkColor:d}))}const iv="color",sv=e=>{const t=(0,r.getBlockSupport)(e,iv);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},av=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,iv);return null!==t&&"object"==typeof t&&!!t.link},cv=e=>{const t=(0,r.getBlockSupport)(e,iv);return null!==t&&"object"==typeof t&&!!t.gradients},uv=e=>{const t=(0,r.getBlockSupport)(e,iv);return t&&!1!==t.background},dv=e=>{const t=(0,r.getBlockSupport)(e,iv);return t&&!1!==t.text},pv=(e,t)=>cr(ur(t,e,void 0)),mv=e=>({textColor:void 0,style:pv(["color","text"],e.style)}),gv=e=>({style:pv(["elements","link","color","text"],e.style)}),hv=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function fv(e,t,n){var o,r,l,i,s,a;if(!sv(t)||pr(t,iv))return e;const u=cv(t),{backgroundColor:d,textColor:p,gradient:m,style:g}=n,h=e=>!pr(t,iv,e),f=h("text")?Bf("color",p):void 0,v=h("gradients")?Hf(m):void 0,b=h("background")?Bf("background-color",d):void 0,_=h("background")||h("gradients"),k=d||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||u&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,f,v,{[b]:!(u&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":h("text")&&(p||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":_&&k,"has-link-color":h("link")&&(null==g||null===(s=g.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const vv=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Sf(e,n[1]).color:t};function bv(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,g=Yo("color.palette.custom"),f=Yo("color.palette.theme"),v=Yo("color.palette.default"),b=(0,s.useMemo)((()=>[...g||[],...f||[],...v||[]]),[g,f,v]),_=Yo("color.gradients.custom"),k=Yo("color.gradients.theme"),y=Yo("color.gradients.default"),E=(0,s.useMemo)((()=>[..._||[],...k||[],...y||[]]),[_,k,y]),C=Yo("color.custom"),S=Yo("color.customGradient"),w=Yo("color.background"),B=Yo("color.link"),I=Yo("color.text"),x=C||!f||(null==f?void 0:f.length)>0,T=S||!k||(null==k?void 0:k.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!sv(p))return null;const P=av(p)&&B&&x,M=dv(p)&&I&&x,L=uv(p)&&w&&x,R=cv(p)&&T;if(!(P||M||L||R))return null;const{style:A,textColor:D,backgroundColor:O,gradient:z}=m;let F;if(R&&z)F=Gf(E,z);else if(R){var V;F=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=wf(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:cr(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=(0,r.getBlockSupport)(e.name,[iv,"__experimentalDefaultControls"]),U=!("web"!==s.Platform.OS||z||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient||!1===(0,r.getBlockSupport)(e.name,[iv,"enableContrastChecker"]));return(0,s.createElement)(lv,{enableContrastChecking:U,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,h.__)("Text"),onColorChange:H("text"),colorValue:Sf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==G?void 0:G.text,resetAllFilter:mv}]:[],...L||R?[{label:(0,h.__)("Background"),onColorChange:L?H("background"):void 0,colorValue:Sf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:F,onGradientChange:R?t=>{const n=Wf(E,t);let o;if(n){var r,l,i;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(l=N.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:cr(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:cr(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==G?void 0:G.background,resetAllFilter:hv}]:[],...P?[{label:(0,h.__)("Link"),onColorChange:t=>{var n;const o=wf(b,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=cr(ur(null===(n=N.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),N.current={...N.current,style:l}},colorValue:vv(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==G?void 0:G.link,resetAllFilter:gv}]:[]]})}const _v=(0,u.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=Yo("color.palette.custom")||[],u=Yo("color.palette.theme")||[],d=Yo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!sv(o)||pr(o,iv))return(0,s.createElement)(e,t);const m={};var g,h;a&&!pr(o,iv,"text")&&(m.color=null===(g=Sf(p,a))||void 0===g?void 0:g.color),l&&!pr(o,iv,"background")&&(m.backgroundColor=null===(h=Sf(p,l))||void 0===h?void 0:h.color);let f=t.wrapperProps;return f={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:f}))})),kv={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return sv(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),cv(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",fv),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!sv(e)||pr(e,iv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),fv(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",_v),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return dr({linkColor:av(r),textColor:dv(r),backgroundColor:uv(r),gradient:cv(r)},kv,e,t,n,o)}));const yv=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],Ev=[{name:(0,h._x)("Thin","font weight"),value:"100"},{name:(0,h._x)("Extra Light","font weight"),value:"200"},{name:(0,h._x)("Light","font weight"),value:"300"},{name:(0,h._x)("Regular","font weight"),value:"400"},{name:(0,h._x)("Medium","font weight"),value:"500"},{name:(0,h._x)("Semi Bold","font weight"),value:"600"},{name:(0,h._x)("Bold","font weight"),value:"700"},{name:(0,h._x)("Extra Bold","font weight"),value:"800"},{name:(0,h._x)("Black","font weight"),value:"900"}],Cv=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function Sv(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...a}=e,c=n||o,u=Cv(n,o),d={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,s.useMemo)((()=>n&&o?(()=>{const e=[d];return yv.forEach((t=>{let{name:n,value:o}=t;Ev.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,h.sprintf)(
|
73 |
/* translators: 1: Font weight name. 2: Font style name. */
|
74 |
+
(0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return yv.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[d];return Ev.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),g=p.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||p[0];return c&&(0,s.createElement)(m.CustomSelectControl,i({},a,{className:"components-font-appearance-control",label:u,describedBy:g?n?o?(0,h.sprintf)(// translators: %s: Currently selected font appearance.
|
75 |
(0,h.__)("Currently selected font appearance: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
|
76 |
(0,h.__)("Currently selected font style: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
|
77 |
+
(0,h.__)("Currently selected font weight: %s"),g.name):(0,h.__)("No selected font appearance"),options:p,value:g,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const wv=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px",...l}=e;const a=function(e){return void 0!==e&&""!==e}(t),c=a?t:"";o||V()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const u=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:u},(0,s.createElement)(m.__experimentalNumberControl,i({},l,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(a)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,h.__)("Line height"),placeholder:1.5,step:.1,value:c,min:0})))},Bv="typography.lineHeight";function Iv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(wv,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:cr(t)})},size:"__unstable-large"})}function xv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Bv)||t}const Tv="typography.__experimentalFontStyle",Nv="typography.__experimentalFontWeight";function Pv(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Mv(e),i=!Lv(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(Sv,{onChange:e=>{r({style:cr({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c},size:"__unstable-large"})}function Mv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Tv),n=Yo("typography.fontStyle");return!t||!n}function Lv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Nv),n=Yo("typography.fontWeight");return!t||!n}function Rv(e){const t=Mv(e),n=Lv(e);return t&&n}function Av(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=Yo("typography.fontFamilies");if(o||(o=l),(0,p.isEmpty)(o))return null;const a=[{value:"",label:(0,h.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(m.SelectControl,i({label:(0,h.__)("Font"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Dv="typography.__experimentalFontFamily";function Ov(e,t,n){if(!(0,r.hasBlockSupport)(t,Dv))return e;if(pr(t,wb,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Sg())(e.className);o.add(`has-${(0,p.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function zv(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Yo("typography.fontFamilies"),l=null===(t=(0,p.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(Av,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,p.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Fv(e){let{name:t}=e;const n=Yo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Dv)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Dv)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Ov),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Dv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ov(o,e,n)},e}));const Vv=(e,t,n)=>{if(t){const n=(0,p.find)(e,{slug:t});if(n)return n}return{size:n}};function Hv(e,t){return(0,p.find)(e,{size:t})||{size:t}}function Gv(e){if(e)return`has-${(0,p.kebabCase)(e)}-font-size`}const Uv=function(e){const t=Yo("typography.fontSizes"),n=!Yo("typography.customFontSize");return(0,s.createElement)(m.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},Wv="1600px",$v="768px",jv=1,Kv=.75,qv=1.5,Yv="14px";function Qv(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:o,minimumViewPortWidth:r=$v,maximumViewPortWidth:l=Wv,scaleFactor:i=jv,minimumFontSizeFactor:s=Kv,maximumFontSizeFactor:a=qv,minimumFontSizeLimit:c=Yv}=e,u=t;if(o){const e=Zv(o);if(null==e||!e.unit)return null;u||(u=Xv(e.value*s,3)+e.unit);const r=Zv(c,{coerceTo:e.unit});if(null!=r&&r.value)if(!t&&(null==e?void 0:e.value)<(null==r?void 0:r.value))u=`${e.value}${e.unit}`;else{const t=Zv(u,{coerceTo:e.unit});null!=t&&t.value&&t.value<r.value&&(u=`${r.value}${r.unit}`)}n||(n=Xv(e.value*a,3)+e.unit)}if(!u||!n)return null;const d=Zv(u),p=(null==d?void 0:d.unit)||"rem",m=Zv(n,{coerceTo:p});if(!d||!m)return null;const g=Zv(u,{coerceTo:"rem"}),h=Zv(l,{coerceTo:p}),f=Zv(r,{coerceTo:p});if(!h||!f||!g)return null;const v=Xv(f.value/100,3),b=Xv(v,3)+p,_=Xv(((m.value-d.value)/(h.value-f.value)*100||1)*i,3);return`clamp(${u}, ${g.value}${g.unit} + ((1vw - ${b}) * ${_}), ${n})`}function Zv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},l=null==r?void 0:r.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),s=e.match(i);if(!s||s.length<3)return null;let[,a,c]=s,u=parseFloat(a);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:Xv(u,3),unit:c}}function Xv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const Jv="typography.fontSize";function eb(e,t,n){if(!(0,r.hasBlockSupport)(t,Jv))return e;if(pr(t,wb,"fontSize"))return e;const o=new(Sg())(e.className);o.add(Gv(n.fontSize));const l=o.value;return e.className=l||void 0,e}function tb(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=Yo("typography.fontSizes"),a=Vv(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(Uv,{onChange:e=>{const t=Hv(i,e).slug;l({style:cr({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function nb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Yo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Jv)||!n}const ob=(0,u.createHigherOrderComponent)((e=>t=>{var n,o;const l=Yo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Jv)||pr(i,wb,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=Vv(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles"),rb={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Jv)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",eb),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Jv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),eb(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ob),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return dr({fontSize:(0,r.hasBlockSupport)(l,Jv)},rb,e,t,n,o)})),(0,l.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,r.hasBlockSupport)(e,Jv)||pr(e,wb,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,o,r;const l=t?t(e):{},i=null==l||null===(n=l.style)||void 0===n?void 0:n.fontSize,s=!(null===(o=(0,d.select)(co).getSettings().__experimentalFeatures)||void 0===o||null===(r=o.typography)||void 0===r||!r.fluid),a=i&&s?Qv({fontSize:i}):null;return null===a?l:{...l,style:{...null==l?void 0:l.style,fontSize:a}}},e}),11);const lb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 11.5h10V13H7z"})),ib=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),sb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})),ab=[{name:(0,h.__)("None"),value:"none",icon:lb},{name:(0,h.__)("Underline"),value:"underline",icon:ib},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:sb}];function cb(e){let{value:t,onChange:n,className:o}=e;return(0,s.createElement)("fieldset",{className:c()("block-editor-text-decoration-control",o)},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},ab.map((e=>(0,s.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const ub="typography.__experimentalTextDecoration";function db(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(cb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:cr({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})},size:"__unstable-large"})}function pb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,ub),n=Yo("typography.textDecoration");return t||!n}const mb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),gb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),hb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})),fb=[{name:(0,h.__)("None"),value:"none",icon:lb},{name:(0,h.__)("Uppercase"),value:"uppercase",icon:mb},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:gb},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:hb}];function vb(e){let{className:t,value:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:c()("block-editor-text-transform-control",t)},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},fb.map((e=>(0,s.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{o(e.value===n?void 0:e.value)}})))))}const bb="typography.__experimentalTextTransform";function _b(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(vb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:cr({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})},size:"__unstable-large"})}function kb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,bb),n=Yo("typography.textTransform");return t||!n}function yb(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(m.__experimentalUnitControl,i({},r,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n}))}const Eb="typography.__experimentalLetterSpacing";function Cb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(yb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:cr({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%",size:"__unstable-large"})}function Sb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Eb),n=Yo("typography.letterSpacing");return t||!n}const wb="typography",Bb=[Bv,Jv,Tv,Nv,Dv,ub,bb,Eb];function Ib(e){const{clientId:t}=e,n=Fv(e),o=nb(e),l=Rv(e),i=xv(e),a=pb(e),c=kb(e),u=Sb(e),d=!Mv(e),p=!Lv(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Rv(e),nb(e),xv(e),Fv(e),pb(e),kb(e),Sb(e)];return t.filter(Boolean).length===t.length}(e),f=xb(e.name);if(g||!f)return null;const v=(0,r.getBlockSupport)(e.name,[wb,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(br,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(zv,e)),!o&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e)
|
78 |
+
/* translators: Ensure translation is distinct from "Letter case" */,label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:cr({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,s.createElement)(tb,e)),!l&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:Cv(d,p),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cr({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,s.createElement)(Pv,e)),!i&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,h.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cr({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,s.createElement)(Iv,e)),!u&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,h.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cr({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(Cb,e)),!a&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,h.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cr({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,s.createElement)(db,e)),!c&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e)
|
79 |
+
/* translators: Ensure translation is distinct from "Font size" */,label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cr({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(_b,e)))}const xb=e=>Bb.some((t=>(0,r.hasBlockSupport)(e,t))),Tb=[...Bb,Tf,iv,Mr],Nb=e=>Tb.some((t=>(0,r.hasBlockSupport)(e,t)));function Pb(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,hl.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const Mb={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[iv],[`${wb}.__experimentalSkipSerialization`]:[wb],[`${Mr}.__experimentalSkipSerialization`]:["spacing"]},Lb={...Mb,[`${Mr}`]:["spacing.blockGap"]},Rb={gradients:"gradient"};function Ab(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return e;let o=e;return n||(o=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;Ab(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function Db(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lb;if(!Nb(t))return e;let{style:l}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,r.getBlockSupport)(t,n);!0===i&&(l=Ab(l,o)),Array.isArray(i)&&i.forEach((e=>{const t=Rb[e]||e;l=Ab(l,[[...o,t]])}))})),e.style={...Pb(l),...e.style},e}const Ob=(0,u.createHigherOrderComponent)((e=>t=>{const n=ho();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(bv,t),(0,s.createElement)(Ib,t),(0,s.createElement)(Af,t),(0,s.createElement)(Ar,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),zb=(0,u.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,u.useInstanceId)(e)}`,a=pr(t.name,iv,"link"),d=(0,s.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:a||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=(0,hl.compileCSS)(n,{selector:`.editor-styles-wrapper .${l} ${r.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),p=(0,s.useContext)(af.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,d&&p&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:d}}),p),(0,s.createElement)(e,i({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Nb(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Db),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Nb(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Db(o,e,n,Mb)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Ob),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",zb),(0,l.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,r.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));const Fb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),Vb=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,s.createElement)(m.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,s.createElement)(m.DuotoneSwatch,{values:i}):(0,s.createElement)(pl,{icon:Fb}),(0,s.createElement)(m.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(m.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==_u.DOWN||(e.preventDefault(),o())},label:(0,h.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,s.createElement)(m.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(m.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})},Hb=[];function Gb(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,s.createElement)(dp,{selector:t}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pp,{id:n,colors:o}),(0,s.createElement)(up,{id:n,selector:t}))}function Ub(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Yo(n),r=Yo(`${t}.custom`)||Hb,l=Yo(`${t}.theme`)||Hb,i=Yo(`${t}.default`)||Hb;return(0,s.useMemo)((()=>[...r,...l,...o?Hb:i]),[o,r,l,i])}function Wb(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=Ub({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Ub({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Yo("color.custom"),u=!Yo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Vb,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}Rd([Ad]);const $b=(0,u.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,d.useSelect)((e=>e(co).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&!o&&(0,s.createElement)(Wb,t))}),"withDuotoneControls"),jb=(0,u.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),d=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!d)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,u.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),g=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(af.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(Gb,{selector:m,id:p,colors:d}),h),(0,s.createElement)(e,i({},t,{className:g})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",$b),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",jb);const Kb="__experimentalLayout";function qb(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=(0,d.useSelect)((e=>{var t;const{getSettings:n}=e(co);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),l=Yo("layout")||{},{attributes:i={},name:s}=n,{layout:a}=i,{default:c}=(0,r.getBlockSupport)(s,Kb)||{},u=null!=a&&a.inherit||null!=a&&a.contentSize||null!=a&&a.wideSize?{...a,type:"constrained"}:a||c||{},m=[];var g,h;return null!=l&&null!==(e=l.definitions)&&void 0!==e&&null!==(t=e[(null==u?void 0:u.type)||"default"])&&void 0!==t&&t.className&&m.push(null==l||null===(g=l.definitions)||void 0===g||null===(h=g[(null==u?void 0:u.type)||"default"])||void 0===h?void 0:h.className),(null!=u&&u.inherit||null!=u&&u.contentSize||"constrained"===(null==u?void 0:u.type))&&o&&m.push("has-global-padding"),null!=u&&u.orientation&&m.push(`is-${(0,p.kebabCase)(u.orientation)}`),null!=u&&u.justifyContent&&m.push(`is-content-justification-${(0,p.kebabCase)(u.justifyContent)}`),null!=u&&u.flexWrap&&"nowrap"===u.flexWrap&&m.push("is-nowrap"),m}function Yb(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const{attributes:o={},name:r}=t,{layout:l={},style:i={}}=o,s=null!=l&&l.inherit||null!=l&&l.contentSize||null!=l&&l.wideSize?{...l,type:"constrained"}:l||{},a=bl((null==s?void 0:s.type)||"default"),c=Yo("layout")||{},u=Yo("spacing.blockGap"),d=null!==u,p=null==a||null===(e=a.getLayoutStyle)||void 0===e?void 0:e.call(a,{blockName:r,selector:n,layout:l,layoutDefinitions:null==c?void 0:c.definitions,style:i,hasBlockGapSupport:d});return p}function Qb(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=Yo("layout"),a=(0,d.useSelect)((e=>{const{getSettings:t}=e(co);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Kb,{}),{allowSwitching:u,allowEditing:p=!0,allowInheriting:g=!0,default:f}=c;if(!p)return null;const v=!(!g||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&"constrained"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||f||{},{inherit:_=!1,type:k="default",contentSize:y=null}=b;if(("default"===k||"constrained"===k)&&!a)return null;const E=bl(k),C=bl("constrained"),S=!b.type&&(y||_),w=!!_||!!y,B=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(br,null,(0,s.createElement)(m.PanelBody,{title:(0,h.__)("Layout")},v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.ToggleControl,{className:"block-editor-hooks__toggle-control",label:(0,h.__)("Inner blocks use content width"),checked:"constrained"===(null==E?void 0:E.name)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(0,h.__)("Nested blocks use content width with options for full and wide widths."):(0,h.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!_&&u&&(0,s.createElement)(Zb,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,s.createElement)(E.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}),C&&S&&(0,s.createElement)(C.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}))),!_&&E&&(0,s.createElement)(E.toolBarControls,{layout:b,onChange:B,layoutBlockSupport:c}))}function Zb(e){let{type:t,onChange:n}=e;return(0,s.createElement)(m.ButtonGroup,null,vl.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(m.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const Xb=(0,u.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Kb)&&(0,s.createElement)(Qb,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Jb=(0,u.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:l}=t,a=(0,r.hasBlockSupport)(n,Kb),p=(0,d.useSelect)((e=>{const{getSettings:t}=e(co);return!!t().disableLayoutStyles})),m=a&&!p,g=(0,u.useInstanceId)(e),h=Yo("layout")||{},f=(0,s.useContext)(af.__unstableElementContext),{layout:v}=o,{default:b}=(0,r.getBlockSupport)(n,Kb)||{},_=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},k=a?qb(l):null,y=`.${(0,r.getBlockDefaultClassName)(n)}.wp-container-${g}`,E=null!==Yo("spacing.blockGap");let C;if(m){var S;const e=bl((null==_?void 0:_.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:_,layoutDefinitions:null==h?void 0:h.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=c()(null==t?void 0:t.className,{[`wp-container-${g}`]:m&&!!C},k);return(0,s.createElement)(s.Fragment,null,m&&f&&!!C&&(0,s.createPortal)((0,s.createElement)(Cl,{blockName:n,selector:y,css:C,layout:_,style:null==o?void 0:o.style}),f),(0,s.createElement)(e,i({},t,{className:w})))}));function e_(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,d.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(co);return n(t)||o(t,!0)}),[t]);return(0,s.useEffect)((()=>{o||n()}),[o]),null}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||(0,r.hasBlockSupport)(e,Kb)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Jb),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Xb);const t_=(0,u.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,d.useSelect)(co),r=(0,s.useRef)(),{templateLock:l,isLockedByParent:a,isEditingAsBlocks:u}=(0,d.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(co);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:r()===t.clientId}}),[t.clientId]),{updateSettings:p,updateBlockListSettings:g,__unstableSetTemporarilyEditingAsBlocks:f}=(0,d.useDispatch)(co),v=!a&&"contentOnly"===l,{__unstableMarkNextChangeAsNotPersistent:b,updateBlockAttributes:_}=(0,d.useDispatch)(co),k=(0,s.useCallback)((()=>{b(),_(t.clientId,{templateLock:"contentOnly"}),g(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),p({focusMode:r.current}),f()}),[t.clientId,r,p,g,n,b,_,f]);return v||u?(0,s.createElement)(s.Fragment,null,u&&!v&&(0,s.createElement)(e_,{clientId:t.clientId,stopEditingAsBlock:k}),(0,s.createElement)(ko,{group:"other"},(0,s.createElement)(m.ToolbarButton,{onClick:()=>{u&&!v?k():(b(),_(t.clientId,{templateLock:void 0}),g(t.clientId,{...n(t.clientId),templateLock:!1}),r.current=o().focusMode,p({focusMode:!0}),f(t.clientId))}},u&&!v?(0,h.__)("Done"):(0,h.__)("Modify"))),(0,s.createElement)(e,i({},t,{className:c()(t.className,u&&"is-content-locked-editing-as-blocks")}))):(0,s.createElement)(e,t)}),"withToolbarControls");(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",t_);function n_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=(0,r.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function o_(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Ff(e)||void 0,style:Pb({border:n})}}function r_(e){const{colors:t}=xf(),n=o_(e),{borderColor:o}=e;if(o){const e=Lf({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function l_(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Bf("background-color",s),m=Bf("color",a),g=Hf(u),h=g||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,g,{[p]:!h&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:Pb({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.metadata)&&void 0!==n&&n.type||n_(e,"name",!1)&&(e.attributes={...e.attributes,metadata:{type:"object"}}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return n_(t)&&(e.metadata=n.metadata),e})),(0,l.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||n_(e,"name",!1)&&(e.__experimentalLabel=(e,t)=>{let{context:n}=t;const{metadata:o}=e;if("list-view"===n&&null!=o&&o.name)return o.name}),e}));const i_={};function s_(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Yo("color.palette.custom")||[],l=Yo("color.palette.theme")||[],i=Yo("color.palette.default")||[],a=Yo("color.gradients")||i_,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=l_(e);if(t){const e=Sf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Gf(u,o)),n){const e=Sf(c,n);d.style.color=e.color}return d}function a_(e){const{style:t}=e;return{style:Pb({spacing:(null==t?void 0:t.spacing)||{}})}}function c_(e,t){var n;let o=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};var r,l;t&&(o={...o,fontSize:Qv({fontSize:null==e||null===(r=e.style)||void 0===r||null===(l=r.typography)||void 0===l?void 0:l.fontSize})});const i=Pb({typography:o}),s=null!=e&&e.fontFamily?`has-${(0,p.kebabCase)(e.fontFamily)}-font-family`:"";return{className:c()(s,Gv(null==e?void 0:e.fontSize)),style:i}}function u_(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const d_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},p_=e=>(0,u.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),m_=()=>(0,u.createHigherOrderComponent)((e=>t=>{const n=Yo("color.palette.custom"),o=Yo("color.palette.theme"),r=Yo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function g_(e,t){const n=(0,p.reduce)(e,((e,t)=>({...e,..."string"==typeof t?{[t]:(0,p.kebabCase)(t)}:t})),{});return(0,u.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Md(t),o=e=>{let{color:t}=e;return n.contrast(t)},r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return(0,p.reduce)(n,((e,t,n)=>{const o=d_(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=wf(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,p.reduce)(n,((e,n,l)=>{const i=Sf(r,o[l],o[`custom${d_(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:Bf(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function h_(e){return function(){const t=p_(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,u.createHigherOrderComponent)(g_(o,t),"withCustomColors")}}function f_(){const e=m_();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,u.createHigherOrderComponent)(g_(n,e),"withColors")}const v_=[],b_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},k_=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,p.reduce)(t,((e,t)=>(e[t]=`custom${b_(t)}`,e)),{});return(0,u.createHigherOrderComponent)((0,u.compose)([(0,u.createHigherOrderComponent)((e=>t=>{const n=Yo("typography.fontSizes")||v_;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,p.reduce)(o,((e,t,n)=>(e[`set${b_(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,p.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,p.some)(o,l))return null;const i=(0,p.reduce)((0,p.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=Vv(r,l,n[t]);return e[o]={...i,class:Gv(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},y_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),E_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),C_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"})),S_=[{icon:y_,title:(0,h.__)("Align text left"),align:"left"},{icon:E_,title:(0,h.__)("Align text center"),align:"center"},{icon:C_,title:(0,h.__)("Align text right"),align:"right"}],w_={position:"bottom right",isAlternate:!0},B_=function(e){let{value:t,onChange:n,alignmentControls:o=S_,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function u(e){return()=>n(t===e?void 0:e)}const d=(0,p.find)(o,(e=>e.align===t)),g=c?m.ToolbarGroup:m.ToolbarDropdownMenu,f=c?{isCollapsed:a}:{toggleProps:{describedBy:l},popoverProps:w_};return(0,s.createElement)(g,i({icon:d?d.icon:(0,h.isRTL)()?C_:y_,label:r,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:u(n)}}))},f))},I_=e=>(0,s.createElement)(B_,i({},e,{isToolbar:!1})),x_=e=>(0,s.createElement)(B_,i({},e,{isToolbar:!0})),T_=()=>{},N_={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(co),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Pp(t,T_),i=(0,s.useMemo)((()=>(e.trim()?rm(o,r,l,e):(0,p.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]),a=(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Au,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[a]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},P_=window.wp.apiFetch;var M_=n.n(P_);const L_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),R_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),A_={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await M_()({path:(0,fm.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pl,{key:"icon",icon:"page"===e.subtype?L_:R_}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)},D_=[];function O_(e){let{completers:t=D_}=e;const{name:n}=go();return(0,s.useMemo)((()=>{let e=[...t,A_];return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,N_]),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(p.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}const z_=function(e){return(0,s.createElement)(m.Autocomplete,i({},e,{completers:O_(e)}))},F_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),V_=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(m.ToolbarButton,{isActive:t,icon:F_,label:n,onClick:()=>o(!t),disabled:r})},H_=()=>{},G_=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=H_,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(m.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(m.Dropdown,{position:"bottom right",popoverProps:{isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(m.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==_u.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(m.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},U_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),W_=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,d.useDispatch)(co),{clientId:r,parents:l,hasSelection:i}=(0,d.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(co),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,h.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(pl,{icon:U_,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Qm,{clientId:e,maximumLength:35})),(0,s.createElement)(pl,{icon:U_,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Qm,{clientId:r,maximumLength:35})))},$_=()=>(0,s.createElement)(m.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(m.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),j_=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)($_,null)))},K_=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==_u.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(j_,null)))}))}},q_=e=>{let{children:t,...n}=e;return V()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(m.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:K_(n),renderContent:()=>t})},Y_=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),Q_=nu(m.__experimentalTreeGridRow);function Z_(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=lu({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Q_,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}const X_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function J_(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(pl,{icon:(0,h.isRTL)()?X_:U_}))}const ek=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:p}=e;const g=qm(o),h=Ym({clientId:o,context:"list-view"}),{isLocked:f}=oh(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==_u.ENTER&&e.keyCode!==_u.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:p,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(J_,{onClick:l}),(0,s.createElement)(Au,{icon:null==g?void 0:g.icon,showColors:!0}),(0,s.createElement)(m.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(m.__experimentalTruncate,{ellipsizeMode:"auto"},h)),(null==g?void 0:g.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,s.createElement)(m.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},g.anchor)),f&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(pl,{icon:lh})))))})),tk=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:p,isExpanded:m,selectedClientIds:g,...h}=e;const{clientId:f}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,d.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(co);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[f]),_=v&&b===f,k=c()("block-editor-list-view-block-contents",{"is-dropping-before":_}),y=g.includes(f)?g:[f];return(0,s.createElement)(Zm,{clientIds:y},(e=>{let{draggable:c,onDragStart:d,onDragEnd:g}=e;return(0,s.createElement)(ek,i({ref:t,className:k,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:p,draggable:c,onDragStart:d,onDragEnd:g,isExpanded:m},h))}))})),nk=tk,ok=(0,s.createContext)({}),rk=()=>(0,s.useContext)(ok),lk=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:l,isBranchSelected:i,selectBlock:a,position:p,level:g,rowCount:f,siblingBlockCount:v,showBlockMovers:b,path:_,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,{isLocked:I,isContentLocked:x}=oh(B),T=(0,d.useSelect)((e=>!l&&!!x&&e(co).hasSelectedInnerBlock(B,!0)),[x,B,l]),N=T||l&&y[0]===B,P=T||l&&y[y.length-1]===B,{toggleBlockHighlight:M}=(0,d.useDispatch)(co),L=qm(B),R=(0,d.useSelect)((e=>e(co).getBlockName(B)),[B]),A=(0,r.hasBlockSupport)(R,"__experimentalToolbar",!0),D=`list-view-block-select-button__${(0,u.useInstanceId)(e)}`,O=((e,t,n)=>(0,h.sprintf)(
|
80 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
81 |
+
(0,h.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(p,v,g);let z=(0,h.__)("Link");L&&(z=I?(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the locked block.
|
82 |
(0,h.__)("%s link (locked)"),L.title):(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
|
83 |
(0,h.__)("%s link"),L.title));const F=L?(0,h.sprintf)(// translators: %s: The title of the block.
|
84 |
+
(0,h.__)("Options for %s block"),L.title):(0,h.__)("Options"),{isTreeGridMounted:V,expand:H,collapse:G}=rk(),U=b&&v>0,W=c()("block-editor-list-view-block__mover-cell",{"is-visible":S||l}),$=c()("block-editor-list-view-block__menu-cell",{"is-visible":S||N});(0,s.useEffect)((()=>{!V&&l&&C.current.focus()}),[]);const j=(0,s.useCallback)((()=>{w(!0),M(B,!0)}),[B,w,M]),K=(0,s.useCallback)((()=>{w(!1),M(B,!1)}),[B,w,M]),q=(0,s.useCallback)((e=>{a(e,B),e.preventDefault()}),[B,a]),Y=(0,s.useCallback)((e=>{a(void 0,e)}),[a]),Q=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?G(B):!1===k&&H(B)}),[B,H,G,k]);let Z;U?Z=2:A||(Z=3);const X=c()({"is-selected":l||T,"is-first-selected":N,"is-last-selected":P,"is-branch-selected":i,"is-dragging":o,"has-single-cell":!A}),J=y.includes(B)?y:[B];return(0,s.createElement)(Z_,{className:X,onMouseEnter:j,onMouseLeave:K,onFocus:j,onBlur:K,level:g,position:p,rowCount:f,path:_,id:`list-view-block-${B}`,"data-block":B,isExpanded:x?void 0:k,"aria-selected":!!l||T},(0,s.createElement)(m.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Z,ref:C,"aria-label":z,"aria-selected":!!l||T,"aria-expanded":x?void 0:k,"aria-describedby":D},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(nk,{block:n,onClick:q,onToggleExpanded:Q,isSelected:l,position:p,siblingBlockCount:v,level:g,ref:t,tabIndex:o,onFocus:r,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:D},O))})),U&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.__experimentalTreeGridCell,{className:W,withoutGridItem:!0},(0,s.createElement)(m.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(rg,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})),(0,s.createElement)(m.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(lg,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),A&&(0,s.createElement)(m.__experimentalTreeGridCell,{className:$,"aria-selected":!!l||T},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(vh,{clientIds:J,icon:Gg,label:F,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:Y})})))}));function ik(e,t,n,o){var r;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(sk(t,n,o),0):1}const sk=(e,t,n)=>(o,r)=>{var l;return(null==t?void 0:t.includes(r.clientId))?o:(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+ik(r,e,t,n):o+1};function ak(e){const{blocks:t,selectBlock:n,showBlockMovers:o,selectedClientIds:r,level:l=1,path:i="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:p,parentId:m,shouldShowInnerBlocks:g=!0}=e,h=(0,d.useSelect)((e=>!(!m||"contentOnly"!==e(co).getTemplateLock(m))),[m]),{expandedState:f,draggedClientIds:v}=rk();if(h)return null;const b=t.filter(Boolean),_=b.length;let k=c;return(0,s.createElement)(s.Fragment,null,b.map(((e,t)=>{var c;const{clientId:m,innerBlocks:h}=e;t>0&&(k+=ik(b[t-1],f,v,p));const{itemInView:y}=u,E=y(k),C=t+1,S=i.length>0?`${i}_${C}`:`${C}`,w=!(null==h||!h.length),B=w&&g?null!==(c=f[m])&&void 0!==c?c:p:void 0,I=!(null==v||!v.includes(m)),x=I||E,T=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(m,r),N=a||T&&w;return(0,s.createElement)(d.AsyncModeProvider,{key:m,value:!T},x&&(0,s.createElement)(lk,{block:e,selectBlock:n,isSelected:T,isBranchSelected:N,isDragged:I,level:l,position:C,rowCount:_,siblingBlockCount:_,showBlockMovers:o,path:S,isExpanded:B,listPosition:k,selectedClientIds:r}),!x&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),w&&B&&!I&&(0,s.createElement)(ak,{parentId:m,blocks:h,selectBlock:n,showBlockMovers:o,level:l+1,path:S,listPosition:k+1,fixedListWindow:u,isBranchSelected:N,selectedClientIds:r,isExpanded:p}))})))}ak.defaultProps={selectBlock:()=>{}};const ck=(0,s.memo)(ak);function uk(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]:[]),[o,r]),c=a||i,u=(0,s.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,s.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),p=(0,s.useMemo)((()=>{if(c&&("top"===l||"bottom"===l||"inside"===l))return{ownerDocument:c.ownerDocument,getBoundingClientRect(){const e=c.getBoundingClientRect(),t=u(),n=e.left+t,o=e.right;let r=0,i=0;"top"===l?(r=e.top,i=e.top):(r=e.bottom,i=e.bottom);const s=o-n,a=i-r;return new window.DOMRect(n,r,s,a)}}}),[c,l,u]);return c?(0,s.createElement)(m.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,s.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}const dk=["top","bottom"];const pk=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,mk=(0,s.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:l=!1,isExpanded:i=!1}=e;const{clientIdsTree:a,draggedClientIds:c,selectedClientIds:p}=function(e){return(0,d.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(co);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:g,shouldShowInnerBlocks:f}=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(co),r=(null==c?void 0:c.length)>0?n(c).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[c]),{updateBlockSelection:v}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,d.useDispatch)(co),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:u,hasSelectedBlock:p}=(0,d.useSelect)(co),{getBlockType:m}=(0,d.useSelect)(r.store),g=(0,s.useCallback)((async(r,s,a)=>{if(null==r||!r.shiftKey)return void n(s);r.preventDefault();const d="keydown"===r.type&&(r.keyCode===_u.UP||r.keyCode===_u.DOWN||r.keyCode===_u.HOME||r.keyCode===_u.END);if(!d&&!p()&&!u())return void n(s,null);const g=c(),f=[...l(s),s];d&&!g.some((e=>f.includes(e)))&&await e();let v=i(),b=s;d&&(p()||u()||(v=s),a&&(b=a));const _=l(v),k=l(b),{start:y,end:E}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(v,b,_,k);await t(y,E,null);const C=c();if((r.keyCode===_u.HOME||r.keyCode===_u.END)&&C.length>1)return;const S=g.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=m(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,h.sprintf)(
|
85 |
/* translators: %s: block name */
|
86 |
(0,h.__)("%s deselected."),e))}else S.length>1&&(w=(0,h.sprintf)(
|
87 |
/* translators: %s: number of deselected blocks */
|
88 |
+
(0,h.__)("%s blocks deselected."),S.length));w&&(0,qt.speak)(w)}),[e,o,m,l,i,a,c,u,p,t,n]);return{updateBlockSelection:g}}(),[b,_]=(0,s.useReducer)(pk,{}),{ref:k,target:y}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,d.useSelect)(co),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},p=jh(a,c),m=o(),g=(0,u.useThrottle)((0,s.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==m||!m.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=qh(t,s,dk),u=Yh(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&m.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(m,i),canInsertDraggedBlocksAsChild:!a||r(m,l)}})),s);c&&i(c)}),[m]),200);return{ref:(0,u.__experimentalUseDropZone)({onDrop:p,onDragOver(e){g(e,e.currentTarget)},onDragEnd(){g.cancel(),i(null)}}),target:l}}(),E=(0,s.useRef)(),C=(0,u.useMergeRefs)([E,k,t]),S=(0,s.useRef)(!1),{setSelectedTreeId:w}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,s.useState)(null),{selectedBlockParentClientIds:l}=(0,d.useSelect)((e=>{const{getBlockParents:n}=e(co);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:p[0],setExpandedState:_}),B=(0,s.useCallback)(((e,t)=>{v(e,t),w(t)}),[w,v]);(0,s.useEffect)((()=>{S.current=!0}),[]);const[I]=(0,u.__experimentalUseFixedWindowList)(E,36,g,{useWindowing:!0,windowOverscan:40}),x=(0,s.useCallback)((e=>{e&&_({type:"expand",clientIds:[e]})}),[_]),T=(0,s.useCallback)((e=>{e&&_({type:"collapse",clientIds:[e]})}),[_]),N=(0,s.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),P=(0,s.useCallback)((e=>{var t;T(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[T]),M=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&v(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[v]),L=(0,s.useMemo)((()=>({isTreeGridMounted:S.current,draggedClientIds:c,expandedState:b,expand:x,collapse:T})),[S.current,c,b,x,T]);return(0,s.createElement)(d.AsyncModeProvider,{value:!0},(0,s.createElement)(uk,{listViewRef:E,blockDropTarget:y}),(0,s.createElement)(m.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,h.__)("Block navigation structure"),ref:C,onCollapseRow:P,onExpandRow:N,onFocusRow:M,applicationAriaLabel:(0,h.__)("Block navigation structure")},(0,s.createElement)(ok.Provider,{value:L},(0,s.createElement)(ck,{blocks:a,selectBlock:B,showBlockMovers:l,fixedListWindow:I,selectedClientIds:p,isExpanded:i,shouldShowInnerBlocks:f}))))}));function gk(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(m.Button,i({},l,{ref:r,icon:Y_,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
|
89 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}const hk=(0,s.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;V()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,d.useSelect)((e=>!!e(co).getBlockCount()),[])&&!n;return(0,s.createElement)(m.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,s.createElement)(gk,i({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)(mk,null))})}));function fk(e){var t;let{genericPreviewBlock:n,style:o,className:l,activeStyle:i}=e;const a=null===(t=(0,r.getBlockType)(n.name))||void 0===t?void 0:t.example,c=wg(l,i,o),u=(0,s.useMemo)((()=>({...n,title:o.label||o.name,description:o.description,initialAttributes:{...n.attributes,className:c+" block-editor-block-styles__block-preview-container"},example:a})),[n,c]);return(0,s.createElement)(kp,{item:u,isStylePreview:!0})}const vk=()=>{};function bk(e){let{clientId:t,onSwitch:n=vk,onHoverClassName:o=vk}=e;const{onSelect:r,stylesToRender:l,activeStyle:i,genericPreviewBlock:a,className:d}=Ig({clientId:t,onSwitch:n}),[p,g]=(0,s.useState)(null),h=(0,u.useViewportMatch)("medium","<");if(!l||0===l.length)return null;const f=(0,u.debounce)(g,250),v=e=>{var t;p!==e?(f(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):f.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},l.map((e=>{const t=e.label||e.name;return(0,s.createElement)(m.Button,{className:c()("block-editor-block-styles__item",{"is-active":i.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>v(e),onFocus:()=>v(e),onMouseLeave:()=>v(null),onBlur:()=>v(null),onClick:()=>(e=>{r(e),o(null),g(null),f.cancel()})(e),"aria-current":i.name===e.name},(0,s.createElement)(m.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),p&&!h&&(0,s.createElement)(m.Popover,{placement:"left-start",offset:20},(0,s.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>v(null)},(0,s.createElement)(fk,{activeStyle:i,className:d,genericPreviewBlock:a,style:p}))))}const _k=bk;bk.Slot=()=>(V()("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);const kk=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),yk=function(e){let{icon:t=kk,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(m.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,h.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(m.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(m.Button,{variant:"link",onClick:()=>l()},(0,h.__)("Skip"))))},Ek=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"})),Ck="carousel",Sk="grid",wk=e=>{let{onBlockPatternSelect:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(m.Button,{variant:"primary",onClick:t},(0,h.__)("Choose")))},Bk=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(m.Button,{icon:Dp,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(m.Button,{icon:Ap,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))},Ik=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a}=e;const c=t===Ck,u=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(m.Button,{icon:Nl,label:(0,h.__)("Carousel view"),onClick:()=>n(Ck),isPressed:c}),(0,s.createElement)(m.Button,{icon:Ek,label:(0,h.__)("Grid view"),onClick:()=>n(Sk),isPressed:t===Sk}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,s.createElement)(Bk,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),u,c&&(0,s.createElement)(wk,{onBlockPatternSelect:a}))},xk=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const l=(0,m.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===Ck){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(Nk,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,s.createElement)(m.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(Tk,{key:e.name,pattern:e,onSelect:r,composite:l})))))};function Tk(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:a,viewportWidth:c=700}=t,d=(0,u.useInstanceId)(Tk,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?d:void 0},(0,s.createElement)(m.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(bp,{blocks:l,viewportWidth:c})),!!a&&(0,s.createElement)(m.VisuallyHidden,{id:d},a))}function Nk(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,u.useInstanceId)(Nk,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,s.createElement)(bp,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,s.createElement)(m.VisuallyHidden,{id:a},i))}const Pk=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:l}=e;const[i,a]=(0,s.useState)(Ck),[c,u]=(0,s.useState)(0),{replaceBlock:p}=(0,d.useDispatch)(co),m=function(e,t,n){return(0,d.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(co),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==m||!m.length)return null;const g=l||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));p(t,n)});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,s.createElement)(xk,{viewMode:i,activeSlide:c,patterns:m,onBlockPatternSelect:g}),(0,s.createElement)(Ik,{viewMode:i,setViewMode:a,activeSlide:c,totalSlides:m.length,handleNext:()=>{u((e=>e+1))},handlePrevious:()=>{u((e=>e-1))},onBlockPatternSelect:()=>{g(m[c].blocks)}})))};function Mk(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,s.createElement)("fieldset",{className:t},(0,s.createElement)(m.VisuallyHidden,{as:"legend"},(0,h.__)("Transform to variation")),r.map((e=>(0,s.createElement)(m.Button,{key:e.name,icon:(0,s.createElement)(Au,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,h.sprintf)(
|
90 |
/* translators: %s: Name of the block variation */
|
|