Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 14.6.0 |
Comparing to | |
See all releases |
Code changes from version 14.5.4 to 14.6.0
- build/block-editor/index.js +2277 -472
- build/block-editor/index.min.asset.php +1 -1
- build/block-editor/index.min.js +50 -50
build/block-editor/index.js
CHANGED
@@ -3271,6 +3271,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
3271 |
"__experimentalLinkControlSearchItem": () => (/* reexport */ search_item),
|
3272 |
"__experimentalLinkControlSearchResults": () => (/* reexport */ LinkControlSearchResults),
|
3273 |
"__experimentalListView": () => (/* reexport */ components_list_view),
|
|
|
3274 |
"__experimentalPanelColorGradientSettings": () => (/* reexport */ panel_color_gradient_settings),
|
3275 |
"__experimentalPreviewOptions": () => (/* reexport */ PreviewOptions),
|
3276 |
"__experimentalPublishDateTimePicker": () => (/* reexport */ publish_date_time_picker),
|
@@ -3349,6 +3350,7 @@ __webpack_require__.d(selectors_namespaceObject, {
|
|
3349 |
"__experimentalGetPatternTransformItems": () => (__experimentalGetPatternTransformItems),
|
3350 |
"__experimentalGetPatternsByBlockTypes": () => (__experimentalGetPatternsByBlockTypes),
|
3351 |
"__experimentalGetReusableBlockTitle": () => (__experimentalGetReusableBlockTitle),
|
|
|
3352 |
"__unstableGetBlockWithoutInnerBlocks": () => (__unstableGetBlockWithoutInnerBlocks),
|
3353 |
"__unstableGetClientIdWithClientIdsTree": () => (__unstableGetClientIdWithClientIdsTree),
|
3354 |
"__unstableGetClientIdsTree": () => (__unstableGetClientIdsTree),
|
@@ -3448,6 +3450,8 @@ __webpack_require__.d(selectors_namespaceObject, {
|
|
3448 |
var actions_namespaceObject = {};
|
3449 |
__webpack_require__.r(actions_namespaceObject);
|
3450 |
__webpack_require__.d(actions_namespaceObject, {
|
|
|
|
|
3451 |
"__unstableDeleteSelection": () => (__unstableDeleteSelection),
|
3452 |
"__unstableExpandSelection": () => (__unstableExpandSelection),
|
3453 |
"__unstableMarkAutomaticChange": () => (__unstableMarkAutomaticChange),
|
@@ -4423,7 +4427,7 @@ const withReplaceInnerBlocks = reducer => (state, action) => {
|
|
4423 |
// will be deleted entirely from its entity.
|
4424 |
|
4425 |
stateAfterInsert.order = { ...stateAfterInsert.order,
|
4426 |
-
...(
|
4427 |
if (state.order[key]) {
|
4428 |
result[key] = state.order[key];
|
4429 |
}
|
@@ -4432,7 +4436,7 @@ const withReplaceInnerBlocks = reducer => (state, action) => {
|
|
4432 |
}, {})
|
4433 |
};
|
4434 |
stateAfterInsert.tree = { ...stateAfterInsert.tree,
|
4435 |
-
...(
|
4436 |
const key = `controlled||${_key}`;
|
4437 |
|
4438 |
if (state.tree[key]) {
|
@@ -4601,17 +4605,23 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
4601 |
return state;
|
4602 |
}
|
4603 |
|
4604 |
-
const next = action.clientIds.reduce((accumulator, id) =>
|
4605 |
-
|
4606 |
-
|
4607 |
-
|
4608 |
-
|
4609 |
-
|
4610 |
-
}
|
4611 |
|
4612 |
-
|
4613 |
-
|
4614 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4615 |
|
4616 |
if (action.clientIds.every(id => next[id] === state[id])) {
|
4617 |
return state;
|
@@ -4748,7 +4758,7 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
4748 |
const mappedBlocks = mapBlockOrder(action.blocks);
|
4749 |
return (0,external_wp_compose_namespaceObject.pipe)([nextState => (0,external_lodash_namespaceObject.omit)(nextState, action.replacedClientIds), nextState => ({ ...nextState,
|
4750 |
...(0,external_lodash_namespaceObject.omit)(mappedBlocks, '')
|
4751 |
-
}), nextState => (0,external_lodash_namespaceObject.mapValues)(nextState, subState => (
|
4752 |
if (clientId === clientIds[0]) {
|
4753 |
return [...result, ...mappedBlocks['']];
|
4754 |
}
|
@@ -4831,6 +4841,29 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
4831 |
}
|
4832 |
|
4833 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4834 |
/**
|
4835 |
* Reducer returning typing state.
|
4836 |
*
|
@@ -5550,6 +5583,7 @@ function temporarilyEditingAsBlocks() {
|
|
5550 |
/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
|
5551 |
blocks,
|
5552 |
isTyping,
|
|
|
5553 |
draggedBlocks,
|
5554 |
selection,
|
5555 |
isMultiSelecting,
|
@@ -6162,7 +6196,7 @@ const getGlobalBlockCount = rememo((state, blockName) => {
|
|
6162 |
return clientIds.length;
|
6163 |
}
|
6164 |
|
6165 |
-
return
|
6166 |
const block = state.blocks.byClientId[clientId];
|
6167 |
return block.name === blockName ? accumulator + 1 : accumulator;
|
6168 |
}, 0);
|
@@ -7067,6 +7101,17 @@ function getBlockMode(state, clientId) {
|
|
7067 |
function selectors_isTyping(state) {
|
7068 |
return state.isTyping;
|
7069 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7070 |
/**
|
7071 |
* Returns true if the user is dragging blocks, or false otherwise.
|
7072 |
*
|
@@ -9602,6 +9647,28 @@ function toggleBlockMode(clientId) {
|
|
9602 |
clientId
|
9603 |
};
|
9604 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9605 |
/**
|
9606 |
* Returns an action object used in signalling that the user has begun to type.
|
9607 |
*
|
@@ -10872,7 +10939,7 @@ const settings_settings = (0,external_wp_element_namespaceObject.createElement)(
|
|
10872 |
|
10873 |
|
10874 |
|
10875 |
-
const blockedPaths = ['color', 'border', 'typography', 'spacing'];
|
10876 |
const deprecatedFlags = {
|
10877 |
'color.palette': settings => settings.colors,
|
10878 |
'color.gradients': settings => settings.gradients,
|
@@ -12282,13 +12349,15 @@ function MarginVisualizer(_ref2) {
|
|
12282 |
if (!external_wp_isShallowEqual_default()(margin, valueRef.current) && !forceShow) {
|
12283 |
setIsActive(true);
|
12284 |
valueRef.current = margin;
|
12285 |
-
clearTimer();
|
12286 |
timeoutRef.current = setTimeout(() => {
|
12287 |
setIsActive(false);
|
12288 |
}, 400);
|
12289 |
}
|
12290 |
|
12291 |
-
return () =>
|
|
|
|
|
|
|
12292 |
}, [margin, forceShow]);
|
12293 |
|
12294 |
if (!isActive && !forceShow) {
|
@@ -12306,6 +12375,129 @@ function MarginVisualizer(_ref2) {
|
|
12306 |
}));
|
12307 |
}
|
12308 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12309 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/padding.js
|
12310 |
|
12311 |
|
@@ -12490,13 +12682,15 @@ function PaddingVisualizer(_ref2) {
|
|
12490 |
if (!external_wp_isShallowEqual_default()(padding, valueRef.current) && !forceShow) {
|
12491 |
setIsActive(true);
|
12492 |
valueRef.current = padding;
|
12493 |
-
clearTimer();
|
12494 |
timeoutRef.current = setTimeout(() => {
|
12495 |
setIsActive(false);
|
12496 |
}, 400);
|
12497 |
}
|
12498 |
|
12499 |
-
return () =>
|
|
|
|
|
|
|
12500 |
}, [padding, forceShow]);
|
12501 |
|
12502 |
if (!isActive && !forceShow) {
|
@@ -12530,6 +12724,7 @@ function PaddingVisualizer(_ref2) {
|
|
12530 |
|
12531 |
|
12532 |
|
|
|
12533 |
/**
|
12534 |
* Internal dependencies
|
12535 |
*/
|
@@ -12539,16 +12734,31 @@ function PaddingVisualizer(_ref2) {
|
|
12539 |
|
12540 |
|
12541 |
|
|
|
|
|
|
|
12542 |
const SPACING_SUPPORT_KEY = 'spacing';
|
12543 |
const dimensions_ALL_SIDES = ['top', 'right', 'bottom', 'left'];
|
12544 |
const AXIAL_SIDES = ['vertical', 'horizontal'];
|
12545 |
|
12546 |
function useVisualizerMouseOver() {
|
12547 |
const [isMouseOver, setIsMouseOver] = (0,external_wp_element_namespaceObject.useState)(false);
|
|
|
|
|
|
|
|
|
12548 |
|
12549 |
-
const onMouseOver =
|
|
|
|
|
|
|
|
|
12550 |
|
12551 |
-
const onMouseOut =
|
|
|
|
|
|
|
|
|
12552 |
|
12553 |
return {
|
12554 |
isMouseOver,
|
@@ -12561,7 +12771,7 @@ function useVisualizerMouseOver() {
|
|
12561 |
*
|
12562 |
* @param {Object} props Block props.
|
12563 |
*
|
12564 |
-
* @return {WPElement} Inspector controls for spacing support features.
|
12565 |
*/
|
12566 |
|
12567 |
|
@@ -12569,6 +12779,7 @@ function DimensionsPanel(props) {
|
|
12569 |
const isGapDisabled = useIsGapDisabled(props);
|
12570 |
const isPaddingDisabled = useIsPaddingDisabled(props);
|
12571 |
const isMarginDisabled = useIsMarginDisabled(props);
|
|
|
12572 |
const isDisabled = useIsDimensionsDisabled(props);
|
12573 |
const isSupported = hasDimensionsSupport(props.name);
|
12574 |
const spacingSizes = useSetting('spacing.spacingSizes');
|
@@ -12579,14 +12790,15 @@ function DimensionsPanel(props) {
|
|
12579 |
return null;
|
12580 |
}
|
12581 |
|
|
|
12582 |
const defaultSpacingControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [SPACING_SUPPORT_KEY, '__experimentalDefaultControls']);
|
12583 |
|
12584 |
-
const createResetAllFilter = attribute => newAttributes => {
|
12585 |
var _newAttributes$style;
|
12586 |
|
12587 |
return { ...newAttributes,
|
12588 |
style: { ...newAttributes.style,
|
12589 |
-
|
12590 |
[attribute]: undefined
|
12591 |
}
|
12592 |
}
|
@@ -12603,7 +12815,7 @@ function DimensionsPanel(props) {
|
|
12603 |
hasValue: () => hasPaddingValue(props),
|
12604 |
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
|
12605 |
onDeselect: () => resetPadding(props),
|
12606 |
-
resetAllFilter: createResetAllFilter('padding'),
|
12607 |
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.padding,
|
12608 |
panelId: props.clientId
|
12609 |
}, (0,external_wp_element_namespaceObject.createElement)(PaddingEdit, _extends({
|
@@ -12614,7 +12826,7 @@ function DimensionsPanel(props) {
|
|
12614 |
hasValue: () => hasMarginValue(props),
|
12615 |
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
|
12616 |
onDeselect: () => resetMargin(props),
|
12617 |
-
resetAllFilter: createResetAllFilter('margin'),
|
12618 |
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.margin,
|
12619 |
panelId: props.clientId
|
12620 |
}, (0,external_wp_element_namespaceObject.createElement)(MarginEdit, _extends({
|
@@ -12625,10 +12837,18 @@ function DimensionsPanel(props) {
|
|
12625 |
hasValue: () => hasGapValue(props),
|
12626 |
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
|
12627 |
onDeselect: () => resetGap(props),
|
12628 |
-
resetAllFilter: createResetAllFilter('blockGap'),
|
12629 |
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.blockGap,
|
12630 |
panelId: props.clientId
|
12631 |
-
}, (0,external_wp_element_namespaceObject.createElement)(GapEdit, props))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12632 |
forceShow: paddingMouseOver.isMouseOver
|
12633 |
}, props)), !isMarginDisabled && (0,external_wp_element_namespaceObject.createElement)(MarginVisualizer, _extends({
|
12634 |
forceShow: marginMouseOver.isMouseOver
|
@@ -12647,7 +12867,7 @@ function hasDimensionsSupport(blockName) {
|
|
12647 |
return false;
|
12648 |
}
|
12649 |
|
12650 |
-
return hasGapSupport(blockName) || hasPaddingSupport(blockName) || hasMarginSupport(blockName);
|
12651 |
}
|
12652 |
/**
|
12653 |
* Determines whether dimensions support has been disabled.
|
@@ -12660,9 +12880,10 @@ function hasDimensionsSupport(blockName) {
|
|
12660 |
const useIsDimensionsDisabled = function () {
|
12661 |
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
12662 |
const gapDisabled = useIsGapDisabled(props);
|
|
|
12663 |
const paddingDisabled = useIsPaddingDisabled(props);
|
12664 |
const marginDisabled = useIsMarginDisabled(props);
|
12665 |
-
return gapDisabled && paddingDisabled && marginDisabled;
|
12666 |
};
|
12667 |
/**
|
12668 |
* Custom hook to retrieve which padding/margin/blockGap is supported
|
@@ -13439,22 +13660,24 @@ function FlexLayoutJustifyContentControl(_ref5) {
|
|
13439 |
});
|
13440 |
}
|
13441 |
|
13442 |
-
return (0,external_wp_element_namespaceObject.createElement)(
|
|
|
|
|
|
|
13443 |
className: "block-editor-hooks__flex-layout-justification-controls"
|
13444 |
-
},
|
13445 |
let {
|
13446 |
value,
|
13447 |
icon,
|
13448 |
label
|
13449 |
} = _ref6;
|
13450 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.
|
13451 |
key: value,
|
13452 |
-
|
13453 |
icon: icon,
|
13454 |
-
|
13455 |
-
onClick: () => onJustificationChange(value)
|
13456 |
});
|
13457 |
-
}))
|
13458 |
}
|
13459 |
|
13460 |
function FlexWrapControl(_ref7) {
|
@@ -13484,22 +13707,21 @@ function OrientationControl(_ref8) {
|
|
13484 |
const {
|
13485 |
orientation = 'horizontal'
|
13486 |
} = layout;
|
13487 |
-
return (0,external_wp_element_namespaceObject.createElement)(
|
13488 |
-
className: "block-editor-hooks__flex-layout-orientation-controls"
|
13489 |
-
|
13490 |
-
|
13491 |
-
|
13492 |
-
|
13493 |
-
onClick: () => onChange({ ...layout,
|
13494 |
-
orientation: 'horizontal'
|
13495 |
})
|
13496 |
-
}
|
13497 |
-
|
|
|
|
|
|
|
13498 |
icon: arrow_down,
|
13499 |
-
|
13500 |
-
|
13501 |
-
orientation: 'vertical'
|
13502 |
-
})
|
13503 |
}));
|
13504 |
}
|
13505 |
|
@@ -26863,6 +27085,7 @@ const external_wp_url_namespaceObject = window["wp"]["url"];
|
|
26863 |
|
26864 |
|
26865 |
|
|
|
26866 |
/**
|
26867 |
* Internal dependencies
|
26868 |
*/
|
@@ -26926,8 +27149,9 @@ function ReusableBlocksTab(_ref3) {
|
|
26926 |
rootClientId: rootClientId
|
26927 |
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
26928 |
className: "block-editor-inserter__manage-reusable-blocks-container"
|
26929 |
-
}, (0,external_wp_element_namespaceObject.createElement)(
|
26930 |
className: "block-editor-inserter__manage-reusable-blocks",
|
|
|
26931 |
href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
|
26932 |
post_type: 'wp_block'
|
26933 |
})
|
@@ -30725,7 +30949,7 @@ var external_wp_tokenList_default = /*#__PURE__*/__webpack_require__.n(external_
|
|
30725 |
/**
|
30726 |
* Returns the active style from the given className.
|
30727 |
*
|
30728 |
-
* @param {Array} styles Block
|
30729 |
* @param {string} className Class name
|
30730 |
*
|
30731 |
* @return {Object?} The active style.
|
@@ -30775,7 +30999,7 @@ function replaceActiveStyle(className, activeStyle, newStyle) {
|
|
30775 |
* act as a fallback for when there is no active style applied to a block. The default item also serves
|
30776 |
* as a switch on the frontend to deactivate non-default styles.
|
30777 |
*
|
30778 |
-
* @param {Array} styles Block
|
30779 |
*
|
30780 |
* @return {Array<Object?>} The style collection.
|
30781 |
*/
|
@@ -30794,7 +31018,7 @@ function getRenderedStyles(styles) {
|
|
30794 |
/**
|
30795 |
* Returns a style object from a collection of styles where that style object is the default block style.
|
30796 |
*
|
30797 |
-
* @param {Array} styles Block
|
30798 |
*
|
30799 |
* @return {Object?} The default style object, if found.
|
30800 |
*/
|
@@ -31289,7 +31513,8 @@ const BlockSwitcherDropdownMenu = _ref => {
|
|
31289 |
blocks
|
31290 |
} = _ref;
|
31291 |
const {
|
31292 |
-
replaceBlocks
|
|
|
31293 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
31294 |
const blockInformation = useBlockDisplayInformation(blocks[0].clientId);
|
31295 |
const {
|
@@ -31351,12 +31576,26 @@ const BlockSwitcherDropdownMenu = _ref => {
|
|
31351 |
maximumLength: 35
|
31352 |
});
|
31353 |
const isReusable = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isReusableBlock)(blocks[0]);
|
31354 |
-
const isTemplate = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31355 |
|
31356 |
-
|
|
|
|
|
|
|
|
|
31357 |
|
31358 |
|
31359 |
-
|
|
|
|
|
|
|
31360 |
/**
|
31361 |
* The `isTemplate` check is a stopgap solution here.
|
31362 |
* Ideally, the Transforms API should handle this
|
@@ -32268,6 +32507,21 @@ const unlock = (0,external_wp_element_namespaceObject.createElement)(external_wp
|
|
32268 |
}));
|
32269 |
/* harmony default export */ const library_unlock = (unlock);
|
32270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32271 |
;// CONCATENATED MODULE: ./packages/icons/build-module/library/lock.js
|
32272 |
|
32273 |
|
@@ -32391,6 +32645,7 @@ function BlockLockModal(_ref) {
|
|
32391 |
"aria-labelledby": instanceId,
|
32392 |
className: "block-editor-block-lock-modal__options"
|
32393 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
|
|
32394 |
className: "block-editor-block-lock-modal__options-title",
|
32395 |
label: (0,external_wp_element_namespaceObject.createElement)("span", {
|
32396 |
id: instanceId
|
@@ -32409,33 +32664,39 @@ function BlockLockModal(_ref) {
|
|
32409 |
}, allowsEditLocking && (0,external_wp_element_namespaceObject.createElement)("li", {
|
32410 |
className: "block-editor-block-lock-modal__checklist-item"
|
32411 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
32412 |
-
|
32413 |
-
|
32414 |
-
})),
|
32415 |
checked: !!lock.edit,
|
32416 |
onChange: edit => setLock(prevLock => ({ ...prevLock,
|
32417 |
edit
|
32418 |
}))
|
|
|
|
|
|
|
32419 |
})), (0,external_wp_element_namespaceObject.createElement)("li", {
|
32420 |
className: "block-editor-block-lock-modal__checklist-item"
|
32421 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
32422 |
-
|
32423 |
-
|
32424 |
-
})),
|
32425 |
checked: lock.move,
|
32426 |
onChange: move => setLock(prevLock => ({ ...prevLock,
|
32427 |
move
|
32428 |
}))
|
|
|
|
|
|
|
32429 |
})), (0,external_wp_element_namespaceObject.createElement)("li", {
|
32430 |
className: "block-editor-block-lock-modal__checklist-item"
|
32431 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
32432 |
-
|
32433 |
-
|
32434 |
-
})),
|
32435 |
checked: lock.remove,
|
32436 |
onChange: remove => setLock(prevLock => ({ ...prevLock,
|
32437 |
remove
|
32438 |
}))
|
|
|
|
|
|
|
32439 |
}))), hasTemplateLock && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
|
32440 |
className: "block-editor-block-lock-modal__template-lock",
|
32441 |
label: (0,external_wp_i18n_namespaceObject.__)('Apply to all blocks inside'),
|
@@ -32487,7 +32748,7 @@ function BlockLockMenuItem(_ref) {
|
|
32487 |
|
32488 |
const label = isLocked ? (0,external_wp_i18n_namespaceObject.__)('Unlock') : (0,external_wp_i18n_namespaceObject.__)('Lock');
|
32489 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
32490 |
-
icon: isLocked ? library_unlock :
|
32491 |
onClick: toggleModal
|
32492 |
}, label), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(BlockLockModal, {
|
32493 |
clientId: clientId,
|
@@ -33492,12 +33753,14 @@ function useBlockToolbarPopoverProps(_ref) {
|
|
33492 |
|
33493 |
|
33494 |
|
|
|
33495 |
function selected_block_popover_selector(select) {
|
33496 |
const {
|
33497 |
__unstableGetEditorMode,
|
33498 |
isMultiSelecting,
|
33499 |
hasMultiSelection,
|
33500 |
isTyping,
|
|
|
33501 |
getSettings,
|
33502 |
getLastMultiSelectedBlockClientId
|
33503 |
} = select(store);
|
@@ -33505,6 +33768,7 @@ function selected_block_popover_selector(select) {
|
|
33505 |
editorMode: __unstableGetEditorMode(),
|
33506 |
isMultiSelecting: isMultiSelecting(),
|
33507 |
isTyping: isTyping(),
|
|
|
33508 |
hasFixedToolbar: getSettings().hasFixedToolbar,
|
33509 |
isDistractionFree: getSettings().isDistractionFree,
|
33510 |
lastClientId: hasMultiSelection() ? getLastMultiSelectedBlockClientId() : null
|
@@ -33526,6 +33790,7 @@ function SelectedBlockPopover(_ref) {
|
|
33526 |
editorMode,
|
33527 |
isMultiSelecting,
|
33528 |
isTyping,
|
|
|
33529 |
hasFixedToolbar,
|
33530 |
isDistractionFree,
|
33531 |
lastClientId
|
@@ -33552,7 +33817,7 @@ function SelectedBlockPopover(_ref) {
|
|
33552 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
33553 |
const showEmptyBlockSideInserter = !isTyping && editorMode === 'edit' && isEmptyDefaultBlock;
|
33554 |
const shouldShowBreadcrumb = editorMode === 'navigation' || editorMode === 'zoom-out';
|
33555 |
-
const shouldShowContextualToolbar = editorMode === 'edit' && !hasFixedToolbar && isLargeViewport && !isMultiSelecting && !showEmptyBlockSideInserter && !isTyping;
|
33556 |
const canFocusHiddenToolbar = editorMode === 'edit' && !shouldShowContextualToolbar && !hasFixedToolbar && !isDistractionFree && !isEmptyDefaultBlock;
|
33557 |
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', () => {
|
33558 |
isToolbarForced.current = true;
|
@@ -33571,11 +33836,29 @@ function SelectedBlockPopover(_ref) {
|
|
33571 |
clientId
|
33572 |
});
|
33573 |
|
33574 |
-
if (!shouldShowBreadcrumb && !shouldShowContextualToolbar) {
|
33575 |
return null;
|
33576 |
}
|
33577 |
|
33578 |
-
return (0,external_wp_element_namespaceObject.createElement)(block_popover, _extends({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33579 |
clientId: capturingClientId || clientId,
|
33580 |
bottomClientId: lastClientId,
|
33581 |
className: classnames_default()('block-editor-block-list__block-popover', {
|
@@ -33598,7 +33881,7 @@ function SelectedBlockPopover(_ref) {
|
|
33598 |
}), shouldShowBreadcrumb && (0,external_wp_element_namespaceObject.createElement)(block_selection_button, {
|
33599 |
clientId: clientId,
|
33600 |
rootClientId: rootClientId
|
33601 |
-
}));
|
33602 |
}
|
33603 |
|
33604 |
function wrapperSelector(select) {
|
@@ -34701,7 +34984,8 @@ function useInnerBlocksProps() {
|
|
34701 |
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
34702 |
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
34703 |
const {
|
34704 |
-
__unstableDisableLayoutClassNames
|
|
|
34705 |
} = options;
|
34706 |
const {
|
34707 |
clientId,
|
@@ -34729,9 +35013,10 @@ function useInnerBlocksProps() {
|
|
34729 |
hasOverlay: blockName !== 'core/template' && !isBlockSelected(clientId) && !hasSelectedInnerBlock(clientId, true) && enableClickThrough
|
34730 |
};
|
34731 |
}, [clientId, isSmallScreen]);
|
34732 |
-
const
|
34733 |
rootClientId: clientId
|
34734 |
-
})
|
|
|
34735 |
const innerBlocksProps = {
|
34736 |
__experimentalCaptureToolbars,
|
34737 |
...options
|
@@ -36695,7 +36980,23 @@ function ColorPanel(_ref) {
|
|
36695 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
36696 |
var _ref$current;
|
36697 |
|
36698 |
-
if (!enableContrastChecking
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36699 |
return;
|
36700 |
}
|
36701 |
|
@@ -37123,7 +37424,7 @@ function ColorEdit(props) {
|
|
37123 |
};
|
37124 |
|
37125 |
const defaultColorControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [COLOR_SUPPORT_KEY, '__experimentalDefaultControls']);
|
37126 |
-
const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient) && // Contrast checking is enabled by default.
|
37127 |
// Deactivating it requires `enableContrastChecker` to have
|
37128 |
// an explicit value of `false`.
|
37129 |
false !== (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [COLOR_SUPPORT_KEY, 'enableContrastChecker']);
|
@@ -38205,7 +38506,6 @@ const DEFAULT_MAXIMUM_VIEWPORT_WIDTH = '1600px';
|
|
38205 |
const DEFAULT_MINIMUM_VIEWPORT_WIDTH = '768px';
|
38206 |
const DEFAULT_SCALE_FACTOR = 1;
|
38207 |
const DEFAULT_MINIMUM_FONT_SIZE_FACTOR = 0.75;
|
38208 |
-
const DEFAULT_MAXIMUM_FONT_SIZE_FACTOR = 1.5;
|
38209 |
const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';
|
38210 |
/**
|
38211 |
* Computes a fluid font-size value that uses clamp(). A minimum and maxinmum
|
@@ -38236,7 +38536,6 @@ const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';
|
|
38236 |
* @param {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional.
|
38237 |
* @param {?number} args.scaleFactor A scale factor to determine how fast a font scales within boundaries. Optional.
|
38238 |
* @param {?number} args.minimumFontSizeFactor How much to scale defaultFontSize by to derive minimumFontSize. Optional.
|
38239 |
-
* @param {?number} args.maximumFontSizeFactor How much to scale defaultFontSize by to derive maximumFontSize. Optional.
|
38240 |
*
|
38241 |
* @return {string|null} A font-size value using clamp().
|
38242 |
*/
|
@@ -38250,74 +38549,60 @@ function getComputedFluidTypographyValue(_ref) {
|
|
38250 |
maximumViewPortWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
|
38251 |
scaleFactor = DEFAULT_SCALE_FACTOR,
|
38252 |
minimumFontSizeFactor = DEFAULT_MINIMUM_FONT_SIZE_FACTOR,
|
38253 |
-
maximumFontSizeFactor = DEFAULT_MAXIMUM_FONT_SIZE_FACTOR,
|
38254 |
minimumFontSizeLimit = DEFAULT_MINIMUM_FONT_SIZE_LIMIT
|
38255 |
} = _ref;
|
38256 |
|
38257 |
-
/*
|
38258 |
-
* Caches minimumFontSize in minimumFontSizeValue
|
38259 |
-
* so we can check if minimumFontSize exists later.
|
38260 |
-
*/
|
38261 |
-
let minimumFontSizeValue = minimumFontSize;
|
38262 |
/*
|
38263 |
* Calculates missing minimumFontSize and maximumFontSize from
|
38264 |
* defaultFontSize if provided.
|
38265 |
*/
|
38266 |
-
|
38267 |
if (fontSize) {
|
38268 |
// Parses default font size.
|
38269 |
const fontSizeParsed = getTypographyValueAndUnit(fontSize); // Protect against invalid units.
|
38270 |
|
38271 |
if (!(fontSizeParsed !== null && fontSizeParsed !== void 0 && fontSizeParsed.unit)) {
|
38272 |
return null;
|
38273 |
-
} // If no minimumFontSize is provided, derive using min scale factor.
|
38274 |
-
|
38275 |
-
|
38276 |
-
if (!minimumFontSizeValue) {
|
38277 |
-
minimumFontSizeValue = roundToPrecision(fontSizeParsed.value * minimumFontSizeFactor, 3) + fontSizeParsed.unit;
|
38278 |
} // Parses the minimum font size limit, so we can perform checks using it.
|
38279 |
|
38280 |
|
38281 |
const minimumFontSizeLimitParsed = getTypographyValueAndUnit(minimumFontSizeLimit, {
|
38282 |
coerceTo: fontSizeParsed.unit
|
38283 |
-
});
|
38284 |
|
38285 |
-
if (!!(minimumFontSizeLimitParsed !== null && minimumFontSizeLimitParsed !== void 0 && minimumFontSizeLimitParsed.value)) {
|
38286 |
/*
|
38287 |
* If a minimum size was not passed to this function
|
38288 |
-
* and the user-defined font size is lower than
|
38289 |
-
*
|
38290 |
*/
|
38291 |
-
if (
|
38292 |
-
|
38293 |
-
} else {
|
38294 |
-
const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSizeValue, {
|
38295 |
-
coerceTo: fontSizeParsed.unit
|
38296 |
-
});
|
38297 |
-
/*
|
38298 |
-
* Otherwise, if the passed or calculated minimum font size is lower than `minimumFontSizeLimit`
|
38299 |
-
* use `minimumFontSizeLimit` instead.
|
38300 |
-
*/
|
38301 |
-
|
38302 |
-
if (!!(minimumFontSizeParsed !== null && minimumFontSizeParsed !== void 0 && minimumFontSizeParsed.value) && minimumFontSizeParsed.value < minimumFontSizeLimitParsed.value) {
|
38303 |
-
minimumFontSizeValue = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`;
|
38304 |
-
}
|
38305 |
}
|
38306 |
-
} // If no
|
38307 |
|
38308 |
|
38309 |
if (!maximumFontSize) {
|
38310 |
-
maximumFontSize =
|
38311 |
}
|
38312 |
-
|
|
|
|
|
|
|
38313 |
|
38314 |
|
38315 |
-
|
38316 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38317 |
} // Grab the minimum font size and normalize it in order to use the value for calculations.
|
38318 |
|
38319 |
|
38320 |
-
const minimumFontSizeParsed = getTypographyValueAndUnit(
|
38321 |
// otherwise the result will not be accurate.
|
38322 |
|
38323 |
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.
|
@@ -38331,7 +38616,7 @@ function getComputedFluidTypographyValue(_ref) {
|
|
38331 |
} // Uses rem for accessible fluid target font scaling.
|
38332 |
|
38333 |
|
38334 |
-
const minimumFontSizeRem = getTypographyValueAndUnit(
|
38335 |
coerceTo: 'rem'
|
38336 |
}); // Viewport widths defined for fluid typography. Normalize units
|
38337 |
|
@@ -38353,7 +38638,7 @@ function getComputedFluidTypographyValue(_ref) {
|
|
38353 |
const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / (maximumViewPortWidthParsed.value - minumumViewPortWidthParsed.value));
|
38354 |
const linearFactorScaled = roundToPrecision((linearFactor || 1) * scaleFactor, 3);
|
38355 |
const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewPortWidthOffset}) * ${linearFactorScaled})`;
|
38356 |
-
return `clamp(${
|
38357 |
}
|
38358 |
/**
|
38359 |
* Internal method that checks a string for a unit and value and returns an array consisting of `'value'` and `'unit'`, e.g., [ '42', 'rem' ].
|
@@ -39529,7 +39814,7 @@ function useIsTypographyDisabled() {
|
|
39529 |
|
39530 |
|
39531 |
|
39532 |
-
const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY];
|
39533 |
|
39534 |
const hasStyleSupport = blockType => styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, key));
|
39535 |
/**
|
@@ -39588,7 +39873,8 @@ const skipSerializationPathsEdit = {
|
|
39588 |
[`${BORDER_SUPPORT_KEY}.__experimentalSkipSerialization`]: ['border'],
|
39589 |
[`${COLOR_SUPPORT_KEY}.__experimentalSkipSerialization`]: [COLOR_SUPPORT_KEY],
|
39590 |
[`${TYPOGRAPHY_SUPPORT_KEY}.__experimentalSkipSerialization`]: [TYPOGRAPHY_SUPPORT_KEY],
|
39591 |
-
[`${
|
|
|
39592 |
};
|
39593 |
/**
|
39594 |
* A dictionary of paths to flag skipping block support serialization as the key,
|
@@ -40586,7 +40872,7 @@ const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrde
|
|
40586 |
} // Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.
|
40587 |
|
40588 |
|
40589 |
-
const
|
40590 |
[`wp-container-${id}`]: shouldRenderLayoutStyles && !!css // Only attach a container class if there is generated CSS to be attached.
|
40591 |
|
40592 |
}, layoutClasses);
|
@@ -40597,7 +40883,7 @@ const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrde
|
|
40597 |
layout: usedLayout,
|
40598 |
style: attributes === null || attributes === void 0 ? void 0 : attributes.style
|
40599 |
}), element), (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, {
|
40600 |
-
__unstableLayoutClassNames:
|
40601 |
})));
|
40602 |
});
|
40603 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/layout/addAttribute', layout_addAttribute);
|
@@ -40701,16 +40987,21 @@ const content_lock_ui_withBlockControls = (0,external_wp_compose_namespaceObject
|
|
40701 |
return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props);
|
40702 |
}
|
40703 |
|
40704 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isEditingAsBlocks && !isContentLocked && (0,external_wp_element_namespaceObject.createElement)(StopEditingAsBlocksOnOutsideSelect, {
|
40705 |
clientId: props.clientId,
|
40706 |
stopEditingAsBlock: stopEditingAsBlock
|
40707 |
}), (0,external_wp_element_namespaceObject.createElement)(block_controls, {
|
40708 |
group: "other"
|
40709 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
40710 |
onClick: () => {
|
40711 |
-
|
40712 |
-
|
40713 |
-
|
|
|
|
|
|
|
|
|
|
|
40714 |
__unstableMarkNextChangeAsNotPersistent();
|
40715 |
|
40716 |
updateBlockAttributes(props.clientId, {
|
@@ -40725,9 +41016,11 @@ const content_lock_ui_withBlockControls = (0,external_wp_compose_namespaceObject
|
|
40725 |
});
|
40726 |
|
40727 |
__unstableSetTemporarilyEditingAsBlocks(props.clientId);
|
|
|
|
|
40728 |
}
|
40729 |
-
}
|
40730 |
-
}
|
40731 |
className: classnames_default()(props.className, isEditingAsBlocks && 'is-content-locked-editing-as-blocks')
|
40732 |
})));
|
40733 |
}, 'withToolbarControls');
|
@@ -41220,7 +41513,7 @@ const withEditorColorPalette = () => (0,external_wp_compose_namespaceObject.crea
|
|
41220 |
|
41221 |
|
41222 |
function createColorHOC(colorTypes, withColorPalette) {
|
41223 |
-
const colorMap =
|
41224 |
return { ...colorObject,
|
41225 |
...(typeof colorType === 'string' ? {
|
41226 |
[colorType]: (0,external_lodash_namespaceObject.kebabCase)(colorType)
|
@@ -41246,7 +41539,7 @@ function createColorHOC(colorTypes, withColorPalette) {
|
|
41246 |
}
|
41247 |
|
41248 |
createSetters() {
|
41249 |
-
return (
|
41250 |
const upperFirstColorAttributeName = upperFirst(colorAttributeName);
|
41251 |
const customColorAttributeName = `custom${upperFirstColorAttributeName}`;
|
41252 |
settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor(colorAttributeName, customColorAttributeName);
|
@@ -41269,7 +41562,8 @@ function createColorHOC(colorTypes, withColorPalette) {
|
|
41269 |
attributes,
|
41270 |
colors
|
41271 |
} = _ref2;
|
41272 |
-
return (
|
|
|
41273 |
const colorObject = getColorObjectByAttributeValues(colors, attributes[colorAttributeName], attributes[`custom${upperFirst(colorAttributeName)}`]);
|
41274 |
const previousColorObject = previousState[colorAttributeName];
|
41275 |
const previousColor = previousColorObject === null || previousColorObject === void 0 ? void 0 : previousColorObject.color;
|
@@ -41434,7 +41728,7 @@ const with_font_sizes_upperFirst = _ref => {
|
|
41434 |
* and the value is the custom font size attribute name.
|
41435 |
* Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized.
|
41436 |
*/
|
41437 |
-
const fontSizeAttributeNames =
|
41438 |
fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${with_font_sizes_upperFirst(fontSizeAttributeName)}`;
|
41439 |
return fontSizeAttributeNamesAccumulator;
|
41440 |
}, {});
|
@@ -41452,7 +41746,8 @@ const with_font_sizes_upperFirst = _ref => {
|
|
41452 |
}
|
41453 |
|
41454 |
createSetters() {
|
41455 |
-
return (
|
|
|
41456 |
const upperFirstFontSizeAttributeName = with_font_sizes_upperFirst(fontSizeAttributeName);
|
41457 |
settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName);
|
41458 |
return settersAccumulator;
|
@@ -41471,11 +41766,11 @@ const with_font_sizes_upperFirst = _ref => {
|
|
41471 |
};
|
41472 |
}
|
41473 |
|
41474 |
-
static getDerivedStateFromProps(
|
41475 |
let {
|
41476 |
attributes,
|
41477 |
fontSizes
|
41478 |
-
} =
|
41479 |
|
41480 |
const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => {
|
41481 |
if (previousState[fontSizeAttributeName]) {
|
@@ -41496,7 +41791,8 @@ const with_font_sizes_upperFirst = _ref => {
|
|
41496 |
return null;
|
41497 |
}
|
41498 |
|
41499 |
-
const newState =
|
|
|
41500 |
const fontSizeAttributeValue = attributes[fontSizeAttributeName];
|
41501 |
const fontSizeObject = getFontSize(fontSizes, fontSizeAttributeValue, attributes[customFontSizeAttributeName]);
|
41502 |
newStateAccumulator[fontSizeAttributeName] = { ...fontSizeObject,
|
@@ -42696,7 +42992,8 @@ function ListViewBlock(_ref) {
|
|
42696 |
} = block;
|
42697 |
const {
|
42698 |
isLocked,
|
42699 |
-
isContentLocked
|
|
|
42700 |
} = useBlockLock(clientId);
|
42701 |
const forceSelectionContentLock = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
42702 |
if (isSelected) {
|
@@ -42709,6 +43006,7 @@ function ListViewBlock(_ref) {
|
|
42709 |
|
42710 |
return select(store).hasSelectedInnerBlock(clientId, true);
|
42711 |
}, [isContentLocked, clientId, isSelected]);
|
|
|
42712 |
const isFirstSelectedBlock = forceSelectionContentLock || isSelected && selectedClientIds[0] === clientId;
|
42713 |
const isLastSelectedBlock = forceSelectionContentLock || isSelected && selectedClientIds[selectedClientIds.length - 1] === clientId;
|
42714 |
const {
|
@@ -42814,7 +43112,7 @@ function ListViewBlock(_ref) {
|
|
42814 |
path: path,
|
42815 |
id: `list-view-block-${clientId}`,
|
42816 |
"data-block": clientId,
|
42817 |
-
isExpanded:
|
42818 |
"aria-selected": !!isSelected || forceSelectionContentLock
|
42819 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
42820 |
className: "block-editor-list-view-block__contents-cell",
|
@@ -42822,7 +43120,7 @@ function ListViewBlock(_ref) {
|
|
42822 |
ref: cellRef,
|
42823 |
"aria-label": blockAriaLabel,
|
42824 |
"aria-selected": !!isSelected || forceSelectionContentLock,
|
42825 |
-
"aria-expanded":
|
42826 |
"aria-describedby": descriptionId
|
42827 |
}, _ref2 => {
|
42828 |
let {
|
@@ -42991,15 +43289,21 @@ function ListViewBranch(props) {
|
|
42991 |
parentId,
|
42992 |
shouldShowInnerBlocks = true
|
42993 |
} = props;
|
42994 |
-
const
|
42995 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42996 |
}, [parentId]);
|
42997 |
const {
|
42998 |
expandedState,
|
42999 |
draggedClientIds
|
43000 |
} = useListViewContext();
|
43001 |
|
43002 |
-
if (
|
43003 |
return null;
|
43004 |
}
|
43005 |
|
@@ -47951,7 +48255,7 @@ const LinkControlSearchInput = (0,external_wp_element_namespaceObject.forwardRef
|
|
47951 |
id,
|
47952 |
url,
|
47953 |
...restLinkProps
|
47954 |
-
} = currentLink;
|
47955 |
onSelect( // Some direct entries don't have types or IDs, and we still need to clear the previous ones.
|
47956 |
{ ...restLinkProps,
|
47957 |
...suggestion
|
@@ -48331,6 +48635,25 @@ const makeCancelable = promise => {
|
|
48331 |
};
|
48332 |
};
|
48333 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48334 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/link-control/index.js
|
48335 |
|
48336 |
|
@@ -48358,6 +48681,7 @@ const makeCancelable = promise => {
|
|
48358 |
|
48359 |
|
48360 |
|
|
|
48361 |
/**
|
48362 |
* Default properties associated with a link control value.
|
48363 |
*
|
@@ -48444,7 +48768,7 @@ const link_control_noop = () => {};
|
|
48444 |
|
48445 |
|
48446 |
function LinkControl(_ref) {
|
48447 |
-
var
|
48448 |
|
48449 |
let {
|
48450 |
searchInputPlaceholder,
|
@@ -48474,12 +48798,10 @@ function LinkControl(_ref) {
|
|
48474 |
const isMounting = (0,external_wp_element_namespaceObject.useRef)(true);
|
48475 |
const wrapperNode = (0,external_wp_element_namespaceObject.useRef)();
|
48476 |
const textInputRef = (0,external_wp_element_namespaceObject.useRef)();
|
48477 |
-
const [internalInputValue, setInternalInputValue] = (0,external_wp_element_namespaceObject.useState)((value === null || value === void 0 ? void 0 : value.url) || '');
|
48478 |
-
const [internalTextValue, setInternalTextValue] = (0,external_wp_element_namespaceObject.useState)((value === null || value === void 0 ? void 0 : value.title) || '');
|
48479 |
-
const currentInputValue = propInputValue || internalInputValue;
|
48480 |
-
const [isEditingLink, setIsEditingLink] = (0,external_wp_element_namespaceObject.useState)(forceIsEditingLink !== undefined ? forceIsEditingLink : !value || !value.url);
|
48481 |
const isEndingEditWithFocus = (0,external_wp_element_namespaceObject.useRef)(false);
|
48482 |
-
const
|
|
|
|
|
48483 |
const {
|
48484 |
createPage,
|
48485 |
isCreatingPage,
|
@@ -48514,48 +48836,30 @@ function LinkControl(_ref) {
|
|
48514 |
nextFocusTarget.focus();
|
48515 |
isEndingEditWithFocus.current = false;
|
48516 |
}, [isEditingLink, isCreatingPage]);
|
48517 |
-
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
48518 |
-
/**
|
48519 |
-
* If the value's `text` property changes then sync this
|
48520 |
-
* back up with state.
|
48521 |
-
*/
|
48522 |
-
if (value !== null && value !== void 0 && value.title && value.title !== internalTextValue) {
|
48523 |
-
setInternalTextValue(value.title);
|
48524 |
-
}
|
48525 |
-
/**
|
48526 |
-
* Update the state value internalInputValue if the url value changes
|
48527 |
-
* for example when clicking on another anchor
|
48528 |
-
*/
|
48529 |
-
|
48530 |
-
|
48531 |
-
if (value !== null && value !== void 0 && value.url) {
|
48532 |
-
setInternalInputValue(value.url);
|
48533 |
-
}
|
48534 |
-
}, [value]);
|
48535 |
/**
|
48536 |
* Cancels editing state and marks that focus may need to be restored after
|
48537 |
* the next render, if focus was within the wrapper when editing finished.
|
48538 |
*/
|
48539 |
|
48540 |
-
|
48541 |
var _wrapperNode$current;
|
48542 |
|
48543 |
isEndingEditWithFocus.current = !!((_wrapperNode$current = wrapperNode.current) !== null && _wrapperNode$current !== void 0 && _wrapperNode$current.contains(wrapperNode.current.ownerDocument.activeElement));
|
48544 |
setIsEditingLink(false);
|
48545 |
-
}
|
48546 |
|
48547 |
const handleSelectSuggestion = updatedValue => {
|
48548 |
onChange({ ...updatedValue,
|
48549 |
-
title:
|
48550 |
});
|
48551 |
stopEditing();
|
48552 |
};
|
48553 |
|
48554 |
const handleSubmit = () => {
|
48555 |
-
if (
|
48556 |
onChange({ ...value,
|
48557 |
-
url:
|
48558 |
-
title:
|
48559 |
});
|
48560 |
}
|
48561 |
|
@@ -48574,6 +48878,8 @@ function LinkControl(_ref) {
|
|
48574 |
}
|
48575 |
};
|
48576 |
|
|
|
|
|
48577 |
const shownUnlinkControl = onRemove && value && !isEditingLink && !isCreatingPage;
|
48578 |
const showSettingsDrawer = !!(settings !== null && settings !== void 0 && settings.length); // Only show text control once a URL value has been committed
|
48579 |
// and it isn't just empty whitespace.
|
@@ -48595,17 +48901,17 @@ function LinkControl(_ref) {
|
|
48595 |
ref: textInputRef,
|
48596 |
className: "block-editor-link-control__field block-editor-link-control__text-content",
|
48597 |
label: "Text",
|
48598 |
-
value:
|
48599 |
-
onChange:
|
48600 |
onKeyDown: handleSubmitWithEnter
|
48601 |
}), (0,external_wp_element_namespaceObject.createElement)(search_input, {
|
48602 |
currentLink: value,
|
48603 |
className: "block-editor-link-control__field block-editor-link-control__search-input",
|
48604 |
placeholder: searchInputPlaceholder,
|
48605 |
-
value:
|
48606 |
withCreateSuggestion: withCreateSuggestion,
|
48607 |
onCreateSuggestion: createPage,
|
48608 |
-
onChange:
|
48609 |
onSelect: handleSelectSuggestion,
|
48610 |
showInitialSuggestions: showInitialSuggestions,
|
48611 |
allowDirectEntry: !noDirectEntry,
|
@@ -48647,103 +48953,91 @@ function LinkControl(_ref) {
|
|
48647 |
LinkControl.ViewerFill = ViewerFill;
|
48648 |
/* harmony default export */ const link_control = (LinkControl);
|
48649 |
|
48650 |
-
;// CONCATENATED MODULE: ./packages/
|
48651 |
-
|
48652 |
-
|
48653 |
-
/**
|
48654 |
-
* WordPress dependencies
|
48655 |
-
*/
|
48656 |
-
|
48657 |
-
const media = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
48658 |
-
xmlns: "http://www.w3.org/2000/svg",
|
48659 |
-
viewBox: "0 0 24 24"
|
48660 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
48661 |
-
d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"
|
48662 |
-
}));
|
48663 |
-
/* harmony default export */ const library_media = (media);
|
48664 |
|
48665 |
-
;// CONCATENATED MODULE: ./packages/icons/build-module/library/upload.js
|
48666 |
|
48667 |
|
48668 |
/**
|
48669 |
-
*
|
48670 |
*/
|
48671 |
|
48672 |
-
const upload = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
48673 |
-
xmlns: "http://www.w3.org/2000/svg",
|
48674 |
-
viewBox: "0 0 24 24"
|
48675 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
48676 |
-
d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"
|
48677 |
-
}));
|
48678 |
-
/* harmony default export */ const library_upload = (upload);
|
48679 |
-
|
48680 |
-
;// CONCATENATED MODULE: ./packages/icons/build-module/library/post-featured-image.js
|
48681 |
-
|
48682 |
|
48683 |
/**
|
48684 |
* WordPress dependencies
|
48685 |
*/
|
48686 |
|
48687 |
-
const postFeaturedImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
48688 |
-
xmlns: "http://www.w3.org/2000/svg",
|
48689 |
-
viewBox: "0 0 24 24"
|
48690 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
48691 |
-
d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"
|
48692 |
-
}));
|
48693 |
-
/* harmony default export */ const post_featured_image = (postFeaturedImage);
|
48694 |
|
48695 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/media-upload/index.js
|
48696 |
/**
|
48697 |
-
*
|
48698 |
*/
|
48699 |
|
48700 |
-
/**
|
48701 |
-
* This is a placeholder for the media upload component necessary to make it possible to provide
|
48702 |
-
* an integration with the core blocks that handle media files. By default it renders nothing but
|
48703 |
-
* it provides a way to have it overridden with the `editor.MediaUpload` filter.
|
48704 |
-
*
|
48705 |
-
* @return {WPComponent} The component to be rendered.
|
48706 |
-
*/
|
48707 |
|
48708 |
-
const
|
48709 |
-
|
48710 |
-
|
48711 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48712 |
|
|
|
48713 |
|
48714 |
-
/* harmony default export */ const media_upload = ((0,external_wp_components_namespaceObject.withFilters)('editor.MediaUpload')(MediaUpload));
|
48715 |
|
48716 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/media-upload/check.js
|
48717 |
/**
|
48718 |
* WordPress dependencies
|
48719 |
*/
|
48720 |
|
48721 |
-
/**
|
48722 |
-
* Internal dependencies
|
48723 |
-
*/
|
48724 |
-
|
48725 |
|
48726 |
-
function
|
48727 |
let {
|
48728 |
-
|
48729 |
-
children
|
48730 |
} = _ref;
|
48731 |
-
|
48732 |
-
|
48733 |
-
|
48734 |
-
|
48735 |
-
|
48736 |
-
|
48737 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48738 |
}
|
48739 |
-
/**
|
48740 |
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md
|
48741 |
-
*/
|
48742 |
|
48743 |
-
|
48744 |
|
48745 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/media-replace-flow/index.js
|
48746 |
|
|
|
|
|
|
|
48747 |
|
48748 |
/**
|
48749 |
* WordPress dependencies
|
@@ -48753,11 +49047,6 @@ function MediaUploadCheck(_ref) {
|
|
48753 |
|
48754 |
|
48755 |
|
48756 |
-
|
48757 |
-
|
48758 |
-
|
48759 |
-
|
48760 |
-
|
48761 |
/**
|
48762 |
* Internal dependencies
|
48763 |
*/
|
@@ -48767,212 +49056,86 @@ function MediaUploadCheck(_ref) {
|
|
48767 |
|
48768 |
|
48769 |
|
48770 |
-
const media_replace_flow_noop = () => {};
|
48771 |
-
|
48772 |
-
let uniqueId = 0;
|
48773 |
|
48774 |
-
|
48775 |
let {
|
48776 |
-
|
48777 |
-
|
48778 |
-
|
48779 |
-
|
48780 |
-
|
48781 |
-
|
48782 |
-
|
48783 |
-
|
48784 |
-
|
48785 |
-
|
48786 |
-
|
48787 |
-
name = (0,external_wp_i18n_namespaceObject.__)('Replace'),
|
48788 |
-
createNotice,
|
48789 |
-
removeNotice,
|
48790 |
-
children,
|
48791 |
-
multiple = false,
|
48792 |
-
addToGallery,
|
48793 |
-
handleUpload = true
|
48794 |
} = _ref;
|
48795 |
-
const
|
48796 |
-
|
48797 |
-
|
48798 |
-
|
48799 |
-
|
48800 |
-
|
48801 |
-
|
48802 |
-
|
48803 |
-
|
48804 |
-
|
48805 |
-
|
48806 |
-
return;
|
48807 |
-
} // We need to set a timeout for showing the notice
|
48808 |
-
// so that VoiceOver and possibly other screen readers
|
48809 |
-
// can announce the error afer the toolbar button
|
48810 |
-
// regains focus once the upload dialog closes.
|
48811 |
-
// Otherwise VO simply skips over the notice and announces
|
48812 |
-
// the focused element and the open menu.
|
48813 |
-
|
48814 |
-
|
48815 |
-
setTimeout(() => {
|
48816 |
-
createNotice('error', safeMessage, {
|
48817 |
-
speak: true,
|
48818 |
-
id: errorNoticeID,
|
48819 |
-
isDismissible: true
|
48820 |
-
});
|
48821 |
-
}, 1000);
|
48822 |
-
};
|
48823 |
-
|
48824 |
-
const selectMedia = (media, closeMenu) => {
|
48825 |
-
if (useFeaturedImage && onToggleFeaturedImage) {
|
48826 |
-
onToggleFeaturedImage();
|
48827 |
-
}
|
48828 |
-
|
48829 |
-
closeMenu(); // Calling `onSelect` after the state update since it might unmount the component.
|
48830 |
-
|
48831 |
-
onSelect(media);
|
48832 |
-
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('The media file has been replaced'));
|
48833 |
-
removeNotice(errorNoticeID);
|
48834 |
-
};
|
48835 |
-
|
48836 |
-
const uploadFiles = (event, closeMenu) => {
|
48837 |
-
const files = event.target.files;
|
48838 |
-
|
48839 |
-
if (!handleUpload) {
|
48840 |
-
closeMenu();
|
48841 |
-
return onSelect(files);
|
48842 |
-
}
|
48843 |
-
|
48844 |
-
onFilesUpload(files);
|
48845 |
-
mediaUpload({
|
48846 |
-
allowedTypes,
|
48847 |
-
filesList: files,
|
48848 |
-
onFileChange: _ref2 => {
|
48849 |
-
let [media] = _ref2;
|
48850 |
-
selectMedia(media, closeMenu);
|
48851 |
-
},
|
48852 |
-
onError: onUploadError
|
48853 |
-
});
|
48854 |
-
};
|
48855 |
|
48856 |
-
const
|
48857 |
-
|
48858 |
-
|
48859 |
-
event.target.click();
|
48860 |
-
}
|
48861 |
};
|
48862 |
|
48863 |
-
|
48864 |
-
if (
|
48865 |
-
|
48866 |
}
|
|
|
48867 |
|
48868 |
-
|
48869 |
-
|
48870 |
-
|
48871 |
-
|
48872 |
-
|
48873 |
-
|
48874 |
-
|
48875 |
-
|
48876 |
-
|
48877 |
-
|
48878 |
-
|
48879 |
-
|
48880 |
-
|
48881 |
-
|
48882 |
-
|
48883 |
-
|
48884 |
-
|
48885 |
-
|
48886 |
-
|
48887 |
-
|
48888 |
-
|
48889 |
-
|
48890 |
-
|
48891 |
-
|
48892 |
-
|
48893 |
-
|
48894 |
-
|
48895 |
-
|
48896 |
-
|
48897 |
-
|
48898 |
-
|
48899 |
-
|
48900 |
-
|
48901 |
-
|
48902 |
-
|
48903 |
-
|
48904 |
-
|
48905 |
-
let {
|
48906 |
-
open
|
48907 |
-
} = _ref5;
|
48908 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
48909 |
-
icon: library_media,
|
48910 |
-
onClick: open
|
48911 |
-
}, (0,external_wp_i18n_namespaceObject.__)('Open Media Library'));
|
48912 |
-
}
|
48913 |
-
}), (0,external_wp_element_namespaceObject.createElement)(media_upload_check, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, {
|
48914 |
-
onChange: event => {
|
48915 |
-
uploadFiles(event, onClose);
|
48916 |
-
},
|
48917 |
-
accept: accept,
|
48918 |
-
multiple: multiple,
|
48919 |
-
render: _ref6 => {
|
48920 |
-
let {
|
48921 |
-
openFileDialog
|
48922 |
-
} = _ref6;
|
48923 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
48924 |
-
icon: library_upload,
|
48925 |
-
onClick: () => {
|
48926 |
-
openFileDialog();
|
48927 |
-
}
|
48928 |
-
}, (0,external_wp_i18n_namespaceObject.__)('Upload'));
|
48929 |
-
}
|
48930 |
-
}))), onToggleFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
48931 |
-
icon: post_featured_image,
|
48932 |
-
onClick: onToggleFeaturedImage,
|
48933 |
-
isPressed: useFeaturedImage
|
48934 |
-
}, (0,external_wp_i18n_namespaceObject.__)('Use featured image')), children), onSelectURL && // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
48935 |
-
(0,external_wp_element_namespaceObject.createElement)("form", {
|
48936 |
-
className: "block-editor-media-flow__url-input"
|
48937 |
-
}, (0,external_wp_element_namespaceObject.createElement)("span", {
|
48938 |
-
className: "block-editor-media-replace-flow__image-url-label"
|
48939 |
-
}, (0,external_wp_i18n_namespaceObject.__)('Current media URL:')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
|
48940 |
-
text: mediaURL,
|
48941 |
-
position: "bottom"
|
48942 |
-
}, (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(link_control, {
|
48943 |
-
value: {
|
48944 |
-
url: mediaURL
|
48945 |
-
},
|
48946 |
-
settings: [],
|
48947 |
-
showSuggestions: false,
|
48948 |
-
onChange: _ref7 => {
|
48949 |
-
let {
|
48950 |
-
url
|
48951 |
-
} = _ref7;
|
48952 |
-
onSelectURL(url);
|
48953 |
-
editMediaButtonRef.current.focus();
|
48954 |
-
}
|
48955 |
-
})))));
|
48956 |
-
}
|
48957 |
-
});
|
48958 |
-
};
|
48959 |
-
/**
|
48960 |
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-replace-flow/README.md
|
48961 |
-
*/
|
48962 |
|
|
|
48963 |
|
48964 |
-
|
48965 |
-
const {
|
48966 |
-
createNotice,
|
48967 |
-
removeNotice
|
48968 |
-
} = dispatch(external_wp_notices_namespaceObject.store);
|
48969 |
-
return {
|
48970 |
-
createNotice,
|
48971 |
-
removeNotice
|
48972 |
-
};
|
48973 |
-
}), (0,external_wp_components_namespaceObject.withFilters)('editor.MediaReplaceFlow')])(MediaReplaceFlow));
|
48974 |
|
48975 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/url-popover/link-viewer-url.js
|
48976 |
|
48977 |
|
48978 |
/**
|
@@ -48985,46 +49148,1660 @@ const MediaReplaceFlow = _ref => {
|
|
48985 |
|
48986 |
|
48987 |
|
48988 |
-
|
48989 |
-
|
48990 |
-
|
48991 |
-
urlLabel,
|
48992 |
-
className
|
48993 |
-
} = _ref;
|
48994 |
-
const linkClassName = classnames_default()(className, 'block-editor-url-popover__link-viewer-url');
|
48995 |
-
|
48996 |
-
if (!url) {
|
48997 |
-
return (0,external_wp_element_namespaceObject.createElement)("span", {
|
48998 |
-
className: linkClassName
|
48999 |
-
});
|
49000 |
-
}
|
49001 |
|
49002 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
|
49003 |
-
className: linkClassName,
|
49004 |
-
href: url
|
49005 |
-
}, urlLabel || (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(url)));
|
49006 |
-
}
|
49007 |
|
49008 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/url-popover/link-viewer.js
|
49009 |
|
49010 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49011 |
|
49012 |
-
|
49013 |
-
|
49014 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49015 |
|
|
|
49016 |
/**
|
49017 |
* WordPress dependencies
|
49018 |
*/
|
49019 |
|
|
|
|
|
49020 |
|
49021 |
-
|
49022 |
-
|
49023 |
/**
|
49024 |
-
*
|
49025 |
*/
|
49026 |
|
49027 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49028 |
function LinkViewer(_ref) {
|
49029 |
let {
|
49030 |
className,
|
@@ -49099,22 +50876,49 @@ function LinkEditor(_ref) {
|
|
49099 |
|
49100 |
|
49101 |
|
|
|
49102 |
/**
|
49103 |
* Internal dependencies
|
49104 |
*/
|
49105 |
|
49106 |
|
49107 |
|
|
|
49108 |
|
49109 |
function URLPopover(_ref) {
|
49110 |
let {
|
49111 |
additionalControls,
|
49112 |
children,
|
49113 |
renderSettings,
|
49114 |
-
|
|
|
49115 |
focusOnMount = 'firstElement',
|
|
|
|
|
|
|
49116 |
...popoverProps
|
49117 |
} = _ref;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49118 |
const [isSettingsExpanded, setIsSettingsExpanded] = (0,external_wp_element_namespaceObject.useState)(false);
|
49119 |
const showSettings = !!renderSettings && isSettingsExpanded;
|
49120 |
|
@@ -49125,7 +50929,7 @@ function URLPopover(_ref) {
|
|
49125 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
|
49126 |
className: "block-editor-url-popover",
|
49127 |
focusOnMount: focusOnMount,
|
49128 |
-
|
49129 |
shift: true
|
49130 |
}, popoverProps), (0,external_wp_element_namespaceObject.createElement)("div", {
|
49131 |
className: "block-editor-url-popover__input-container"
|
@@ -53937,6 +55741,7 @@ function PublishDateTimePicker(_ref, ref) {
|
|
53937 |
|
53938 |
|
53939 |
|
|
|
53940 |
|
53941 |
|
53942 |
|
3271 |
"__experimentalLinkControlSearchItem": () => (/* reexport */ search_item),
|
3272 |
"__experimentalLinkControlSearchResults": () => (/* reexport */ LinkControlSearchResults),
|
3273 |
"__experimentalListView": () => (/* reexport */ components_list_view),
|
3274 |
+
"__experimentalOffCanvasEditor": () => (/* reexport */ off_canvas_editor),
|
3275 |
"__experimentalPanelColorGradientSettings": () => (/* reexport */ panel_color_gradient_settings),
|
3276 |
"__experimentalPreviewOptions": () => (/* reexport */ PreviewOptions),
|
3277 |
"__experimentalPublishDateTimePicker": () => (/* reexport */ publish_date_time_picker),
|
3350 |
"__experimentalGetPatternTransformItems": () => (__experimentalGetPatternTransformItems),
|
3351 |
"__experimentalGetPatternsByBlockTypes": () => (__experimentalGetPatternsByBlockTypes),
|
3352 |
"__experimentalGetReusableBlockTitle": () => (__experimentalGetReusableBlockTitle),
|
3353 |
+
"__experimentalIsBlockInterfaceHidden": () => (__experimentalIsBlockInterfaceHidden),
|
3354 |
"__unstableGetBlockWithoutInnerBlocks": () => (__unstableGetBlockWithoutInnerBlocks),
|
3355 |
"__unstableGetClientIdWithClientIdsTree": () => (__unstableGetClientIdWithClientIdsTree),
|
3356 |
"__unstableGetClientIdsTree": () => (__unstableGetClientIdsTree),
|
3450 |
var actions_namespaceObject = {};
|
3451 |
__webpack_require__.r(actions_namespaceObject);
|
3452 |
__webpack_require__.d(actions_namespaceObject, {
|
3453 |
+
"__experimentalHideBlockInterface": () => (__experimentalHideBlockInterface),
|
3454 |
+
"__experimentalShowBlockInterface": () => (__experimentalShowBlockInterface),
|
3455 |
"__unstableDeleteSelection": () => (__unstableDeleteSelection),
|
3456 |
"__unstableExpandSelection": () => (__unstableExpandSelection),
|
3457 |
"__unstableMarkAutomaticChange": () => (__unstableMarkAutomaticChange),
|
4427 |
// will be deleted entirely from its entity.
|
4428 |
|
4429 |
stateAfterInsert.order = { ...stateAfterInsert.order,
|
4430 |
+
...Object.keys(nestedControllers).reduce((result, key) => {
|
4431 |
if (state.order[key]) {
|
4432 |
result[key] = state.order[key];
|
4433 |
}
|
4436 |
}, {})
|
4437 |
};
|
4438 |
stateAfterInsert.tree = { ...stateAfterInsert.tree,
|
4439 |
+
...Object.keys(nestedControllers).reduce((result, _key) => {
|
4440 |
const key = `controlled||${_key}`;
|
4441 |
|
4442 |
if (state.tree[key]) {
|
4605 |
return state;
|
4606 |
}
|
4607 |
|
4608 |
+
const next = action.clientIds.reduce((accumulator, id) => {
|
4609 |
+
var _action$attributes;
|
4610 |
+
|
4611 |
+
return { ...accumulator,
|
4612 |
+
[id]: Object.entries(action.uniqueByBlock ? action.attributes[id] : (_action$attributes = action.attributes) !== null && _action$attributes !== void 0 ? _action$attributes : {}).reduce((result, _ref3) => {
|
4613 |
+
let [key, value] = _ref3;
|
|
|
4614 |
|
4615 |
+
// Consider as updates only changed values.
|
4616 |
+
if (value !== result[key]) {
|
4617 |
+
result = getMutateSafeObject(state[id], result);
|
4618 |
+
result[key] = value;
|
4619 |
+
}
|
4620 |
+
|
4621 |
+
return result;
|
4622 |
+
}, state[id])
|
4623 |
+
};
|
4624 |
+
}, {});
|
4625 |
|
4626 |
if (action.clientIds.every(id => next[id] === state[id])) {
|
4627 |
return state;
|
4758 |
const mappedBlocks = mapBlockOrder(action.blocks);
|
4759 |
return (0,external_wp_compose_namespaceObject.pipe)([nextState => (0,external_lodash_namespaceObject.omit)(nextState, action.replacedClientIds), nextState => ({ ...nextState,
|
4760 |
...(0,external_lodash_namespaceObject.omit)(mappedBlocks, '')
|
4761 |
+
}), nextState => (0,external_lodash_namespaceObject.mapValues)(nextState, subState => Object.values(subState).reduce((result, clientId) => {
|
4762 |
if (clientId === clientIds[0]) {
|
4763 |
return [...result, ...mappedBlocks['']];
|
4764 |
}
|
4841 |
}
|
4842 |
|
4843 |
});
|
4844 |
+
/**
|
4845 |
+
* Reducer returning visibility status of block interface.
|
4846 |
+
*
|
4847 |
+
* @param {boolean} state Current state.
|
4848 |
+
* @param {Object} action Dispatched action.
|
4849 |
+
*
|
4850 |
+
* @return {boolean} Updated state.
|
4851 |
+
*/
|
4852 |
+
|
4853 |
+
function isBlockInterfaceHidden() {
|
4854 |
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
4855 |
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
4856 |
+
|
4857 |
+
switch (action.type) {
|
4858 |
+
case 'HIDE_BLOCK_INTERFACE':
|
4859 |
+
return true;
|
4860 |
+
|
4861 |
+
case 'SHOW_BLOCK_INTERFACE':
|
4862 |
+
return false;
|
4863 |
+
}
|
4864 |
+
|
4865 |
+
return state;
|
4866 |
+
}
|
4867 |
/**
|
4868 |
* Reducer returning typing state.
|
4869 |
*
|
5583 |
/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
|
5584 |
blocks,
|
5585 |
isTyping,
|
5586 |
+
isBlockInterfaceHidden,
|
5587 |
draggedBlocks,
|
5588 |
selection,
|
5589 |
isMultiSelecting,
|
6196 |
return clientIds.length;
|
6197 |
}
|
6198 |
|
6199 |
+
return clientIds.reduce((accumulator, clientId) => {
|
6200 |
const block = state.blocks.byClientId[clientId];
|
6201 |
return block.name === blockName ? accumulator + 1 : accumulator;
|
6202 |
}, 0);
|
7101 |
function selectors_isTyping(state) {
|
7102 |
return state.isTyping;
|
7103 |
}
|
7104 |
+
/**
|
7105 |
+
* Returns true if the the block interface should be hidden, or false otherwise.
|
7106 |
+
*
|
7107 |
+
* @param {Object} state Global application state.
|
7108 |
+
*
|
7109 |
+
* @return {boolean} Whether the block toolbar is hidden.
|
7110 |
+
*/
|
7111 |
+
|
7112 |
+
function __experimentalIsBlockInterfaceHidden(state) {
|
7113 |
+
return state.isBlockInterfaceHidden;
|
7114 |
+
}
|
7115 |
/**
|
7116 |
* Returns true if the user is dragging blocks, or false otherwise.
|
7117 |
*
|
9647 |
clientId
|
9648 |
};
|
9649 |
}
|
9650 |
+
/**
|
9651 |
+
* Returns an action object used in signalling that the block interface, eg. toolbar, outline, etc. should be hidden.
|
9652 |
+
*
|
9653 |
+
* @return {Object} Action object.
|
9654 |
+
*/
|
9655 |
+
|
9656 |
+
function __experimentalHideBlockInterface() {
|
9657 |
+
return {
|
9658 |
+
type: 'HIDE_BLOCK_INTERFACE'
|
9659 |
+
};
|
9660 |
+
}
|
9661 |
+
/**
|
9662 |
+
* Returns an action object used in signalling that the block interface, eg. toolbar, outline, etc. should be shown.
|
9663 |
+
*
|
9664 |
+
* @return {Object} Action object.
|
9665 |
+
*/
|
9666 |
+
|
9667 |
+
function __experimentalShowBlockInterface() {
|
9668 |
+
return {
|
9669 |
+
type: 'SHOW_BLOCK_INTERFACE'
|
9670 |
+
};
|
9671 |
+
}
|
9672 |
/**
|
9673 |
* Returns an action object used in signalling that the user has begun to type.
|
9674 |
*
|
10939 |
|
10940 |
|
10941 |
|
10942 |
+
const blockedPaths = ['color', 'border', 'dimensions', 'typography', 'spacing'];
|
10943 |
const deprecatedFlags = {
|
10944 |
'color.palette': settings => settings.colors,
|
10945 |
'color.gradients': settings => settings.gradients,
|
12349 |
if (!external_wp_isShallowEqual_default()(margin, valueRef.current) && !forceShow) {
|
12350 |
setIsActive(true);
|
12351 |
valueRef.current = margin;
|
|
|
12352 |
timeoutRef.current = setTimeout(() => {
|
12353 |
setIsActive(false);
|
12354 |
}, 400);
|
12355 |
}
|
12356 |
|
12357 |
+
return () => {
|
12358 |
+
setIsActive(false);
|
12359 |
+
clearTimer();
|
12360 |
+
};
|
12361 |
}, [margin, forceShow]);
|
12362 |
|
12363 |
if (!isActive && !forceShow) {
|
12375 |
}));
|
12376 |
}
|
12377 |
|
12378 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/min-height.js
|
12379 |
+
|
12380 |
+
|
12381 |
+
/**
|
12382 |
+
* WordPress dependencies
|
12383 |
+
*/
|
12384 |
+
|
12385 |
+
|
12386 |
+
|
12387 |
+
/**
|
12388 |
+
* Internal dependencies
|
12389 |
+
*/
|
12390 |
+
|
12391 |
+
|
12392 |
+
|
12393 |
+
|
12394 |
+
/**
|
12395 |
+
* Determines if there is minHeight support.
|
12396 |
+
*
|
12397 |
+
* @param {string|Object} blockType Block name or Block Type object.
|
12398 |
+
* @return {boolean} Whether there is support.
|
12399 |
+
*/
|
12400 |
+
|
12401 |
+
function hasMinHeightSupport(blockType) {
|
12402 |
+
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, DIMENSIONS_SUPPORT_KEY);
|
12403 |
+
return !!(true === support || support !== null && support !== void 0 && support.minHeight);
|
12404 |
+
}
|
12405 |
+
/**
|
12406 |
+
* Checks if there is a current value in the minHeight block support attributes.
|
12407 |
+
*
|
12408 |
+
* @param {Object} props Block props.
|
12409 |
+
* @return {boolean} Whether or not the block has a minHeight value set.
|
12410 |
+
*/
|
12411 |
+
|
12412 |
+
function hasMinHeightValue(props) {
|
12413 |
+
var _props$attributes$sty, _props$attributes$sty2;
|
12414 |
+
|
12415 |
+
return ((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.dimensions) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.minHeight) !== undefined;
|
12416 |
+
}
|
12417 |
+
/**
|
12418 |
+
* Resets the minHeight block support attributes. This can be used when disabling
|
12419 |
+
* the padding support controls for a block via a `ToolsPanel`.
|
12420 |
+
*
|
12421 |
+
* @param {Object} props Block props.
|
12422 |
+
* @param {Object} props.attributes Block's attributes.
|
12423 |
+
* @param {Object} props.setAttributes Function to set block's attributes.
|
12424 |
+
*/
|
12425 |
+
|
12426 |
+
function resetMinHeight(_ref) {
|
12427 |
+
let {
|
12428 |
+
attributes = {},
|
12429 |
+
setAttributes
|
12430 |
+
} = _ref;
|
12431 |
+
const {
|
12432 |
+
style
|
12433 |
+
} = attributes;
|
12434 |
+
setAttributes({
|
12435 |
+
style: cleanEmptyObject({ ...style,
|
12436 |
+
dimensions: { ...(style === null || style === void 0 ? void 0 : style.dimensions),
|
12437 |
+
minHeight: undefined
|
12438 |
+
}
|
12439 |
+
})
|
12440 |
+
});
|
12441 |
+
}
|
12442 |
+
/**
|
12443 |
+
* Custom hook that checks if minHeight controls have been disabled.
|
12444 |
+
*
|
12445 |
+
* @param {string} name The name of the block.
|
12446 |
+
* @return {boolean} Whether minHeight control is disabled.
|
12447 |
+
*/
|
12448 |
+
|
12449 |
+
function useIsMinHeightDisabled() {
|
12450 |
+
let {
|
12451 |
+
name: blockName
|
12452 |
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
12453 |
+
const isDisabled = !useSetting('dimensions.minHeight');
|
12454 |
+
return !hasMinHeightSupport(blockName) || isDisabled;
|
12455 |
+
}
|
12456 |
+
/**
|
12457 |
+
* Inspector control panel containing the minHeight related configuration.
|
12458 |
+
*
|
12459 |
+
* @param {Object} props Block props.
|
12460 |
+
* @return {WPElement} Edit component for height.
|
12461 |
+
*/
|
12462 |
+
|
12463 |
+
function MinHeightEdit(props) {
|
12464 |
+
var _style$dimensions;
|
12465 |
+
|
12466 |
+
const {
|
12467 |
+
attributes: {
|
12468 |
+
style
|
12469 |
+
},
|
12470 |
+
setAttributes
|
12471 |
+
} = props;
|
12472 |
+
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
12473 |
+
availableUnits: useSetting('dimensions.units') || ['%', 'px', 'em', 'rem', 'vh', 'vw']
|
12474 |
+
});
|
12475 |
+
|
12476 |
+
if (useIsMinHeightDisabled(props)) {
|
12477 |
+
return null;
|
12478 |
+
}
|
12479 |
+
|
12480 |
+
const onChange = next => {
|
12481 |
+
const newStyle = { ...style,
|
12482 |
+
dimensions: { ...(style === null || style === void 0 ? void 0 : style.dimensions),
|
12483 |
+
minHeight: next
|
12484 |
+
}
|
12485 |
+
};
|
12486 |
+
setAttributes({
|
12487 |
+
style: cleanEmptyObject(newStyle)
|
12488 |
+
});
|
12489 |
+
};
|
12490 |
+
|
12491 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
|
12492 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Min. height'),
|
12493 |
+
value: style === null || style === void 0 ? void 0 : (_style$dimensions = style.dimensions) === null || _style$dimensions === void 0 ? void 0 : _style$dimensions.minHeight,
|
12494 |
+
units: units,
|
12495 |
+
onChange: onChange,
|
12496 |
+
min: 0,
|
12497 |
+
size: '__unstable-large'
|
12498 |
+
});
|
12499 |
+
}
|
12500 |
+
|
12501 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/padding.js
|
12502 |
|
12503 |
|
12682 |
if (!external_wp_isShallowEqual_default()(padding, valueRef.current) && !forceShow) {
|
12683 |
setIsActive(true);
|
12684 |
valueRef.current = padding;
|
|
|
12685 |
timeoutRef.current = setTimeout(() => {
|
12686 |
setIsActive(false);
|
12687 |
}, 400);
|
12688 |
}
|
12689 |
|
12690 |
+
return () => {
|
12691 |
+
setIsActive(false);
|
12692 |
+
clearTimer();
|
12693 |
+
};
|
12694 |
}, [padding, forceShow]);
|
12695 |
|
12696 |
if (!isActive && !forceShow) {
|
12724 |
|
12725 |
|
12726 |
|
12727 |
+
|
12728 |
/**
|
12729 |
* Internal dependencies
|
12730 |
*/
|
12734 |
|
12735 |
|
12736 |
|
12737 |
+
|
12738 |
+
|
12739 |
+
const DIMENSIONS_SUPPORT_KEY = 'dimensions';
|
12740 |
const SPACING_SUPPORT_KEY = 'spacing';
|
12741 |
const dimensions_ALL_SIDES = ['top', 'right', 'bottom', 'left'];
|
12742 |
const AXIAL_SIDES = ['vertical', 'horizontal'];
|
12743 |
|
12744 |
function useVisualizerMouseOver() {
|
12745 |
const [isMouseOver, setIsMouseOver] = (0,external_wp_element_namespaceObject.useState)(false);
|
12746 |
+
const {
|
12747 |
+
__experimentalHideBlockInterface: hideBlockInterface,
|
12748 |
+
__experimentalShowBlockInterface: showBlockInterface
|
12749 |
+
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
12750 |
|
12751 |
+
const onMouseOver = e => {
|
12752 |
+
e.stopPropagation();
|
12753 |
+
hideBlockInterface();
|
12754 |
+
setIsMouseOver(true);
|
12755 |
+
};
|
12756 |
|
12757 |
+
const onMouseOut = e => {
|
12758 |
+
e.stopPropagation();
|
12759 |
+
showBlockInterface();
|
12760 |
+
setIsMouseOver(false);
|
12761 |
+
};
|
12762 |
|
12763 |
return {
|
12764 |
isMouseOver,
|
12771 |
*
|
12772 |
* @param {Object} props Block props.
|
12773 |
*
|
12774 |
+
* @return {WPElement} Inspector controls for dimensions and spacing support features.
|
12775 |
*/
|
12776 |
|
12777 |
|
12779 |
const isGapDisabled = useIsGapDisabled(props);
|
12780 |
const isPaddingDisabled = useIsPaddingDisabled(props);
|
12781 |
const isMarginDisabled = useIsMarginDisabled(props);
|
12782 |
+
const isMinHeightDisabled = useIsMinHeightDisabled(props);
|
12783 |
const isDisabled = useIsDimensionsDisabled(props);
|
12784 |
const isSupported = hasDimensionsSupport(props.name);
|
12785 |
const spacingSizes = useSetting('spacing.spacingSizes');
|
12790 |
return null;
|
12791 |
}
|
12792 |
|
12793 |
+
const defaultDimensionsControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [DIMENSIONS_SUPPORT_KEY, '__experimentalDefaultControls']);
|
12794 |
const defaultSpacingControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [SPACING_SUPPORT_KEY, '__experimentalDefaultControls']);
|
12795 |
|
12796 |
+
const createResetAllFilter = (attribute, featureSet) => newAttributes => {
|
12797 |
var _newAttributes$style;
|
12798 |
|
12799 |
return { ...newAttributes,
|
12800 |
style: { ...newAttributes.style,
|
12801 |
+
[featureSet]: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style[featureSet]),
|
12802 |
[attribute]: undefined
|
12803 |
}
|
12804 |
}
|
12815 |
hasValue: () => hasPaddingValue(props),
|
12816 |
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
|
12817 |
onDeselect: () => resetPadding(props),
|
12818 |
+
resetAllFilter: createResetAllFilter('padding', 'spacing'),
|
12819 |
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.padding,
|
12820 |
panelId: props.clientId
|
12821 |
}, (0,external_wp_element_namespaceObject.createElement)(PaddingEdit, _extends({
|
12826 |
hasValue: () => hasMarginValue(props),
|
12827 |
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
|
12828 |
onDeselect: () => resetMargin(props),
|
12829 |
+
resetAllFilter: createResetAllFilter('margin', 'spacing'),
|
12830 |
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.margin,
|
12831 |
panelId: props.clientId
|
12832 |
}, (0,external_wp_element_namespaceObject.createElement)(MarginEdit, _extends({
|
12837 |
hasValue: () => hasGapValue(props),
|
12838 |
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
|
12839 |
onDeselect: () => resetGap(props),
|
12840 |
+
resetAllFilter: createResetAllFilter('blockGap', 'spacing'),
|
12841 |
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.blockGap,
|
12842 |
panelId: props.clientId
|
12843 |
+
}, (0,external_wp_element_namespaceObject.createElement)(GapEdit, props)), !isMinHeightDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
12844 |
+
className: "single-column",
|
12845 |
+
hasValue: () => hasMinHeightValue(props),
|
12846 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Min. height'),
|
12847 |
+
onDeselect: () => resetMinHeight(props),
|
12848 |
+
resetAllFilter: createResetAllFilter('minHeight', 'dimensions'),
|
12849 |
+
isShownByDefault: defaultDimensionsControls === null || defaultDimensionsControls === void 0 ? void 0 : defaultDimensionsControls.minHeight,
|
12850 |
+
panelId: props.clientId
|
12851 |
+
}, (0,external_wp_element_namespaceObject.createElement)(MinHeightEdit, props))), !isPaddingDisabled && (0,external_wp_element_namespaceObject.createElement)(PaddingVisualizer, _extends({
|
12852 |
forceShow: paddingMouseOver.isMouseOver
|
12853 |
}, props)), !isMarginDisabled && (0,external_wp_element_namespaceObject.createElement)(MarginVisualizer, _extends({
|
12854 |
forceShow: marginMouseOver.isMouseOver
|
12867 |
return false;
|
12868 |
}
|
12869 |
|
12870 |
+
return hasGapSupport(blockName) || hasMinHeightSupport(blockName) || hasPaddingSupport(blockName) || hasMarginSupport(blockName);
|
12871 |
}
|
12872 |
/**
|
12873 |
* Determines whether dimensions support has been disabled.
|
12880 |
const useIsDimensionsDisabled = function () {
|
12881 |
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
12882 |
const gapDisabled = useIsGapDisabled(props);
|
12883 |
+
const minHeightDisabled = useIsMinHeightDisabled(props);
|
12884 |
const paddingDisabled = useIsPaddingDisabled(props);
|
12885 |
const marginDisabled = useIsMarginDisabled(props);
|
12886 |
+
return gapDisabled && minHeightDisabled && paddingDisabled && marginDisabled;
|
12887 |
};
|
12888 |
/**
|
12889 |
* Custom hook to retrieve which padding/margin/blockGap is supported
|
13660 |
});
|
13661 |
}
|
13662 |
|
13663 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
|
13664 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Justification'),
|
13665 |
+
value: justifyContent,
|
13666 |
+
onChange: onJustificationChange,
|
13667 |
className: "block-editor-hooks__flex-layout-justification-controls"
|
13668 |
+
}, justificationOptions.map(_ref6 => {
|
13669 |
let {
|
13670 |
value,
|
13671 |
icon,
|
13672 |
label
|
13673 |
} = _ref6;
|
13674 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, {
|
13675 |
key: value,
|
13676 |
+
value: value,
|
13677 |
icon: icon,
|
13678 |
+
label: label
|
|
|
13679 |
});
|
13680 |
+
}));
|
13681 |
}
|
13682 |
|
13683 |
function FlexWrapControl(_ref7) {
|
13707 |
const {
|
13708 |
orientation = 'horizontal'
|
13709 |
} = layout;
|
13710 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
|
13711 |
+
className: "block-editor-hooks__flex-layout-orientation-controls",
|
13712 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Orientation'),
|
13713 |
+
value: orientation,
|
13714 |
+
onChange: value => onChange({ ...layout,
|
13715 |
+
orientation: value
|
|
|
|
|
13716 |
})
|
13717 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, {
|
13718 |
+
icon: arrow_right,
|
13719 |
+
value: 'horizontal',
|
13720 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Horizontal')
|
13721 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, {
|
13722 |
icon: arrow_down,
|
13723 |
+
value: 'vertical',
|
13724 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Vertical')
|
|
|
|
|
13725 |
}));
|
13726 |
}
|
13727 |
|
27085 |
|
27086 |
|
27087 |
|
27088 |
+
|
27089 |
/**
|
27090 |
* Internal dependencies
|
27091 |
*/
|
27149 |
rootClientId: rootClientId
|
27150 |
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
27151 |
className: "block-editor-inserter__manage-reusable-blocks-container"
|
27152 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
27153 |
className: "block-editor-inserter__manage-reusable-blocks",
|
27154 |
+
variant: "secondary",
|
27155 |
href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
|
27156 |
post_type: 'wp_block'
|
27157 |
})
|
30949 |
/**
|
30950 |
* Returns the active style from the given className.
|
30951 |
*
|
30952 |
+
* @param {Array} styles Block styles.
|
30953 |
* @param {string} className Class name
|
30954 |
*
|
30955 |
* @return {Object?} The active style.
|
30999 |
* act as a fallback for when there is no active style applied to a block. The default item also serves
|
31000 |
* as a switch on the frontend to deactivate non-default styles.
|
31001 |
*
|
31002 |
+
* @param {Array} styles Block styles.
|
31003 |
*
|
31004 |
* @return {Array<Object?>} The style collection.
|
31005 |
*/
|
31018 |
/**
|
31019 |
* Returns a style object from a collection of styles where that style object is the default block style.
|
31020 |
*
|
31021 |
+
* @param {Array} styles Block styles.
|
31022 |
*
|
31023 |
* @return {Object?} The default style object, if found.
|
31024 |
*/
|
31513 |
blocks
|
31514 |
} = _ref;
|
31515 |
const {
|
31516 |
+
replaceBlocks,
|
31517 |
+
multiSelect
|
31518 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
31519 |
const blockInformation = useBlockDisplayInformation(blocks[0].clientId);
|
31520 |
const {
|
31576 |
maximumLength: 35
|
31577 |
});
|
31578 |
const isReusable = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isReusableBlock)(blocks[0]);
|
31579 |
+
const isTemplate = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]);
|
31580 |
+
|
31581 |
+
function selectForMultipleBlocks(insertedBlocks) {
|
31582 |
+
if (insertedBlocks.length > 1) {
|
31583 |
+
multiSelect(insertedBlocks[0].clientId, insertedBlocks[insertedBlocks.length - 1].clientId);
|
31584 |
+
}
|
31585 |
+
} // Simple block tranformation based on the `Block Transforms` API.
|
31586 |
+
|
31587 |
|
31588 |
+
function onBlockTransform(name) {
|
31589 |
+
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, name);
|
31590 |
+
replaceBlocks(clientIds, newBlocks);
|
31591 |
+
selectForMultipleBlocks(newBlocks);
|
31592 |
+
} // Pattern transformation through the `Patterns` API.
|
31593 |
|
31594 |
|
31595 |
+
function onPatternTransform(transformedBlocks) {
|
31596 |
+
replaceBlocks(clientIds, transformedBlocks);
|
31597 |
+
selectForMultipleBlocks(transformedBlocks);
|
31598 |
+
}
|
31599 |
/**
|
31600 |
* The `isTemplate` check is a stopgap solution here.
|
31601 |
* Ideally, the Transforms API should handle this
|
32507 |
}));
|
32508 |
/* harmony default export */ const library_unlock = (unlock);
|
32509 |
|
32510 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/lock-outline.js
|
32511 |
+
|
32512 |
+
|
32513 |
+
/**
|
32514 |
+
* WordPress dependencies
|
32515 |
+
*/
|
32516 |
+
|
32517 |
+
const lockOutline = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
32518 |
+
viewBox: "0 0 24 24",
|
32519 |
+
xmlns: "http://www.w3.org/2000/svg"
|
32520 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
32521 |
+
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-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"
|
32522 |
+
}));
|
32523 |
+
/* harmony default export */ const lock_outline = (lockOutline);
|
32524 |
+
|
32525 |
;// CONCATENATED MODULE: ./packages/icons/build-module/library/lock.js
|
32526 |
|
32527 |
|
32645 |
"aria-labelledby": instanceId,
|
32646 |
className: "block-editor-block-lock-modal__options"
|
32647 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
32648 |
+
__nextHasNoMarginBottom: true,
|
32649 |
className: "block-editor-block-lock-modal__options-title",
|
32650 |
label: (0,external_wp_element_namespaceObject.createElement)("span", {
|
32651 |
id: instanceId
|
32664 |
}, allowsEditLocking && (0,external_wp_element_namespaceObject.createElement)("li", {
|
32665 |
className: "block-editor-block-lock-modal__checklist-item"
|
32666 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
32667 |
+
__nextHasNoMarginBottom: true,
|
32668 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Restrict editing'),
|
|
|
32669 |
checked: !!lock.edit,
|
32670 |
onChange: edit => setLock(prevLock => ({ ...prevLock,
|
32671 |
edit
|
32672 |
}))
|
32673 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
|
32674 |
+
className: "block-editor-block-lock-modal__lock-icon",
|
32675 |
+
icon: lock.edit ? library_lock : library_unlock
|
32676 |
})), (0,external_wp_element_namespaceObject.createElement)("li", {
|
32677 |
className: "block-editor-block-lock-modal__checklist-item"
|
32678 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
32679 |
+
__nextHasNoMarginBottom: true,
|
32680 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Disable movement'),
|
|
|
32681 |
checked: lock.move,
|
32682 |
onChange: move => setLock(prevLock => ({ ...prevLock,
|
32683 |
move
|
32684 |
}))
|
32685 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
|
32686 |
+
className: "block-editor-block-lock-modal__lock-icon",
|
32687 |
+
icon: lock.move ? library_lock : library_unlock
|
32688 |
})), (0,external_wp_element_namespaceObject.createElement)("li", {
|
32689 |
className: "block-editor-block-lock-modal__checklist-item"
|
32690 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
|
32691 |
+
__nextHasNoMarginBottom: true,
|
32692 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Prevent removal'),
|
|
|
32693 |
checked: lock.remove,
|
32694 |
onChange: remove => setLock(prevLock => ({ ...prevLock,
|
32695 |
remove
|
32696 |
}))
|
32697 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
|
32698 |
+
className: "block-editor-block-lock-modal__lock-icon",
|
32699 |
+
icon: lock.remove ? library_lock : library_unlock
|
32700 |
}))), hasTemplateLock && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
|
32701 |
className: "block-editor-block-lock-modal__template-lock",
|
32702 |
label: (0,external_wp_i18n_namespaceObject.__)('Apply to all blocks inside'),
|
32748 |
|
32749 |
const label = isLocked ? (0,external_wp_i18n_namespaceObject.__)('Unlock') : (0,external_wp_i18n_namespaceObject.__)('Lock');
|
32750 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
32751 |
+
icon: isLocked ? library_unlock : lock_outline,
|
32752 |
onClick: toggleModal
|
32753 |
}, label), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(BlockLockModal, {
|
32754 |
clientId: clientId,
|
33753 |
|
33754 |
|
33755 |
|
33756 |
+
|
33757 |
function selected_block_popover_selector(select) {
|
33758 |
const {
|
33759 |
__unstableGetEditorMode,
|
33760 |
isMultiSelecting,
|
33761 |
hasMultiSelection,
|
33762 |
isTyping,
|
33763 |
+
__experimentalIsBlockInterfaceHidden: isBlockInterfaceHidden,
|
33764 |
getSettings,
|
33765 |
getLastMultiSelectedBlockClientId
|
33766 |
} = select(store);
|
33768 |
editorMode: __unstableGetEditorMode(),
|
33769 |
isMultiSelecting: isMultiSelecting(),
|
33770 |
isTyping: isTyping(),
|
33771 |
+
isBlockInterfaceHidden: isBlockInterfaceHidden(),
|
33772 |
hasFixedToolbar: getSettings().hasFixedToolbar,
|
33773 |
isDistractionFree: getSettings().isDistractionFree,
|
33774 |
lastClientId: hasMultiSelection() ? getLastMultiSelectedBlockClientId() : null
|
33790 |
editorMode,
|
33791 |
isMultiSelecting,
|
33792 |
isTyping,
|
33793 |
+
isBlockInterfaceHidden,
|
33794 |
hasFixedToolbar,
|
33795 |
isDistractionFree,
|
33796 |
lastClientId
|
33817 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
33818 |
const showEmptyBlockSideInserter = !isTyping && editorMode === 'edit' && isEmptyDefaultBlock;
|
33819 |
const shouldShowBreadcrumb = editorMode === 'navigation' || editorMode === 'zoom-out';
|
33820 |
+
const shouldShowContextualToolbar = editorMode === 'edit' && !hasFixedToolbar && isLargeViewport && !isMultiSelecting && !showEmptyBlockSideInserter && !isTyping && !isBlockInterfaceHidden;
|
33821 |
const canFocusHiddenToolbar = editorMode === 'edit' && !shouldShowContextualToolbar && !hasFixedToolbar && !isDistractionFree && !isEmptyDefaultBlock;
|
33822 |
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', () => {
|
33823 |
isToolbarForced.current = true;
|
33836 |
clientId
|
33837 |
});
|
33838 |
|
33839 |
+
if (!shouldShowBreadcrumb && !shouldShowContextualToolbar && !showEmptyBlockSideInserter) {
|
33840 |
return null;
|
33841 |
}
|
33842 |
|
33843 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, showEmptyBlockSideInserter && (0,external_wp_element_namespaceObject.createElement)(block_popover, _extends({
|
33844 |
+
clientId: capturingClientId || clientId,
|
33845 |
+
__unstableCoverTarget: true,
|
33846 |
+
bottomClientId: lastClientId,
|
33847 |
+
className: classnames_default()('block-editor-block-list__block-side-inserter-popover', {
|
33848 |
+
'is-insertion-point-visible': isInsertionPointVisible
|
33849 |
+
}),
|
33850 |
+
__unstablePopoverSlot: __unstablePopoverSlot,
|
33851 |
+
__unstableContentRef: __unstableContentRef,
|
33852 |
+
resize: false,
|
33853 |
+
shift: false
|
33854 |
+
}, popoverProps), (0,external_wp_element_namespaceObject.createElement)("div", {
|
33855 |
+
className: "block-editor-block-list__empty-block-inserter"
|
33856 |
+
}, (0,external_wp_element_namespaceObject.createElement)(inserter, {
|
33857 |
+
position: "bottom right",
|
33858 |
+
rootClientId: rootClientId,
|
33859 |
+
clientId: clientId,
|
33860 |
+
__experimentalIsQuick: true
|
33861 |
+
}))), (shouldShowBreadcrumb || shouldShowContextualToolbar) && (0,external_wp_element_namespaceObject.createElement)(block_popover, _extends({
|
33862 |
clientId: capturingClientId || clientId,
|
33863 |
bottomClientId: lastClientId,
|
33864 |
className: classnames_default()('block-editor-block-list__block-popover', {
|
33881 |
}), shouldShowBreadcrumb && (0,external_wp_element_namespaceObject.createElement)(block_selection_button, {
|
33882 |
clientId: clientId,
|
33883 |
rootClientId: rootClientId
|
33884 |
+
})));
|
33885 |
}
|
33886 |
|
33887 |
function wrapperSelector(select) {
|
34984 |
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
34985 |
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
34986 |
const {
|
34987 |
+
__unstableDisableLayoutClassNames,
|
34988 |
+
__unstableDisableDropZone
|
34989 |
} = options;
|
34990 |
const {
|
34991 |
clientId,
|
35013 |
hasOverlay: blockName !== 'core/template' && !isBlockSelected(clientId) && !hasSelectedInnerBlock(clientId, true) && enableClickThrough
|
35014 |
};
|
35015 |
}, [clientId, isSmallScreen]);
|
35016 |
+
const blockDropZoneRef = useBlockDropZone({
|
35017 |
rootClientId: clientId
|
35018 |
+
});
|
35019 |
+
const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, __unstableDisableDropZone ? null : blockDropZoneRef]);
|
35020 |
const innerBlocksProps = {
|
35021 |
__experimentalCaptureToolbars,
|
35022 |
...options
|
36980 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
36981 |
var _ref$current;
|
36982 |
|
36983 |
+
if (!enableContrastChecking) {
|
36984 |
+
return;
|
36985 |
+
}
|
36986 |
+
|
36987 |
+
if (!definedColors.length) {
|
36988 |
+
if (detectedBackgroundColor) {
|
36989 |
+
setDetectedBackgroundColor();
|
36990 |
+
}
|
36991 |
+
|
36992 |
+
if (detectedColor) {
|
36993 |
+
setDetectedColor();
|
36994 |
+
}
|
36995 |
+
|
36996 |
+
if (detectedLinkColor) {
|
36997 |
+
setDetectedColor();
|
36998 |
+
}
|
36999 |
+
|
37000 |
return;
|
37001 |
}
|
37002 |
|
37424 |
};
|
37425 |
|
37426 |
const defaultColorControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [COLOR_SUPPORT_KEY, '__experimentalDefaultControls']);
|
37427 |
+
const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient) && hasBackgroundColor && (hasLinkColor || hasTextColor) && // Contrast checking is enabled by default.
|
37428 |
// Deactivating it requires `enableContrastChecker` to have
|
37429 |
// an explicit value of `false`.
|
37430 |
false !== (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [COLOR_SUPPORT_KEY, 'enableContrastChecker']);
|
38506 |
const DEFAULT_MINIMUM_VIEWPORT_WIDTH = '768px';
|
38507 |
const DEFAULT_SCALE_FACTOR = 1;
|
38508 |
const DEFAULT_MINIMUM_FONT_SIZE_FACTOR = 0.75;
|
|
|
38509 |
const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';
|
38510 |
/**
|
38511 |
* Computes a fluid font-size value that uses clamp(). A minimum and maxinmum
|
38536 |
* @param {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional.
|
38537 |
* @param {?number} args.scaleFactor A scale factor to determine how fast a font scales within boundaries. Optional.
|
38538 |
* @param {?number} args.minimumFontSizeFactor How much to scale defaultFontSize by to derive minimumFontSize. Optional.
|
|
|
38539 |
*
|
38540 |
* @return {string|null} A font-size value using clamp().
|
38541 |
*/
|
38549 |
maximumViewPortWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
|
38550 |
scaleFactor = DEFAULT_SCALE_FACTOR,
|
38551 |
minimumFontSizeFactor = DEFAULT_MINIMUM_FONT_SIZE_FACTOR,
|
|
|
38552 |
minimumFontSizeLimit = DEFAULT_MINIMUM_FONT_SIZE_LIMIT
|
38553 |
} = _ref;
|
38554 |
|
|
|
|
|
|
|
|
|
|
|
38555 |
/*
|
38556 |
* Calculates missing minimumFontSize and maximumFontSize from
|
38557 |
* defaultFontSize if provided.
|
38558 |
*/
|
|
|
38559 |
if (fontSize) {
|
38560 |
// Parses default font size.
|
38561 |
const fontSizeParsed = getTypographyValueAndUnit(fontSize); // Protect against invalid units.
|
38562 |
|
38563 |
if (!(fontSizeParsed !== null && fontSizeParsed !== void 0 && fontSizeParsed.unit)) {
|
38564 |
return null;
|
|
|
|
|
|
|
|
|
|
|
38565 |
} // Parses the minimum font size limit, so we can perform checks using it.
|
38566 |
|
38567 |
|
38568 |
const minimumFontSizeLimitParsed = getTypographyValueAndUnit(minimumFontSizeLimit, {
|
38569 |
coerceTo: fontSizeParsed.unit
|
38570 |
+
}); // Don't enforce minimum font size if a font size has explicitly set a min and max value.
|
38571 |
|
38572 |
+
if (!!(minimumFontSizeLimitParsed !== null && minimumFontSizeLimitParsed !== void 0 && minimumFontSizeLimitParsed.value) && !minimumFontSize && !maximumFontSize) {
|
38573 |
/*
|
38574 |
* If a minimum size was not passed to this function
|
38575 |
+
* and the user-defined font size is lower than $minimum_font_size_limit,
|
38576 |
+
* do not calculate a fluid value.
|
38577 |
*/
|
38578 |
+
if ((fontSizeParsed === null || fontSizeParsed === void 0 ? void 0 : fontSizeParsed.value) <= (minimumFontSizeLimitParsed === null || minimumFontSizeLimitParsed === void 0 ? void 0 : minimumFontSizeLimitParsed.value)) {
|
38579 |
+
return null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38580 |
}
|
38581 |
+
} // If no fluid max font size is available use the incoming value.
|
38582 |
|
38583 |
|
38584 |
if (!maximumFontSize) {
|
38585 |
+
maximumFontSize = `${fontSizeParsed.value}${fontSizeParsed.unit}`;
|
38586 |
}
|
38587 |
+
/*
|
38588 |
+
* If no minimumFontSize is provided, create one using
|
38589 |
+
* the given font size multiplied by the min font size scale factor.
|
38590 |
+
*/
|
38591 |
|
38592 |
|
38593 |
+
if (!minimumFontSize) {
|
38594 |
+
const calculatedMinimumFontSize = roundToPrecision(fontSizeParsed.value * minimumFontSizeFactor, 3); // Only use calculated min font size if it's > $minimum_font_size_limit value.
|
38595 |
+
|
38596 |
+
if (!!(minimumFontSizeLimitParsed !== null && minimumFontSizeLimitParsed !== void 0 && minimumFontSizeLimitParsed.value) && calculatedMinimumFontSize < (minimumFontSizeLimitParsed === null || minimumFontSizeLimitParsed === void 0 ? void 0 : minimumFontSizeLimitParsed.value)) {
|
38597 |
+
minimumFontSize = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`;
|
38598 |
+
} else {
|
38599 |
+
minimumFontSize = `${calculatedMinimumFontSize}${fontSizeParsed.unit}`;
|
38600 |
+
}
|
38601 |
+
}
|
38602 |
} // Grab the minimum font size and normalize it in order to use the value for calculations.
|
38603 |
|
38604 |
|
38605 |
+
const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSize); // We get a 'preferred' unit to keep units consistent when calculating,
|
38606 |
// otherwise the result will not be accurate.
|
38607 |
|
38608 |
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.
|
38616 |
} // Uses rem for accessible fluid target font scaling.
|
38617 |
|
38618 |
|
38619 |
+
const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSize, {
|
38620 |
coerceTo: 'rem'
|
38621 |
}); // Viewport widths defined for fluid typography. Normalize units
|
38622 |
|
38638 |
const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / (maximumViewPortWidthParsed.value - minumumViewPortWidthParsed.value));
|
38639 |
const linearFactorScaled = roundToPrecision((linearFactor || 1) * scaleFactor, 3);
|
38640 |
const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewPortWidthOffset}) * ${linearFactorScaled})`;
|
38641 |
+
return `clamp(${minimumFontSize}, ${fluidTargetFontSize}, ${maximumFontSize})`;
|
38642 |
}
|
38643 |
/**
|
38644 |
* Internal method that checks a string for a unit and value and returns an array consisting of `'value'` and `'unit'`, e.g., [ '42', 'rem' ].
|
39814 |
|
39815 |
|
39816 |
|
39817 |
+
const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, DIMENSIONS_SUPPORT_KEY, SPACING_SUPPORT_KEY];
|
39818 |
|
39819 |
const hasStyleSupport = blockType => styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, key));
|
39820 |
/**
|
39873 |
[`${BORDER_SUPPORT_KEY}.__experimentalSkipSerialization`]: ['border'],
|
39874 |
[`${COLOR_SUPPORT_KEY}.__experimentalSkipSerialization`]: [COLOR_SUPPORT_KEY],
|
39875 |
[`${TYPOGRAPHY_SUPPORT_KEY}.__experimentalSkipSerialization`]: [TYPOGRAPHY_SUPPORT_KEY],
|
39876 |
+
[`${DIMENSIONS_SUPPORT_KEY}.__experimentalSkipSerialization`]: [DIMENSIONS_SUPPORT_KEY],
|
39877 |
+
[`${SPACING_SUPPORT_KEY}.__experimentalSkipSerialization`]: [SPACING_SUPPORT_KEY]
|
39878 |
};
|
39879 |
/**
|
39880 |
* A dictionary of paths to flag skipping block support serialization as the key,
|
40872 |
} // Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.
|
40873 |
|
40874 |
|
40875 |
+
const layoutClassNames = classnames_default()({
|
40876 |
[`wp-container-${id}`]: shouldRenderLayoutStyles && !!css // Only attach a container class if there is generated CSS to be attached.
|
40877 |
|
40878 |
}, layoutClasses);
|
40883 |
layout: usedLayout,
|
40884 |
style: attributes === null || attributes === void 0 ? void 0 : attributes.style
|
40885 |
}), element), (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, {
|
40886 |
+
__unstableLayoutClassNames: layoutClassNames
|
40887 |
})));
|
40888 |
});
|
40889 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/layout/addAttribute', layout_addAttribute);
|
40987 |
return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props);
|
40988 |
}
|
40989 |
|
40990 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isEditingAsBlocks && !isContentLocked && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(StopEditingAsBlocksOnOutsideSelect, {
|
40991 |
clientId: props.clientId,
|
40992 |
stopEditingAsBlock: stopEditingAsBlock
|
40993 |
}), (0,external_wp_element_namespaceObject.createElement)(block_controls, {
|
40994 |
group: "other"
|
40995 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
40996 |
onClick: () => {
|
40997 |
+
stopEditingAsBlock();
|
40998 |
+
}
|
40999 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Done')))), !isEditingAsBlocks && isContentLocked && props.isSelected && (0,external_wp_element_namespaceObject.createElement)(block_settings_menu_controls, null, _ref2 => {
|
41000 |
+
let {
|
41001 |
+
onClose
|
41002 |
+
} = _ref2;
|
41003 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
41004 |
+
onClick: () => {
|
41005 |
__unstableMarkNextChangeAsNotPersistent();
|
41006 |
|
41007 |
updateBlockAttributes(props.clientId, {
|
41016 |
});
|
41017 |
|
41018 |
__unstableSetTemporarilyEditingAsBlocks(props.clientId);
|
41019 |
+
|
41020 |
+
onClose();
|
41021 |
}
|
41022 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Modify'));
|
41023 |
+
}), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({}, props, {
|
41024 |
className: classnames_default()(props.className, isEditingAsBlocks && 'is-content-locked-editing-as-blocks')
|
41025 |
})));
|
41026 |
}, 'withToolbarControls');
|
41513 |
|
41514 |
|
41515 |
function createColorHOC(colorTypes, withColorPalette) {
|
41516 |
+
const colorMap = colorTypes.reduce((colorObject, colorType) => {
|
41517 |
return { ...colorObject,
|
41518 |
...(typeof colorType === 'string' ? {
|
41519 |
[colorType]: (0,external_lodash_namespaceObject.kebabCase)(colorType)
|
41539 |
}
|
41540 |
|
41541 |
createSetters() {
|
41542 |
+
return Object.keys(colorMap).reduce((settersAccumulator, colorAttributeName) => {
|
41543 |
const upperFirstColorAttributeName = upperFirst(colorAttributeName);
|
41544 |
const customColorAttributeName = `custom${upperFirstColorAttributeName}`;
|
41545 |
settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor(colorAttributeName, customColorAttributeName);
|
41562 |
attributes,
|
41563 |
colors
|
41564 |
} = _ref2;
|
41565 |
+
return Object.entries(colorMap).reduce((newState, _ref3) => {
|
41566 |
+
let [colorAttributeName, colorContext] = _ref3;
|
41567 |
const colorObject = getColorObjectByAttributeValues(colors, attributes[colorAttributeName], attributes[`custom${upperFirst(colorAttributeName)}`]);
|
41568 |
const previousColorObject = previousState[colorAttributeName];
|
41569 |
const previousColor = previousColorObject === null || previousColorObject === void 0 ? void 0 : previousColorObject.color;
|
41728 |
* and the value is the custom font size attribute name.
|
41729 |
* Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized.
|
41730 |
*/
|
41731 |
+
const fontSizeAttributeNames = fontSizeNames.reduce((fontSizeAttributeNamesAccumulator, fontSizeAttributeName) => {
|
41732 |
fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${with_font_sizes_upperFirst(fontSizeAttributeName)}`;
|
41733 |
return fontSizeAttributeNamesAccumulator;
|
41734 |
}, {});
|
41746 |
}
|
41747 |
|
41748 |
createSetters() {
|
41749 |
+
return Object.entries(fontSizeAttributeNames).reduce((settersAccumulator, _ref2) => {
|
41750 |
+
let [fontSizeAttributeName, customFontSizeAttributeName] = _ref2;
|
41751 |
const upperFirstFontSizeAttributeName = with_font_sizes_upperFirst(fontSizeAttributeName);
|
41752 |
settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName);
|
41753 |
return settersAccumulator;
|
41766 |
};
|
41767 |
}
|
41768 |
|
41769 |
+
static getDerivedStateFromProps(_ref3, previousState) {
|
41770 |
let {
|
41771 |
attributes,
|
41772 |
fontSizes
|
41773 |
+
} = _ref3;
|
41774 |
|
41775 |
const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => {
|
41776 |
if (previousState[fontSizeAttributeName]) {
|
41791 |
return null;
|
41792 |
}
|
41793 |
|
41794 |
+
const newState = Object.entries((0,external_lodash_namespaceObject.pickBy)(fontSizeAttributeNames, didAttributesChange)).reduce((newStateAccumulator, _ref4) => {
|
41795 |
+
let [fontSizeAttributeName, customFontSizeAttributeName] = _ref4;
|
41796 |
const fontSizeAttributeValue = attributes[fontSizeAttributeName];
|
41797 |
const fontSizeObject = getFontSize(fontSizes, fontSizeAttributeValue, attributes[customFontSizeAttributeName]);
|
41798 |
newStateAccumulator[fontSizeAttributeName] = { ...fontSizeObject,
|
42992 |
} = block;
|
42993 |
const {
|
42994 |
isLocked,
|
42995 |
+
isContentLocked,
|
42996 |
+
canEdit
|
42997 |
} = useBlockLock(clientId);
|
42998 |
const forceSelectionContentLock = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
42999 |
if (isSelected) {
|
43006 |
|
43007 |
return select(store).hasSelectedInnerBlock(clientId, true);
|
43008 |
}, [isContentLocked, clientId, isSelected]);
|
43009 |
+
const canExpand = isContentLocked ? false : canEdit;
|
43010 |
const isFirstSelectedBlock = forceSelectionContentLock || isSelected && selectedClientIds[0] === clientId;
|
43011 |
const isLastSelectedBlock = forceSelectionContentLock || isSelected && selectedClientIds[selectedClientIds.length - 1] === clientId;
|
43012 |
const {
|
43112 |
path: path,
|
43113 |
id: `list-view-block-${clientId}`,
|
43114 |
"data-block": clientId,
|
43115 |
+
isExpanded: canExpand ? isExpanded : undefined,
|
43116 |
"aria-selected": !!isSelected || forceSelectionContentLock
|
43117 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
43118 |
className: "block-editor-list-view-block__contents-cell",
|
43120 |
ref: cellRef,
|
43121 |
"aria-label": blockAriaLabel,
|
43122 |
"aria-selected": !!isSelected || forceSelectionContentLock,
|
43123 |
+
"aria-expanded": canExpand ? isExpanded : undefined,
|
43124 |
"aria-describedby": descriptionId
|
43125 |
}, _ref2 => {
|
43126 |
let {
|
43289 |
parentId,
|
43290 |
shouldShowInnerBlocks = true
|
43291 |
} = props;
|
43292 |
+
const canParentExpand = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
43293 |
+
if (!parentId) {
|
43294 |
+
return true;
|
43295 |
+
}
|
43296 |
+
|
43297 |
+
const isContentLocked = select(store).getTemplateLock(parentId) === 'contentOnly';
|
43298 |
+
const canEdit = select(store).canEditBlock(parentId);
|
43299 |
+
return isContentLocked ? false : canEdit;
|
43300 |
}, [parentId]);
|
43301 |
const {
|
43302 |
expandedState,
|
43303 |
draggedClientIds
|
43304 |
} = useListViewContext();
|
43305 |
|
43306 |
+
if (!canParentExpand) {
|
43307 |
return null;
|
43308 |
}
|
43309 |
|
48255 |
id,
|
48256 |
url,
|
48257 |
...restLinkProps
|
48258 |
+
} = currentLink !== null && currentLink !== void 0 ? currentLink : {};
|
48259 |
onSelect( // Some direct entries don't have types or IDs, and we still need to clear the previous ones.
|
48260 |
{ ...restLinkProps,
|
48261 |
...suggestion
|
48635 |
};
|
48636 |
};
|
48637 |
|
48638 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/link-control/use-internal-input-value.js
|
48639 |
+
/**
|
48640 |
+
* WordPress dependencies
|
48641 |
+
*/
|
48642 |
+
|
48643 |
+
function useInternalInputValue(value) {
|
48644 |
+
const [internalInputValue, setInternalInputValue] = (0,external_wp_element_namespaceObject.useState)(value || '');
|
48645 |
+
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
48646 |
+
/**
|
48647 |
+
* If the value's `text` property changes then sync this
|
48648 |
+
* back up with state.
|
48649 |
+
*/
|
48650 |
+
if (value !== null && value !== void 0 && value.title && value.title !== internalInputValue) {
|
48651 |
+
setInternalInputValue(value.title);
|
48652 |
+
}
|
48653 |
+
}, [value]);
|
48654 |
+
return [internalInputValue, setInternalInputValue];
|
48655 |
+
}
|
48656 |
+
|
48657 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/link-control/index.js
|
48658 |
|
48659 |
|
48681 |
|
48682 |
|
48683 |
|
48684 |
+
|
48685 |
/**
|
48686 |
* Default properties associated with a link control value.
|
48687 |
*
|
48768 |
|
48769 |
|
48770 |
function LinkControl(_ref) {
|
48771 |
+
var _currentUrlInputValue, _value$url, _value$url$trim;
|
48772 |
|
48773 |
let {
|
48774 |
searchInputPlaceholder,
|
48798 |
const isMounting = (0,external_wp_element_namespaceObject.useRef)(true);
|
48799 |
const wrapperNode = (0,external_wp_element_namespaceObject.useRef)();
|
48800 |
const textInputRef = (0,external_wp_element_namespaceObject.useRef)();
|
|
|
|
|
|
|
|
|
48801 |
const isEndingEditWithFocus = (0,external_wp_element_namespaceObject.useRef)(false);
|
48802 |
+
const [internalUrlInputValue, setInternalUrlInputValue] = useInternalInputValue((value === null || value === void 0 ? void 0 : value.url) || '');
|
48803 |
+
const [internalTextInputValue, setInternalTextInputValue] = useInternalInputValue((value === null || value === void 0 ? void 0 : value.title) || '');
|
48804 |
+
const [isEditingLink, setIsEditingLink] = (0,external_wp_element_namespaceObject.useState)(forceIsEditingLink !== undefined ? forceIsEditingLink : !value || !value.url);
|
48805 |
const {
|
48806 |
createPage,
|
48807 |
isCreatingPage,
|
48836 |
nextFocusTarget.focus();
|
48837 |
isEndingEditWithFocus.current = false;
|
48838 |
}, [isEditingLink, isCreatingPage]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48839 |
/**
|
48840 |
* Cancels editing state and marks that focus may need to be restored after
|
48841 |
* the next render, if focus was within the wrapper when editing finished.
|
48842 |
*/
|
48843 |
|
48844 |
+
const stopEditing = () => {
|
48845 |
var _wrapperNode$current;
|
48846 |
|
48847 |
isEndingEditWithFocus.current = !!((_wrapperNode$current = wrapperNode.current) !== null && _wrapperNode$current !== void 0 && _wrapperNode$current.contains(wrapperNode.current.ownerDocument.activeElement));
|
48848 |
setIsEditingLink(false);
|
48849 |
+
};
|
48850 |
|
48851 |
const handleSelectSuggestion = updatedValue => {
|
48852 |
onChange({ ...updatedValue,
|
48853 |
+
title: internalTextInputValue || (updatedValue === null || updatedValue === void 0 ? void 0 : updatedValue.title)
|
48854 |
});
|
48855 |
stopEditing();
|
48856 |
};
|
48857 |
|
48858 |
const handleSubmit = () => {
|
48859 |
+
if (currentUrlInputValue !== (value === null || value === void 0 ? void 0 : value.url) || internalTextInputValue !== (value === null || value === void 0 ? void 0 : value.title)) {
|
48860 |
onChange({ ...value,
|
48861 |
+
url: currentUrlInputValue,
|
48862 |
+
title: internalTextInputValue
|
48863 |
});
|
48864 |
}
|
48865 |
|
48878 |
}
|
48879 |
};
|
48880 |
|
48881 |
+
const currentUrlInputValue = propInputValue || internalUrlInputValue;
|
48882 |
+
const currentInputIsEmpty = !(currentUrlInputValue !== null && currentUrlInputValue !== void 0 && (_currentUrlInputValue = currentUrlInputValue.trim()) !== null && _currentUrlInputValue !== void 0 && _currentUrlInputValue.length);
|
48883 |
const shownUnlinkControl = onRemove && value && !isEditingLink && !isCreatingPage;
|
48884 |
const showSettingsDrawer = !!(settings !== null && settings !== void 0 && settings.length); // Only show text control once a URL value has been committed
|
48885 |
// and it isn't just empty whitespace.
|
48901 |
ref: textInputRef,
|
48902 |
className: "block-editor-link-control__field block-editor-link-control__text-content",
|
48903 |
label: "Text",
|
48904 |
+
value: internalTextInputValue,
|
48905 |
+
onChange: setInternalTextInputValue,
|
48906 |
onKeyDown: handleSubmitWithEnter
|
48907 |
}), (0,external_wp_element_namespaceObject.createElement)(search_input, {
|
48908 |
currentLink: value,
|
48909 |
className: "block-editor-link-control__field block-editor-link-control__search-input",
|
48910 |
placeholder: searchInputPlaceholder,
|
48911 |
+
value: currentUrlInputValue,
|
48912 |
withCreateSuggestion: withCreateSuggestion,
|
48913 |
onCreateSuggestion: createPage,
|
48914 |
+
onChange: setInternalUrlInputValue,
|
48915 |
onSelect: handleSelectSuggestion,
|
48916 |
showInitialSuggestions: showInitialSuggestions,
|
48917 |
allowDirectEntry: !noDirectEntry,
|
48953 |
LinkControl.ViewerFill = ViewerFill;
|
48954 |
/* harmony default export */ const link_control = (LinkControl);
|
48955 |
|
48956 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/leaf.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48957 |
|
|
|
48958 |
|
48959 |
|
48960 |
/**
|
48961 |
+
* External dependencies
|
48962 |
*/
|
48963 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48964 |
|
48965 |
/**
|
48966 |
* WordPress dependencies
|
48967 |
*/
|
48968 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48969 |
|
|
|
48970 |
/**
|
48971 |
+
* Internal dependencies
|
48972 |
*/
|
48973 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48974 |
|
48975 |
+
const leaf_AnimatedTreeGridRow = animated(external_wp_components_namespaceObject.__experimentalTreeGridRow);
|
48976 |
+
function leaf_ListViewLeaf(_ref) {
|
48977 |
+
let {
|
48978 |
+
isSelected,
|
48979 |
+
position,
|
48980 |
+
level,
|
48981 |
+
rowCount,
|
48982 |
+
children,
|
48983 |
+
className,
|
48984 |
+
path,
|
48985 |
+
...props
|
48986 |
+
} = _ref;
|
48987 |
+
const ref = use_moving_animation({
|
48988 |
+
isSelected,
|
48989 |
+
adjustScrolling: false,
|
48990 |
+
enableAnimation: true,
|
48991 |
+
triggerAnimationOnChange: path
|
48992 |
+
});
|
48993 |
+
return (0,external_wp_element_namespaceObject.createElement)(leaf_AnimatedTreeGridRow, _extends({
|
48994 |
+
ref: ref,
|
48995 |
+
className: classnames_default()('block-editor-list-view-leaf', className),
|
48996 |
+
level: level,
|
48997 |
+
positionInSet: position,
|
48998 |
+
setSize: rowCount
|
48999 |
+
}, props), children);
|
49000 |
+
}
|
49001 |
|
49002 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/expander.js
|
49003 |
|
|
|
49004 |
|
|
|
49005 |
/**
|
49006 |
* WordPress dependencies
|
49007 |
*/
|
49008 |
|
|
|
|
|
|
|
|
|
49009 |
|
49010 |
+
function expander_ListViewExpander(_ref) {
|
49011 |
let {
|
49012 |
+
onClick
|
|
|
49013 |
} = _ref;
|
49014 |
+
return (// Keyboard events are handled by TreeGrid see: components/src/tree-grid/index.js
|
49015 |
+
//
|
49016 |
+
// The expander component is implemented as a pseudo element in the w3 example
|
49017 |
+
// https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html
|
49018 |
+
//
|
49019 |
+
// We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree.
|
49020 |
+
// For the current tree grid implementation, please do not try to make this a button.
|
49021 |
+
//
|
49022 |
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
49023 |
+
(0,external_wp_element_namespaceObject.createElement)("span", {
|
49024 |
+
className: "block-editor-list-view__expander",
|
49025 |
+
onClick: event => onClick(event, {
|
49026 |
+
forceToggle: true
|
49027 |
+
}),
|
49028 |
+
"aria-hidden": "true"
|
49029 |
+
}, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
49030 |
+
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small : chevron_right_small
|
49031 |
+
}))
|
49032 |
+
);
|
49033 |
}
|
|
|
|
|
|
|
49034 |
|
49035 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/block-select-button.js
|
49036 |
|
|
|
49037 |
|
49038 |
+
/**
|
49039 |
+
* External dependencies
|
49040 |
+
*/
|
49041 |
|
49042 |
/**
|
49043 |
* WordPress dependencies
|
49047 |
|
49048 |
|
49049 |
|
|
|
|
|
|
|
|
|
|
|
49050 |
/**
|
49051 |
* Internal dependencies
|
49052 |
*/
|
49056 |
|
49057 |
|
49058 |
|
|
|
|
|
|
|
49059 |
|
49060 |
+
function block_select_button_ListViewBlockSelectButton(_ref, ref) {
|
49061 |
let {
|
49062 |
+
className,
|
49063 |
+
block: {
|
49064 |
+
clientId
|
49065 |
+
},
|
49066 |
+
onClick,
|
49067 |
+
onToggleExpanded,
|
49068 |
+
tabIndex,
|
49069 |
+
onFocus,
|
49070 |
+
onDragStart,
|
49071 |
+
onDragEnd,
|
49072 |
+
draggable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49073 |
} = _ref;
|
49074 |
+
const blockInformation = useBlockDisplayInformation(clientId);
|
49075 |
+
const blockTitle = useBlockDisplayTitle({
|
49076 |
+
clientId,
|
49077 |
+
context: 'list-view'
|
49078 |
+
});
|
49079 |
+
const {
|
49080 |
+
isLocked
|
49081 |
+
} = useBlockLock(clientId); // The `href` attribute triggers the browser's native HTML drag operations.
|
49082 |
+
// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.
|
49083 |
+
// We need to clear any HTML drag data to prevent `pasteHandler` from firing
|
49084 |
+
// inside the `useOnBlockDrop` hook.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49085 |
|
49086 |
+
const onDragStartHandler = event => {
|
49087 |
+
event.dataTransfer.clearData();
|
49088 |
+
onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(event);
|
|
|
|
|
49089 |
};
|
49090 |
|
49091 |
+
function onKeyDownHandler(event) {
|
49092 |
+
if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER || event.keyCode === external_wp_keycodes_namespaceObject.SPACE) {
|
49093 |
+
onClick(event);
|
49094 |
}
|
49095 |
+
}
|
49096 |
|
49097 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
49098 |
+
className: classnames_default()('block-editor-list-view-block-select-button', className),
|
49099 |
+
onClick: onClick,
|
49100 |
+
onKeyDown: onKeyDownHandler,
|
49101 |
+
ref: ref,
|
49102 |
+
tabIndex: tabIndex,
|
49103 |
+
onFocus: onFocus,
|
49104 |
+
onDragStart: onDragStartHandler,
|
49105 |
+
onDragEnd: onDragEnd,
|
49106 |
+
draggable: draggable,
|
49107 |
+
href: `#block-${clientId}`,
|
49108 |
+
"aria-hidden": true
|
49109 |
+
}, (0,external_wp_element_namespaceObject.createElement)(expander_ListViewExpander, {
|
49110 |
+
onClick: onToggleExpanded
|
49111 |
+
}), (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
49112 |
+
icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon,
|
49113 |
+
showColors: true
|
49114 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
49115 |
+
alignment: "center",
|
49116 |
+
className: "block-editor-list-view-block-select-button__label-wrapper",
|
49117 |
+
justify: "flex-start",
|
49118 |
+
spacing: 1
|
49119 |
+
}, (0,external_wp_element_namespaceObject.createElement)("span", {
|
49120 |
+
className: "block-editor-list-view-block-select-button__title"
|
49121 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, {
|
49122 |
+
ellipsizeMode: "auto"
|
49123 |
+
}, blockTitle)), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
49124 |
+
className: "block-editor-list-view-block-select-button__anchor-wrapper"
|
49125 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, {
|
49126 |
+
className: "block-editor-list-view-block-select-button__anchor",
|
49127 |
+
ellipsizeMode: "auto"
|
49128 |
+
}, blockInformation.anchor)), isLocked && (0,external_wp_element_namespaceObject.createElement)("span", {
|
49129 |
+
className: "block-editor-list-view-block-select-button__lock"
|
49130 |
+
}, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
49131 |
+
icon: library_lock
|
49132 |
+
})))));
|
49133 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49134 |
|
49135 |
+
/* harmony default export */ const off_canvas_editor_block_select_button = ((0,external_wp_element_namespaceObject.forwardRef)(block_select_button_ListViewBlockSelectButton));
|
49136 |
|
49137 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/block-contents.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49138 |
|
|
|
49139 |
|
49140 |
|
49141 |
/**
|
49148 |
|
49149 |
|
49150 |
|
49151 |
+
/**
|
49152 |
+
* Internal dependencies
|
49153 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49154 |
|
|
|
|
|
|
|
|
|
|
|
49155 |
|
|
|
49156 |
|
49157 |
|
49158 |
+
const block_contents_ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => {
|
49159 |
+
let {
|
49160 |
+
onClick,
|
49161 |
+
onToggleExpanded,
|
49162 |
+
block,
|
49163 |
+
isSelected,
|
49164 |
+
position,
|
49165 |
+
siblingBlockCount,
|
49166 |
+
level,
|
49167 |
+
isExpanded,
|
49168 |
+
selectedClientIds,
|
49169 |
+
...props
|
49170 |
+
} = _ref;
|
49171 |
+
const {
|
49172 |
+
clientId
|
49173 |
+
} = block;
|
49174 |
+
const {
|
49175 |
+
blockMovingClientId,
|
49176 |
+
selectedBlockInBlockEditor
|
49177 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
49178 |
+
const {
|
49179 |
+
hasBlockMovingClientId,
|
49180 |
+
getSelectedBlockClientId
|
49181 |
+
} = select(store);
|
49182 |
+
return {
|
49183 |
+
blockMovingClientId: hasBlockMovingClientId(),
|
49184 |
+
selectedBlockInBlockEditor: getSelectedBlockClientId()
|
49185 |
+
};
|
49186 |
+
}, [clientId]);
|
49187 |
+
const isBlockMoveTarget = blockMovingClientId && selectedBlockInBlockEditor === clientId;
|
49188 |
+
const className = classnames_default()('block-editor-list-view-block-contents', {
|
49189 |
+
'is-dropping-before': isBlockMoveTarget
|
49190 |
+
}); // Only include all selected blocks if the currently clicked on block
|
49191 |
+
// is one of the selected blocks. This ensures that if a user attempts
|
49192 |
+
// to drag a block that isn't part of the selection, they're still able
|
49193 |
+
// to drag it and rearrange its position.
|
49194 |
|
49195 |
+
const draggableClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId];
|
49196 |
+
return (0,external_wp_element_namespaceObject.createElement)(block_draggable, {
|
49197 |
+
clientIds: draggableClientIds
|
49198 |
+
}, _ref2 => {
|
49199 |
+
let {
|
49200 |
+
draggable,
|
49201 |
+
onDragStart,
|
49202 |
+
onDragEnd
|
49203 |
+
} = _ref2;
|
49204 |
+
return (0,external_wp_element_namespaceObject.createElement)(off_canvas_editor_block_select_button, _extends({
|
49205 |
+
ref: ref,
|
49206 |
+
className: className,
|
49207 |
+
block: block,
|
49208 |
+
onClick: onClick,
|
49209 |
+
onToggleExpanded: onToggleExpanded,
|
49210 |
+
isSelected: isSelected,
|
49211 |
+
position: position,
|
49212 |
+
siblingBlockCount: siblingBlockCount,
|
49213 |
+
level: level,
|
49214 |
+
draggable: draggable,
|
49215 |
+
onDragStart: onDragStart,
|
49216 |
+
onDragEnd: onDragEnd,
|
49217 |
+
isExpanded: isExpanded
|
49218 |
+
}, props));
|
49219 |
+
});
|
49220 |
+
});
|
49221 |
+
/* harmony default export */ const off_canvas_editor_block_contents = (block_contents_ListViewBlockContents);
|
49222 |
|
49223 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/context.js
|
49224 |
/**
|
49225 |
* WordPress dependencies
|
49226 |
*/
|
49227 |
|
49228 |
+
const context_ListViewContext = (0,external_wp_element_namespaceObject.createContext)({});
|
49229 |
+
const context_useListViewContext = () => (0,external_wp_element_namespaceObject.useContext)(context_ListViewContext);
|
49230 |
|
49231 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/utils.js
|
|
|
49232 |
/**
|
49233 |
+
* WordPress dependencies
|
49234 |
*/
|
49235 |
|
49236 |
+
const utils_getBlockPositionDescription = (position, siblingCount, level) => (0,external_wp_i18n_namespaceObject.sprintf)(
|
49237 |
+
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
49238 |
+
(0,external_wp_i18n_namespaceObject.__)('Block %1$d of %2$d, Level %3$d'), position, siblingCount, level);
|
49239 |
+
/**
|
49240 |
+
* Returns true if the client ID occurs within the block selection or multi-selection,
|
49241 |
+
* or false otherwise.
|
49242 |
+
*
|
49243 |
+
* @param {string} clientId Block client ID.
|
49244 |
+
* @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs.
|
49245 |
+
*
|
49246 |
+
* @return {boolean} Whether the block is in multi-selection set.
|
49247 |
+
*/
|
49248 |
+
|
49249 |
+
const utils_isClientIdSelected = (clientId, selectedBlockClientIds) => Array.isArray(selectedBlockClientIds) && selectedBlockClientIds.length ? selectedBlockClientIds.indexOf(clientId) !== -1 : selectedBlockClientIds === clientId;
|
49250 |
+
/**
|
49251 |
+
* From a start and end clientId of potentially different nesting levels,
|
49252 |
+
* return the nearest-depth ids that have a common level of depth in the
|
49253 |
+
* nesting hierarchy. For multiple block selection, this ensure that the
|
49254 |
+
* selection is always at the same nesting level, and not split across
|
49255 |
+
* separate levels.
|
49256 |
+
*
|
49257 |
+
* @param {string} startId The first id of a selection.
|
49258 |
+
* @param {string} endId The end id of a selection, usually one that has been clicked on.
|
49259 |
+
* @param {string[]} startParents An array of ancestor ids for the start id, in descending order.
|
49260 |
+
* @param {string[]} endParents An array of ancestor ids for the end id, in descending order.
|
49261 |
+
* @return {Object} An object containing the start and end ids.
|
49262 |
+
*/
|
49263 |
+
|
49264 |
+
function utils_getCommonDepthClientIds(startId, endId, startParents, endParents) {
|
49265 |
+
const startPath = [...startParents, startId];
|
49266 |
+
const endPath = [...endParents, endId];
|
49267 |
+
const depth = Math.min(startPath.length, endPath.length) - 1;
|
49268 |
+
const start = startPath[depth];
|
49269 |
+
const end = endPath[depth];
|
49270 |
+
return {
|
49271 |
+
start,
|
49272 |
+
end
|
49273 |
+
};
|
49274 |
+
}
|
49275 |
+
|
49276 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/block.js
|
49277 |
+
|
49278 |
+
|
49279 |
+
/**
|
49280 |
+
* External dependencies
|
49281 |
+
*/
|
49282 |
+
|
49283 |
+
/**
|
49284 |
+
* WordPress dependencies
|
49285 |
+
*/
|
49286 |
+
|
49287 |
+
|
49288 |
+
|
49289 |
+
|
49290 |
+
|
49291 |
+
|
49292 |
+
|
49293 |
+
|
49294 |
+
/**
|
49295 |
+
* Internal dependencies
|
49296 |
+
*/
|
49297 |
+
|
49298 |
+
|
49299 |
+
|
49300 |
+
|
49301 |
+
|
49302 |
+
|
49303 |
+
|
49304 |
+
|
49305 |
+
|
49306 |
+
|
49307 |
+
|
49308 |
+
function block_ListViewBlock(_ref) {
|
49309 |
+
let {
|
49310 |
+
block,
|
49311 |
+
isDragged,
|
49312 |
+
isSelected,
|
49313 |
+
isBranchSelected,
|
49314 |
+
selectBlock,
|
49315 |
+
position,
|
49316 |
+
level,
|
49317 |
+
rowCount,
|
49318 |
+
siblingBlockCount,
|
49319 |
+
showBlockMovers,
|
49320 |
+
path,
|
49321 |
+
isExpanded,
|
49322 |
+
selectedClientIds,
|
49323 |
+
preventAnnouncement,
|
49324 |
+
selectBlockInCanvas
|
49325 |
+
} = _ref;
|
49326 |
+
const cellRef = (0,external_wp_element_namespaceObject.useRef)(null);
|
49327 |
+
const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false);
|
49328 |
+
const {
|
49329 |
+
clientId
|
49330 |
+
} = block;
|
49331 |
+
const {
|
49332 |
+
isLocked,
|
49333 |
+
isContentLocked
|
49334 |
+
} = useBlockLock(clientId);
|
49335 |
+
const forceSelectionContentLock = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
49336 |
+
if (isSelected) {
|
49337 |
+
return false;
|
49338 |
+
}
|
49339 |
+
|
49340 |
+
if (!isContentLocked) {
|
49341 |
+
return false;
|
49342 |
+
}
|
49343 |
+
|
49344 |
+
return select(store).hasSelectedInnerBlock(clientId, true);
|
49345 |
+
}, [isContentLocked, clientId, isSelected]);
|
49346 |
+
const isFirstSelectedBlock = forceSelectionContentLock || isSelected && selectedClientIds[0] === clientId;
|
49347 |
+
const isLastSelectedBlock = forceSelectionContentLock || isSelected && selectedClientIds[selectedClientIds.length - 1] === clientId;
|
49348 |
+
const {
|
49349 |
+
toggleBlockHighlight
|
49350 |
+
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
49351 |
+
const blockInformation = useBlockDisplayInformation(clientId);
|
49352 |
+
const blockName = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlockName(clientId), [clientId]); // When a block hides its toolbar it also hides the block settings menu,
|
49353 |
+
// since that menu is part of the toolbar in the editor canvas.
|
49354 |
+
// List View respects this by also hiding the block settings menu.
|
49355 |
+
|
49356 |
+
const showBlockActions = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, '__experimentalToolbar', true);
|
49357 |
+
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(block_ListViewBlock);
|
49358 |
+
const descriptionId = `list-view-block-select-button__${instanceId}`;
|
49359 |
+
const blockPositionDescription = utils_getBlockPositionDescription(position, siblingBlockCount, level);
|
49360 |
+
|
49361 |
+
let blockAriaLabel = (0,external_wp_i18n_namespaceObject.__)('Link');
|
49362 |
+
|
49363 |
+
if (blockInformation) {
|
49364 |
+
blockAriaLabel = isLocked ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block. This string indicates a link to select the locked block.
|
49365 |
+
(0,external_wp_i18n_namespaceObject.__)('%s link (locked)'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block. This string indicates a link to select the block.
|
49366 |
+
(0,external_wp_i18n_namespaceObject.__)('%s link'), blockInformation.title);
|
49367 |
+
}
|
49368 |
+
|
49369 |
+
const settingsAriaLabel = blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block.
|
49370 |
+
(0,external_wp_i18n_namespaceObject.__)('Options for %s block'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.__)('Options');
|
49371 |
+
const {
|
49372 |
+
isTreeGridMounted,
|
49373 |
+
expand,
|
49374 |
+
collapse
|
49375 |
+
} = context_useListViewContext();
|
49376 |
+
const hasSiblings = siblingBlockCount > 0;
|
49377 |
+
const hasRenderedMovers = showBlockMovers && hasSiblings;
|
49378 |
+
const moverCellClassName = classnames_default()('block-editor-list-view-block__mover-cell', {
|
49379 |
+
'is-visible': isHovered || isSelected
|
49380 |
+
});
|
49381 |
+
const listViewBlockSettingsClassName = classnames_default()('block-editor-list-view-block__menu-cell', {
|
49382 |
+
'is-visible': isHovered || isFirstSelectedBlock
|
49383 |
+
}); // If ListView has experimental features related to the Persistent List View,
|
49384 |
+
// only focus the selected list item on mount; otherwise the list would always
|
49385 |
+
// try to steal the focus from the editor canvas.
|
49386 |
+
|
49387 |
+
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
49388 |
+
if (!isTreeGridMounted && isSelected) {
|
49389 |
+
cellRef.current.focus();
|
49390 |
+
}
|
49391 |
+
}, []);
|
49392 |
+
const onMouseEnter = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
49393 |
+
setIsHovered(true);
|
49394 |
+
toggleBlockHighlight(clientId, true);
|
49395 |
+
}, [clientId, setIsHovered, toggleBlockHighlight]);
|
49396 |
+
const onMouseLeave = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
49397 |
+
setIsHovered(false);
|
49398 |
+
toggleBlockHighlight(clientId, false);
|
49399 |
+
}, [clientId, setIsHovered, toggleBlockHighlight]);
|
49400 |
+
const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(event => {
|
49401 |
+
selectBlock(event, clientId);
|
49402 |
+
event.preventDefault();
|
49403 |
+
}, [clientId, selectBlock]);
|
49404 |
+
const updateSelection = (0,external_wp_element_namespaceObject.useCallback)(newClientId => {
|
49405 |
+
selectBlock(undefined, newClientId);
|
49406 |
+
}, [selectBlock]);
|
49407 |
+
const toggleExpanded = (0,external_wp_element_namespaceObject.useCallback)(event => {
|
49408 |
+
// Prevent shift+click from opening link in a new window when toggling.
|
49409 |
+
event.preventDefault();
|
49410 |
+
event.stopPropagation();
|
49411 |
+
|
49412 |
+
if (isExpanded === true) {
|
49413 |
+
collapse(clientId);
|
49414 |
+
} else if (isExpanded === false) {
|
49415 |
+
expand(clientId);
|
49416 |
+
}
|
49417 |
+
}, [clientId, expand, collapse, isExpanded]);
|
49418 |
+
let colSpan;
|
49419 |
+
|
49420 |
+
if (hasRenderedMovers) {
|
49421 |
+
colSpan = 2;
|
49422 |
+
} else if (!showBlockActions) {
|
49423 |
+
colSpan = 3;
|
49424 |
+
}
|
49425 |
+
|
49426 |
+
const classes = classnames_default()({
|
49427 |
+
'is-selected': isSelected || forceSelectionContentLock,
|
49428 |
+
'is-first-selected': isFirstSelectedBlock,
|
49429 |
+
'is-last-selected': isLastSelectedBlock,
|
49430 |
+
'is-branch-selected': isBranchSelected,
|
49431 |
+
'is-dragging': isDragged,
|
49432 |
+
'has-single-cell': !showBlockActions
|
49433 |
+
}); // Only include all selected blocks if the currently clicked on block
|
49434 |
+
// is one of the selected blocks. This ensures that if a user attempts
|
49435 |
+
// to alter a block that isn't part of the selection, they're still able
|
49436 |
+
// to do so.
|
49437 |
+
|
49438 |
+
const dropdownClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId];
|
49439 |
+
return (0,external_wp_element_namespaceObject.createElement)(leaf_ListViewLeaf, {
|
49440 |
+
className: classes,
|
49441 |
+
onMouseEnter: onMouseEnter,
|
49442 |
+
onMouseLeave: onMouseLeave,
|
49443 |
+
onFocus: onMouseEnter,
|
49444 |
+
onBlur: onMouseLeave,
|
49445 |
+
level: level,
|
49446 |
+
position: position,
|
49447 |
+
rowCount: rowCount,
|
49448 |
+
path: path,
|
49449 |
+
id: `list-view-block-${clientId}`,
|
49450 |
+
"data-block": clientId,
|
49451 |
+
isExpanded: isContentLocked ? undefined : isExpanded,
|
49452 |
+
"aria-selected": !!isSelected || forceSelectionContentLock
|
49453 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
49454 |
+
className: "block-editor-list-view-block__contents-cell",
|
49455 |
+
colSpan: colSpan,
|
49456 |
+
ref: cellRef,
|
49457 |
+
"aria-label": blockAriaLabel,
|
49458 |
+
"aria-selected": !!isSelected || forceSelectionContentLock,
|
49459 |
+
"aria-expanded": isContentLocked ? undefined : isExpanded,
|
49460 |
+
"aria-describedby": descriptionId
|
49461 |
+
}, _ref2 => {
|
49462 |
+
let {
|
49463 |
+
ref,
|
49464 |
+
tabIndex,
|
49465 |
+
onFocus
|
49466 |
+
} = _ref2;
|
49467 |
+
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
49468 |
+
className: "block-editor-list-view-block__contents-container"
|
49469 |
+
}, (0,external_wp_element_namespaceObject.createElement)(off_canvas_editor_block_contents, {
|
49470 |
+
block: block,
|
49471 |
+
onClick: selectBlockInCanvas ? selectEditorBlock : event => {
|
49472 |
+
event.preventDefault();
|
49473 |
+
},
|
49474 |
+
onToggleExpanded: toggleExpanded,
|
49475 |
+
isSelected: isSelected,
|
49476 |
+
position: position,
|
49477 |
+
siblingBlockCount: siblingBlockCount,
|
49478 |
+
level: level,
|
49479 |
+
ref: ref,
|
49480 |
+
tabIndex: tabIndex,
|
49481 |
+
onFocus: onFocus,
|
49482 |
+
isExpanded: isExpanded,
|
49483 |
+
selectedClientIds: selectedClientIds,
|
49484 |
+
preventAnnouncement: preventAnnouncement
|
49485 |
+
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
49486 |
+
className: "block-editor-list-view-block-select-button__description",
|
49487 |
+
id: descriptionId
|
49488 |
+
}, blockPositionDescription));
|
49489 |
+
}), hasRenderedMovers && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
49490 |
+
className: moverCellClassName,
|
49491 |
+
withoutGridItem: true
|
49492 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridItem, null, _ref3 => {
|
49493 |
+
let {
|
49494 |
+
ref,
|
49495 |
+
tabIndex,
|
49496 |
+
onFocus
|
49497 |
+
} = _ref3;
|
49498 |
+
return (0,external_wp_element_namespaceObject.createElement)(BlockMoverUpButton, {
|
49499 |
+
orientation: "vertical",
|
49500 |
+
clientIds: [clientId],
|
49501 |
+
ref: ref,
|
49502 |
+
tabIndex: tabIndex,
|
49503 |
+
onFocus: onFocus
|
49504 |
+
});
|
49505 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridItem, null, _ref4 => {
|
49506 |
+
let {
|
49507 |
+
ref,
|
49508 |
+
tabIndex,
|
49509 |
+
onFocus
|
49510 |
+
} = _ref4;
|
49511 |
+
return (0,external_wp_element_namespaceObject.createElement)(BlockMoverDownButton, {
|
49512 |
+
orientation: "vertical",
|
49513 |
+
clientIds: [clientId],
|
49514 |
+
ref: ref,
|
49515 |
+
tabIndex: tabIndex,
|
49516 |
+
onFocus: onFocus
|
49517 |
+
});
|
49518 |
+
}))), showBlockActions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
49519 |
+
className: listViewBlockSettingsClassName,
|
49520 |
+
"aria-selected": !!isSelected || forceSelectionContentLock
|
49521 |
+
}, _ref5 => {
|
49522 |
+
let {
|
49523 |
+
ref,
|
49524 |
+
tabIndex,
|
49525 |
+
onFocus
|
49526 |
+
} = _ref5;
|
49527 |
+
return (0,external_wp_element_namespaceObject.createElement)(block_settings_dropdown, {
|
49528 |
+
clientIds: dropdownClientIds,
|
49529 |
+
icon: more_vertical,
|
49530 |
+
label: settingsAriaLabel,
|
49531 |
+
toggleProps: {
|
49532 |
+
ref,
|
49533 |
+
className: 'block-editor-list-view-block__menu',
|
49534 |
+
tabIndex,
|
49535 |
+
onFocus
|
49536 |
+
},
|
49537 |
+
disableOpenOnArrowDown: true,
|
49538 |
+
__experimentalSelectBlock: updateSelection
|
49539 |
+
});
|
49540 |
+
}));
|
49541 |
+
}
|
49542 |
+
|
49543 |
+
/* harmony default export */ const off_canvas_editor_block = ((0,external_wp_element_namespaceObject.memo)(block_ListViewBlock));
|
49544 |
+
|
49545 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/branch.js
|
49546 |
+
|
49547 |
+
|
49548 |
+
/**
|
49549 |
+
* WordPress dependencies
|
49550 |
+
*/
|
49551 |
+
|
49552 |
+
|
49553 |
+
/**
|
49554 |
+
* Internal dependencies
|
49555 |
+
*/
|
49556 |
+
|
49557 |
+
|
49558 |
+
|
49559 |
+
|
49560 |
+
|
49561 |
+
/**
|
49562 |
+
* Given a block, returns the total number of blocks in that subtree. This is used to help determine
|
49563 |
+
* the list position of a block.
|
49564 |
+
*
|
49565 |
+
* When a block is collapsed, we do not count their children as part of that total. In the current drag
|
49566 |
+
* implementation dragged blocks and their children are not counted.
|
49567 |
+
*
|
49568 |
+
* @param {Object} block block tree
|
49569 |
+
* @param {Object} expandedState state that notes which branches are collapsed
|
49570 |
+
* @param {Array} draggedClientIds a list of dragged client ids
|
49571 |
+
* @param {boolean} isExpandedByDefault flag to determine the default fallback expanded state.
|
49572 |
+
* @return {number} block count
|
49573 |
+
*/
|
49574 |
+
|
49575 |
+
function branch_countBlocks(block, expandedState, draggedClientIds, isExpandedByDefault) {
|
49576 |
+
var _expandedState$block$;
|
49577 |
+
|
49578 |
+
const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId);
|
49579 |
+
|
49580 |
+
if (isDragged) {
|
49581 |
+
return 0;
|
49582 |
+
}
|
49583 |
+
|
49584 |
+
const isExpanded = (_expandedState$block$ = expandedState[block.clientId]) !== null && _expandedState$block$ !== void 0 ? _expandedState$block$ : isExpandedByDefault;
|
49585 |
+
|
49586 |
+
if (isExpanded) {
|
49587 |
+
return 1 + block.innerBlocks.reduce(branch_countReducer(expandedState, draggedClientIds, isExpandedByDefault), 0);
|
49588 |
+
}
|
49589 |
+
|
49590 |
+
return 1;
|
49591 |
+
}
|
49592 |
+
|
49593 |
+
const branch_countReducer = (expandedState, draggedClientIds, isExpandedByDefault) => (count, block) => {
|
49594 |
+
var _expandedState$block$2;
|
49595 |
+
|
49596 |
+
const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId);
|
49597 |
+
|
49598 |
+
if (isDragged) {
|
49599 |
+
return count;
|
49600 |
+
}
|
49601 |
+
|
49602 |
+
const isExpanded = (_expandedState$block$2 = expandedState[block.clientId]) !== null && _expandedState$block$2 !== void 0 ? _expandedState$block$2 : isExpandedByDefault;
|
49603 |
+
|
49604 |
+
if (isExpanded && block.innerBlocks.length > 0) {
|
49605 |
+
return count + branch_countBlocks(block, expandedState, draggedClientIds, isExpandedByDefault);
|
49606 |
+
}
|
49607 |
+
|
49608 |
+
return count + 1;
|
49609 |
+
};
|
49610 |
+
|
49611 |
+
function branch_ListViewBranch(props) {
|
49612 |
+
const {
|
49613 |
+
blocks,
|
49614 |
+
selectBlock,
|
49615 |
+
showBlockMovers,
|
49616 |
+
selectedClientIds,
|
49617 |
+
level = 1,
|
49618 |
+
path = '',
|
49619 |
+
isBranchSelected = false,
|
49620 |
+
listPosition = 0,
|
49621 |
+
fixedListWindow,
|
49622 |
+
isExpanded,
|
49623 |
+
parentId,
|
49624 |
+
shouldShowInnerBlocks = true,
|
49625 |
+
selectBlockInCanvas
|
49626 |
+
} = props;
|
49627 |
+
const isContentLocked = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
49628 |
+
return !!(parentId && select(store).getTemplateLock(parentId) === 'contentOnly');
|
49629 |
+
}, [parentId]);
|
49630 |
+
const {
|
49631 |
+
expandedState,
|
49632 |
+
draggedClientIds
|
49633 |
+
} = context_useListViewContext();
|
49634 |
+
|
49635 |
+
if (isContentLocked) {
|
49636 |
+
return null;
|
49637 |
+
}
|
49638 |
+
|
49639 |
+
const filteredBlocks = blocks.filter(Boolean);
|
49640 |
+
const blockCount = filteredBlocks.length;
|
49641 |
+
let nextPosition = listPosition;
|
49642 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, filteredBlocks.map((block, index) => {
|
49643 |
+
var _expandedState$client;
|
49644 |
+
|
49645 |
+
const {
|
49646 |
+
clientId,
|
49647 |
+
innerBlocks
|
49648 |
+
} = block;
|
49649 |
+
|
49650 |
+
if (index > 0) {
|
49651 |
+
nextPosition += branch_countBlocks(filteredBlocks[index - 1], expandedState, draggedClientIds, isExpanded);
|
49652 |
+
}
|
49653 |
+
|
49654 |
+
const {
|
49655 |
+
itemInView
|
49656 |
+
} = fixedListWindow;
|
49657 |
+
const blockInView = itemInView(nextPosition);
|
49658 |
+
const position = index + 1;
|
49659 |
+
const updatedPath = path.length > 0 ? `${path}_${position}` : `${position}`;
|
49660 |
+
const hasNestedBlocks = !!(innerBlocks !== null && innerBlocks !== void 0 && innerBlocks.length);
|
49661 |
+
const shouldExpand = hasNestedBlocks && shouldShowInnerBlocks ? (_expandedState$client = expandedState[clientId]) !== null && _expandedState$client !== void 0 ? _expandedState$client : isExpanded : undefined;
|
49662 |
+
const isDragged = !!(draggedClientIds !== null && draggedClientIds !== void 0 && draggedClientIds.includes(clientId));
|
49663 |
+
const showBlock = isDragged || blockInView; // Make updates to the selected or dragged blocks synchronous,
|
49664 |
+
// but asynchronous for any other block.
|
49665 |
+
|
49666 |
+
const isSelected = utils_isClientIdSelected(clientId, selectedClientIds);
|
49667 |
+
const isSelectedBranch = isBranchSelected || isSelected && hasNestedBlocks;
|
49668 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, {
|
49669 |
+
key: clientId,
|
49670 |
+
value: !isSelected
|
49671 |
+
}, showBlock && (0,external_wp_element_namespaceObject.createElement)(off_canvas_editor_block, {
|
49672 |
+
block: block,
|
49673 |
+
selectBlock: selectBlock,
|
49674 |
+
isSelected: isSelected,
|
49675 |
+
isBranchSelected: isSelectedBranch,
|
49676 |
+
isDragged: isDragged,
|
49677 |
+
level: level,
|
49678 |
+
position: position,
|
49679 |
+
rowCount: blockCount,
|
49680 |
+
siblingBlockCount: blockCount,
|
49681 |
+
showBlockMovers: showBlockMovers,
|
49682 |
+
path: updatedPath,
|
49683 |
+
isExpanded: shouldExpand,
|
49684 |
+
listPosition: nextPosition,
|
49685 |
+
selectedClientIds: selectedClientIds,
|
49686 |
+
selectBlockInCanvas: selectBlockInCanvas
|
49687 |
+
}), !showBlock && (0,external_wp_element_namespaceObject.createElement)("tr", null, (0,external_wp_element_namespaceObject.createElement)("td", {
|
49688 |
+
className: "block-editor-list-view-placeholder"
|
49689 |
+
})), hasNestedBlocks && shouldExpand && !isDragged && (0,external_wp_element_namespaceObject.createElement)(branch_ListViewBranch, {
|
49690 |
+
parentId: clientId,
|
49691 |
+
blocks: innerBlocks,
|
49692 |
+
selectBlock: selectBlock,
|
49693 |
+
showBlockMovers: showBlockMovers,
|
49694 |
+
level: level + 1,
|
49695 |
+
path: updatedPath,
|
49696 |
+
listPosition: nextPosition + 1,
|
49697 |
+
fixedListWindow: fixedListWindow,
|
49698 |
+
isBranchSelected: isSelectedBranch,
|
49699 |
+
selectedClientIds: selectedClientIds,
|
49700 |
+
isExpanded: isExpanded,
|
49701 |
+
selectBlockInCanvas: selectBlockInCanvas
|
49702 |
+
}));
|
49703 |
+
}));
|
49704 |
+
}
|
49705 |
+
|
49706 |
+
branch_ListViewBranch.defaultProps = {
|
49707 |
+
selectBlock: () => {}
|
49708 |
+
};
|
49709 |
+
/* harmony default export */ const off_canvas_editor_branch = ((0,external_wp_element_namespaceObject.memo)(branch_ListViewBranch));
|
49710 |
+
|
49711 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/drop-indicator.js
|
49712 |
+
|
49713 |
+
|
49714 |
+
/**
|
49715 |
+
* WordPress dependencies
|
49716 |
+
*/
|
49717 |
+
|
49718 |
+
|
49719 |
+
function drop_indicator_ListViewDropIndicator(_ref) {
|
49720 |
+
let {
|
49721 |
+
listViewRef,
|
49722 |
+
blockDropTarget
|
49723 |
+
} = _ref;
|
49724 |
+
const {
|
49725 |
+
rootClientId,
|
49726 |
+
clientId,
|
49727 |
+
dropPosition
|
49728 |
+
} = blockDropTarget || {};
|
49729 |
+
const [rootBlockElement, blockElement] = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
49730 |
+
if (!listViewRef.current) {
|
49731 |
+
return [];
|
49732 |
+
} // The rootClientId will be defined whenever dropping into inner
|
49733 |
+
// block lists, but is undefined when dropping at the root level.
|
49734 |
+
|
49735 |
+
|
49736 |
+
const _rootBlockElement = rootClientId ? listViewRef.current.querySelector(`[data-block="${rootClientId}"]`) : undefined; // The clientId represents the sibling block, the dragged block will
|
49737 |
+
// usually be inserted adjacent to it. It will be undefined when
|
49738 |
+
// dropping a block into an empty block list.
|
49739 |
+
|
49740 |
+
|
49741 |
+
const _blockElement = clientId ? listViewRef.current.querySelector(`[data-block="${clientId}"]`) : undefined;
|
49742 |
+
|
49743 |
+
return [_rootBlockElement, _blockElement];
|
49744 |
+
}, [rootClientId, clientId]); // The targetElement is the element that the drop indicator will appear
|
49745 |
+
// before or after. When dropping into an empty block list, blockElement
|
49746 |
+
// is undefined, so the indicator will appear after the rootBlockElement.
|
49747 |
+
|
49748 |
+
const targetElement = blockElement || rootBlockElement;
|
49749 |
+
const getDropIndicatorIndent = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
49750 |
+
if (!rootBlockElement) {
|
49751 |
+
return 0;
|
49752 |
+
} // Calculate the indent using the block icon of the root block.
|
49753 |
+
// Using a classname selector here might be flaky and could be
|
49754 |
+
// improved.
|
49755 |
+
|
49756 |
+
|
49757 |
+
const targetElementRect = targetElement.getBoundingClientRect();
|
49758 |
+
const rootBlockIconElement = rootBlockElement.querySelector('.block-editor-block-icon');
|
49759 |
+
const rootBlockIconRect = rootBlockIconElement.getBoundingClientRect();
|
49760 |
+
return rootBlockIconRect.right - targetElementRect.left;
|
49761 |
+
}, [rootBlockElement, targetElement]);
|
49762 |
+
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
49763 |
+
if (!targetElement) {
|
49764 |
+
return {};
|
49765 |
+
}
|
49766 |
+
|
49767 |
+
const indent = getDropIndicatorIndent();
|
49768 |
+
return {
|
49769 |
+
width: targetElement.offsetWidth - indent
|
49770 |
+
};
|
49771 |
+
}, [getDropIndicatorIndent, targetElement]);
|
49772 |
+
const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
49773 |
+
const isValidDropPosition = dropPosition === 'top' || dropPosition === 'bottom' || dropPosition === 'inside';
|
49774 |
+
|
49775 |
+
if (!targetElement || !isValidDropPosition) {
|
49776 |
+
return undefined;
|
49777 |
+
}
|
49778 |
+
|
49779 |
+
return {
|
49780 |
+
ownerDocument: targetElement.ownerDocument,
|
49781 |
+
|
49782 |
+
getBoundingClientRect() {
|
49783 |
+
const rect = targetElement.getBoundingClientRect();
|
49784 |
+
const indent = getDropIndicatorIndent();
|
49785 |
+
const left = rect.left + indent;
|
49786 |
+
const right = rect.right;
|
49787 |
+
let top = 0;
|
49788 |
+
let bottom = 0;
|
49789 |
+
|
49790 |
+
if (dropPosition === 'top') {
|
49791 |
+
top = rect.top;
|
49792 |
+
bottom = rect.top;
|
49793 |
+
} else {
|
49794 |
+
// `dropPosition` is either `bottom` or `inside`
|
49795 |
+
top = rect.bottom;
|
49796 |
+
bottom = rect.bottom;
|
49797 |
+
}
|
49798 |
+
|
49799 |
+
const width = right - left;
|
49800 |
+
const height = bottom - top;
|
49801 |
+
return new window.DOMRect(left, top, width, height);
|
49802 |
+
}
|
49803 |
+
|
49804 |
+
};
|
49805 |
+
}, [targetElement, dropPosition, getDropIndicatorIndent]);
|
49806 |
+
|
49807 |
+
if (!targetElement) {
|
49808 |
+
return null;
|
49809 |
+
}
|
49810 |
+
|
49811 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
|
49812 |
+
animate: false,
|
49813 |
+
anchor: popoverAnchor,
|
49814 |
+
focusOnMount: false,
|
49815 |
+
className: "block-editor-list-view-drop-indicator",
|
49816 |
+
variant: "unstyled"
|
49817 |
+
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
49818 |
+
style: style,
|
49819 |
+
className: "block-editor-list-view-drop-indicator__line"
|
49820 |
+
}));
|
49821 |
+
}
|
49822 |
+
|
49823 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/use-block-selection.js
|
49824 |
+
/**
|
49825 |
+
* WordPress dependencies
|
49826 |
+
*/
|
49827 |
+
|
49828 |
+
|
49829 |
+
|
49830 |
+
|
49831 |
+
|
49832 |
+
|
49833 |
+
/**
|
49834 |
+
* Internal dependencies
|
49835 |
+
*/
|
49836 |
+
|
49837 |
+
|
49838 |
+
|
49839 |
+
function use_block_selection_useBlockSelection() {
|
49840 |
+
const {
|
49841 |
+
clearSelectedBlock,
|
49842 |
+
multiSelect,
|
49843 |
+
selectBlock
|
49844 |
+
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
49845 |
+
const {
|
49846 |
+
getBlockName,
|
49847 |
+
getBlockParents,
|
49848 |
+
getBlockSelectionStart,
|
49849 |
+
getBlockSelectionEnd,
|
49850 |
+
getSelectedBlockClientIds,
|
49851 |
+
hasMultiSelection,
|
49852 |
+
hasSelectedBlock
|
49853 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
49854 |
+
const {
|
49855 |
+
getBlockType
|
49856 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
|
49857 |
+
const updateBlockSelection = (0,external_wp_element_namespaceObject.useCallback)(async (event, clientId, destinationClientId) => {
|
49858 |
+
if (!(event !== null && event !== void 0 && event.shiftKey)) {
|
49859 |
+
selectBlock(clientId);
|
49860 |
+
return;
|
49861 |
+
} // To handle multiple block selection via the `SHIFT` key, prevent
|
49862 |
+
// the browser default behavior of opening the link in a new window.
|
49863 |
+
|
49864 |
+
|
49865 |
+
event.preventDefault();
|
49866 |
+
const isKeyPress = event.type === 'keydown' && (event.keyCode === external_wp_keycodes_namespaceObject.UP || event.keyCode === external_wp_keycodes_namespaceObject.DOWN || event.keyCode === external_wp_keycodes_namespaceObject.HOME || event.keyCode === external_wp_keycodes_namespaceObject.END); // Handle clicking on a block when no blocks are selected, and return early.
|
49867 |
+
|
49868 |
+
if (!isKeyPress && !hasSelectedBlock() && !hasMultiSelection()) {
|
49869 |
+
selectBlock(clientId, null);
|
49870 |
+
return;
|
49871 |
+
}
|
49872 |
+
|
49873 |
+
const selectedBlocks = getSelectedBlockClientIds();
|
49874 |
+
const clientIdWithParents = [...getBlockParents(clientId), clientId];
|
49875 |
+
|
49876 |
+
if (isKeyPress && !selectedBlocks.some(blockId => clientIdWithParents.includes(blockId))) {
|
49877 |
+
// Ensure that shift-selecting blocks via the keyboard only
|
49878 |
+
// expands the current selection if focusing over already
|
49879 |
+
// selected blocks. Otherwise, clear the selection so that
|
49880 |
+
// a user can create a new selection entirely by keyboard.
|
49881 |
+
await clearSelectedBlock();
|
49882 |
+
}
|
49883 |
+
|
49884 |
+
let startTarget = getBlockSelectionStart();
|
49885 |
+
let endTarget = clientId; // Handle keyboard behavior for selecting multiple blocks.
|
49886 |
+
|
49887 |
+
if (isKeyPress) {
|
49888 |
+
if (!hasSelectedBlock() && !hasMultiSelection()) {
|
49889 |
+
// Set the starting point of the selection to the currently
|
49890 |
+
// focused block, if there are no blocks currently selected.
|
49891 |
+
// This ensures that as the selection is expanded or contracted,
|
49892 |
+
// the starting point of the selection is anchored to that block.
|
49893 |
+
startTarget = clientId;
|
49894 |
+
}
|
49895 |
+
|
49896 |
+
if (destinationClientId) {
|
49897 |
+
// If the user presses UP or DOWN, we want to ensure that the block they're
|
49898 |
+
// moving to is the target for selection, and not the currently focused one.
|
49899 |
+
endTarget = destinationClientId;
|
49900 |
+
}
|
49901 |
+
}
|
49902 |
+
|
49903 |
+
const startParents = getBlockParents(startTarget);
|
49904 |
+
const endParents = getBlockParents(endTarget);
|
49905 |
+
const {
|
49906 |
+
start,
|
49907 |
+
end
|
49908 |
+
} = utils_getCommonDepthClientIds(startTarget, endTarget, startParents, endParents);
|
49909 |
+
await multiSelect(start, end, null); // Announce deselected block, or number of deselected blocks if
|
49910 |
+
// the total number of blocks deselected is greater than one.
|
49911 |
+
|
49912 |
+
const updatedSelectedBlocks = getSelectedBlockClientIds(); // If the selection is greater than 1 and the Home or End keys
|
49913 |
+
// were used to generate the selection, then skip announcing the
|
49914 |
+
// deselected blocks.
|
49915 |
+
|
49916 |
+
if ((event.keyCode === external_wp_keycodes_namespaceObject.HOME || event.keyCode === external_wp_keycodes_namespaceObject.END) && updatedSelectedBlocks.length > 1) {
|
49917 |
+
return;
|
49918 |
+
}
|
49919 |
+
|
49920 |
+
const selectionDiff = selectedBlocks.filter(blockId => !updatedSelectedBlocks.includes(blockId));
|
49921 |
+
let label;
|
49922 |
+
|
49923 |
+
if (selectionDiff.length === 1) {
|
49924 |
+
var _getBlockType;
|
49925 |
+
|
49926 |
+
const title = (_getBlockType = getBlockType(getBlockName(selectionDiff[0]))) === null || _getBlockType === void 0 ? void 0 : _getBlockType.title;
|
49927 |
+
|
49928 |
+
if (title) {
|
49929 |
+
label = (0,external_wp_i18n_namespaceObject.sprintf)(
|
49930 |
+
/* translators: %s: block name */
|
49931 |
+
(0,external_wp_i18n_namespaceObject.__)('%s deselected.'), title);
|
49932 |
+
}
|
49933 |
+
} else if (selectionDiff.length > 1) {
|
49934 |
+
label = (0,external_wp_i18n_namespaceObject.sprintf)(
|
49935 |
+
/* translators: %s: number of deselected blocks */
|
49936 |
+
(0,external_wp_i18n_namespaceObject.__)('%s blocks deselected.'), selectionDiff.length);
|
49937 |
+
}
|
49938 |
+
|
49939 |
+
if (label) {
|
49940 |
+
(0,external_wp_a11y_namespaceObject.speak)(label);
|
49941 |
+
}
|
49942 |
+
}, [clearSelectedBlock, getBlockName, getBlockType, getBlockParents, getBlockSelectionStart, getBlockSelectionEnd, getSelectedBlockClientIds, hasMultiSelection, hasSelectedBlock, multiSelect, selectBlock]);
|
49943 |
+
return {
|
49944 |
+
updateBlockSelection
|
49945 |
+
};
|
49946 |
+
}
|
49947 |
+
|
49948 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/use-list-view-client-ids.js
|
49949 |
+
/**
|
49950 |
+
* WordPress dependencies
|
49951 |
+
*/
|
49952 |
+
|
49953 |
+
/**
|
49954 |
+
* Internal dependencies
|
49955 |
+
*/
|
49956 |
+
|
49957 |
+
|
49958 |
+
function use_list_view_client_ids_useListViewClientIds(blocks) {
|
49959 |
+
return (0,external_wp_data_namespaceObject.useSelect)(select => {
|
49960 |
+
const {
|
49961 |
+
getDraggedBlockClientIds,
|
49962 |
+
getSelectedBlockClientIds,
|
49963 |
+
__unstableGetClientIdsTree
|
49964 |
+
} = select(store);
|
49965 |
+
return {
|
49966 |
+
selectedClientIds: getSelectedBlockClientIds(),
|
49967 |
+
draggedClientIds: getDraggedBlockClientIds(),
|
49968 |
+
clientIdsTree: blocks ? blocks : __unstableGetClientIdsTree()
|
49969 |
+
};
|
49970 |
+
}, [blocks]);
|
49971 |
+
}
|
49972 |
+
|
49973 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/use-list-view-drop-zone.js
|
49974 |
+
/**
|
49975 |
+
* WordPress dependencies
|
49976 |
+
*/
|
49977 |
+
|
49978 |
+
|
49979 |
+
|
49980 |
+
/**
|
49981 |
+
* Internal dependencies
|
49982 |
+
*/
|
49983 |
+
|
49984 |
+
|
49985 |
+
|
49986 |
+
|
49987 |
+
/** @typedef {import('../../utils/math').WPPoint} WPPoint */
|
49988 |
+
|
49989 |
+
/**
|
49990 |
+
* The type of a drag event.
|
49991 |
+
*
|
49992 |
+
* @typedef {'default'|'file'|'html'} WPDragEventType
|
49993 |
+
*/
|
49994 |
+
|
49995 |
+
/**
|
49996 |
+
* An array representing data for blocks in the DOM used by drag and drop.
|
49997 |
+
*
|
49998 |
+
* @typedef {Object} WPListViewDropZoneBlocks
|
49999 |
+
* @property {string} clientId The client id for the block.
|
50000 |
+
* @property {string} rootClientId The root client id for the block.
|
50001 |
+
* @property {number} blockIndex The block's index.
|
50002 |
+
* @property {Element} element The DOM element representing the block.
|
50003 |
+
* @property {number} innerBlockCount The number of inner blocks the block has.
|
50004 |
+
* @property {boolean} isDraggedBlock Whether the block is currently being dragged.
|
50005 |
+
* @property {boolean} canInsertDraggedBlocksAsSibling Whether the dragged block can be a sibling of this block.
|
50006 |
+
* @property {boolean} canInsertDraggedBlocksAsChild Whether the dragged block can be a child of this block.
|
50007 |
+
*/
|
50008 |
+
|
50009 |
+
/**
|
50010 |
+
* An object containing details of a drop target.
|
50011 |
+
*
|
50012 |
+
* @typedef {Object} WPListViewDropZoneTarget
|
50013 |
+
* @property {string} blockIndex The insertion index.
|
50014 |
+
* @property {string} rootClientId The root client id for the block.
|
50015 |
+
* @property {string|undefined} clientId The client id for the block.
|
50016 |
+
* @property {'top'|'bottom'|'inside'} dropPosition The position relative to the block that the user is dropping to.
|
50017 |
+
* 'inside' refers to nesting as an inner block.
|
50018 |
+
*/
|
50019 |
+
|
50020 |
+
/**
|
50021 |
+
* Determines whether the user positioning the dragged block to nest as an
|
50022 |
+
* inner block.
|
50023 |
+
*
|
50024 |
+
* Presently this is determined by whether the cursor is on the right hand side
|
50025 |
+
* of the block.
|
50026 |
+
*
|
50027 |
+
* @param {WPPoint} point The point representing the cursor position when dragging.
|
50028 |
+
* @param {DOMRect} rect The rectangle.
|
50029 |
+
*/
|
50030 |
+
|
50031 |
+
function use_list_view_drop_zone_isNestingGesture(point, rect) {
|
50032 |
+
const blockCenterX = rect.left + rect.width / 2;
|
50033 |
+
return point.x > blockCenterX;
|
50034 |
+
} // Block navigation is always a vertical list, so only allow dropping
|
50035 |
+
// to the above or below a block.
|
50036 |
+
|
50037 |
+
|
50038 |
+
const use_list_view_drop_zone_ALLOWED_DROP_EDGES = ['top', 'bottom'];
|
50039 |
+
/**
|
50040 |
+
* Given blocks data and the cursor position, compute the drop target.
|
50041 |
+
*
|
50042 |
+
* @param {WPListViewDropZoneBlocks} blocksData Data about the blocks in list view.
|
50043 |
+
* @param {WPPoint} position The point representing the cursor position when dragging.
|
50044 |
+
*
|
50045 |
+
* @return {WPListViewDropZoneTarget} An object containing data about the drop target.
|
50046 |
+
*/
|
50047 |
+
|
50048 |
+
function use_list_view_drop_zone_getListViewDropTarget(blocksData, position) {
|
50049 |
+
let candidateEdge;
|
50050 |
+
let candidateBlockData;
|
50051 |
+
let candidateDistance;
|
50052 |
+
let candidateRect;
|
50053 |
+
|
50054 |
+
for (const blockData of blocksData) {
|
50055 |
+
if (blockData.isDraggedBlock) {
|
50056 |
+
continue;
|
50057 |
+
}
|
50058 |
+
|
50059 |
+
const rect = blockData.element.getBoundingClientRect();
|
50060 |
+
const [distance, edge] = getDistanceToNearestEdge(position, rect, use_list_view_drop_zone_ALLOWED_DROP_EDGES);
|
50061 |
+
const isCursorWithinBlock = isPointContainedByRect(position, rect);
|
50062 |
+
|
50063 |
+
if (candidateDistance === undefined || distance < candidateDistance || isCursorWithinBlock) {
|
50064 |
+
candidateDistance = distance;
|
50065 |
+
const index = blocksData.indexOf(blockData);
|
50066 |
+
const previousBlockData = blocksData[index - 1]; // If dragging near the top of a block and the preceding block
|
50067 |
+
// is at the same level, use the preceding block as the candidate
|
50068 |
+
// instead, as later it makes determining a nesting drop easier.
|
50069 |
+
|
50070 |
+
if (edge === 'top' && previousBlockData && previousBlockData.rootClientId === blockData.rootClientId && !previousBlockData.isDraggedBlock) {
|
50071 |
+
candidateBlockData = previousBlockData;
|
50072 |
+
candidateEdge = 'bottom';
|
50073 |
+
candidateRect = previousBlockData.element.getBoundingClientRect();
|
50074 |
+
} else {
|
50075 |
+
candidateBlockData = blockData;
|
50076 |
+
candidateEdge = edge;
|
50077 |
+
candidateRect = rect;
|
50078 |
+
} // If the mouse position is within the block, break early
|
50079 |
+
// as the user would intend to drop either before or after
|
50080 |
+
// this block.
|
50081 |
+
//
|
50082 |
+
// This solves an issue where some rows in the list view
|
50083 |
+
// tree overlap slightly due to sub-pixel rendering.
|
50084 |
+
|
50085 |
+
|
50086 |
+
if (isCursorWithinBlock) {
|
50087 |
+
break;
|
50088 |
+
}
|
50089 |
+
}
|
50090 |
+
}
|
50091 |
+
|
50092 |
+
if (!candidateBlockData) {
|
50093 |
+
return;
|
50094 |
+
}
|
50095 |
+
|
50096 |
+
const isDraggingBelow = candidateEdge === 'bottom'; // If the user is dragging towards the bottom of the block check whether
|
50097 |
+
// they might be trying to nest the block as a child.
|
50098 |
+
// If the block already has inner blocks, this should always be treated
|
50099 |
+
// as nesting since the next block in the tree will be the first child.
|
50100 |
+
|
50101 |
+
if (isDraggingBelow && candidateBlockData.canInsertDraggedBlocksAsChild && (candidateBlockData.innerBlockCount > 0 || use_list_view_drop_zone_isNestingGesture(position, candidateRect))) {
|
50102 |
+
return {
|
50103 |
+
rootClientId: candidateBlockData.clientId,
|
50104 |
+
blockIndex: 0,
|
50105 |
+
dropPosition: 'inside'
|
50106 |
+
};
|
50107 |
+
} // If dropping as a sibling, but block cannot be inserted in
|
50108 |
+
// this context, return early.
|
50109 |
+
|
50110 |
+
|
50111 |
+
if (!candidateBlockData.canInsertDraggedBlocksAsSibling) {
|
50112 |
+
return;
|
50113 |
+
}
|
50114 |
+
|
50115 |
+
const offset = isDraggingBelow ? 1 : 0;
|
50116 |
+
return {
|
50117 |
+
rootClientId: candidateBlockData.rootClientId,
|
50118 |
+
clientId: candidateBlockData.clientId,
|
50119 |
+
blockIndex: candidateBlockData.blockIndex + offset,
|
50120 |
+
dropPosition: candidateEdge
|
50121 |
+
};
|
50122 |
+
}
|
50123 |
+
/**
|
50124 |
+
* A react hook for implementing a drop zone in list view.
|
50125 |
+
*
|
50126 |
+
* @return {WPListViewDropZoneTarget} The drop target.
|
50127 |
+
*/
|
50128 |
+
|
50129 |
+
|
50130 |
+
function use_list_view_drop_zone_useListViewDropZone() {
|
50131 |
+
const {
|
50132 |
+
getBlockRootClientId,
|
50133 |
+
getBlockIndex,
|
50134 |
+
getBlockCount,
|
50135 |
+
getDraggedBlockClientIds,
|
50136 |
+
canInsertBlocks
|
50137 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
50138 |
+
const [target, setTarget] = (0,external_wp_element_namespaceObject.useState)();
|
50139 |
+
const {
|
50140 |
+
rootClientId: targetRootClientId,
|
50141 |
+
blockIndex: targetBlockIndex
|
50142 |
+
} = target || {};
|
50143 |
+
const onBlockDrop = useOnBlockDrop(targetRootClientId, targetBlockIndex);
|
50144 |
+
const draggedBlockClientIds = getDraggedBlockClientIds();
|
50145 |
+
const throttled = (0,external_wp_compose_namespaceObject.useThrottle)((0,external_wp_element_namespaceObject.useCallback)((event, currentTarget) => {
|
50146 |
+
const position = {
|
50147 |
+
x: event.clientX,
|
50148 |
+
y: event.clientY
|
50149 |
+
};
|
50150 |
+
const isBlockDrag = !!(draggedBlockClientIds !== null && draggedBlockClientIds !== void 0 && draggedBlockClientIds.length);
|
50151 |
+
const blockElements = Array.from(currentTarget.querySelectorAll('[data-block]'));
|
50152 |
+
const blocksData = blockElements.map(blockElement => {
|
50153 |
+
const clientId = blockElement.dataset.block;
|
50154 |
+
const rootClientId = getBlockRootClientId(clientId);
|
50155 |
+
return {
|
50156 |
+
clientId,
|
50157 |
+
rootClientId,
|
50158 |
+
blockIndex: getBlockIndex(clientId),
|
50159 |
+
element: blockElement,
|
50160 |
+
isDraggedBlock: isBlockDrag ? draggedBlockClientIds.includes(clientId) : false,
|
50161 |
+
innerBlockCount: getBlockCount(clientId),
|
50162 |
+
canInsertDraggedBlocksAsSibling: isBlockDrag ? canInsertBlocks(draggedBlockClientIds, rootClientId) : true,
|
50163 |
+
canInsertDraggedBlocksAsChild: isBlockDrag ? canInsertBlocks(draggedBlockClientIds, clientId) : true
|
50164 |
+
};
|
50165 |
+
});
|
50166 |
+
const newTarget = use_list_view_drop_zone_getListViewDropTarget(blocksData, position);
|
50167 |
+
|
50168 |
+
if (newTarget) {
|
50169 |
+
setTarget(newTarget);
|
50170 |
+
}
|
50171 |
+
}, [draggedBlockClientIds]), 200);
|
50172 |
+
const ref = (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
|
50173 |
+
onDrop: onBlockDrop,
|
50174 |
+
|
50175 |
+
onDragOver(event) {
|
50176 |
+
// `currentTarget` is only available while the event is being
|
50177 |
+
// handled, so get it now and pass it to the thottled function.
|
50178 |
+
// https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget
|
50179 |
+
throttled(event, event.currentTarget);
|
50180 |
+
},
|
50181 |
+
|
50182 |
+
onDragEnd() {
|
50183 |
+
throttled.cancel();
|
50184 |
+
setTarget(null);
|
50185 |
+
}
|
50186 |
+
|
50187 |
+
});
|
50188 |
+
return {
|
50189 |
+
ref,
|
50190 |
+
target
|
50191 |
+
};
|
50192 |
+
}
|
50193 |
+
|
50194 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js
|
50195 |
+
/**
|
50196 |
+
* WordPress dependencies
|
50197 |
+
*/
|
50198 |
+
|
50199 |
+
|
50200 |
+
/**
|
50201 |
+
* Internal dependencies
|
50202 |
+
*/
|
50203 |
+
|
50204 |
+
|
50205 |
+
function use_list_view_expand_selected_item_useListViewExpandSelectedItem(_ref) {
|
50206 |
+
let {
|
50207 |
+
firstSelectedBlockClientId,
|
50208 |
+
setExpandedState
|
50209 |
+
} = _ref;
|
50210 |
+
const [selectedTreeId, setSelectedTreeId] = (0,external_wp_element_namespaceObject.useState)(null);
|
50211 |
+
const {
|
50212 |
+
selectedBlockParentClientIds
|
50213 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
50214 |
+
const {
|
50215 |
+
getBlockParents
|
50216 |
+
} = select(store);
|
50217 |
+
return {
|
50218 |
+
selectedBlockParentClientIds: getBlockParents(firstSelectedBlockClientId, false)
|
50219 |
+
};
|
50220 |
+
}, [firstSelectedBlockClientId]);
|
50221 |
+
const parentClientIds = Array.isArray(selectedBlockParentClientIds) && selectedBlockParentClientIds.length ? selectedBlockParentClientIds : null; // Expand tree when a block is selected.
|
50222 |
+
|
50223 |
+
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
50224 |
+
// If the selectedTreeId is the same as the selected block,
|
50225 |
+
// it means that the block was selected using the block list tree.
|
50226 |
+
if (selectedTreeId === firstSelectedBlockClientId) {
|
50227 |
+
return;
|
50228 |
+
} // If the selected block has parents, get the top-level parent.
|
50229 |
+
|
50230 |
+
|
50231 |
+
if (parentClientIds) {
|
50232 |
+
// If the selected block has parents,
|
50233 |
+
// expand the tree branch.
|
50234 |
+
setExpandedState({
|
50235 |
+
type: 'expand',
|
50236 |
+
clientIds: selectedBlockParentClientIds
|
50237 |
+
});
|
50238 |
+
}
|
50239 |
+
}, [firstSelectedBlockClientId]);
|
50240 |
+
return {
|
50241 |
+
setSelectedTreeId
|
50242 |
+
};
|
50243 |
+
}
|
50244 |
+
|
50245 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/off-canvas-editor/index.js
|
50246 |
+
|
50247 |
+
|
50248 |
+
/**
|
50249 |
+
* WordPress dependencies
|
50250 |
+
*/
|
50251 |
+
|
50252 |
+
|
50253 |
+
|
50254 |
+
|
50255 |
+
|
50256 |
+
/**
|
50257 |
+
* Internal dependencies
|
50258 |
+
*/
|
50259 |
+
|
50260 |
+
|
50261 |
+
|
50262 |
+
|
50263 |
+
|
50264 |
+
|
50265 |
+
|
50266 |
+
|
50267 |
+
|
50268 |
+
|
50269 |
+
const off_canvas_editor_expanded = (state, action) => {
|
50270 |
+
if (Array.isArray(action.clientIds)) {
|
50271 |
+
return { ...state,
|
50272 |
+
...action.clientIds.reduce((newState, id) => ({ ...newState,
|
50273 |
+
[id]: action.type === 'expand'
|
50274 |
+
}), {})
|
50275 |
+
};
|
50276 |
+
}
|
50277 |
+
|
50278 |
+
return state;
|
50279 |
+
};
|
50280 |
+
|
50281 |
+
const off_canvas_editor_BLOCK_LIST_ITEM_HEIGHT = 36;
|
50282 |
+
/**
|
50283 |
+
* Show a hierarchical list of blocks.
|
50284 |
+
*
|
50285 |
+
* @param {Object} props Components props.
|
50286 |
+
* @param {string} props.id An HTML element id for the root element of ListView.
|
50287 |
+
* @param {Array} props.blocks Custom subset of block client IDs to be used instead of the default hierarchy.
|
50288 |
+
* @param {boolean} props.showBlockMovers Flag to enable block movers
|
50289 |
+
* @param {boolean} props.isExpanded Flag to determine whether nested levels are expanded by default.
|
50290 |
+
* @param {boolean} props.selectBlockInCanvas Flag to determine whether the list view should be a block selection mechanism,.
|
50291 |
+
* @param {Object} ref Forwarded ref
|
50292 |
+
*/
|
50293 |
+
|
50294 |
+
function __ExperimentalOffCanvasEditor(_ref, ref) {
|
50295 |
+
let {
|
50296 |
+
id,
|
50297 |
+
blocks,
|
50298 |
+
showBlockMovers = false,
|
50299 |
+
isExpanded = false,
|
50300 |
+
selectBlockInCanvas = true
|
50301 |
+
} = _ref;
|
50302 |
+
const {
|
50303 |
+
clientIdsTree,
|
50304 |
+
draggedClientIds,
|
50305 |
+
selectedClientIds
|
50306 |
+
} = use_list_view_client_ids_useListViewClientIds(blocks);
|
50307 |
+
const {
|
50308 |
+
visibleBlockCount,
|
50309 |
+
shouldShowInnerBlocks
|
50310 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
50311 |
+
const {
|
50312 |
+
getGlobalBlockCount,
|
50313 |
+
getClientIdsOfDescendants,
|
50314 |
+
__unstableGetEditorMode
|
50315 |
+
} = select(store);
|
50316 |
+
const draggedBlockCount = (draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.length) > 0 ? getClientIdsOfDescendants(draggedClientIds).length + 1 : 0;
|
50317 |
+
return {
|
50318 |
+
visibleBlockCount: getGlobalBlockCount() - draggedBlockCount,
|
50319 |
+
shouldShowInnerBlocks: __unstableGetEditorMode() !== 'zoom-out'
|
50320 |
+
};
|
50321 |
+
}, [draggedClientIds]);
|
50322 |
+
const {
|
50323 |
+
updateBlockSelection
|
50324 |
+
} = use_block_selection_useBlockSelection();
|
50325 |
+
const [expandedState, setExpandedState] = (0,external_wp_element_namespaceObject.useReducer)(off_canvas_editor_expanded, {});
|
50326 |
+
const {
|
50327 |
+
ref: dropZoneRef,
|
50328 |
+
target: blockDropTarget
|
50329 |
+
} = use_list_view_drop_zone_useListViewDropZone();
|
50330 |
+
const elementRef = (0,external_wp_element_namespaceObject.useRef)();
|
50331 |
+
const treeGridRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([elementRef, dropZoneRef, ref]);
|
50332 |
+
const isMounted = (0,external_wp_element_namespaceObject.useRef)(false);
|
50333 |
+
const {
|
50334 |
+
setSelectedTreeId
|
50335 |
+
} = use_list_view_expand_selected_item_useListViewExpandSelectedItem({
|
50336 |
+
firstSelectedBlockClientId: selectedClientIds[0],
|
50337 |
+
setExpandedState
|
50338 |
+
});
|
50339 |
+
const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)((event, clientId) => {
|
50340 |
+
updateBlockSelection(event, clientId);
|
50341 |
+
setSelectedTreeId(clientId);
|
50342 |
+
}, [setSelectedTreeId, updateBlockSelection]);
|
50343 |
+
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
50344 |
+
isMounted.current = true;
|
50345 |
+
}, []); // List View renders a fixed number of items and relies on each having a fixed item height of 36px.
|
50346 |
+
// If this value changes, we should also change the itemHeight value set in useFixedWindowList.
|
50347 |
+
// See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.
|
50348 |
+
|
50349 |
+
const [fixedListWindow] = (0,external_wp_compose_namespaceObject.__experimentalUseFixedWindowList)(elementRef, off_canvas_editor_BLOCK_LIST_ITEM_HEIGHT, visibleBlockCount, {
|
50350 |
+
useWindowing: true,
|
50351 |
+
windowOverscan: 40
|
50352 |
+
});
|
50353 |
+
const expand = (0,external_wp_element_namespaceObject.useCallback)(clientId => {
|
50354 |
+
if (!clientId) {
|
50355 |
+
return;
|
50356 |
+
}
|
50357 |
+
|
50358 |
+
setExpandedState({
|
50359 |
+
type: 'expand',
|
50360 |
+
clientIds: [clientId]
|
50361 |
+
});
|
50362 |
+
}, [setExpandedState]);
|
50363 |
+
const collapse = (0,external_wp_element_namespaceObject.useCallback)(clientId => {
|
50364 |
+
if (!clientId) {
|
50365 |
+
return;
|
50366 |
+
}
|
50367 |
+
|
50368 |
+
setExpandedState({
|
50369 |
+
type: 'collapse',
|
50370 |
+
clientIds: [clientId]
|
50371 |
+
});
|
50372 |
+
}, [setExpandedState]);
|
50373 |
+
const expandRow = (0,external_wp_element_namespaceObject.useCallback)(row => {
|
50374 |
+
var _row$dataset;
|
50375 |
+
|
50376 |
+
expand(row === null || row === void 0 ? void 0 : (_row$dataset = row.dataset) === null || _row$dataset === void 0 ? void 0 : _row$dataset.block);
|
50377 |
+
}, [expand]);
|
50378 |
+
const collapseRow = (0,external_wp_element_namespaceObject.useCallback)(row => {
|
50379 |
+
var _row$dataset2;
|
50380 |
+
|
50381 |
+
collapse(row === null || row === void 0 ? void 0 : (_row$dataset2 = row.dataset) === null || _row$dataset2 === void 0 ? void 0 : _row$dataset2.block);
|
50382 |
+
}, [collapse]);
|
50383 |
+
const focusRow = (0,external_wp_element_namespaceObject.useCallback)((event, startRow, endRow) => {
|
50384 |
+
if (event.shiftKey) {
|
50385 |
+
var _startRow$dataset, _endRow$dataset;
|
50386 |
+
|
50387 |
+
updateBlockSelection(event, startRow === null || startRow === void 0 ? void 0 : (_startRow$dataset = startRow.dataset) === null || _startRow$dataset === void 0 ? void 0 : _startRow$dataset.block, endRow === null || endRow === void 0 ? void 0 : (_endRow$dataset = endRow.dataset) === null || _endRow$dataset === void 0 ? void 0 : _endRow$dataset.block);
|
50388 |
+
}
|
50389 |
+
}, [updateBlockSelection]);
|
50390 |
+
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
|
50391 |
+
isTreeGridMounted: isMounted.current,
|
50392 |
+
draggedClientIds,
|
50393 |
+
expandedState,
|
50394 |
+
expand,
|
50395 |
+
collapse
|
50396 |
+
}), [isMounted.current, draggedClientIds, expandedState, expand, collapse]);
|
50397 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, {
|
50398 |
+
value: true
|
50399 |
+
}, (0,external_wp_element_namespaceObject.createElement)(drop_indicator_ListViewDropIndicator, {
|
50400 |
+
listViewRef: elementRef,
|
50401 |
+
blockDropTarget: blockDropTarget
|
50402 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGrid, {
|
50403 |
+
id: id,
|
50404 |
+
className: "block-editor-list-view-tree",
|
50405 |
+
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Block navigation structure'),
|
50406 |
+
ref: treeGridRef,
|
50407 |
+
onCollapseRow: collapseRow,
|
50408 |
+
onExpandRow: expandRow,
|
50409 |
+
onFocusRow: focusRow,
|
50410 |
+
applicationAriaLabel: (0,external_wp_i18n_namespaceObject.__)('Block navigation structure')
|
50411 |
+
}, (0,external_wp_element_namespaceObject.createElement)(context_ListViewContext.Provider, {
|
50412 |
+
value: contextValue
|
50413 |
+
}, (0,external_wp_element_namespaceObject.createElement)(off_canvas_editor_branch, {
|
50414 |
+
blocks: clientIdsTree,
|
50415 |
+
selectBlock: selectEditorBlock,
|
50416 |
+
showBlockMovers: showBlockMovers,
|
50417 |
+
fixedListWindow: fixedListWindow,
|
50418 |
+
selectedClientIds: selectedClientIds,
|
50419 |
+
isExpanded: isExpanded,
|
50420 |
+
shouldShowInnerBlocks: shouldShowInnerBlocks,
|
50421 |
+
selectBlockInCanvas: selectBlockInCanvas
|
50422 |
+
}))));
|
50423 |
+
}
|
50424 |
+
|
50425 |
+
/* harmony default export */ const off_canvas_editor = ((0,external_wp_element_namespaceObject.forwardRef)(__ExperimentalOffCanvasEditor));
|
50426 |
+
|
50427 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/media.js
|
50428 |
+
|
50429 |
+
|
50430 |
+
/**
|
50431 |
+
* WordPress dependencies
|
50432 |
+
*/
|
50433 |
+
|
50434 |
+
const media = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
50435 |
+
xmlns: "http://www.w3.org/2000/svg",
|
50436 |
+
viewBox: "0 0 24 24"
|
50437 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
50438 |
+
d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"
|
50439 |
+
}));
|
50440 |
+
/* harmony default export */ const library_media = (media);
|
50441 |
+
|
50442 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/upload.js
|
50443 |
+
|
50444 |
+
|
50445 |
+
/**
|
50446 |
+
* WordPress dependencies
|
50447 |
+
*/
|
50448 |
+
|
50449 |
+
const upload = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
50450 |
+
xmlns: "http://www.w3.org/2000/svg",
|
50451 |
+
viewBox: "0 0 24 24"
|
50452 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
50453 |
+
d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"
|
50454 |
+
}));
|
50455 |
+
/* harmony default export */ const library_upload = (upload);
|
50456 |
+
|
50457 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/post-featured-image.js
|
50458 |
+
|
50459 |
+
|
50460 |
+
/**
|
50461 |
+
* WordPress dependencies
|
50462 |
+
*/
|
50463 |
+
|
50464 |
+
const postFeaturedImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
50465 |
+
xmlns: "http://www.w3.org/2000/svg",
|
50466 |
+
viewBox: "0 0 24 24"
|
50467 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
50468 |
+
d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"
|
50469 |
+
}));
|
50470 |
+
/* harmony default export */ const post_featured_image = (postFeaturedImage);
|
50471 |
+
|
50472 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/media-upload/index.js
|
50473 |
+
/**
|
50474 |
+
* WordPress dependencies
|
50475 |
+
*/
|
50476 |
+
|
50477 |
+
/**
|
50478 |
+
* This is a placeholder for the media upload component necessary to make it possible to provide
|
50479 |
+
* an integration with the core blocks that handle media files. By default it renders nothing but
|
50480 |
+
* it provides a way to have it overridden with the `editor.MediaUpload` filter.
|
50481 |
+
*
|
50482 |
+
* @return {WPComponent} The component to be rendered.
|
50483 |
+
*/
|
50484 |
+
|
50485 |
+
const MediaUpload = () => null;
|
50486 |
+
/**
|
50487 |
+
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md
|
50488 |
+
*/
|
50489 |
+
|
50490 |
+
|
50491 |
+
/* harmony default export */ const media_upload = ((0,external_wp_components_namespaceObject.withFilters)('editor.MediaUpload')(MediaUpload));
|
50492 |
+
|
50493 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/media-upload/check.js
|
50494 |
+
/**
|
50495 |
+
* WordPress dependencies
|
50496 |
+
*/
|
50497 |
+
|
50498 |
+
/**
|
50499 |
+
* Internal dependencies
|
50500 |
+
*/
|
50501 |
+
|
50502 |
+
|
50503 |
+
function MediaUploadCheck(_ref) {
|
50504 |
+
let {
|
50505 |
+
fallback = null,
|
50506 |
+
children
|
50507 |
+
} = _ref;
|
50508 |
+
const hasUploadPermissions = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
50509 |
+
const {
|
50510 |
+
getSettings
|
50511 |
+
} = select(store);
|
50512 |
+
return !!getSettings().mediaUpload;
|
50513 |
+
}, []);
|
50514 |
+
return hasUploadPermissions ? children : fallback;
|
50515 |
+
}
|
50516 |
+
/**
|
50517 |
+
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md
|
50518 |
+
*/
|
50519 |
+
|
50520 |
+
/* harmony default export */ const media_upload_check = (MediaUploadCheck);
|
50521 |
+
|
50522 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/media-replace-flow/index.js
|
50523 |
+
|
50524 |
+
|
50525 |
+
/**
|
50526 |
+
* WordPress dependencies
|
50527 |
+
*/
|
50528 |
+
|
50529 |
+
|
50530 |
+
|
50531 |
+
|
50532 |
+
|
50533 |
+
|
50534 |
+
|
50535 |
+
|
50536 |
+
|
50537 |
+
|
50538 |
+
/**
|
50539 |
+
* Internal dependencies
|
50540 |
+
*/
|
50541 |
+
|
50542 |
+
|
50543 |
+
|
50544 |
+
|
50545 |
+
|
50546 |
+
|
50547 |
+
const media_replace_flow_noop = () => {};
|
50548 |
+
|
50549 |
+
let uniqueId = 0;
|
50550 |
+
|
50551 |
+
const MediaReplaceFlow = _ref => {
|
50552 |
+
let {
|
50553 |
+
mediaURL,
|
50554 |
+
mediaId,
|
50555 |
+
mediaIds,
|
50556 |
+
allowedTypes,
|
50557 |
+
accept,
|
50558 |
+
onError,
|
50559 |
+
onSelect,
|
50560 |
+
onSelectURL,
|
50561 |
+
onToggleFeaturedImage,
|
50562 |
+
useFeaturedImage,
|
50563 |
+
onFilesUpload = media_replace_flow_noop,
|
50564 |
+
name = (0,external_wp_i18n_namespaceObject.__)('Replace'),
|
50565 |
+
createNotice,
|
50566 |
+
removeNotice,
|
50567 |
+
children,
|
50568 |
+
multiple = false,
|
50569 |
+
addToGallery,
|
50570 |
+
handleUpload = true
|
50571 |
+
} = _ref;
|
50572 |
+
const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
50573 |
+
return select(store).getSettings().mediaUpload;
|
50574 |
+
}, []);
|
50575 |
+
const editMediaButtonRef = (0,external_wp_element_namespaceObject.useRef)();
|
50576 |
+
const errorNoticeID = `block-editor/media-replace-flow/error-notice/${++uniqueId}`;
|
50577 |
+
|
50578 |
+
const onUploadError = message => {
|
50579 |
+
const safeMessage = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(message);
|
50580 |
+
|
50581 |
+
if (onError) {
|
50582 |
+
onError(safeMessage);
|
50583 |
+
return;
|
50584 |
+
} // We need to set a timeout for showing the notice
|
50585 |
+
// so that VoiceOver and possibly other screen readers
|
50586 |
+
// can announce the error afer the toolbar button
|
50587 |
+
// regains focus once the upload dialog closes.
|
50588 |
+
// Otherwise VO simply skips over the notice and announces
|
50589 |
+
// the focused element and the open menu.
|
50590 |
+
|
50591 |
+
|
50592 |
+
setTimeout(() => {
|
50593 |
+
createNotice('error', safeMessage, {
|
50594 |
+
speak: true,
|
50595 |
+
id: errorNoticeID,
|
50596 |
+
isDismissible: true
|
50597 |
+
});
|
50598 |
+
}, 1000);
|
50599 |
+
};
|
50600 |
+
|
50601 |
+
const selectMedia = (media, closeMenu) => {
|
50602 |
+
if (useFeaturedImage && onToggleFeaturedImage) {
|
50603 |
+
onToggleFeaturedImage();
|
50604 |
+
}
|
50605 |
+
|
50606 |
+
closeMenu(); // Calling `onSelect` after the state update since it might unmount the component.
|
50607 |
+
|
50608 |
+
onSelect(media);
|
50609 |
+
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('The media file has been replaced'));
|
50610 |
+
removeNotice(errorNoticeID);
|
50611 |
+
};
|
50612 |
+
|
50613 |
+
const uploadFiles = (event, closeMenu) => {
|
50614 |
+
const files = event.target.files;
|
50615 |
+
|
50616 |
+
if (!handleUpload) {
|
50617 |
+
closeMenu();
|
50618 |
+
return onSelect(files);
|
50619 |
+
}
|
50620 |
+
|
50621 |
+
onFilesUpload(files);
|
50622 |
+
mediaUpload({
|
50623 |
+
allowedTypes,
|
50624 |
+
filesList: files,
|
50625 |
+
onFileChange: _ref2 => {
|
50626 |
+
let [media] = _ref2;
|
50627 |
+
selectMedia(media, closeMenu);
|
50628 |
+
},
|
50629 |
+
onError: onUploadError
|
50630 |
+
});
|
50631 |
+
};
|
50632 |
+
|
50633 |
+
const openOnArrowDown = event => {
|
50634 |
+
if (event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
|
50635 |
+
event.preventDefault();
|
50636 |
+
event.target.click();
|
50637 |
+
}
|
50638 |
+
};
|
50639 |
+
|
50640 |
+
const onlyAllowsImages = () => {
|
50641 |
+
if (!allowedTypes || allowedTypes.length === 0) {
|
50642 |
+
return false;
|
50643 |
+
}
|
50644 |
+
|
50645 |
+
return allowedTypes.every(allowedType => allowedType === 'image' || allowedType.startsWith('image/'));
|
50646 |
+
};
|
50647 |
+
|
50648 |
+
const gallery = multiple && onlyAllowsImages();
|
50649 |
+
const POPOVER_PROPS = {
|
50650 |
+
variant: 'toolbar'
|
50651 |
+
};
|
50652 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
|
50653 |
+
popoverProps: POPOVER_PROPS,
|
50654 |
+
contentClassName: "block-editor-media-replace-flow__options",
|
50655 |
+
renderToggle: _ref3 => {
|
50656 |
+
let {
|
50657 |
+
isOpen,
|
50658 |
+
onToggle
|
50659 |
+
} = _ref3;
|
50660 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
50661 |
+
ref: editMediaButtonRef,
|
50662 |
+
"aria-expanded": isOpen,
|
50663 |
+
"aria-haspopup": "true",
|
50664 |
+
onClick: onToggle,
|
50665 |
+
onKeyDown: openOnArrowDown
|
50666 |
+
}, name);
|
50667 |
+
},
|
50668 |
+
renderContent: _ref4 => {
|
50669 |
+
let {
|
50670 |
+
onClose
|
50671 |
+
} = _ref4;
|
50672 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, {
|
50673 |
+
className: "block-editor-media-replace-flow__media-upload-menu"
|
50674 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(media_upload, {
|
50675 |
+
gallery: gallery,
|
50676 |
+
addToGallery: addToGallery,
|
50677 |
+
multiple: multiple,
|
50678 |
+
value: multiple ? mediaIds : mediaId,
|
50679 |
+
onSelect: media => selectMedia(media, onClose),
|
50680 |
+
allowedTypes: allowedTypes,
|
50681 |
+
render: _ref5 => {
|
50682 |
+
let {
|
50683 |
+
open
|
50684 |
+
} = _ref5;
|
50685 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
50686 |
+
icon: library_media,
|
50687 |
+
onClick: open
|
50688 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Open Media Library'));
|
50689 |
+
}
|
50690 |
+
}), (0,external_wp_element_namespaceObject.createElement)(media_upload_check, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, {
|
50691 |
+
onChange: event => {
|
50692 |
+
uploadFiles(event, onClose);
|
50693 |
+
},
|
50694 |
+
accept: accept,
|
50695 |
+
multiple: multiple,
|
50696 |
+
render: _ref6 => {
|
50697 |
+
let {
|
50698 |
+
openFileDialog
|
50699 |
+
} = _ref6;
|
50700 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
50701 |
+
icon: library_upload,
|
50702 |
+
onClick: () => {
|
50703 |
+
openFileDialog();
|
50704 |
+
}
|
50705 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Upload'));
|
50706 |
+
}
|
50707 |
+
}))), onToggleFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
50708 |
+
icon: post_featured_image,
|
50709 |
+
onClick: onToggleFeaturedImage,
|
50710 |
+
isPressed: useFeaturedImage
|
50711 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Use featured image')), children), onSelectURL && // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
50712 |
+
(0,external_wp_element_namespaceObject.createElement)("form", {
|
50713 |
+
className: "block-editor-media-flow__url-input"
|
50714 |
+
}, (0,external_wp_element_namespaceObject.createElement)("span", {
|
50715 |
+
className: "block-editor-media-replace-flow__image-url-label"
|
50716 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Current media URL:')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
|
50717 |
+
text: mediaURL,
|
50718 |
+
position: "bottom"
|
50719 |
+
}, (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(link_control, {
|
50720 |
+
value: {
|
50721 |
+
url: mediaURL
|
50722 |
+
},
|
50723 |
+
settings: [],
|
50724 |
+
showSuggestions: false,
|
50725 |
+
onChange: _ref7 => {
|
50726 |
+
let {
|
50727 |
+
url
|
50728 |
+
} = _ref7;
|
50729 |
+
onSelectURL(url);
|
50730 |
+
editMediaButtonRef.current.focus();
|
50731 |
+
}
|
50732 |
+
})))));
|
50733 |
+
}
|
50734 |
+
});
|
50735 |
+
};
|
50736 |
+
/**
|
50737 |
+
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-replace-flow/README.md
|
50738 |
+
*/
|
50739 |
+
|
50740 |
+
|
50741 |
+
/* harmony default export */ const media_replace_flow = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withDispatch)(dispatch => {
|
50742 |
+
const {
|
50743 |
+
createNotice,
|
50744 |
+
removeNotice
|
50745 |
+
} = dispatch(external_wp_notices_namespaceObject.store);
|
50746 |
+
return {
|
50747 |
+
createNotice,
|
50748 |
+
removeNotice
|
50749 |
+
};
|
50750 |
+
}), (0,external_wp_components_namespaceObject.withFilters)('editor.MediaReplaceFlow')])(MediaReplaceFlow));
|
50751 |
+
|
50752 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/url-popover/link-viewer-url.js
|
50753 |
+
|
50754 |
+
|
50755 |
+
/**
|
50756 |
+
* External dependencies
|
50757 |
+
*/
|
50758 |
+
|
50759 |
+
/**
|
50760 |
+
* WordPress dependencies
|
50761 |
+
*/
|
50762 |
+
|
50763 |
+
|
50764 |
+
|
50765 |
+
function LinkViewerURL(_ref) {
|
50766 |
+
let {
|
50767 |
+
url,
|
50768 |
+
urlLabel,
|
50769 |
+
className
|
50770 |
+
} = _ref;
|
50771 |
+
const linkClassName = classnames_default()(className, 'block-editor-url-popover__link-viewer-url');
|
50772 |
+
|
50773 |
+
if (!url) {
|
50774 |
+
return (0,external_wp_element_namespaceObject.createElement)("span", {
|
50775 |
+
className: linkClassName
|
50776 |
+
});
|
50777 |
+
}
|
50778 |
+
|
50779 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
|
50780 |
+
className: linkClassName,
|
50781 |
+
href: url
|
50782 |
+
}, urlLabel || (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(url)));
|
50783 |
+
}
|
50784 |
+
|
50785 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/url-popover/link-viewer.js
|
50786 |
+
|
50787 |
+
|
50788 |
+
|
50789 |
+
/**
|
50790 |
+
* External dependencies
|
50791 |
+
*/
|
50792 |
+
|
50793 |
+
/**
|
50794 |
+
* WordPress dependencies
|
50795 |
+
*/
|
50796 |
+
|
50797 |
+
|
50798 |
+
|
50799 |
+
|
50800 |
+
/**
|
50801 |
+
* Internal dependencies
|
50802 |
+
*/
|
50803 |
+
|
50804 |
+
|
50805 |
function LinkViewer(_ref) {
|
50806 |
let {
|
50807 |
className,
|
50876 |
|
50877 |
|
50878 |
|
50879 |
+
|
50880 |
/**
|
50881 |
* Internal dependencies
|
50882 |
*/
|
50883 |
|
50884 |
|
50885 |
|
50886 |
+
const DEFAULT_PLACEMENT = 'bottom';
|
50887 |
|
50888 |
function URLPopover(_ref) {
|
50889 |
let {
|
50890 |
additionalControls,
|
50891 |
children,
|
50892 |
renderSettings,
|
50893 |
+
// The DEFAULT_PLACEMENT value is assigned inside the function's body
|
50894 |
+
placement,
|
50895 |
focusOnMount = 'firstElement',
|
50896 |
+
// Deprecated
|
50897 |
+
position,
|
50898 |
+
// Rest
|
50899 |
...popoverProps
|
50900 |
} = _ref;
|
50901 |
+
|
50902 |
+
if (position !== undefined) {
|
50903 |
+
external_wp_deprecated_default()('`position` prop in wp.blockEditor.URLPopover', {
|
50904 |
+
since: '6.2',
|
50905 |
+
alternative: '`placement` prop'
|
50906 |
+
});
|
50907 |
+
} // Compute popover's placement:
|
50908 |
+
// - give priority to `placement` prop, if defined
|
50909 |
+
// - otherwise, compute it from the legacy `position` prop (if defined)
|
50910 |
+
// - finally, fallback to the DEFAULT_PLACEMENT.
|
50911 |
+
|
50912 |
+
|
50913 |
+
let computedPlacement;
|
50914 |
+
|
50915 |
+
if (placement !== undefined) {
|
50916 |
+
computedPlacement = placement;
|
50917 |
+
} else if (position !== undefined) {
|
50918 |
+
computedPlacement = (0,external_wp_components_namespaceObject.__experimentalPopoverPositionToPlacement)(position);
|
50919 |
+
}
|
50920 |
+
|
50921 |
+
computedPlacement = computedPlacement || DEFAULT_PLACEMENT;
|
50922 |
const [isSettingsExpanded, setIsSettingsExpanded] = (0,external_wp_element_namespaceObject.useState)(false);
|
50923 |
const showSettings = !!renderSettings && isSettingsExpanded;
|
50924 |
|
50929 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
|
50930 |
className: "block-editor-url-popover",
|
50931 |
focusOnMount: focusOnMount,
|
50932 |
+
placement: computedPlacement,
|
50933 |
shift: true
|
50934 |
}, popoverProps), (0,external_wp_element_namespaceObject.createElement)("div", {
|
50935 |
className: "block-editor-url-popover__input-container"
|
55741 |
|
55742 |
|
55743 |
|
55744 |
+
|
55745 |
|
55746 |
|
55747 |
|
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' => 'dd9427bef6f2100b9af7');
|
build/block-editor/index.min.js
CHANGED
@@ -1,114 +1,123 @@
|
|
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:()=>P_,AlignmentToolbar:()=>L_,Autocomplete:()=>U_,BlockAlignmentControl:()=>Ll,BlockAlignmentToolbar:()=>Rl,BlockBreadcrumb:()=>Y_,BlockColorsStyleSelector:()=>J_,BlockContextProvider:()=>Kl,BlockControls:()=>ko,BlockEdit:()=>Ql,BlockEditorKeyboardShortcuts:()=>JC,BlockEditorProvider:()=>Fu,BlockFormatControls:()=>_o,BlockIcon:()=>Ru,BlockInspector:()=>jC,BlockList:()=>mf,BlockMover:()=>dg,BlockNavigationDropdown:()=>kk,BlockPreview:()=>vp,BlockSelectionClearer:()=>Gu,BlockSettingsMenu:()=>Ch,BlockSettingsMenuControls:()=>bh,BlockStyles:()=>Sk,BlockTitle:()=>tg,BlockToolbar:()=>Ph,BlockTools:()=>YC,BlockVerticalAlignmentControl:()=>Yr,BlockVerticalAlignmentToolbar:()=>Zr,ButtonBlockAppender:()=>Hm,ButtonBlockerAppender:()=>Vm,ColorPalette:()=>Hk,ColorPaletteControl:()=>Gk,ContrastChecker:()=>av,CopyHandler:()=>Xg,DefaultBlockAppender:()=>zm,FontSizePicker:()=>qv,InnerBlocks:()=>af,Inserter:()=>Dm,InspectorAdvancedControls:()=>hr,InspectorControls:()=>fr,JustifyContentControl:()=>Jr,JustifyToolbar:()=>el,LineHeightControl:()=>Mv,MediaPlaceholder:()=>LE,MediaReplaceFlow:()=>IE,MediaUpload:()=>CE,MediaUploadCheck:()=>SE,MultiSelectScrollIntoView:()=>eS,NavigableToolbar:()=>gg,ObserveTyping:()=>rS,PanelColorSettings:()=>RE,PlainText:()=>gC,RichText:()=>dC,RichTextShortcut:()=>vC,RichTextToolbarButton:()=>bC,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>OC,ToolSelector:()=>yC,Typewriter:()=>aS,URLInput:()=>Gy,URLInputButton:()=>wC,URLPopover:()=>ME,Warning:()=>Jl,WritingFlow:()=>nd,__experimentalBlockAlignmentMatrixControl:()=>K_,__experimentalBlockFullHeightAligmentControl:()=>$_,__experimentalBlockPatternSetup:()=>Ok,__experimentalBlockPatternsList:()=>Vp,__experimentalBlockVariationPicker:()=>Bk,__experimentalBlockVariationTransforms:()=>Fk,__experimentalBorderRadiusControl:()=>If,__experimentalColorGradientControl:()=>ov,__experimentalColorGradientSettingsDropdown:()=>sv,__experimentalDateFormatPicker:()=>$k,__experimentalDuotoneControl:()=>$b,__experimentalFontAppearanceControl:()=>Tv,__experimentalFontFamilyControl:()=>Vv,__experimentalGetBorderClassesAndStyles:()=>a_,__experimentalGetColorClassesAndStyles:()=>u_,__experimentalGetElementClassName:()=>fS,__experimentalGetGapCSSValue:()=>Vr,__experimentalGetGradientClass:()=>jf,__experimentalGetGradientObjectByGradientValue:()=>qf,__experimentalGetMatchingVariation:()=>bS,__experimentalGetSpacingClassesAndStyles:()=>m_,__experimentalImageEditingProvider:()=>yy,__experimentalImageEditor:()=>Ny,__experimentalImageSizeControl:()=>Ry,__experimentalImageURLInputUI:()=>LC,__experimentalInspectorPopoverHeader:()=>mS,__experimentalLayoutStyle:()=>El,__experimentalLetterSpacingControl:()=>Bb,__experimentalLibrary:()=>QC,__experimentalLinkControl:()=>_E,__experimentalLinkControlSearchInput:()=>uE,__experimentalLinkControlSearchItem:()=>Qy,__experimentalLinkControlSearchResults:()=>oE,__experimentalListView:()=>bk,__experimentalPanelColorGradientSettings:()=>Qk,__experimentalPreviewOptions:()=>RC,__experimentalPublishDateTimePicker:()=>gS,__experimentalRecursionProvider:()=>uS,__experimentalResponsiveBlockControl:()=>fC,__experimentalSpacingSizesControl:()=>rr,__experimentalTextDecorationControl:()=>gb,__experimentalTextTransformControl:()=>Eb,__experimentalUnitControl:()=>EC,__experimentalUseBlockOverlayActive:()=>Eu,__experimentalUseBlockPreview:()=>bp,__experimentalUseBorderProps:()=>c_,__experimentalUseColorProps:()=>p_,__experimentalUseCustomSides:()=>Or,__experimentalUseGradient:()=>Zf,__experimentalUseHasRecursion:()=>dS,__experimentalUseMultipleOriginColorsAndGradients:()=>Lf,__experimentalUseResizeCanvas:()=>AC,__experimentaluseLayoutClasses:()=>Jb,__experimentaluseLayoutStyles:()=>e_,__unstableBlockNameContext:()=>Nh,__unstableBlockSettingsMenuFirstItem:()=>lh,__unstableBlockToolbarLastItem:()=>jg,__unstableDuotoneFilter:()=>dp,__unstableDuotoneStylesheet:()=>cp,__unstableDuotoneUnsetStylesheet:()=>up,__unstableEditorStyles:()=>sp,__unstableGetValuesFromColors:()=>ap,__unstableIframe:()=>ld,__unstableInserterMenuExtension:()=>Bm,__unstablePresetDuotoneFilter:()=>pp,__unstableRichTextInputEvent:()=>_C,__unstableUseBlockSelectionClearer:()=>Hu,__unstableUseClipboardHandler:()=>Qg,__unstableUseMouseMoveTypingReset:()=>nS,__unstableUseTypewriter:()=>sS,__unstableUseTypingObserver:()=>oS,createCustomColorsHOC:()=>y_,getColorClassName:()=>Nf,getColorObjectByAttributeValues:()=>Tf,getColorObjectByColorValue:()=>Mf,getComputedFluidTypographyValue:()=>tb,getFontSize:()=>$v,getFontSizeClass:()=>Kv,getFontSizeObjectByValue:()=>jv,getGradientSlugByValue:()=>Yf,getGradientValueBySlug:()=>Kf,getPxFromCssUnit:()=>xS,getTypographyClassesAndStyles:()=>g_,store:()=>co,storeConfig:()=>ao,transformStyles:()=>rp,useBlockDisplayInformation:()=>Jm,useBlockEditContext:()=>go,useBlockProps:()=>Cu,useCachedTruthy:()=>h_,useInnerBlocksProps:()=>sf,useSetting:()=>qo,withColorContext:()=>Vk,withColors:()=>E_,withFontSizes:()=>w_});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Vt,__experimentalGetAllowedBlocks:()=>_t,__experimentalGetAllowedPatterns:()=>Ct,__experimentalGetBlockListSettingsForBlocks:()=>Tt,__experimentalGetDirectInsertBlock:()=>kt,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Pt,__experimentalGetParsedPattern:()=>yt,__experimentalGetPatternTransformItems:()=>wt,__experimentalGetPatternsByBlockTypes:()=>St,__experimentalGetReusableBlockTitle:()=>Mt,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Z,__unstableGetContentLockingParent:()=>Wt,__unstableGetEditorMode:()=>At,__unstableGetSelectedBlocksWithPartialSelection:()=>Re,__unstableGetTemporarilyEditingAsBlocks:()=>$t,__unstableGetVisibleBlocks:()=>Ut,__unstableHasActiveBlockOverlayActive:()=>jt,__unstableIsFullySelected:()=>Me,__unstableIsLastBlockChangeIgnored:()=>Nt,__unstableIsSelectionCollapsed:()=>Ne,__unstableIsSelectionMergeable:()=>Le,__unstableIsWithinBlockOverlay:()=>Kt,__unstableSelectionHasUnmergeableBlock:()=>Pe,areInnerBlocksControlled:()=>Ft,canEditBlock:()=>ct,canInsertBlockType:()=>ot,canInsertBlocks:()=>rt,canLockBlockType:()=>ut,canMoveBlock:()=>st,canMoveBlocks:()=>at,canRemoveBlock:()=>lt,canRemoveBlocks:()=>it,didAutomaticChange:()=>Dt,getAdjacentBlockClientId:()=>fe,getBlock:()=>j,getBlockAttributes:()=>$,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>Oe,getBlockInsertionPoint:()=>Ze,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:()=>Q,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:()=>Ot,hasInserterItems:()=>bt,hasMultiSelection:()=>Ve,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>ze,isAncestorBeingDragged:()=>qe,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>Ke,isBlockHighlighted:()=>zt,isBlockInsertionPointVisible:()=>Qe,isBlockMultiSelected:()=>Be,isBlockSelected:()=>De,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:()=>Mn,__unstableMarkAutomaticChange:()=>Yn,__unstableMarkLastChangeAsPersistent:()=>Kn,__unstableMarkNextChangeAsNotPersistent:()=>qn,__unstableSaveReusableBlock:()=>jn,__unstableSetEditorMode:()=>Qn,__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:()=>Nn,moveBlockToPosition:()=>yn,moveBlocksDown:()=>vn,moveBlocksToPosition:()=>kn,moveBlocksUp:()=>bn,multiSelect:()=>un,receiveBlocks:()=>tn,removeBlock:()=>Ln,removeBlocks:()=>Pn,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:()=>Zn,setTemplateValidity:()=>Bn,showInsertionPoint:()=>Sn,startDraggingBlocks:()=>zn,startMultiSelect:()=>an,startTyping:()=>On,stopDraggingBlocks:()=>Fn,stopMultiSelect:()=>cn,stopTyping:()=>Dn,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),...Array.isArray(t)?t:[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 M(){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 N=(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:M(r.selectionStart,l),selectionEnd:M(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 P={};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(P)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(P,l)),s.get(P)}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 O=window.wp.primitives,D=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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:Z(e,t)})),(e=>[e.blocks.order])),Z=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])),Q=A(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Ae(e))t.push(n,...Q(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)(Array.isArray(t)?t:[t],(t=>j(e,t)))),((e,t)=>(0,p.map)(Array.isArray(t)?t:[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(!t.clientId||!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 Me(e){const t=oe(e),n=re(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ne(e){const t=oe(e),n=re(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Pe(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 Oe(e,t){return Ae(e,de(e,t)).indexOf(t)}function De(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 Ae(e,t).some((t=>De(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){return!!$e(e)&&pe(e,t).some((t=>Ke(e,t)))}function Ye(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Ze(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=Oe(e,r.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Qe(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),p=n.parent,m=U(e,o),g=tt(p,m);let h=!0;const f=n.ancestor;f&&(h=[o,...pe(e,o)].some((t=>tt(f,U(e,t)))));const v=h&&(null===d&&null===g||!0===d||!0===g);return v?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",v,n,o,{getBlock:j.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):v},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=te(e,X(e)).some((e=>{let{name:n}=e;return n===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=D;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=Array.isArray(t)?t:[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,r.getBlockTypes)().some((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])),Mt=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 Nt(e){return e.blocks.isIgnoredChange}function Pt(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 Ot(e){return e.hasBlockMovingClientId}function Dt(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))&&!De(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 Zt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Yt)}))}const Qt=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:Qt(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=Qt(e),t=mn(Qt(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:Qt(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(Qt(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,M=v.name===_.name?[T]:(0,r.switchToBlockType)(T,g.name);if(!M||!M.length)return;let N;if(e){const e=M.pop();N=g.merge(e.attributes,x.attributes)}else{const e=M.shift();N=g.merge(I.attributes,e.attributes)}const P=Zt(N),L=N[P],R=(0,z.create)({html:L,...H(g.attributes[P])}),A=R.text.indexOf(Yt),O=(0,z.remove)(R,A,A+1),D=(0,z.toHTMLString)({value:O,...H(g.attributes[P])});N[P]=D;const F=o.getSelectedBlockClientIds(),V=[...e?M:[],{...m,attributes:{...m.attributes,...N}},...e?[]:M];n.batch((()=>{l.selectionChange(m.clientId,P,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())},Mn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},Nn=(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=Zt(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)},Pn=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=Qt(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 Pn([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 On(){return{type:"START_TYPING"}}function Dn(){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"})}))},Zn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},Qn=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=Qt(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:N,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)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),Eo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),Co=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),So=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),wo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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)),
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
-
o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n)),o}const
|
8 |
-
(0,h.sprintf)((0,h.__)("Custom (%s)"),a),slug:"custom",size:a}],B=
|
9 |
-
(0,h.__)("%1$s %2$s"),zo[u],null==f?void 0:f.toLowerCase()),O=y&&!C&&void 0!==P;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"},zo[u]),O&&(0,s.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},P)),"all"===u&&O&&(0,s.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},P),!E&&(0,s.createElement)(m.Button,{label:C?(0,h.__)("Use size preset"):(0,h.__)("Set custom size"),icon:Wo,onClick:()=>{S(!C)},isPressed:C,isSmall:!0,className:c()({"components-spacing-sizes-control__custom-toggle-all":"all"===u,"components-spacing-sizes-control__custom-toggle-single":"all"!==u}),iconSize:24}),C&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.__experimentalUnitControl,{onMouseOver:b,onMouseOut:_,onChange:e=>p((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:B,units:w,min:v,placeholder:N,disableUnits:g,label:A,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,s.createElement)(m.RangeControl,{onMouseOver:b,onMouseOut:_,value:T,min:0,max:null!==(t=null===(n=Yo[I])||void 0===n?void 0:n.max)&&void 0!==t?t:10,step:null!==(o=null===(r=Yo[I])||void 0===r?void 0:r.steps)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{p([e,I].join(""))},className:"components-spacing-sizes-control__custom-value-range"})),y&&!C&&(0,s.createElement)(m.RangeControl,{onMouseOver:b,onMouseOut:_,className:"components-spacing-sizes-control__range-control",value:B,onChange:e=>p(M(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":B,"aria-valuetext":null===(l=i[B])||void 0===l?void 0:l.name,renderTooltipContent:x,min:0,max:i.length-1,marks:R,label:A,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),!y&&!C&&(0,s.createElement)(m.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:L.find((e=>e.key===B))||"",onChange:e=>{p(M(e.selectedItem.key,"selectList"))},options:L,label:A,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:b,onMouseOut:_}))}function Qo(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:c}=e;const u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ho(Object.values(e))}(n),d=Uo(n)&&Go(n,o);return(0,s.createElement)(Zo,{value:u,onChange:e=>{const r=(0,m.__experimentalApplyValueToSides)(n,e,o);t(r)},side:"all",spacingSizes:r,isMixed:d,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:c})}function Xo(e){let{values:t,sides:n,onChange:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:c}=e;const u=null!=n&&n.length?Vo.filter((e=>n.includes(e))):Vo,d=e=>n=>{const r={...t};r[e]=n,o(r)};return(0,s.createElement)(s.Fragment,null,u.map((e=>(0,s.createElement)(Zo,{value:t[e],label:zo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:d(e),spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:c}))))}const Jo=["vertical","horizontal"];function er(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:c}=e;const u=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)},d=null!=o&&o.length?Jo.filter((e=>o.includes(e))):Jo;return(0,s.createElement)(s.Fragment,null,d.map((e=>{const t="vertical"===e?n.top:n.left;return(0,s.createElement)(Zo,{value:t,onChange:u(e),label:zo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:c})})))}const tr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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,onMouseOver:p,onMouseOut:g}=e;const f=[{name:0,slug:"0",size:0},...qo("spacing.spacingSizes")||[]];f.length>8&&f.unshift({name:(0,h.__)("Default"),slug:"default",size:void 0});const v=r||Fo,b=Uo(r),_=1===(null==l?void 0:l.length),[k,y]=(0,s.useState)(!b||!Go(v,l)||_),E={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:k,sides:l,values:v,spacingSizes:f,useSelect:u,type:o,minimumCustomValue:d,onMouseOver:p,onMouseOut:g};return(0,s.createElement)("fieldset",{role:"region",className:c()("component-spacing-sizes-control",{"is-unlinked":!k})},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},o),!_&&(0,s.createElement)(or,{onClick:()=>{y(!k)},isLinked:k}),k&&(0,s.createElement)(Qo,i({"aria-label":o},E)),!k&&a&&(0,s.createElement)(er,E),!k&&!a&&(0,s.createElement)(Xo,E))}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,p.isEmpty)(e)?null:e;return(0,s.createElement)(m.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const sr=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,p.mapValues)(e,sr)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,p.isEmpty)(t)?void 0:t};function ar(e,t,n){return(0,p.setWith)(e?(0,p.clone)(e):{},t,n,p.clone)}function cr(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:ar(c.attributes,e,t)})}))})),c}function ur(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 dr(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:sr(r.style)},t[n]=r})),r(n,t,!0)}),[sr,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 pr(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 mr(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)(dr,{group:n,label:o},(0,s.createElement)(pr,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const gr=ir;gr.Slot=mr;const hr=e=>(0,s.createElement)(ir,i({},e,{__experimentalGroup:"advanced"}));hr.Slot=e=>(0,s.createElement)(mr,i({},e,{__experimentalGroup:"advanced"})),hr.slotName="InspectorAdvancedControls";const fr=gr,vr=window.wp.isShallowEqual;var br=n.n(vr);const _r=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])},kr=Number.MAX_SAFE_INTEGER,yr=(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,_r(p)]),[_,k]=(0,s.useReducer)((e=>(e+1)%kr),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),variant:"unstyled"}),a&&(0,s.createElement)("div",{style:y},r),!a&&r)}));function Er(e){const t=(0,r.getBlockSupport)(e,Mr);return!!(!0===t||null!=t&&t.margin)}function Cr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qo("spacing.margin"),n=!Dr(e,"margin");return!Er(e)||t||n}function Sr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:a}=e,c=qo("spacing.spacingSizes"),u=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["%","px","em","rem","vw"]}),d=Or(o,"margin"),p=d&&d.some((e=>Pr.includes(e)));if(Cr(e))return null;const g=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};l({style:sr(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!c||0===(null==c?void 0:c.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:g,label:(0,h.__)("Margin"),sides:d,units:u,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==c?void 0:c.length)>0&&(0,s.createElement)(rr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.margin,onChange:g,label:(0,h.__)("Margin"),sides:d,units:u,allowReset:!1,splitOnAxis:!1,onMouseOver:i,onMouseOut:a})),native:null})}function wr(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,a=(0,s.useMemo)((()=>{const e=null!=i&&i.top?Oo(null==i?void 0:i.top):0,t=null!=i&&i.right?Oo(null==i?void 0:i.right):0,n=null!=i&&i.bottom?Oo(null==i?void 0:i.bottom):0,o=null!=i&&i.left?Oo(null==i?void 0:i.left):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:e?`calc(${e} * -1)`:0,right:t?`calc(${t} * -1)`:0,bottom:n?`calc(${n} * -1)`:0,left:o?`calc(${o} * -1)`:0}}),[i]),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(i),p=(0,s.useRef)(),m=()=>{p.current&&window.clearTimeout(p.current)};return(0,s.useEffect)((()=>(br()(i,d.current)||l||(u(!0),d.current=i,m(),p.current=setTimeout((()=>{u(!1)}),400)),()=>m())),[i,l]),c||l?(0,s.createElement)(yr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,shift:!1},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function Br(e){const t=(0,r.getBlockSupport)(e,Mr);return!!(!0===t||null!=t&&t.padding)}function Ir(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qo("spacing.padding"),n=!Dr(e,"padding");return!Br(e)||t||n}function xr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:a}=e,c=qo("spacing.spacingSizes"),u=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["%","px","em","rem","vw"]}),d=Or(o,"padding"),p=d&&d.some((e=>Pr.includes(e)));if(Ir(e))return null;const g=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};l({style:sr(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!c||0===(null==c?void 0:c.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:g,label:(0,h.__)("Padding"),sides:d,units:u,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==c?void 0:c.length)>0&&(0,s.createElement)(rr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.padding,onChange:g,label:(0,h.__)("Padding"),sides:d,units:u,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a})),native:null})}function Tr(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,a=(0,s.useMemo)((()=>({borderTopWidth:null!=i&&i.top?Oo(null==i?void 0:i.top):0,borderRightWidth:null!=i&&i.right?Oo(null==i?void 0:i.right):0,borderBottomWidth:null!=i&&i.bottom?Oo(null==i?void 0:i.bottom):0,borderLeftWidth:null!=i&&i.left?Oo(null==i?void 0:i.left):0})),[i]),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(i),p=(0,s.useRef)(),m=()=>{p.current&&window.clearTimeout(p.current)};return(0,s.useEffect)((()=>(br()(i,d.current)||l||(u(!0),d.current=i,m(),p.current=setTimeout((()=>{u(!1)}),400)),()=>m())),[i,l]),c||l?(0,s.createElement)(yr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,shift:!1},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}const Mr="spacing",Nr=["top","right","bottom","left"],Pr=["vertical","horizontal"];function Lr(){const[e,t]=(0,s.useState)(!1);return{isMouseOver:e,onMouseOver:()=>t(!0),onMouseOut:()=>t(!1)}}function Rr(e){const t=Hr(e),n=Ir(e),o=Cr(e),l=Ar(e),a=(g=e.name,"web"===s.Platform.OS&&(zr(g)||Br(g)||Er(g))),u=qo("spacing.spacingSizes"),d=Lr(),p=Lr();var g;if(l||!a)return null;const f=(0,r.getBlockSupport)(e.name,[Mr,"__experimentalDefaultControls"]),v=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}},b=c()({"tools-panel-item-spacing":u&&u.length>0});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fr,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:b,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:sr({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:v("padding"),isShownByDefault:null==f?void 0:f.padding,panelId:e.clientId},(0,s.createElement)(xr,i({onMouseOver:d.onMouseOver,onMouseOut:d.onMouseOut},e))),!o&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:b,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:sr({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:v("margin"),isShownByDefault:null==f?void 0:f.margin,panelId:e.clientId},(0,s.createElement)(Sr,i({onMouseOver:p.onMouseOver,onMouseOut:p.onMouseOut},e))),!t&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:b,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:v("blockGap"),isShownByDefault:null==f?void 0:f.blockGap,panelId:e.clientId},(0,s.createElement)(Gr,e))),!n&&(0,s.createElement)(Tr,i({forceShow:d.isMouseOver},e)),!o&&(0,s.createElement)(wr,i({forceShow:p.isMouseOver},e)))}const Ar=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Hr(e),n=Ir(e),o=Cr(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 Dr(e,t){const n=Or(e,t);return!(n&&n.some((e=>Nr.includes(e)))&&n.some((e=>Pr.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,Mr);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=!qo("spacing.blockGap");return!zr(e)||t}function Gr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=qo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["%","px","em","rem","vw"]}),c=Or(r,"blockGap"),u=Lo(n);if(Hr(e))return null;const d=c&&c.some((e=>Pr.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:sr(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"})),$r={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")}},jr=["top","center","bottom"],Kr={variant:"toolbar"},qr=function(e){let{value:t,onChange:n,controls:o=jr,isCollapsed:r=!0,isToolbar:l}=e;const a=$r[t],c=$r.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{...$r[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})),Zr=e=>(0,s.createElement)(qr,i({},e,{isToolbar:!0})),Qr={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?Qr[r]:Qr.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&&!ur(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",variant:"toolbar"}});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="";ur(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)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),ml=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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:qo("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,{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="";ur(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!==qo("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,d.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)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Il=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),xl=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),Tl=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),Ml={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")}},Nl={variant:"toolbar"},Pl=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=Ml[t],p=Ml.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{...Ml[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{toggleProps:{describedBy:(0,h.__)("Change alignment")},popoverProps:Nl,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}=Ml[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)(Pl,i({},e,{isToolbar:!1})),Rl=e=>(0,s.createElement)(Pl,i({},e,{isToolbar:!0})),Al=["left","center","right","wide","full"],Ol=["wide","full"];function Dl(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?t.filter((e=>!Ol.includes(e))):t}const zl=(0,u.createHigherOrderComponent)((e=>t=>{const n=(0,s.createElement)(e,t),{name:o}=t,l=wl(Dl((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)(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,u.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=wl(Dl((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 Dl((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,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(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)(fr,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(fr,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,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)(fr,{__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 $l=window.wp.dom,jl=(0,s.createContext)({});function Kl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(jl),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(jl.Provider,{value:r,children:n})}const ql=jl,Yl={},Zl=(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,p.pick)(l,o.usesContext):Yl),[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 Ql(e){const{name:t,isSelected:n,clientId:o,__unstableLayoutClassNames:r}=e,l={name:t,isSelected:n,clientId:o,__unstableLayoutClassNames:r};return(0,s.createElement)(mo,{value:(0,s.useMemo)((()=>l),Object.values(l))},(0,s.createElement)(Zl,e))}const Xl=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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,$l.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=(u=l(t),(Array.isArray(u)?u:[u]).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var u;const d=(p=t.originalContent,m=a,(0,ei.Kx)(p,m).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 p,m;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:d,renderedContent:a}))},oi=e=>(0,r.rawHandler)({HTML:e.originalContent}),ri=(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,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,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)(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),Mi=n.n(Ti);function Ni(){}const Pi={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(Pi.arr(e)){if(!Pi.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(Pi.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=>Pi.und(e)?[]:Pi.arr(e)?e:[e];function Di(e,t){if(e.size){const n=Array.from(e);e.clear(),Ri(n,t)}}const zi=(e,...t)=>Di(e,(e=>e(...t))),Fi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Vi,Hi,Gi=null,Ui=!1,Wi=Ni;var $i=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 ji=new Set;let Ki=[],qi=[],Yi=0;const Zi={get idle(){return!ji.size&&!Ki.length},start(e){Yi>e.priority?(ji.add(e),pi.onStart(Qi)):(Xi(e),pi(es))},advance:es,sort(e){if(Yi)pi.onFrame((()=>Zi.sort(e)));else{const t=Ki.indexOf(e);~t&&(Ki.splice(t,1),Ji(e))}},clear(){Ki=[],ji.clear()}};function Qi(){ji.forEach(Xi),ji.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(Pi.fun(e))return e;if(Pi.arr(e))return _s({range:e,output:t,extrapolate:n});if(Pi.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)=>Ns(e,ys,t);function Ts(e,t){if(e[ys]){let n=e[Es];n||Ns(e,Es,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Ms(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 Ns=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ps=/[+\-]?(?: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(`(${Ps.source})(%|[a-z]+)`,"i"),As=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Os=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Ds=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&&Os.test(n)?Ds(n):n||e},zs=e=>{const t=Os.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(Os,Ds).replace(Ls,bs).replace(Fs,bs))),n=t.map((e=>e.match(Ps).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(Ps,""));let l=0;return t[0].replace(Ps,(()=>`${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),$s=Us(console.warn);function js(e){return Pi.str(e)&&("#"==e[0]||/\d/.test(e)||!Fi()&&Os.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,Zs),Zs=[];function Qs(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,Pi.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 Pi.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,Pi.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(Pi.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(js(e)?ra:oa).create(e)}function ca(e){const t=Js(e);return t?t.constructor:Pi.arr(e)?sa:js(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=!Pi.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&&(Pi.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=>Ms(e,p.current))),pi.cancel(p.current.update))}))),(0,Ti.useEffect)(u,[]),Ys((()=>()=>{const e=p.current;Ri(e.deps,(t=>Ms(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=>Pi.str(e)?e:e&&Pi.str(e.displayName)?e.displayName:Pi.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 Pi.fun(e)?e(...t):e}const va=(e,t)=>!0===e||!!(t&&e&&(Pi.fun(e)?e(t):Oi(e).includes(t))),ba=(e,t)=>Pi.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);Pi.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),Pi.arr(e)?e.map(wa):js(e)?$i.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 Pi.fun(e)||Pi.arr(e)&&Pi.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 Ma=1.70158,Na=1.525*Ma,Pa=Ma+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},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=>Pa*e*e*e-Ma*e*e,easeOutBack:e=>1+Pa*Math.pow(e-1,3)+Ma*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-Na)/2:(Math.pow(2*e-2,2)*((Na+1)*(2*e-2)+Na)+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},Da=ha({},{tension:170,friction:26},{mass:1,damping:1,easing:Oa.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,Da)}}function Fa(e,t){if(Pi.und(t.decay)){const n=!Pi.und(t.tension)||!Pi.und(t.friction);!n&&Pi.und(t.frequency)&&Pi.und(t.damping)&&Pi.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{Pi.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&&!$i.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))?ja(e.get()):t.every((e=>e.noop))?Wa(e.get()):$a(e.get(),t.every((e=>e.finished))),Wa=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),$a=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ja=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)&&ja(o)||r!==n.asyncId&&$a(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new Ya,i=new Za;return(async()=>{if($i.skipAnimation)throw qa(n),i.result=$a(o,!1),d(i),i;m(l);const s=Pi.obj(e)?ha({},e):ha({},t,{to:e});s.parentId=r,Ai(c,((e,t)=>{Pi.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($i.skipAnimation)return qa(n),$a(o,!1);try{let t;t=Pi.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=$a(o.get(),!0,!1)}catch(e){if(e instanceof Ya)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 Pi.fun(i)&&pi.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function qa(e,t){Di(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 Za extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Qa=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 $i.to(this,e)}interpolate(...e){return Ws(`${Gs}The "interpolate" function is deprecated in v9 (use "to" instead)`),$i.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||Zi.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,!Pi.und(e)||!Pi.und(t)){const n=Pi.obj(e)?ha({},e):ha({},t,{from:e});Pi.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=Oi(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=Pi.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(Pi.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=!Pi.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 Pi.und(e)?(n=this.queue||[],this.queue=[]):n=[Pi.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=Pi.obj(n)?n[t]:n,(null==n||Ia(n))&&(n=void 0),o=Pi.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),Pi.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",$a(this,sc(this,this.animation.to)),this))},resume:()=>{oc(this)&&(lc(this,!1),nc(this)&&this._resume(),zi(i.resumeQueue),gc(this,"onResume",$a(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(ja(this));const o=!Pi.und(e.to),r=!Pi.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(ja(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&&!Pi.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 Da)null==e[t]&&(e[t]=Da[t]);let{mass:o,frequency:r,damping:l}=e;Pi.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||Pi.und(u))return n($a(this,!0));const _=Pi.und(t.reset)?r&&!t.default:!Pi.und(d)&&va(t.reset,l),k=_?d:this.get(),y=wa(u),E=Pi.num(y)||Pi.arr(y)||js(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]:Oi(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=$a(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),Qa(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Cs(e)&&Ms(e,this)}_set(e,t=!0){const n=Ss(e);if(!Pi.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",$a(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(){$i.skipAnimation?this.finish():Zi.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?ja(this.get()):$a(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 Pi.obj(t)&&dc(t,o),Pi.obj(n)&&dc(n,o),e.keys=o.size?Array.from(o):null,e}function uc(e){const t=cc(e);return Pi.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];Pi.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=Oi(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(Oi(t),(t=>n[t].stop(!!e)))}else qa(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Pi.und(e))this.start({pause:!0});else{const t=this.springs;Ri(Oi(e),(e=>t[e].pause()))}return this}resume(e){if(Pi.und(e))this.start({pause:!1});else{const t=this.springs;Ri(Oi(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,Di(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&&Di(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Di(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=Pi.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Pi.arr(r)||Pi.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(Pi.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:Ni,resume:Ni,start(t,n){m?(qa(d,e._lastAsyncId),n(ja(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(Oi(t),(e=>{Pi.und(e.keys)&&(e=cc(e)),Pi.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 Mc=()=>{const e=[],t=function(t){$s(`${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(Pi.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(Pi.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 Pi.fun(e)?e(n,t):e};return t._getProps=n,t};function Nc(e,t,n){const o=Pi.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ti.useMemo)((()=>o||3==arguments.length?Mc():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=Qs(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=Qs(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 Pc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Pc||(Pc={}));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)&&Oc(this)}_get(){const e=Pi.arr(this.source)?this.source.map(Ss):Oi(Ss(this.source));return this.calc(...e)}_start(){this.idle&&!Ac(this._active)&&(this.idle=!1,Ri(ta(this),(e=>{e.done=!1})),$i.skipAnimation?(pi.batchedUpdates((()=>this.advance())),Oc(this)):Zi.start(this))}_attach(){let e=1;Ri(Oi(this.source),(t=>{Cs(t)&&Ts(t,this),Qa(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Ri(Oi(this.source),(e=>{Cs(e)&&Ms(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,(Qa(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 Oc(e){e.idle||(e.idle=!0,Ri(ta(e),(e=>{e.done=!0})),Bs(e,{type:"idle",parent:e}))}$i.assign({createStringInterpolator:Hs,to:(e,t)=>new Lc(e,t)}),Zi.advance;const Dc=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 $c=["x","y","z"],jc=/^(matrix|translate|scale|rotate|skew)/,Kc=/^(translate)/,qc=/^(rotate|skew)/,Yc=(e,t)=>Pi.num(e)&&0!==e?e+t:e,Zc=(e,t)=>Pi.arr(e)?e.every((e=>Zc(e,t))):Pi.num(e)?e===t:parseFloat(e)===t;class Qc extends ia{constructor(e){let{x:t,y:n,z:o}=e,r=zc(e,$c);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(",")})`,Zc(e,0)]))),Ai(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(jc.test(t)){if(delete r[t],Pi.und(e))return;const n=Kc.test(t)?"px":qc.test(t)?"deg":"";l.push(Oi(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Yc(r,n)})`,Zc(r,0)]:e=>[`${t}(${e.map((e=>Yc(e,n))).join(",")})`,Zc(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](Pi.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)&&Ms(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Bs(this,e)}}const Jc=["scrollTop","scrollLeft"];$i.assign({batchedUpdates:Dc.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=Pi.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)=>{Pi.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 Qc(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,u.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(nu,0),[d,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,$l.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=Pi.fun(e),[[o],r]=Nc(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},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,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(au(t.current,l.activeElement))return;const i=$l.focus.tabbable.find(t.current).filter((e=>(0,$l.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=$l.focus.tabbable.findNext(t.current);if(e&&au(t.current,e)&&(0,$l.isFormElement)(e))return void e.focus()}(0,$l.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,d.useSelect)((e=>{const{getSettings:t}=e(co);return t().outlineMode}),[]);return(0,u.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,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 gu(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 hu(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 fu(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 vu(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):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,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!==bu.ENTER&&s!==bu.BACKSPACE&&s!==bu.DELETE||a!==i||(0,$l.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,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 yu(){const e=(0,s.useContext)(uf);return(0,u.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Eu(e){return(0,d.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: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=Eu(n),y=(0,h.sprintf)((0,h.__)("Block: %s"),f),E="html"!==p||t?"":"-visual",C=(0,u.useMergeRefs)([e.ref,uu(n),Po(n),vu(n),_u(n),ku(n),pu(),yu(),ru({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,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,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}})),Iu=(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)}}})),xu=(0,u.compose)(u.pure,Bu,Iu,(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,__unstableLayoutClassNames:g,name:h,isValid:f,attributes:v,wrapperProps:b,setAttributes:_,onReplace:k,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const{themeSupportsLayout:S,hasContentLockedParent:w,isContentBlock:B,isContentLocking:I,isTemporarilyEditingAsBlocks:x}=(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(h),hasContentLockedParent:i,isContentLocking:"contentOnly"===o(a)&&!i,isTemporarilyEditingAsBlocks:l()===a}}),[h,a]),{removeBlock:T}=(0,d.useDispatch)(co),M=(0,s.useCallback)((()=>T(a)),[a]);let N=(0,s.createElement)(Ql,{name:h,isSelected:u,attributes:v,setAttributes:_,insertBlocksAfter:l?void 0:y,onReplace:i?k:void 0,onRemove:i?M:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C,__unstableLayoutClassNames:g});const P=(0,r.getBlockType)(h);w&&!B&&(b={...b,tabIndex:-1}),null!=P&&P.getEditWrapperProps&&(b=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}(b,P.getEditWrapperProps(v)));const L=b&&!!b["data-align"]&&!S;let R;if(L&&(N=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},N)),f)R="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,b,N);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(P,v);R=(0,s.createElement)(wu,{className:"has-warning"},(0,s.createElement)(ri,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,$l.safeHTML)(e)))}const{"data-align":A,...O}=null!==(t=b)&&void 0!==t?t:{},D={clientId:a,className:c()({"is-content-locked":I,"is-content-locked-temporarily-editing-as-blocks":x,"is-content-block":w&&B},A&&S&&`align${A}`,m),wrapperProps:O,isAligned:L},z=(0,s.useMemo)((()=>D),Object.values(D));return(0,s.createElement)(Su.Provider,{value:z},(0,s.createElement)(ai,{fallback:(0,s.createElement)(wu,{className:"has-warning"},(0,s.createElement)(ii,null))},R))})),Tu=window.wp.htmlEntities,Mu=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),Nu=[(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.")],Pu=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Nu.length));return(0,s.createElement)(m.Tip,null,Nu[e])},Lu=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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)))},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"),Du=()=>{};function zu(e){let{clientId:t=null,value:n,selection:o,onChange:l=Du,onInput:i=Du}=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 Fu=Ou((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,d.useDispatch)(co);return(0,s.useEffect)((()=>{o(n)}),[n]),zu(e),(0,s.createElement)(No,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)("div",{inert:"true"},(0,s.createElement)(mf,null)))}function Hu(){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 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,d.useSelect)(Uu,[]);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 $u(e,t,n,o){let r,l=$l.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(!$l.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 ju(){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===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?$l.isVerticalEdge:$l.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,$l.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,$l.isRTL)(u)?!_:_,{keepCaretInsideBlock:x}=n();if(d)(function(e,t){const n=$u(e,t,i);return n&&cu(n)})(u,_)&&S(u,_)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,$l.isVerticalEdge)(u,_)||m&&!(0,$l.isHorizontalEdge)(u,I)||x){if(k&&B.getSelection().isCollapsed&&(0,$l.isHorizontalEdge)(u,I)&&!x){const e=$u(u,I,i);(0,$l.placeCaretAtHorizontalEdge)(e,_),a.preventDefault()}}else{const e=$u(u,_,i,!0);e&&((0,$l.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,d.useSelect)(co),{multiSelect:o,selectBlock:r}=(0,d.useDispatch)(co),l=(0,Ku.__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,$l.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 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;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 Qu(e,t){e.contentEditable=t,t&&e.focus()}function Xu(){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 Qu(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 Qu(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,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=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,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===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,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";$l.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===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,$l.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,$l.isFormElement)($l.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!==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=$l.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,ed(),Zu(),Xu(),Ju(),Wu(),qu(),ju(),(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 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,u.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:d,...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,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()}))}),[]),M=(0,u.useMergeRefs)([n,E,S]),N=(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(`.${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,"html{height:auto!important;}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:M,className:c()("block-editor-iframe__body",od,...b,{"is-zoomed-out":d}),style:d?{marginBottom:`-${.55*I-100}px`}:{}},B,(0,s.createElement)("div",{style:{display:"none"},ref:N}),(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}},Md=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 Nd({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),Nd(Id(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Nd(Id(this.rgba,-e))},e.prototype.grayscale=function(){return Nd(Id(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Nd(Td(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Nd(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?Nd({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?Nd({h:e,s:t.s,l:t.l,a:t.a}):ad(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Nd(e).toHex()},e}(),Nd=function(e){return e instanceof Md?e:new Md(e)},Pd=[],Ld=function(e){e.forEach((function(e){Pd.indexOf(e)<0&&(e(Md,wd),Pd.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)},Od=function(e){return.2126*Ad(e.r)+.7152*Ad(e.g)+.0722*Ad(e.b)};function Dd(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 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),$d=n.n(Wd);const jd=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){jd.call(this,e)}$d()(Yd,jd),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 Zd=Qd;function Qd(e){e=e||{},jd.call(this,e),this.indentation=e.indent}$d()(Qd,jd),Qd.prototype.compile=function(e){return this.stylesheet(e)},Qd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Qd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",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(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Qd.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}")},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(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Qd.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)+"}")},Qd.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")},Qd.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}")},Qd.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}")},Qd.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}")},Qd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Qd.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()+"}"):""},Qd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Qd.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 Zd(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,p.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,u.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=Nd(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=Nd(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,Dd]);const gp=2e3;function hp(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]);mp=mp||(0,u.pure)(mf);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,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: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,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)(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,d.useSelect)((e=>e(co).getSettings()),[]),c=(0,s.useMemo)((()=>({...a,__unstableIsPreviewMode:!0})),[a]),u=(0,s.useMemo)((()=>Array.isArray(t)?t:[t]),[t]);return t&&0!==t.length?(0,s.createElement)(Fu,{value:u,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,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]),p=(0,s.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),m=(0,s.createElement)(Fu,{value:p,settings:l},(0,s.createElement)(hf,{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?m: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)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Cp(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)(Ru,{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)(
|
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.",s),s);(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);
|
22 |
/* translators: %d: number of results. */
|
23 |
-
(0,h._n)("%d result found.","%d results found.",e),e);
|
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"),
|
31 |
-
(0,h.__)("%s block added"),a.title);(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:Mu}));return(g||p)&&(f=(0,s.createElement)(m.Tooltip,{text:n},f)),f},isAppender:!0})}const Vm=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Fm(e,t)))),Hm=(0,s.forwardRef)(Fm),Gm=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)(zm,{rootClientId:t}):(0,s.createElement)(Hm,{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)},Um=Number.MAX_SAFE_INTEGER;(0,s.createContext)();const Wm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const[u,p]=(0,s.useReducer)((e=>(e+1)%Um),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=_r(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",variant:"unstyled"}),(0,s.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null},$m={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}},jm=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)(yr,{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?$m.show:$m.hide,animate:$m.show,exit:r?$m.show:$m.exit,className:"block-editor-block-popover__drop-zone-foreground"}))},Km=(0,s.createContext)();function qm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,d.useDispatch)(co),l=(0,s.useContext)(Km),i=(0,s.useRef)(),{orientation:a,previousClientId:p,nextClientId:g,rootClientId:h,isInserterShown:f,isDistractionFree:v,isNavigationMode:b}=(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}}),[]),_="vertical"===a,k=(0,u.useReducedMotion)(),y={start:{..._?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:f?.5:0,type:"tween"}},hover:{..._?{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"}}},E={start:{scale:k?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(v&&!b)return null;const C=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(Wm,{previousClientId:p,nextClientId:g,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(m.__unstableMotion.div,{layout:!k,initial:k?"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()(C,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(m.__unstableMotion.div,{variants:y,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,s.createElement)(m.__unstableMotion.div,{variants:E,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Dm,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Ym(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)(jm,i({key:`${t.rootClientId}-${t.index}`},e)):(0,s.createElement)(qm,e):null}function Zm(){const e=(0,s.useContext)(Km),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 Qm="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Xm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Jm(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 eg(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=Jm(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 tg(e){let{clientId:t,maximumLength:n,context:o}=e;return eg({clientId:t,maximumLength:n,context:o})}const ng=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,$l.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)(Cp,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},og=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),rg=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),lg=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,h.isRTL)()?"left":"right":"down":null;const ig=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?Rp:Ap:og:"down"===e?"horizontal"===t?(0,h.isRTL)()?Ap:Rp:rg:null,sg=(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,ag=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const p=(0,u.useInstanceId)(ag),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:ig(o,C),label:sg(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=lg("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(
|
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(
|
39 |
-
(0,h.__)("Block %s is the only block, and cannot be moved"),t);if(
|
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(
|
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(
|
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(
|
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,
|
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"),
|
56 |
/* translators: %d: number of blocks. */
|
57 |
-
(0,h._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),
|
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
|
60 |
-
(0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",
|
61 |
-
(0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",
|
62 |
/* translators: %s: Name of the block. */
|
63 |
-
(0,h.__)("Lock %s"),
|
64 |
/* translators: %s: block name */
|
65 |
-
(0,h.__)("Remove %s"),I),M=1===p?T:(0,h.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=
|
66 |
/* translators: %s: Name of the block's parent. */
|
67 |
-
(0,h.__)("Select parent block (%s)"),
|
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)(Ph,{hideDragHandle:n}))},Rh={placement:"top-start"},Ah={...Rh,flip:!1,shift:!0},Oh={...Rh,flip:!0,shift:!1};function Dh(e,t,n){if(!e||!t)return Ah;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?Ah:Oh}function zh(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 Fh(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)(zh,[]),_=(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,Ku.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)((()=>Dh(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(Dh(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)(yr,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)(Lh,{focusOnMount:y.current,__experimentalInitialIndex:B.current,__experimentalOnIndexChange:e=>{B.current=e},key:t}),C&&(0,s.createElement)(pg,{clientId:t,rootClientId:n})):null}function Vh(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 Hh(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,d.useSelect)(Vh,[]);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)(Fh,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,showContents:!u||p,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Gh(e){let{children:t}=e;const n=(0,s.useContext)(Km),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)(Ym,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Hh,{__unstablePopoverSlot:"block-toolbar"}),t))}const Uh=(0,u.createHigherOrderComponent)((e=>t=>{const{clientId:n}=go();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Wh=Uh((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Hm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),$h=(0,u.compose)([Uh,(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)(zm,{rootClientId:t})})),jh=new WeakMap,Kh=new WeakMap;function qh(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 Yh(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 Zh(e,t,n){return e=>{const t=(0,r.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}function Qh(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=qh(e,t,i,a,k,_,h),E=Yh(e,0,r,g,l,_),C=Zh(0,0,_);return e=>{const t=(0,$l.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?E(t):y(e)}}function Xh(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 Jh(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=Xh(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function ef(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}function tf(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]=Jh(t,u,l);n&&ef(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 nf(){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=Qh(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]=tf(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 of(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=vl(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),br()(p,t)||(jh.get(u)||jh.set(u,[]),jh.get(u).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=jh.get(u))&&void 0!==e&&e.length&&u.batch((()=>{jh.get(u).forEach((e=>{c(...e)})),jh.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){Kh.has(t)||Kh.set(t,new WeakMap);const n=Kh.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)(Kl,{value:_},(0,s.createElement)(hf,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function rf(e){return zu(e),(0,s.createElement)(of,e)}const lf=(0,s.forwardRef)(((e,t)=>{const n=sf({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function sf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableLayoutClassNames:n}=t,{clientId:o,__unstableLayoutClassNames:l=""}=go(),a=(0,u.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:p,hasOverlay:m}=(0,d.useSelect)((e=>{if(!o)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:l,__unstableGetEditorMode:i}=e(co),s=t(o),c="navigation"===i()||a;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(s,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==s&&!n(o)&&!l(o,!0)&&c}}),[o,a]),g=(0,u.useMergeRefs)([e.ref,nf({rootClientId:o})]),h={__experimentalCaptureToolbars:p,...t},f=h.value&&h.onChange?rf:of;return{...e,ref:g,className:c()(e.className,"block-editor-block-list__layout",n?"":l,{"has-overlay":m}),children:o?(0,s.createElement)(f,i({},h,{clientId:o})):(0,s.createElement)(hf,t)}}sf.save=r.__unstableGetInnerBlocksProps,lf.DefaultBlockAppender=$h,lf.ButtonBlockAppender=Wh,lf.Content=()=>sf.save().children;const af=lf,cf=(0,s.createContext)(),uf=(0,s.createContext)(),df=new WeakMap;function pf(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={};df.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=>{df.get(m)||df.set(m,[]);for(const t of e){const e=t.target.getAttribute("data-block");df.get(m).push([e,t.isIntersecting])}h()}))}),[]),v=sf({ref:(0,u.useMergeRefs)([Hu(),Zm(),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)(cf.Provider,{value:o},(0,s.createElement)(uf.Provider,{value:f},(0,s.createElement)("div",v)))}function mf(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=Qm(r))};return n=Qm(r),()=>Xm(n)}),[e,t])}(),(0,s.createElement)(Gh,null,(0,s.createElement)(mo,{value:uo},(0,s.createElement)(pf,e)))}function gf(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=bl}=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)(kl,{value:l},i.map((e=>(0,s.createElement)(d.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)(Gm,{tagName:r,rootClientId:n,renderAppender:o}))}function hf(e){return(0,s.createElement)(d.AsyncModeProvider,{value:!1},(0,s.createElement)(gf,e))}function ff(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function vf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||ff(Object.values(n).filter(Boolean))||"px"}function bf(){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=ff(o),i=0===r||r?`${r}${l}`:void 0;return i}function _f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=bf(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function kf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function yf(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,a=bf(r);void 0===a&&(a=vf(n));const c=kf(r)&&_f(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,size:"__unstable-large"}))}mf.__unstableElementContext=cf;const Ef={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function Cf(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(Ef).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)}),size:"__unstable-large"}))));var g})))}function Sf(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 wf={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},Bf={px:100,em:20,rem:20};function If(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!kf(n)||!_f(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:qo("spacing.units")||["px","em","rem"]}),c=vf(l),u=a&&a.find((e=>e.value===c)),d=(null==u?void 0:u.step)||1,[p]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(bf(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)(yf,{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:Bf[c],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${c}`:void 0)},step:d,__nextHasNoMarginBottom:!0})):(0,s.createElement)(Cf,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||wf,units:a}),(0,s.createElement)(Sf,{onClick:()=>r(!o),isLinked:o})))}function xf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(If,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=sr({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}Ld([Rd,Dd]);const Tf=(e,t,n)=>{if(t){const n=(0,p.find)(e,{slug:t});if(n)return n}return{color:n}},Mf=(e,t)=>(0,p.find)(e,{color:t});function Nf(e,t){if(e&&t)return`has-${(0,p.kebabCase)(t)}-${e}`}function Pf(){return{disableCustomColors:!qo("color.custom"),disableCustomGradients:!qo("color.customGradient")}}function Lf(){const e=Pf(),t=qo("color.palette.custom"),n=qo("color.palette.theme"),o=qo("color.palette.default"),r=qo("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=qo("color.gradients.custom"),i=qo("color.gradients.theme"),a=qo("color.gradients.default"),c=qo("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 Rf="__experimentalBorder",Af=["top","right","bottom","left"],Of=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}}}},Df=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},zf=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Df(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return Df(t,"color",o)||{color:o}};function Ff(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Vf(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Lf(),a=Hf(e.name),c=qo("border.color")&&Hf(e.name,"color"),u=qo("border.radius")&&Hf(e.name,"radius"),d=qo("border.style")&&Hf(e.name,"style"),p=qo("border.width")&&Hf(e.name,"width");if([!c,!u,!d,!p].every(Boolean)||!a)return null;const g=(0,r.getBlockSupport)(e.name,[Rf,"__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}=zf({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Af.forEach((e=>{var n;const o=Ff(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=zf({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(fr,{__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:sr({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:f,resetAllFilter:Of,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}},Af.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=zf({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=zf({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=sr({...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",size:"__unstable-large",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:Gf(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)(xf,e)))}function Hf(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,Rf);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 Gf(e,t){return sr({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Uf(e,t,n){if(!Hf(t,"color")||ur(t,Rf,"color"))return e;const o=Wf(n),r=c()(e.className,o);return e.className=r||void 0,e}function Wf(e){var t;const{borderColor:n,style:o}=e,r=Nf("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 $f=(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}=Lf();if(!Hf(m,"color")||ur(m,Rf,"color"))return(0,s.createElement)(e,t);const{color:b}=zf({colors:v,namedColor:h}),{color:_}=zf({colors:v,namedColor:Ff(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:k}=zf({colors:v,namedColor:Ff(null==f||null===(r=f.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=zf({colors:v,namedColor:Ff(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=zf({colors:v,namedColor:Ff(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 jf(e){if(e)return`has-${e}-gradient-background`}function Kf(e,t){const n=(0,p.find)(e,["slug",t]);return n&&n.gradient}function qf(e,t){return(0,p.find)(e,["gradient",t])}function Yf(e,t){const n=qf(e,t);return n&&n.slug}function Zf(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=go(),o=qo("color.gradients.custom"),r=qo("color.gradients.theme"),l=qo("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=Yf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),m=jf(a);let g;return g=a?Kf(i,a):c,{gradientClass:m,gradientValue:g,setGradient:p}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Hf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Uf),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Hf(e,"color")||ur(e,Rf,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Uf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",$f);const Qf=["colors","disableCustomColors","gradients","disableCustomGradients"],Xf={name:"color",title:"Solid",value:"color"},Jf={name:"gradient",title:"Gradient",value:"gradient"},ev=[Xf,Jf];function tv(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={[Xf.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:_}),[Jf.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:ev,initialTabName:f?Jf.value:!!k&&Xf.value},(e=>C(e.value))),!y&&C(Xf.value),!k&&C(Jf.value))))}function nv(e){const t={};return t.colors=qo("color.palette"),t.gradients=qo("color.gradients"),t.disableCustomColors=!qo("color.custom"),t.disableCustomGradients=!qo("color.customGradient"),(0,s.createElement)(tv,i({},t,e))}const ov=function(e){return Qf.every((t=>e.hasOwnProperty(t)))?(0,s.createElement)(tv,e):(0,s.createElement)(nv,e)},rv=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)},lv=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))},iv=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)(lv,{colorValue:r,label:l}))};function sv(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)(rv,i({key:c,setting:e},p),(0,s.createElement)(m.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:iv(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)(ov,h)))}))})))}Ld([Rd,Dd]);const av=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=Nd(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=Nd(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,
|
73 |
/* translators: 1: Font weight name. 2: Font style name. */
|
74 |
-
(0,h.__)("%1$s %2$s"),
|
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 Mv=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,spinControls:"custom"})))},Nv="typography.lineHeight";function Pv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Mv,{__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:sr(t)})},size:"__unstable-large"})}function Lv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Nv)||t}const Rv="typography.__experimentalFontStyle",Av="typography.__experimentalFontWeight";function Ov(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Dv(e),i=!zv(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)(Tv,{onChange:e=>{r({style:sr({...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 Dv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Rv),n=qo("typography.fontStyle");return!t||!n}function zv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Av),n=qo("typography.fontWeight");return!t||!n}function Fv(e){const t=Dv(e),n=zv(e);return t&&n}function Vv(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=qo("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 Hv="typography.__experimentalFontFamily";function Gv(e,t,n){if(!(0,r.hasBlockSupport)(t,Hv))return e;if(ur(t,Mb,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Tg())(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 Uv(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=qo("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)(Vv,{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 Wv(e){let{name:t}=e;const n=qo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Hv)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Hv)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Gv),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Hv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Gv(o,e,n)},e}));const $v=(e,t,n)=>{if(t){const n=(0,p.find)(e,{slug:t});if(n)return n}return{size:n}};function jv(e,t){return(0,p.find)(e,{size:t})||{size:t}}function Kv(e){if(e)return`has-${(0,p.kebabCase)(e)}-font-size`}const qv=function(e){const t=qo("typography.fontSizes"),n=!qo("typography.customFontSize");return(0,s.createElement)(m.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},Yv="1600px",Zv="768px",Qv=1,Xv=.75,Jv=1.5,eb="14px";function tb(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:o,minimumViewPortWidth:r=Zv,maximumViewPortWidth:l=Yv,scaleFactor:i=Qv,minimumFontSizeFactor:s=Xv,maximumFontSizeFactor:a=Jv,minimumFontSizeLimit:c=eb}=e,u=t;if(o){const e=nb(o);if(null==e||!e.unit)return null;u||(u=ob(e.value*s,3)+e.unit);const r=nb(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=nb(u,{coerceTo:e.unit});null!=t&&t.value&&t.value<r.value&&(u=`${r.value}${r.unit}`)}n||(n=ob(e.value*a,3)+e.unit)}if(!u||!n)return null;const d=nb(u),p=(null==d?void 0:d.unit)||"rem",m=nb(n,{coerceTo:p});if(!d||!m)return null;const g=nb(u,{coerceTo:"rem"}),h=nb(l,{coerceTo:p}),f=nb(r,{coerceTo:p});if(!h||!f||!g)return null;const v=ob(f.value/100,3),b=ob(v,3)+p,_=ob(((m.value-d.value)/(h.value-f.value)*100||1)*i,3);return`clamp(${u}, ${g.value}${g.unit} + ((1vw - ${b}) * ${_}), ${n})`}function nb(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:ob(u,3),unit:c}}function ob(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 rb="typography.fontSize";function lb(e,t,n){if(!(0,r.hasBlockSupport)(t,rb))return e;if(ur(t,Mb,"fontSize"))return e;const o=new(Tg())(e.className);o.add(Kv(n.fontSize));const l=o.value;return e.className=l||void 0,e}function ib(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=qo("typography.fontSizes"),a=$v(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)(qv,{onChange:e=>{const t=jv(i,e).slug;l({style:sr({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function sb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=qo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,rb)||!n}const ab=(0,u.createHigherOrderComponent)((e=>t=>{var n,o;const l=qo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,rb)||ur(i,Mb,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=$v(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"),cb={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,rb)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",lb),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,rb))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),lb(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ab),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return cr({fontSize:(0,r.hasBlockSupport)(l,rb)},cb,e,t,n,o)})),(0,l.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,r.hasBlockSupport)(e,rb)||ur(e,Mb,"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?tb({fontSize:i}):null;return null===a?l:{...l,style:{...null==l?void 0:l.style,fontSize:a}}},e}),11);const ub=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 11.5h10V13H7z"})),db=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),pb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),mb=[{name:(0,h.__)("None"),value:"none",icon:ub},{name:(0,h.__)("Underline"),value:"underline",icon:db},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:pb}];function gb(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"},mb.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 hb="typography.__experimentalTextDecoration";function fb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(gb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:sr({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})},size:"__unstable-large"})}function vb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,hb),n=qo("typography.textDecoration");return t||!n}const bb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),_b=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),kb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),yb=[{name:(0,h.__)("None"),value:"none",icon:ub},{name:(0,h.__)("Uppercase"),value:"uppercase",icon:bb},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:_b},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:kb}];function Eb(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"},yb.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 Cb="typography.__experimentalTextTransform";function Sb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Eb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:sr({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})},size:"__unstable-large"})}function wb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Cb),n=qo("typography.textTransform");return t||!n}function Bb(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("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 Ib="typography.__experimentalLetterSpacing";function xb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Bb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:sr({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%",size:"__unstable-large"})}function Tb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Ib),n=qo("typography.letterSpacing");return t||!n}const Mb="typography",Nb=[Nv,rb,Rv,Av,Hv,hb,Cb,Ib];function Pb(e){const{clientId:t}=e,n=Wv(e),o=sb(e),l=Fv(e),i=Lv(e),a=vb(e),c=wb(e),u=Tb(e),d=!Dv(e),p=!zv(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Fv(e),sb(e),Lv(e),Wv(e),vb(e),wb(e),Tb(e)];return t.filter(Boolean).length===t.length}(e),f=Lb(e.name);if(g||!f)return null;const v=(0,r.getBlockSupport)(e.name,[Mb,"__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)(fr,{__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)(Uv,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:sr({...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)(Sb,e)))}const Lb=e=>Nb.some((t=>(0,r.hasBlockSupport)(e,t))),Rb=[...Nb,Rf,dv,Mr],Ab=e=>Rb.some((t=>(0,r.hasBlockSupport)(e,t)));function Ob(){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 Db={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[dv],[`${Mb}.__experimentalSkipSerialization`]:[Mb],[`${Mr}.__experimentalSkipSerialization`]:["spacing"]},zb={...Db,[`${Mr}`]:["spacing.blockGap"]},Fb={gradients:"gradient"};function Vb(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;Vb(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function Hb(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zb;if(!Ab(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=Vb(l,o)),Array.isArray(i)&&i.forEach((e=>{const t=Fb[e]||e;l=Vb(l,[[...o,t]])}))})),e.style={...Ob(l),...e.style},e}const Gb=(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)(Cv,t),(0,s.createElement)(Pb,t),(0,s.createElement)(Vf,t),(0,s.createElement)(Rr,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Ub=(0,u.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,u.useInstanceId)(e)}`,a=ur(t.name,dv,"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,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)(mf.__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 Ab(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Hb),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Ab(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Hb(o,e,n,Db)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Gb),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Ub),(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 Wb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),$b=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:Wb}),(0,s.createElement)(m.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),variant:"toolbar"},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}))})},jb=[];function Kb(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 qb(e){let{presetSetting:t,defaultSetting:n}=e;const o=!qo(n),r=qo(`${t}.custom`)||jb,l=qo(`${t}.theme`)||jb,i=qo(`${t}.default`)||jb;return(0,s.useMemo)((()=>[...r,...l,...o?jb:i]),[o,r,l,i])}function Yb(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=qb({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=qb({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!qo("color.custom"),u=!qo("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)($b,{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 Zb=(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)(Yb,t))}),"withDuotoneControls"),Qb=(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)(mf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(Kb,{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",Zb),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Qb);const Xb="__experimentalLayout";function Jb(){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=qo("layout")||{},{attributes:i={},name:s}=n,{layout:a}=i,{default:c}=(0,r.getBlockSupport)(s,Xb)||{},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 e_(){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=qo("layout")||{},u=qo("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 t_(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=qo("layout"),a=(0,d.useSelect)((e=>{const{getSettings:t}=e(co);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Xb,{}),{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=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)(fr,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)(n_,{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 n_(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 o_=(0,u.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Xb)&&(0,s.createElement)(t_,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),r_=(0,u.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:l}=t,a=(0,r.hasBlockSupport)(n,Xb),p=(0,d.useSelect)((e=>{const{getSettings:t}=e(co);return!!t().disableLayoutStyles})),m=a&&!p,g=(0,u.useInstanceId)(e),h=qo("layout")||{},f=(0,s.useContext)(mf.__unstableElementContext),{layout:v}=o,{default:b}=(0,r.getBlockSupport)(n,Xb)||{},_=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},k=a?Jb(l):null,y=`.wp-container-${g}.wp-container-${g}`,E=null!==qo("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,{__unstableLayoutClassNames:w})))}));function l_(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,Xb)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",r_),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",o_);const i_=(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)(l_,{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",i_);function s_(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 a_(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Wf(e)||void 0,style:Ob({border:n})}}function c_(e){const{colors:t}=Lf(),n=a_(e),{borderColor:o}=e;if(o){const e=zf({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function u_(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Nf("background-color",s),m=Nf("color",a),g=jf(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:Ob({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||s_(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 s_(t)&&(e.metadata=n.metadata),e})),(0,l.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||s_(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 d_={};function p_(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=qo("color.palette.custom")||[],l=qo("color.palette.theme")||[],i=qo("color.palette.default")||[],a=qo("color.gradients")||d_,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=u_(e);if(t){const e=Tf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Kf(u,o)),n){const e=Tf(c,n);d.style.color=e.color}return d}function m_(e){const{style:t}=e;return{style:Ob({spacing:(null==t?void 0:t.spacing)||{}})}}function g_(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:tb({fontSize:null==e||null===(r=e.style)||void 0===r||null===(l=r.typography)||void 0===l?void 0:l.fontSize})});const i=Ob({typography:o}),s=null!=e&&e.fontFamily?`has-${(0,p.kebabCase)(e.fontFamily)}-font-family`:"";return{className:c()(s,Kv(null==e?void 0:e.fontSize)),style:i}}function h_(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const f_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},v_=e=>(0,u.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),b_=()=>(0,u.createHigherOrderComponent)((e=>t=>{const n=qo("color.palette.custom"),o=qo("color.palette.theme"),r=qo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function k_(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=Nd(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=f_(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Mf(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=Tf(r,o[l],o[`custom${f_(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:Nf(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function y_(e){return function(){const t=v_(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,u.createHigherOrderComponent)(k_(o,t),"withCustomColors")}}function E_(){const e=b_();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,u.createHigherOrderComponent)(k_(n,e),"withColors")}const C_=[],S_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},w_=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${S_(t)}`,e)),{});return(0,u.createHigherOrderComponent)((0,u.compose)([(0,u.createHigherOrderComponent)((e=>t=>{const n=qo("typography.fontSizes")||C_;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${S_(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(!Object.values(o).some(l))return null;const i=(0,p.reduce)((0,p.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=$v(r,l,n[t]);return e[o]={...i,class:Kv(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},B_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),I_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),x_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"})),T_=[{icon:B_,title:(0,h.__)("Align text left"),align:"left"},{icon:I_,title:(0,h.__)("Align text center"),align:"center"},{icon:x_,title:(0,h.__)("Align text right"),align:"right"}],M_={position:"bottom right",variant:"toolbar"},N_=function(e){let{value:t,onChange:n,alignmentControls:o=T_,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:M_};return(0,s.createElement)(g,i({icon:d?d.icon:(0,h.isRTL)()?x_:B_,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))},P_=e=>(0,s.createElement)(N_,i({},e,{isToolbar:!1})),L_=e=>(0,s.createElement)(N_,i({},e,{isToolbar:!0})),R_=()=>{},A_={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]=Mp(t,R_),i=(0,s.useMemo)((()=>(e.trim()?cm(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)(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))}}},O_=window.wp.apiFetch;var D_=n.n(O_);const z_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),F_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),V_={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await D_()({path:(0,ym.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?z_:F_}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)},H_=[];function G_(e){let{completers:t=H_}=e;const{name:n}=go();return(0,s.useMemo)((()=>{let e=[...t,V_];return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,A_]),(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 U_=function(e){return(0,s.createElement)(m.Autocomplete,i({},e,{completers:G_(e)}))},W_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),$_=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:W_,label:n,onClick:()=>o(!t),disabled:r})},j_=()=>{},K_=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=j_,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:{variant:"toolbar"},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})})},q_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Y_=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)(dl,{icon:q_,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)(tg,{clientId:e,maximumLength:35})),(0,s.createElement)(dl,{icon:q_,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(tg,{clientId:r,maximumLength:35})))},Z_=()=>(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"})),Q_=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)(Z_,null)))},X_=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)(Q_,null)))}))}},J_=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:X_(n),renderContent:()=>t})},ek=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),tk=tu(m.__experimentalTreeGridRow);function nk(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)(tk,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}const ok=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function rk(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)()?ok:q_}))}const lk=(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=Jm(o),h=eg({clientId:o,context:"list-view"}),{isLocked:f}=ah(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)(rk,{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:uh})))))})),ik=(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)(ng,{clientIds:y},(e=>{let{draggable:c,onDragStart:d,onDragEnd:g}=e;return(0,s.createElement)(lk,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))}))})),sk=ik,ak=(0,s.createContext)({}),ck=()=>(0,s.useContext)(ak),uk=(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}=ah(B),T=(0,d.useSelect)((e=>!l&&!!x&&e(co).hasSelectedInnerBlock(B,!0)),[x,B,l]),M=T||l&&y[0]===B,N=T||l&&y[y.length-1]===B,{toggleBlockHighlight:P}=(0,d.useDispatch)(co),L=Jm(B),R=(0,d.useSelect)((e=>e(co).getBlockName(B)),[B]),A=(0,r.hasBlockSupport)(R,"__experimentalToolbar",!0),O=`list-view-block-select-button__${(0,u.useInstanceId)(e)}`,D=((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
|
82 |
-
(0,h.__)("%s link (locked)"),
|
83 |
-
(0,h.__)("%s link"),
|
84 |
-
(0,h.__)("Options for %s block"),
|
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,
|
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 zk(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:rg,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 Fk=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,d.useDispatch)(co),{activeBlockVariation:o,variations:l}=(0,d.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?Dk:zk;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})},Vk=(0,u.createHigherOrderComponent)((e=>t=>{const n=qo("color.palette"),o=!qo("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,p.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),Hk=Vk(m.ColorPalette);function Gk(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(ov,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}const Uk=window.wp.date,Wk=new Date(2022,0,25);function $k(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,Uk.dateI18n)(n,Wk))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(jk,{format:t,onChange:o}))}function jk(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,Uk.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 Kk=["colors","disableCustomColors","gradients","disableCustomGradients"],qk=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,u.useInstanceId)(qk),{batch:k}=(0,d.useRegistry)();return(0,p.isEmpty)(n)&&(0,p.isEmpty)(o)&&r&&l&&null!=a&&a.every((e=>(0,p.isEmpty)(e.colors)&&(0,p.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)(sv,{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))},Yk=e=>{const t=Pf();return t.colors=qo("color.palette"),t.gradients=qo("color.gradients"),(0,s.createElement)(qk,i({},t,e))},Zk=e=>{const t=Lf();return(0,s.createElement)(qk,i({},t,e))},Qk=e=>Kk.every((t=>e.hasOwnProperty(t)))?(0,s.createElement)(qk,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Zk,e):(0,s.createElement)(Yk,e);var Xk=function(e,t){return Xk=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])},Xk(e,t)},Jk=function(){return Jk=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},Jk.apply(this,arguments)};Object.create,Object.create;var ey=n(7970),ty=n.n(ey);function ny(e,t,n,o,r,l){void 0===l&&(l=0);var i=my(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 oy(e,t,n,o,r){void 0===r&&(r=0);var l=my(t.width,t.height,r),i=l.width,s=l.height;return{x:ry(e.x,i,n.width,o),y:ry(e.y,s,n.height,o)}}function ry(e,t,n,o){var r=t*o/2-n/2;return gy(e,-r,r)}function ly(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function iy(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function sy(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i?ay:cy,a=my(t.width,t.height,l),c=my(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:Jk(Jk({},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 ay(e,t){return Math.min(e,Math.max(0,t))}function cy(e,t){return t}function uy(e,t,n,o,r,l){var i=my(t.width,t.height,n),s=gy(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 dy(e,t,n,o,r,l){void 0===n&&(n=0);var i=my(t.naturalWidth,t.naturalHeight,n),s=gy(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 py(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function my(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 gy(e,t,n){return Math.min(Math.max(e,t),n)}function hy(){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 fy=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=Mi().createRef(),n.videoRef=Mi().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=uy(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=dy(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=Jk(Jk({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:ny(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=Jk({},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?oy(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=ty()(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=gy(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?oy(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?sy(n.props.restrictPosition?oy(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?oy(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}Xk(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=ly(n,o),this.lastPinchRotation=iy(n,o),this.onDragStart(py(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=py(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=ly(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=iy(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 Mi().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:hy("reactEasyCrop_Container",b)},n?Mi().createElement("img",Jk({alt:"",className:hy("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:Jk(Jk({},f),{transform:l||"translate("+s+"px, "+a+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&Mi().createElement("video",Jk({autoPlay:!0,loop:!0,muted:!0,className:hy("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:Jk(Jk({},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 Mi().createElement("source",Jk({key:e.src},e))}))),this.state.cropSize&&Mi().createElement("div",{style:Jk(Jk({},h),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:hy("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}(Mi().Component);const vy=fy,by={position:"bottom right",variant:"toolbar"};const _y=(0,s.createContext)({}),ky=()=>(0,s.useContext)(_y);function yy(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const p=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,rotation:g,setRotation:h,rotateClockwise:y,aspect:f,setAspect:v,defaultAspect:b,initializeTransformValues:k})),[r,i,a,c,u,d,p,m,g,h,y,f,v,b,k])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),m=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:p}=(0,d.useDispatch)(Op.store),[m,g]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>{g(!1),u()}),[g,u]),v=(0,s.useCallback)((()=>{g(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,D_()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{p((0,h.sprintf)(
|
1 |
+
(()=>{var e={6411:function(e,t){var n,o;n=function(e,t){"use strict";var n,o,l="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))}}),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!l.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]})),l.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",l.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),l=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})),l&&(document.documentElement.scrollTop=l)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),l="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(l<t?"hidden"===n.overflowY&&(c("scroll"),u(),l="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),l="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==l){o=l;var i=r("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=l.get(e);t&&t.destroy()}function a(e){var t=l.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 l(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var i=l.apply(null,n);i&&e.push(i)}}else if("object"===r)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?(l.default=l,e.exports=l):void 0===(n=function(){return l}.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,l){for(var r=0,i=t.length,s=0,a=0;r<i;r++){var c=t[r];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,r&&t[r-1].added){var u=t[r-1];t[r-1]=t[r],t[r]=u}}else{if(!c.added&&l){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 l(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]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var i=this;function s(e){return r?(setTimeout((function(){r(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 r=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?(r=l(m),i.pushComponent(r.components,void 0,!0)):((r=d).newPos++,i.pushComponent(r.components,!0,void 0)),g=i.extractCommon(r,t,e,n),r.newPos+1>=a&&g+1>=c)return s(o(i,r.components,t,e,i.useLongestToken));p[n]=r}else p[n]=void 0}u++}if(r)!function e(){setTimeout((function(){if(u>d)return r();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 l=t.length,r=n.length,i=e.newPos,s=i-o,a=0;i+1<l&&s+1<r&&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 l.diff(e,t,n)};var l=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 l=n.allowHorizontalScroll,r=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;l=void 0===l||l;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,k=void 0,_=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},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={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+k+(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,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):r||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),l&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):r||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.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 l=e.document;"number"!=typeof(n=l.documentElement[o])&&(n=l.body[o])}return n}function l(e){return o(e)}function r(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,l=e.ownerDocument,r=l.body,i=l&&l.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||r.clientLeft||0,top:o-=i.clientTop||r.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=l(o),t.top+=r(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="",l=e.ownerDocument,r=n||l.defaultView.getComputedStyle(e,null);return r&&(o=r.getPropertyValue(t)||r[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,l=o.left,r=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=l,e.runtimeStyle.left=r}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},l=e.style,r=void 0;for(r in t)t.hasOwnProperty(r)&&(o[r]=l[r],l[r]=t[r]);for(r in n.call(e),t)t.hasOwnProperty(r)&&(l[r]=o[r])}function g(e,t,n){var o=0,l=void 0,r=void 0,i=void 0;for(r=0;r<t.length;r++)if(l=t[r])for(i=0;i<n.length;i++){var s;s="border"===l?l+n[i]+"Width":l+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"],l="width"===t?e.offsetWidth:e.offsetHeight,r=(c(e),d(e)),i=0;(null==l||l<=0)&&(l=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=r?1:-1);var s=void 0!==l||r,a=l||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,l=o.body,r=o.documentElement[n];return"CSS1Compat"===o.compatMode&&r||l&&l[n]||r}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(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 _(e,t,o){var l=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==l?("number"==typeof l&&(l+="px"),void(e.style[t]=l)):c(e,t);for(var r in t)t.hasOwnProperty(r)&&_(e,r,t[r])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);f["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=g(t,["padding","border"],n)),_(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"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},l=void 0,r=void 0;for(r in t)t.hasOwnProperty(r)&&(l=parseFloat(_(e,r))||0,o[r]=l+t[r]-n[r]);_(e,o)}(e,t)},isWindow:h,each:u,css:_,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 l(e);window.scrollTo(t,r(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(l(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 l=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),l?e.style.lineHeight=l: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 r=e.nodeName,i=document.createElement(r);i.innerHTML=" ","TEXTAREA"===r.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,l,r,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 k=/(?:Trident\/(\d+.\d+))/.exec(e);i=k?parseFloat(k[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,o=v[3]?parseFloat(v[3]):NaN,(l=v[4]?parseFloat(v[4]):NaN)?(v=/(?:Chrome\/(\d+\.\d+))/.exec(e),r=v&&v[1]?parseFloat(v[1]):NaN):r=NaN}else t=n=o=r=l=NaN;if(b){if(b[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!_||parseFloat(_[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()||l},safari:function(){return b.webkit()},chrome:function(){return v()||r},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,l=n(3110);l.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!l.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var i=document.createElement("div");i.setAttribute(n,"return;"),r="function"==typeof i[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}},195:(e,t,n)=>{"use strict";var o=n(3812),l=n(7939);function r(e){var t=0,n=0,o=0,l=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,l=10*n,"deltaY"in e&&(l=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||l)&&e.deltaMode&&(1==e.deltaMode?(o*=40,l*=40):(o*=800,l*=800)),o&&!t&&(t=o<1?-1:1),l&&!n&&(n=l<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:l}}r.getEventType=function(){return o.firefox()?"DOMMouseScroll":l("wheel")?"wheel":"mousewheel"},e.exports=r},5372:(e,t,n)=>{"use strict";var o=n(9567);function l(){}function r(){}r.resetWarningCache=l,e.exports=function(){function e(e,t,n,l,r,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:r,resetWarningCache:l};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,l=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 __)}),r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);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 l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&(n[o[l]]=e[o[l]])}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 l(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),l=(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",r({},a,{onChange:this.onChange,style:u?r({},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)}}),l)},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,r({},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"),l=new RegExp(n,""),r=function(e){return e.replace(o,(function(e){return t[e]}))};e.exports=r,e.exports.has=function(e){return!!e.match(l)},e.exports.remove=r},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?l(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=r(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,l){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var r=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=r.node),r.isLast=l==h.keys.length-1,r.isFirst=0==l,m.post&&m.post.call(h,r),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function l(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(r(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 l=e[o];c.call(n,l)||(n[l]={}),n=n[l]}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=l(o);return e.push(o),t.push(s),a(r(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var r=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(r(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),l=new n(t);return l[e].apply(l,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 l=t[o];if(void 0!==l)return l.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.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:()=>zk,AlignmentToolbar:()=>Fk,Autocomplete:()=>Yk,BlockAlignmentControl:()=>Vr,BlockAlignmentToolbar:()=>Hr,BlockBreadcrumb:()=>t_,BlockColorsStyleSelector:()=>r_,BlockContextProvider:()=>ei,BlockControls:()=>Co,BlockEdit:()=>li,BlockEditorKeyboardShortcuts:()=>SS,BlockEditorProvider:()=>ju,BlockFormatControls:()=>Eo,BlockIcon:()=>Hu,BlockInspector:()=>vS,BlockList:()=>yf,BlockMover:()=>bg,BlockNavigationDropdown:()=>I_,BlockPreview:()=>Sp,BlockSelectionClearer:()=>Yu,BlockSettingsMenu:()=>Nh,BlockSettingsMenuControls:()=>Bh,BlockStyles:()=>N_,BlockTitle:()=>ag,BlockToolbar:()=>Vh,BlockTools:()=>_S,BlockVerticalAlignmentControl:()=>nr,BlockVerticalAlignmentToolbar:()=>or,ButtonBlockAppender:()=>qm,ButtonBlockerAppender:()=>Km,ColorPalette:()=>q_,ColorPaletteControl:()=>Y_,ContrastChecker:()=>fv,CopyHandler:()=>rh,DefaultBlockAppender:()=>$m,FontSizePicker:()=>nb,InnerBlocks:()=>ff,Inserter:()=>Wm,InspectorAdvancedControls:()=>bl,InspectorControls:()=>kl,JustifyContentControl:()=>ir,JustifyToolbar:()=>sr,LineHeightControl:()=>zv,MediaPlaceholder:()=>lC,MediaReplaceFlow:()=>XE,MediaUpload:()=>qE,MediaUploadCheck:()=>YE,MultiSelectScrollIntoView:()=>wS,NavigableToolbar:()=>yg,ObserveTyping:()=>TS,PanelColorSettings:()=>rC,PlainText:()=>FC,RichText:()=>DC,RichTextShortcut:()=>GC,RichTextToolbarButton:()=>UC,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>sS,ToolSelector:()=>jC,Typewriter:()=>LS,URLInput:()=>Yy,URLInputButton:()=>ZC,URLPopover:()=>tC,Warning:()=>ii,WritingFlow:()=>cd,__experimentalBlockAlignmentMatrixControl:()=>Jk,__experimentalBlockFullHeightAligmentControl:()=>Qk,__experimentalBlockPatternSetup:()=>U_,__experimentalBlockPatternsList:()=>Kp,__experimentalBlockVariationPicker:()=>L_,__experimentalBlockVariationTransforms:()=>j_,__experimentalBorderRadiusControl:()=>Af,__experimentalColorGradientControl:()=>dv,__experimentalColorGradientSettingsDropdown:()=>hv,__experimentalDateFormatPicker:()=>X_,__experimentalDuotoneControl:()=>Xb,__experimentalFontAppearanceControl:()=>Ov,__experimentalFontFamilyControl:()=>qv,__experimentalGetBorderClassesAndStyles:()=>hk,__experimentalGetColorClassesAndStyles:()=>vk,__experimentalGetElementClassName:()=>HS,__experimentalGetGapCSSValue:()=>Kl,__experimentalGetGradientClass:()=>ev,__experimentalGetGradientObjectByGradientValue:()=>nv,__experimentalGetMatchingVariation:()=>US,__experimentalGetSpacingClassesAndStyles:()=>_k,__experimentalImageEditingProvider:()=>xy,__experimentalImageEditor:()=>zy,__experimentalImageSizeControl:()=>Hy,__experimentalImageURLInputUI:()=>lS,__experimentalInspectorPopoverHeader:()=>zS,__experimentalLayoutStyle:()=>Tr,__experimentalLetterSpacingControl:()=>Lb,__experimentalLibrary:()=>ES,__experimentalLinkControl:()=>IE,__experimentalLinkControlSearchInput:()=>vE,__experimentalLinkControlSearchItem:()=>lE,__experimentalLinkControlSearchResults:()=>uE,__experimentalListView:()=>w_,__experimentalOffCanvasEditor:()=>WE,__experimentalPanelColorGradientSettings:()=>ly,__experimentalPreviewOptions:()=>rS,__experimentalPublishDateTimePicker:()=>FS,__experimentalRecursionProvider:()=>AS,__experimentalResponsiveBlockControl:()=>HC,__experimentalSpacingSizesControl:()=>sl,__experimentalTextDecorationControl:()=>yb,__experimentalTextTransformControl:()=>Tb,__experimentalUnitControl:()=>KC,__experimentalUseBlockOverlayActive:()=>Tu,__experimentalUseBlockPreview:()=>wp,__experimentalUseBorderProps:()=>fk,__experimentalUseColorProps:()=>kk,__experimentalUseCustomSides:()=>Ul,__experimentalUseGradient:()=>lv,__experimentalUseHasRecursion:()=>DS,__experimentalUseMultipleOriginColorsAndGradients:()=>Hf,__experimentalUseResizeCanvas:()=>iS,__experimentaluseLayoutClasses:()=>ik,__experimentaluseLayoutStyles:()=>sk,__unstableBlockNameContext:()=>Fh,__unstableBlockSettingsMenuFirstItem:()=>ph,__unstableBlockToolbarLastItem:()=>Jg,__unstableDuotoneFilter:()=>bp,__unstableDuotoneStylesheet:()=>fp,__unstableDuotoneUnsetStylesheet:()=>vp,__unstableEditorStyles:()=>gp,__unstableGetValuesFromColors:()=>hp,__unstableIframe:()=>pd,__unstableInserterMenuExtension:()=>Lm,__unstablePresetDuotoneFilter:()=>kp,__unstableRichTextInputEvent:()=>WC,__unstableUseBlockSelectionClearer:()=>qu,__unstableUseClipboardHandler:()=>lh,__unstableUseMouseMoveTypingReset:()=>IS,__unstableUseTypewriter:()=>PS,__unstableUseTypingObserver:()=>xS,createCustomColorsHOC:()=>Ik,getColorClassName:()=>Ff,getColorObjectByAttributeValues:()=>Of,getColorObjectByColorValue:()=>zf,getComputedFluidTypographyValue:()=>ab,getFontSize:()=>Jv,getFontSizeClass:()=>tb,getFontSizeObjectByValue:()=>eb,getGradientSlugByValue:()=>ov,getGradientValueBySlug:()=>tv,getPxFromCssUnit:()=>JS,getTypographyClassesAndStyles:()=>yk,store:()=>mo,storeConfig:()=>po,transformStyles:()=>dp,useBlockDisplayInformation:()=>ig,useBlockEditContext:()=>vo,useBlockProps:()=>Mu,useCachedTruthy:()=>Ek,useInnerBlocksProps:()=>hf,useSetting:()=>Qo,withColorContext:()=>K_,withColors:()=>xk,withFontSizes:()=>Nk});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Ht,__experimentalGetAllowedBlocks:()=>_t,__experimentalGetAllowedPatterns:()=>St,__experimentalGetBlockListSettingsForBlocks:()=>Mt,__experimentalGetDirectInsertBlock:()=>yt,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Lt,__experimentalGetParsedPattern:()=>Et,__experimentalGetPatternTransformItems:()=>Bt,__experimentalGetPatternsByBlockTypes:()=>wt,__experimentalGetReusableBlockTitle:()=>Nt,__experimentalIsBlockInterfaceHidden:()=>$e,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Z,__unstableGetContentLockingParent:()=>$t,__unstableGetEditorMode:()=>Dt,__unstableGetSelectedBlocksWithPartialSelection:()=>Re,__unstableGetTemporarilyEditingAsBlocks:()=>jt,__unstableGetVisibleBlocks:()=>Wt,__unstableHasActiveBlockOverlayActive:()=>Kt,__unstableIsFullySelected:()=>Me,__unstableIsLastBlockChangeIgnored:()=>Pt,__unstableIsSelectionCollapsed:()=>Ne,__unstableIsSelectionMergeable:()=>Le,__unstableIsWithinBlockOverlay:()=>qt,__unstableSelectionHasUnmergeableBlock:()=>Pe,areInnerBlocksControlled:()=>Vt,canEditBlock:()=>ut,canInsertBlockType:()=>lt,canInsertBlocks:()=>rt,canLockBlockType:()=>dt,canMoveBlock:()=>at,canMoveBlocks:()=>ct,canRemoveBlock:()=>it,canRemoveBlocks:()=>st,didAutomaticChange:()=>zt,getAdjacentBlockClientId:()=>fe,getBlock:()=>j,getBlockAttributes:()=>$,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>De,getBlockInsertionPoint:()=>Qe,getBlockListSettings:()=>It,getBlockMode:()=>Ue,getBlockName:()=>U,getBlockOrder:()=>Ae,getBlockParents:()=>pe,getBlockParentsByBlockName:()=>me,getBlockRootClientId:()=>de,getBlockSelectionEnd:()=>ie,getBlockSelectionStart:()=>re,getBlockTransformItems:()=>bt,getBlocks:()=>q,getBlocksByClientId:()=>te,getClientIdsOfDescendants:()=>Q,getClientIdsWithDescendants:()=>X,getDraggedBlockClientIds:()=>Ke,getFirstMultiSelectedBlockClientId:()=>Ce,getGlobalBlockCount:()=>J,getInserterItems:()=>vt,getLastMultiSelectedBlockClientId:()=>Se,getLowestCommonAncestorWithSelectedBlock:()=>he,getMultiSelectedBlockClientIds:()=>ye,getMultiSelectedBlocks:()=>Ee,getMultiSelectedBlocksEndClientId:()=>Te,getMultiSelectedBlocksStartClientId:()=>xe,getNextBlockClientId:()=>be,getPreviousBlockClientId:()=>ve,getSelectedBlock:()=>ue,getSelectedBlockClientId:()=>ce,getSelectedBlockClientIds:()=>_e,getSelectedBlockCount:()=>se,getSelectedBlocksInitialCaretPosition:()=>ke,getSelectionEnd:()=>le,getSelectionStart:()=>oe,getSettings:()=>xt,getTemplate:()=>et,getTemplateLock:()=>tt,hasBlockMovingClientId:()=>Ot,hasInserterItems:()=>kt,hasMultiSelection:()=>Ve,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>ze,isAncestorBeingDragged:()=>Ye,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>qe,isBlockHighlighted:()=>Ft,isBlockInsertionPointVisible:()=>Xe,isBlockMultiSelected:()=>Be,isBlockSelected:()=>Oe,isBlockValid:()=>W,isBlockVisible:()=>Ut,isBlockWithinSelection:()=>Fe,isCaretWithinFormattedText:()=>Ze,isDraggingBlocks:()=>je,isFirstMultiSelectedBlock:()=>we,isLastBlockChangePersistent:()=>Tt,isMultiSelecting:()=>He,isNavigationMode:()=>At,isSelectionEnabled:()=>Ge,isTyping:()=>We,isValidTemplate:()=>Je,wasBlockJustInserted:()=>Gt});var t={};n.r(t),n.d(t,{__experimentalHideBlockInterface:()=>On,__experimentalShowBlockInterface:()=>zn,__unstableDeleteSelection:()=>Tn,__unstableExpandSelection:()=>Nn,__unstableMarkAutomaticChange:()=>Xn,__unstableMarkLastChangeAsPersistent:()=>Zn,__unstableMarkNextChangeAsNotPersistent:()=>Qn,__unstableSaveReusableBlock:()=>Yn,__unstableSetEditorMode:()=>eo,__unstableSetTemporarilyEditingAsBlocks:()=>co,__unstableSplitSelection:()=>Mn,clearSelectedBlock:()=>pn,duplicateBlocks:()=>no,enterFormattedText:()=>Un,exitFormattedText:()=>Wn,flashBlock:()=>io,hideInsertionPoint:()=>Bn,insertAfterBlock:()=>lo,insertBeforeBlock:()=>oo,insertBlock:()=>Cn,insertBlocks:()=>Sn,insertDefaultBlock:()=>jn,mergeBlocks:()=>Pn,moveBlockToPosition:()=>En,moveBlocksDown:()=>bn,moveBlocksToPosition:()=>yn,moveBlocksUp:()=>kn,multiSelect:()=>dn,receiveBlocks:()=>nn,removeBlock:()=>Rn,removeBlocks:()=>Ln,replaceBlock:()=>fn,replaceBlocks:()=>hn,replaceInnerBlocks:()=>An,resetBlocks:()=>Jt,resetSelection:()=>tn,selectBlock:()=>rn,selectNextBlock:()=>an,selectPreviousBlock:()=>sn,selectionChange:()=>$n,setBlockMovingClientId:()=>to,setBlockVisibility:()=>ao,setHasControlledInnerBlocks:()=>so,setNavigationMode:()=>Jn,setTemplateValidity:()=>In,showInsertionPoint:()=>wn,startDraggingBlocks:()=>Hn,startMultiSelect:()=>cn,startTyping:()=>Fn,stopDraggingBlocks:()=>Gn,stopMultiSelect:()=>un,stopTyping:()=>Vn,synchronizeTemplate:()=>xn,toggleBlockHighlight:()=>ro,toggleBlockMode:()=>Dn,toggleSelection:()=>mn,updateBlock:()=>ln,updateBlockAttributes:()=>on,updateBlockListSettings:()=>Kn,updateSettings:()=>qn,validateBlocksToTemplate:()=>en});const l=window.wp.blocks,r=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,r.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,l.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),...Array.isArray(t)?t:[t],...e.slice(n)]}function k(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const l=[...e];return l.splice(t,o),b(l,e.slice(t,t+o),n)}const _=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:l}=e;n[t].push(o),Object.assign(n,y(l,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]:_;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...l}=o.shift();o.push(...e),n[l.clientId]=t(l)}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],l=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),l.push(...e.innerBlocks)}for(const e of l)n[e.clientId]={};for(const t of l)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 l=new Set([]),r=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){r.add(n);break}l.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of l)t[e]={...t[e]};for(const n of l)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of r)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,l)=>{const{name:r}=t.byClientId[l];return"core/block"===r&&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 l=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||l.push(t.parents[e]);o.tree=x(o,o.tree,l,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const l of n.clientIds)void 0===t.parents[l]||""!==t.parents[l]&&!o.byClientId[t.parents[l]]||e.push(t.parents[l]);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,l]=e;return"core/block"===o.byClientId[t].name&&l.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 l=0;l<o.length;l++)!t.order[o[l]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[l]]||(o===e&&(o=[...o]),o.push(...t.order[o[l]]));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,...l}=e.shift();e.push(...n),t.controlledInnerBlocks[l.clientId]&&(o[l.clientId]=!0)}}let l=t;t.order[n.rootClientId]&&(l=e(l,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let r=l;return n.blocks.length&&(r=e(r,{...n,type:"INSERT_BLOCKS",index:0}),r.order={...r.order,...Object.keys(o).reduce(((e,n)=>(t.order[n]&&(e[n]=t.order[n]),e)),{})},r.tree={...r.tree,...Object.keys(o).reduce(((e,n)=>{const o=`controlled||${n}`;return t.tree[o]&&(e[o]=t.tree[o]),e}),{})}),r}),(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,l)=>{let r=e(o,l);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===l.type||n;if(o===r&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===l.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...r,isPersistentChange:e}}return r={...r,isPersistentChange:i?!n:!B(l,t)},t=l,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===l.type,r}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const l=e(n,o);return l!==n&&(l.isIgnoredChange=t.has(o.type)),l}}),(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)=>{var l;return{...n,[o]:Object.entries(t.uniqueByBlock?t.attributes[o]:null!==(l=t.attributes)&&void 0!==l?l:{}).reduce(((t,n)=>{let[l,r]=n;var i,s;return r!==t[l]&&((t=(i=e[o])===(s=t)?{...i}:s)[l]=r),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]||[],l=y(t.blocks,n),{index:r=o.length}=t;return{...e,...l,[n]:b(o,l[n],r)}}case"MOVE_BLOCKS_TO_POSITION":{var n,o;const{fromRootClientId:l="",toRootClientId:r="",clientIds:i}=t,{index:s=e[r].length}=t;if(l===r){const t=e[r].indexOf(i[0]);return{...e,[r]:k(e[r],t,s,i.length)}}return{...e,[l]:null!==(n=null===(o=e[l])||void 0===o?void 0:o.filter((e=>!i.includes(e))))&&void 0!==n?n:[],[r]:b(e[r],i,s)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,l=n[0],r=e[o];if(!r.length||l===r[0])return e;const i=r.indexOf(l);return{...e,[o]:k(r,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,l=n[0],r=n[n.length-1],i=e[o];if(!i.length||r===i[i.length-1])return e;const s=i.indexOf(l);return{...e,[o]:k(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=>Object.values(e).reduce(((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 M(){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 N=(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},isBlockInterfaceHidden:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":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 l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;switch(r.type){case"SELECTION_CHANGE":return r.clientId?{selectionStart:{clientId:r.clientId,attributeKey:r.attributeKey,offset:r.startOffset},selectionEnd:{clientId:r.clientId,attributeKey:r.attributeKey,offset:r.endOffset}}:{selectionStart:r.start||l.selectionStart,selectionEnd:r.end||l.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=r;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=r;return a===(null===(e=l.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=l.selectionEnd)||void 0===t?void 0:t.clientId)?l:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==l||null===(n=l.selectionStart)||void 0===n?void 0:n.clientId,d=null==l||null===(o=l.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return l;if(!r.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!r.blocks.some((e=>e.clientId===d)))return{...l,selectionEnd:l.selectionStart}}return{selectionStart:M(l.selectionStart,r),selectionEnd:M(l.selectionEnd,r)}},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:l,operation:r}=t,i={rootClientId:n,index:o,__unstableWithInserter:l,operation:r};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:r}=n,i=(0,d.select)(l.store).getActiveBlockVariation(r,o);let s=null!=i&&i.name?`${r}/${i.name}`:r;const a={name:s};return"core/block"===r&&(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 P={};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 l(e){var t,o,l,r,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):(l=new WeakMap,s.set(o,l),s=l)}return s.has(P)||((r=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(P,r)),s.get(P)}function r(){n=new WeakMap}function i(){var t,n,r,i,s,a=arguments.length;for(i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];for((t=l(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=r,r(),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:l}=n;return l?`core/social-link-${l}`: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&&Vt(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:Z(e,t)})),(e=>[e.blocks.order])),Z=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])),Q=A(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Ae(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(e);return t?n.reduce(((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)(Array.isArray(t)?t:[t],(t=>j(e,t)))),((e,t)=>(0,p.map)(Array.isArray(t)?t:[t],(t=>e.blocks.tree[t]))));function ne(e,t){return Ae(e,t).length}function oe(e){return e.selection.selectionStart}function le(e){return e.selection.selectionEnd}function re(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 l=t;for(;e.blocks.parents[l];)l=e.blocks.parents[l],o.push(l);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 l=pe(e,t,o);return(0,p.map)((0,p.filter)((0,p.map)(l,(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],l=[...pe(e,n),n];let r;const i=Math.min(o.length,l.length);for(let e=0;e<i&&o[e]===l[e];e++)r=o[e];return r}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:l}=e.blocks,r=l[o],i=r.indexOf(t),s=i+1*n;return s<0||s===r.length?null:r[s]}function ve(e,t){return fe(e,t,-1)}function be(e,t){return fe(e,t,1)}function ke(e){return e.initialPosition}const _e=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return G;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return G;const l=Ae(e,o),r=l.indexOf(t.clientId),i=l.indexOf(n.clientId);return r>i?l.slice(i,r+1):l.slice(r,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:_e(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>j(e,t))):G}),(e=>[..._e.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 Me(e){const t=oe(e),n=le(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ne(e){const t=oe(e),n=le(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Pe(e){return _e(e).some((t=>{const n=U(e,t);return!(0,l.getBlockType)(n).merge}))}function Le(e,t){const n=oe(e),o=le(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=de(e,n.clientId);if(r!==de(e,o.clientId))return!1;const i=Ae(e,r);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,l.getBlockType)(d).merge)return!1;const p=j(e,u);if(p.name===d)return!0;const m=(0,l.switchToBlockType)(p,d);return m&&m.length}const Re=e=>{const t=oe(e),n=le(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 r=Ae(e,o),i=r.indexOf(t.clientId),s=r.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=j(e,a.clientId),d=(0,l.getBlockType)(u.name),p=j(e,c.clientId),m=(0,l.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)}),k=(0,z.create)({html:h,...H(v)});return b=(0,z.remove)(b,0,a.offset),k=(0,z.remove)(k,c.offset,k.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:k,...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 Ae(e,t).some((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.isBlockInterfaceHidden}function je(e){return!!e.draggedBlocks.length}function Ke(e){return e.draggedBlocks}function qe(e,t){return e.draggedBlocks.includes(t)}function Ye(e,t){return!!je(e)&&pe(e,t).some((t=>qe(e,t)))}function Ze(){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:l}}=e;if(null!==o)return o;const{clientId:r}=l;return r?(t=de(e,r)||void 0,n=De(e,l.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Xe(e){return null!==e.insertionPoint}function Je(e){return e.template.isValid}function et(e){return e.settings.template}function tt(e,t){if(!t)return e.settings.templateLock;const n=It(e,t);return n?n.templateLock:void 0}const nt=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},ot=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,l.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=xt(e),s=nt(i,t,!0);if(!s)return!1;const a=!!tt(e,o);if(a)return!1;const c=It(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=nt(u,t),p=n.parent,m=U(e,o),g=nt(p,m);let h=!0;const f=n.ancestor;f&&(h=[o,...pe(e,o)].some((t=>nt(f,U(e,t)))));const v=h&&(null===d&&null===g||!0===d||!0===g);return v?(0,r.applyFilters)("blockEditor.__unstableCanInsertBlockType",v,n,o,{getBlock:j.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):v},lt=A(ot,((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=>lt(e,U(e,t),n)))}function it(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:l}=o,r=!!tt(e,n);return void 0===l||void 0===(null==l?void 0:l.remove)?!r:!(null!=l&&l.remove)}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>it(e,t,n)))}function at(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return;const{lock:l}=o,r="all"===tt(e,n);return void 0===l||void 0===(null==l?void 0:l.move)?!r:!(null!=l&&l.move)}function ct(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>at(e,t,n)))}function ut(e,t){const n=$(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function dt(e,t){var n;return!!(0,l.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function pt(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 mt=(e,t,n)=>!!(0,l.hasBlockSupport)(t,"inserter",!0)&&ot(e,t.name,n),gt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:l,count:r=0}=pt(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:ht(l,r)}},ht=(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}},ft=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let r=!1;(0,l.hasBlockSupport)(t.name,"multiple",!0)||(r=te(e,X(e)).some((e=>{let{name:n}=e;return n===t.name})));const{time:i,count:s=0}=pt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:r,frecency:ht(i,s)};if("transform"===n)return a;const c=(0,l.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},vt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=ft(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,r=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,r=(0,l.getBlockType)(t+o);r&&(n=r.icon)}}const r=`core/block/${t.id}`,{time:i,count:a=0}=pt(e,r)||{},c=ht(i,a);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,l.getBlockTypes)().filter((n=>mt(e,n,t))).map(n),a=ot(e,"core/block",t)?Rt(e).map(r):[],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 l=gt(e,n);t.push(...o.map(l))}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,Rt(e),(0,l.getBlockTypes)()])),bt=A((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=Array.isArray(t)?t:[t],[i]=r,s=ft(e,{buildScope:"transform"}),a=(0,l.getBlockTypes)().filter((t=>mt(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,l.getPossibleBlockTransformations)(r).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,l.getBlockTypes)()])),kt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,l.getBlockTypes)().some((n=>mt(e,n,t)));if(n)return!0;const o=ot(e,"core/block",t)&&Rt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Rt(e),(0,l.getBlockTypes)()])),_t=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,p.filter)((0,l.getBlockTypes)(),(n=>mt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,l.getBlockTypes)()])),yt=A((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const l=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,r=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return l&&r?"function"==typeof r?r(j(e,o))?l:null:l:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),Et=A(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,l.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Ct=A((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=xt(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return Et(e,n)})),l=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(!nt(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 l}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),St=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Ct(e),o=(0,p.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return lt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),wt=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;const o=St(e,n),l=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=>l.includes(e)))}))}),((e,t)=>[...St.getDependants(e,t)])),Bt=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||Vt(e,n)})))return G;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return wt(e,o,n)}),((e,t)=>[...wt.getDependants(e,t)]));function It(e,t){return e.blockListSettings[t]}function xt(e){return e.settings}function Tt(e){return e.blocks.isPersistentChange}const Mt=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)(Rt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Rt(e)]));function Pt(e){return e.blocks.isIgnoredChange}function Lt(e){return e.lastBlockAttributesChange}function Rt(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 At(e){return"navigation"===e.editorMode}function Dt(e){return e.editorMode}function Ot(e){return e.hasBlockMovingClientId}function zt(e){return!!e.automaticChangeStatus}function Ft(e,t){return e.highlightedBlock===t}function Vt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Ht=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(U(e,n)))return n;const o=ye(e),l=me(e,n||o[0],t);return l?l[l.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Gt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Ut(e,t){var n,o;return null===(n=null===(o=e.blockVisibility)||void 0===o?void 0:o[t])||void 0===n||n}const Wt=A((e=>new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])))),(e=>[e.blockVisibility])),$t=A(((e,t)=>{let n,o=t;for(;e.blocks.parents[o];)o=e.blocks.parents[o],"contentOnly"===tt(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function jt(e){return e.temporarilyEditingAsBlocks}function Kt(e,t){if(!ut(e,t))return!0;const n=Dt(e);if("zoom-out"===n&&t&&!de(e,t))return!0;const o=(0,l.hasBlockSupport)(U(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Vt(e,t))&&!Oe(e,t)&&!ze(e,t,!0)}function qt(e,t){let n=e.blocks.parents[t];for(;n;){if(Kt(e,n))return!0;n=e.blocks.parents[n]}return!1}const Yt=window.wp.a11y,Zt="";function Qt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Zt)}))}const Xt=e=>Array.isArray(e)?e:[e],Jt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(en(e))},en=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getTemplate(),i=n.getTemplateLock(),s=!r||"all"!==i||(0,l.doBlocksMatchTemplate)(e,r);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function tn(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function nn(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function on(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Xt(e),attributes:t,uniqueByBlock:n}}function ln(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 sn=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getPreviousBlockClientId(e);l&&o.selectBlock(l,-1)},an=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getNextBlockClientId(e);l&&o.selectBlock(l)};function cn(){return{type:"START_MULTI_SELECT"}}function un(){return{type:"STOP_MULTI_SELECT"}}const dn=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:l,dispatch:r}=o;if(l.getBlockRootClientId(e)!==l.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=l.getSelectedBlockCount();(0,Yt.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 pn(){return{type:"CLEAR_SELECTED_BLOCK"}}function mn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function gn(e,t){var n,o;const r=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,l.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!r[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=r[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const hn=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,l=arguments.length>4?arguments[4]:void 0;return r=>{let{select:i,dispatch:s}=r;e=Xt(e),t=gn(Xt(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:l}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function fn(e,t){return hn(e,t)}const vn=e=>(t,n)=>o=>{let{select:l,dispatch:r}=o;l.canMoveBlocks(t,n)&&r({type:e,clientIds:Xt(t),rootClientId:n})},bn=vn("MOVE_BLOCKS_DOWN"),kn=vn("MOVE_BLOCKS_UP"),yn=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 l=>{let{select:r,dispatch:i}=l;if(r.canMoveBlocks(e,t)){if(t!==n){if(!r.canRemoveBlocks(e,t))return;if(!r.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function En(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 yn([e],t,n,o)}function Cn(e,t,n,o,l){return Sn([e],t,n,o,0,l)}const Sn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;null!==l&&"object"==typeof l&&(r=l,l=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=gn(Xt(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?l:null,meta:r})}};function wn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o,operation:l}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:l}}const Bn=()=>e=>{let{select:t,dispatch:n}=e;t.isBlockInsertionPointVisible()&&n({type:"HIDE_INSERTION_POINT"})};function In(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const xn=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),r=t.getTemplate(),i=(0,l.synchronizeBlocksWithTemplate)(o,r);n.resetBlocks(i)},Tn=e=>t=>{let{registry:n,select:o,dispatch:r}=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,l.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,l.getBlockType)(v.name),k=o.getBlock(f.clientId),_=(0,l.getBlockType)(k.name),y=v.attributes[h.attributeKey],E=k.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=_.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,Zt,0,f.offset);const I=(0,l.cloneBlock)(v,{[h.attributeKey]:(0,z.toHTMLString)({value:w,...H(C)})}),x=(0,l.cloneBlock)(k,{[f.attributeKey]:(0,z.toHTMLString)({value:B,...H(S)})}),T=e?I:x,M=v.name===k.name?[T]:(0,l.switchToBlockType)(T,g.name);if(!M||!M.length)return;let N;if(e){const e=M.pop();N=g.merge(e.attributes,x.attributes)}else{const e=M.shift();N=g.merge(I.attributes,e.attributes)}const P=Qt(N),L=N[P],R=(0,z.create)({html:L,...H(g.attributes[P])}),A=R.text.indexOf(Zt),D=(0,z.remove)(R,A,A+1),O=(0,z.toHTMLString)({value:D,...H(g.attributes[P])});N[P]=O;const F=o.getSelectedBlockClientIds(),V=[...e?M:[],{...m,attributes:{...m.attributes,...N}},...e?[]:M];n.batch((()=>{r.selectionChange(m.clientId,P,A,A),r.replaceBlocks(F,V,0,o.getSelectedBlocksInitialCaretPosition())}))},Mn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();if(o.clientId===r.clientId)return;if(!o.attributeKey||!r.attributeKey||void 0===o.offset||void 0===r.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(r.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(r.clientId)?(a=r,c=o):(a=o,c=r);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,l.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,l.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=h.attributes[d.attributeKey];let _=(0,z.create)({html:f,...H(b)}),y=(0,z.create)({html:v,...H(k)});_=(0,z.remove)(_,u.offset,_.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:_,...H(b)})}},(0,l.createBlock)((0,l.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...H(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Nn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:l.clientId}})},Pn=(e,t)=>n=>{let{registry:o,select:r,dispatch:i}=n;const s=[e,t];i({type:"MERGE_BLOCKS",blocks:s});const[a,c]=s,u=r.getBlock(a),d=(0,l.getBlockType)(u.name);if(!d)return;const p=r.getBlock(c);if(d&&!d.merge){const e=(0,l.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,l.getBlockType)(p.name),{clientId:g,attributeKey:h,offset:f}=r.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 k=(0,l.cloneBlock)(u),_=(0,l.cloneBlock)(p);if(b){const e=g===a?k:_,t=e.attributes[h],n=(0,z.insert)((0,z.create)({html:t,...H(v)}),Zt,f,f);e.attributes[h]=(0,z.toHTMLString)({value:n,...H(v)})}const y=u.name===p.name?[_]:(0,l.switchToBlockType)(_,u.name);if(!y||!y.length)return;const E=d.merge(k.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(Zt),l=(0,z.remove)(n,o,o+1),r=(0,z.toHTMLString)({value:l,...H(d.attributes[e])});E[e]=r,i.selectionChange(u.clientId,e,o,o)}i.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},Ln=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;e=Xt(e);const r=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,r)&&(t&&l.selectPreviousBlock(e[0]),l({type:"REMOVE_BLOCKS",clientIds:e}),l((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function Rn(e,t){return Ln([e],t)}function An(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 Dn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function On(){return{type:"HIDE_BLOCK_INTERFACE"}}function zn(){return{type:"SHOW_BLOCK_INTERFACE"}}function Fn(){return{type:"START_TYPING"}}function Vn(){return{type:"STOP_TYPING"}}function Hn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Gn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Un(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Wn(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function $n(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const jn=(e,t,n)=>o=>{let{dispatch:r}=o;const i=(0,l.getDefaultBlockName)();if(!i)return;const s=(0,l.createBlock)(i,e);return r.insertBlock(s,n,t)};function Kn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function qn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Yn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Zn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Qn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Xn=()=>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"})}))},Jn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},eo=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,Yt.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,Yt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Yt.speak)((0,h.__)("You are currently in zoom-out mode."))},to=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,Yt.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."))}},no=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;const i=o.getBlocksByClientId(e);if(i.some((e=>!e)))return;const s=i.map((e=>e.name));if(s.some((e=>!(0,l.hasBlockSupport)(e,"multiple",!0))))return;const a=o.getBlockRootClientId(e[0]),c=Xt(e),u=o.getBlockIndex(c[c.length-1]),d=i.map((e=>(0,l.__experimentalCloneSanitizedBlock)(e)));return r.insertBlocks(d,u+1,a,t),d.length>1&&t&&r.multiSelect(d[0].clientId,d[d.length-1].clientId),d.map((e=>e.clientId))}},oo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const l=n.getBlockRootClientId(e);if(n.getTemplateLock(l))return;const r=n.getBlockIndex(e);return o.insertDefaultBlock({},l,r)},lo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const l=n.getBlockRootClientId(e);if(n.getTemplateLock(l))return;const r=n.getBlockIndex(e);return o.insertDefaultBlock({},l,r+1)};function ro(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const io=e=>async t=>{let{dispatch:n}=t;n(ro(e,!0)),await new Promise((e=>setTimeout(e,150))),n(ro(e,!1))};function so(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function ao(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function co(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const uo="core/block-editor",po={reducer:N,selectors:e,actions:t},mo=(0,d.createReduxStore)(uo,{...po,persist:["preferences"]});(0,d.registerStore)(uo,{...po,persist:["preferences"]});const go={name:"",isSelected:!1},ho=(0,s.createContext)(go),{Provider:fo}=ho;function vo(){return(0,s.useContext)(ho)}function bo(){const{isSelected:e,clientId:t,name:n}=vo();return(0,d.useSelect)((o=>{if(e)return!0;const{getBlockName:l,isFirstMultiSelectedBlock:r,getMultiSelectedBlockClientIds:i}=o(mo);return!!r(t)&&i().every((e=>l(e)===n))}),[t,e,n])}function ko(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:r=!1}=e;const i=function(e,t){const n=bo(),{clientId:o}=vo(),r=(0,d.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(mo),{hasBlockSupport:i}=e(l.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:r?g.parent.Fill:null}(t,r);return i?(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(i,null,(e=>{const l=(0,p.isEmpty)(e)?null:e;return(0,s.createElement)(m.__experimentalToolbarContext.Provider,{value:l},"default"===t&&(0,s.createElement)(m.ToolbarGroup,{controls:n}),o)}))):null}function _o(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(m.__experimentalToolbarContext),l=g[t].Slot,r=(0,m.__experimentalUseSlotFills)(l.__unstableName);return Boolean(r&&r.length)?"default"===t?(0,s.createElement)(l,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(l,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const yo=ko;yo.Slot=_o;const Eo=e=>(0,s.createElement)(ko,i({group:"inline"},e));Eo.Slot=e=>(0,s.createElement)(_o,i({group:"inline"},e));const Co=yo,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 9v6h11V9H9zM4 20h1.5V4H4v16z"})),wo=(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"})),Bo=(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"})),Io=(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"})),xo=(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"})),To=(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 Mo(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 No(e,t,n,o){var l,r;let i="";return null!=t&&null!==(l=t[n])&&void 0!==l&&null!==(r=l.spacingStyles)&&void 0!==r&&r.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${Mo(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function Po(e){const{contentSize:t,wideSize:n}=e,o={},l=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return l.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
+
o.none=(0,h.sprintf)((0,h.__)("Max %s wide"),t)),l.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 Lo=(0,s.createContext)({refs:new Map,callbacks:new Map});function Ro(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(Lo.Provider,{value:n},t)}function Ao(e){const{refs:t,callbacks:n}=(0,s.useContext)(Lo),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 Do(e){const{refs:t}=(0,s.useContext)(Lo),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,l]of t.entries())l===n.current&&o.current&&(e=o.current);return e}})),[])}function Oo(e){const{callbacks:t}=(0,s.useContext)(Lo),n=Do(e),[o,l]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(l,e),()=>{t.delete(l)}}),[e]),n.current||o}function zo(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function Fo(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Vo(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 Ho={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")},Go={top:void 0,right:void 0,bottom:void 0,left:void 0},Uo=["top","right","bottom","left"];function Wo(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function $o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uo;return Object.values(e).length>=1&&Object.values(e).length<t.length||new Set(Object.values(e)).size>1}function jo(e){return null!=e&&!(0,p.isEmpty)(Object.values(e).filter((e=>!!e)))}const Ko=(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"})),qo=["color","border","dimensions","typography","spacing"],Yo={"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},Zo={"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 Qo(e){const{name:t,clientId:n}=vo();return(0,d.useSelect)((o=>{if(qo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r;const i=(e=>Zo[e]||e)(e),s=[n,...o(mo).getBlockParents(n,!0)];for(const e of s){const n=o(mo).getBlockName(e);if((0,l.hasBlockSupport)(n,"__experimentalSettings",!1)){var a;const n=o(mo).getBlockAttributes(e);if(r=null!==(a=(0,p.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==a?a:(0,p.get)(n,`settings.${i}`),void 0!==r)break}}const c=o(mo).getSettings();if(void 0===r){var u;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;r=null!==(u=(0,p.get)(c,n))&&void 0!==u?u:(0,p.get)(c,e)}var d,m;if(void 0!==r)return l.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(m=r.custom)&&void 0!==m?m:r.theme)&&void 0!==d?d:r.default:r;const g=Yo[i]?Yo[i](c):void 0;return void 0!==g?g:"typography.dropCap"===i||void 0}),[t,n,e])}const Xo={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 Jo(e){var t,n,o,l,r;let{spacingSizes:i,value:a,side:u,onChange:p,isMixed:g=!1,type:f,minimumCustomValue:v,onMouseOver:b,onMouseOut:k}=e;a=function(e,t){if(zo(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 _=i;const y=i.length<=8,E=(0,d.useSelect)((e=>{const t=e(mo).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[C,S]=(0,s.useState)(!E&&void 0!==a&&!zo(a)),w=(0,m.__experimentalUseCustomUnits)({availableUnits:Qo("spacing.units")||["px","em","rem"]});let B=null;y||C||void 0===a||!(!zo(a)||zo(a)&&g)?g||(B=C?function(e,t){if(!zo(e))return e;const n=Vo(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}(a,i):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Vo(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(a,i)):(_=[...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}],B=_.length-1);const I=(0,s.useMemo)((()=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(B)),[B])[1]||w[0].value,x=e=>{var t;return void 0===a||null===(t=i[e])||void 0===t?void 0:t.name},T=parseFloat(B,10),M=(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}`},N=g?(0,h.__)("Mixed"):null,P=g?(0,h.__)("Mixed"):x(B),L=_.map(((e,t)=>({key:t,name:e.name}))),R=i.map(((e,t)=>({value:t,label:void 0}))),A=(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"),Ho[u],null==f?void 0:f.toLowerCase()),D=y&&!C&&void 0!==P;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"},Ho[u]),D&&(0,s.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},P)),"all"===u&&D&&(0,s.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},P),!E&&(0,s.createElement)(m.Button,{label:C?(0,h.__)("Use size preset"):(0,h.__)("Set custom size"),icon:Ko,onClick:()=>{S(!C)},isPressed:C,isSmall:!0,className:c()({"components-spacing-sizes-control__custom-toggle-all":"all"===u,"components-spacing-sizes-control__custom-toggle-single":"all"!==u}),iconSize:24}),C&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.__experimentalUnitControl,{onMouseOver:b,onMouseOut:k,onChange:e=>p((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:B,units:w,min:v,placeholder:N,disableUnits:g,label:A,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,s.createElement)(m.RangeControl,{onMouseOver:b,onMouseOut:k,value:T,min:0,max:null!==(t=null===(n=Xo[I])||void 0===n?void 0:n.max)&&void 0!==t?t:10,step:null!==(o=null===(l=Xo[I])||void 0===l?void 0:l.steps)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{p([e,I].join(""))},className:"components-spacing-sizes-control__custom-value-range"})),y&&!C&&(0,s.createElement)(m.RangeControl,{onMouseOver:b,onMouseOut:k,className:"components-spacing-sizes-control__range-control",value:B,onChange:e=>p(M(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":B,"aria-valuetext":null===(r=i[B])||void 0===r?void 0:r.name,renderTooltipContent:x,min:0,max:i.length-1,marks:R,label:A,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),!y&&!C&&(0,s.createElement)(m.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:L.find((e=>e.key===B))||"",onChange:e=>{p(M(e.selectedItem.key,"selectList"))},options:L,label:A,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:b,onMouseOut:k}))}function el(e){let{onChange:t,values:n,sides:o,spacingSizes:l,type:r,minimumCustomValue:i,onMouseOver:a,onMouseOut:c}=e;const u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Wo(Object.values(e))}(n),d=jo(n)&&$o(n,o);return(0,s.createElement)(Jo,{value:u,onChange:e=>{const l=(0,m.__experimentalApplyValueToSides)(n,e,o);t(l)},side:"all",spacingSizes:l,isMixed:d,type:r,minimumCustomValue:i,onMouseOver:a,onMouseOut:c})}function tl(e){let{values:t,sides:n,onChange:o,spacingSizes:l,type:r,minimumCustomValue:i,onMouseOver:a,onMouseOut:c}=e;const u=null!=n&&n.length?Uo.filter((e=>n.includes(e))):Uo,d=e=>n=>{const l={...t};l[e]=n,o(l)};return(0,s.createElement)(s.Fragment,null,u.map((e=>(0,s.createElement)(Jo,{value:t[e],label:Ho[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:d(e),spacingSizes:l,type:r,minimumCustomValue:i,onMouseOver:a,onMouseOut:c}))))}const nl=["vertical","horizontal"];function ol(e){let{onChange:t,values:n,sides:o,spacingSizes:l,type:r,minimumCustomValue:i,onMouseOver:a,onMouseOut:c}=e;const u=e=>o=>{if(!t)return;const l={...n};"vertical"===e&&(l.top=o,l.bottom=o),"horizontal"===e&&(l.left=o,l.right=o),t(l)},d=null!=o&&o.length?nl.filter((e=>o.includes(e))):nl;return(0,s.createElement)(s.Fragment,null,d.map((e=>{const t="vertical"===e?n.top:n.left;return(0,s.createElement)(Jo,{value:t,onChange:u(e),label:Ho[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:l,type:r,minimumCustomValue:i,onMouseOver:a,onMouseOut:c})})))}const ll=(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"})),rl=(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 il(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?ll:rl,iconSize:24,"aria-label":o,onClick:n})))}function sl(e){let{inputProps:t,onChange:n,label:o=(0,h.__)("Spacing Control"),values:l,sides:r,splitOnAxis:a=!1,useSelect:u,minimumCustomValue:d=0,onMouseOver:p,onMouseOut:g}=e;const f=[{name:0,slug:"0",size:0},...Qo("spacing.spacingSizes")||[]];f.length>8&&f.unshift({name:(0,h.__)("Default"),slug:"default",size:void 0});const v=l||Go,b=jo(l),k=1===(null==r?void 0:r.length),[_,y]=(0,s.useState)(!b||!$o(v,r)||k),E={...t,onChange:e=>{const t={...l,...e};n(t)},isLinked:_,sides:r,values:v,spacingSizes:f,useSelect:u,type:o,minimumCustomValue:d,onMouseOver:p,onMouseOut:g};return(0,s.createElement)("fieldset",{role:"region",className:c()("component-spacing-sizes-control",{"is-unlinked":!_})},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},o),!k&&(0,s.createElement)(il,{onClick:()=>{y(!_)},isLinked:_}),_&&(0,s.createElement)(el,i({"aria-label":o},E)),!_&&a&&(0,s.createElement)(ol,E),!_&&!a&&(0,s.createElement)(tl,E))}window.wp.warning;const al={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 cl(e){var t;let{__experimentalGroup:n="default",children:o}=e;const l=bo(),r=null===(t=al[n])||void 0===t?void 0:t.Fill;return r?l?(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(r,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 ul=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,p.mapValues)(e,ul)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,p.isEmpty)(t)?void 0:t};function dl(e,t,n){return(0,p.setWith)(e?(0,p.clone)(e):{},t,n,p.clone)}function pl(e,t,n,o,l,r){var i;if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===r.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(r.length>1&&o.length>1){if(!o[l])return n;var a;s=null===(a=o[l])||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:dl(c.attributes,e,t)})}))})),c}function ml(e,t,n){const o=(0,l.getBlockSupport)(e,t),r=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function gl(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:l}=(0,d.useDispatch)(mo),{getBlockAttributes:r,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,d.useSelect)(mo),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}=r(n);let l={style:o};e.forEach((e=>{l={...l,...e(l)}})),l={...l,style:ul(l.style)},t[n]=l})),l(n,t,!0)}),[ul,r,i,c,u,l]);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 hl(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 fl(e){var t;let{__experimentalGroup:n="default",label:o,...l}=e;const r=null===(t=al[n])||void 0===t?void 0:t.Slot,a=(0,m.__experimentalUseSlot)(null==r?void 0:r.__unstableName),c=(0,m.__experimentalUseSlotFills)(null==r?void 0:r.__unstableName);return r&&a?Boolean(c&&c.length)?o?(0,s.createElement)(gl,{group:n,label:o},(0,s.createElement)(hl,i({},l,{Slot:r}))):(0,s.createElement)(r,i({},l,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const vl=cl;vl.Slot=fl;const bl=e=>(0,s.createElement)(cl,i({},e,{__experimentalGroup:"advanced"}));bl.Slot=e=>(0,s.createElement)(fl,i({},e,{__experimentalGroup:"advanced"})),bl.slotName="InspectorAdvancedControls";const kl=vl,_l=window.wp.isShallowEqual;var yl=n.n(_l);const El=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])},Cl=Number.MAX_SAFE_INTEGER,Sl=(0,s.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:l,__unstableRefreshSize:r,__unstableCoverTarget:a=!1,__unstablePopoverSlot:d,__unstableContentRef:p,shift:g=!0,...h}=e;const f=Oo(n),v=Oo(null!=o?o:n),b=(0,u.useMergeRefs)([t,El(p)]),[k,_]=(0,s.useReducer)((e=>(e+1)%Cl),0);(0,s.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(_);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]);const y=(0,s.useMemo)((()=>k<0||!f||v!==f?{}:{position:"absolute",width:f.offsetWidth,height:f.offsetHeight}),[f,v,r,k]),E=(0,s.useMemo)((()=>{if(!(k<0||!f||o&&!v))return{getBoundingClientRect(){var e,t,n,o;const l=f.getBoundingClientRect(),r=null==v?void 0:v.getBoundingClientRect(),i=Math.min(l.left,null!==(e=null==r?void 0:r.left)&&void 0!==e?e:1/0),s=Math.min(l.top,null!==(t=null==r?void 0:r.top)&&void 0!==t?t:1/0),a=Math.max(l.right,null!==(n=r.right)&&void 0!==n?n:-1/0)-i,c=Math.max(l.bottom,null!==(o=r.bottom)&&void 0!==o?o:-1/0)-s;return new window.DOMRect(i,s,a,c)},ownerDocument:f.ownerDocument}}),[o,v,f,k]);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),variant:"unstyled"}),a&&(0,s.createElement)("div",{style:y},l),!a&&l)}));function wl(e){const t=(0,l.getBlockSupport)(e,Ol);return!!(!0===t||null!=t&&t.margin)}function Bl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Qo("spacing.margin"),n=!Wl(e,"margin");return!wl(e)||t||n}function Il(e){var t,n;const{name:o,attributes:{style:l},setAttributes:r,onMouseOver:i,onMouseOut:a}=e,c=Qo("spacing.spacingSizes"),u=(0,m.__experimentalUseCustomUnits)({availableUnits:Qo("spacing.units")||["%","px","em","rem","vw"]}),d=Ul(o,"margin"),p=d&&d.some((e=>Fl.includes(e)));if(Bl(e))return null;const g=e=>{const t={...l,spacing:{...null==l?void 0:l.spacing,margin:e}};r({style:ul(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!c||0===(null==c?void 0:c.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==l||null===(t=l.spacing)||void 0===t?void 0:t.margin,onChange:g,label:(0,h.__)("Margin"),sides:d,units:u,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==c?void 0:c.length)>0&&(0,s.createElement)(sl,{values:null==l||null===(n=l.spacing)||void 0===n?void 0:n.margin,onChange:g,label:(0,h.__)("Margin"),sides:d,units:u,allowReset:!1,splitOnAxis:!1,onMouseOver:i,onMouseOut:a})),native:null})}function xl(e){var t,n;let{clientId:o,attributes:l,forceShow:r}=e;const i=null==l||null===(t=l.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,a=(0,s.useMemo)((()=>{const e=null!=i&&i.top?Fo(null==i?void 0:i.top):0,t=null!=i&&i.right?Fo(null==i?void 0:i.right):0,n=null!=i&&i.bottom?Fo(null==i?void 0:i.bottom):0,o=null!=i&&i.left?Fo(null==i?void 0:i.left):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:e?`calc(${e} * -1)`:0,right:t?`calc(${t} * -1)`:0,bottom:n?`calc(${n} * -1)`:0,left:o?`calc(${o} * -1)`:0}}),[i]),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(i),p=(0,s.useRef)();return(0,s.useEffect)((()=>(yl()(i,d.current)||r||(u(!0),d.current=i,p.current=setTimeout((()=>{u(!1)}),400)),()=>{u(!1),p.current&&window.clearTimeout(p.current)})),[i,r]),c||r?(0,s.createElement)(Sl,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,shift:!1},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function Tl(e){const t=(0,l.getBlockSupport)(e,Dl);return!!(!0===t||null!=t&&t.minHeight)}function Ml(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Qo("dimensions.minHeight");return!Tl(e)||t}function Nl(e){var t;const{attributes:{style:n},setAttributes:o}=e,l=(0,m.__experimentalUseCustomUnits)({availableUnits:Qo("dimensions.units")||["%","px","em","rem","vh","vw"]});return Ml(e)?null:(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Min. height"),value:null==n||null===(t=n.dimensions)||void 0===t?void 0:t.minHeight,units:l,onChange:e=>{const t={...n,dimensions:{...null==n?void 0:n.dimensions,minHeight:e}};o({style:ul(t)})},min:0,size:"__unstable-large"})}function Pl(e){const t=(0,l.getBlockSupport)(e,Ol);return!!(!0===t||null!=t&&t.padding)}function Ll(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Qo("spacing.padding"),n=!Wl(e,"padding");return!Pl(e)||t||n}function Rl(e){var t,n;const{name:o,attributes:{style:l},setAttributes:r,onMouseOver:i,onMouseOut:a}=e,c=Qo("spacing.spacingSizes"),u=(0,m.__experimentalUseCustomUnits)({availableUnits:Qo("spacing.units")||["%","px","em","rem","vw"]}),d=Ul(o,"padding"),p=d&&d.some((e=>Fl.includes(e)));if(Ll(e))return null;const g=e=>{const t={...l,spacing:{...null==l?void 0:l.spacing,padding:e}};r({style:ul(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!c||0===(null==c?void 0:c.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==l||null===(t=l.spacing)||void 0===t?void 0:t.padding,onChange:g,label:(0,h.__)("Padding"),sides:d,units:u,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==c?void 0:c.length)>0&&(0,s.createElement)(sl,{values:null==l||null===(n=l.spacing)||void 0===n?void 0:n.padding,onChange:g,label:(0,h.__)("Padding"),sides:d,units:u,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a})),native:null})}function Al(e){var t,n;let{clientId:o,attributes:l,forceShow:r}=e;const i=null==l||null===(t=l.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,a=(0,s.useMemo)((()=>({borderTopWidth:null!=i&&i.top?Fo(null==i?void 0:i.top):0,borderRightWidth:null!=i&&i.right?Fo(null==i?void 0:i.right):0,borderBottomWidth:null!=i&&i.bottom?Fo(null==i?void 0:i.bottom):0,borderLeftWidth:null!=i&&i.left?Fo(null==i?void 0:i.left):0})),[i]),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(i),p=(0,s.useRef)();return(0,s.useEffect)((()=>(yl()(i,d.current)||r||(u(!0),d.current=i,p.current=setTimeout((()=>{u(!1)}),400)),()=>{u(!1),p.current&&window.clearTimeout(p.current)})),[i,r]),c||r?(0,s.createElement)(Sl,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,shift:!1},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}const Dl="dimensions",Ol="spacing",zl=["top","right","bottom","left"],Fl=["vertical","horizontal"];function Vl(){const[e,t]=(0,s.useState)(!1),{__experimentalHideBlockInterface:n,__experimentalShowBlockInterface:o}=(0,d.useDispatch)(mo);return{isMouseOver:e,onMouseOver:e=>{e.stopPropagation(),n(),t(!0)},onMouseOut:e=>{e.stopPropagation(),o(),t(!1)}}}function Hl(e){const t=ql(e),n=Ll(e),o=Bl(e),r=Ml(e),a=Gl(e),u=(f=e.name,"web"===s.Platform.OS&&($l(f)||Tl(f)||Pl(f)||wl(f))),d=Qo("spacing.spacingSizes"),p=Vl(),g=Vl();var f;if(a||!u)return null;const v=(0,l.getBlockSupport)(e.name,[Dl,"__experimentalDefaultControls"]),b=(0,l.getBlockSupport)(e.name,[Ol,"__experimentalDefaultControls"]),k=(e,t)=>n=>{var o;return{...n,style:{...n.style,[t]:{...null===(o=n.style)||void 0===o?void 0:o[t],[e]:void 0}}}},_=c()({"tools-panel-item-spacing":d&&d.length>0});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(kl,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:_,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:ul({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:k("padding","spacing"),isShownByDefault:null==b?void 0:b.padding,panelId:e.clientId},(0,s.createElement)(Rl,i({onMouseOver:p.onMouseOver,onMouseOut:p.onMouseOut},e))),!o&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:_,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:ul({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:k("margin","spacing"),isShownByDefault:null==b?void 0:b.margin,panelId:e.clientId},(0,s.createElement)(Il,i({onMouseOver:g.onMouseOver,onMouseOut:g.onMouseOut},e))),!t&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:_,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:k("blockGap","spacing"),isShownByDefault:null==b?void 0:b.blockGap,panelId:e.clientId},(0,s.createElement)(Yl,e)),!r&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.dimensions)||void 0===n?void 0:n.minHeight)}(e),label:(0,h.__)("Min. height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ul({...o,dimensions:{...null==o?void 0:o.dimensions,minHeight:void 0}})})}(e),resetAllFilter:k("minHeight","dimensions"),isShownByDefault:null==v?void 0:v.minHeight,panelId:e.clientId},(0,s.createElement)(Nl,e))),!n&&(0,s.createElement)(Al,i({forceShow:p.isMouseOver},e)),!o&&(0,s.createElement)(xl,i({forceShow:g.isMouseOver},e)))}const Gl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=ql(e),n=Ml(e),o=Ll(e),l=Bl(e);return t&&n&&o&&l};function Ul(e,t){var n;const o=(0,l.getBlockSupport)(e,Ol);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 Wl(e,t){const n=Ul(e,t);return!(n&&n.some((e=>zl.includes(e)))&&n.some((e=>Fl.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function $l(e){const t=(0,l.getBlockSupport)(e,Ol);return!!(!0===t||null!=t&&t.blockGap)}function jl(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 Kl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=jl(e);if(!n)return null;const o=Fo(null==n?void 0:n.top)||t,l=Fo(null==n?void 0:n.left)||t;return o===l?o:`${o} ${l}`}function ql(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Qo("spacing.blockGap");return!$l(e)||t}function Yl(e){var t;const{clientId:n,attributes:{style:o},name:l,setAttributes:r}=e,i=Qo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Qo("spacing.units")||["%","px","em","rem","vw"]}),c=Ul(l,"blockGap"),u=Do(n);if(ql(e))return null;const d=c&&c.some((e=>Fl.includes(e))),p=e=>{var t;let n=e;e&&d?n={...jl(e)}:null!=e&&e.hasOwnProperty("top")&&(n=e.top);const l={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};r({style:ul(l)});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=jl(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)(sl,{values:f,onChange:p,label:(0,h.__)("Block spacing"),sides:d?c:["top"],units:a,allowReset:!1,splitOnAxis:d})),native:null})}const Zl=(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"})),Ql=(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"})),Xl={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:Ql,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Zl,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},Jl=["top","center","bottom"],er={variant:"toolbar"},tr=function(e){let{value:t,onChange:n,controls:o=Jl,isCollapsed:l=!0,isToolbar:r}=e;const a=Xl[t],c=Xl.top,u=r?m.ToolbarGroup:m.ToolbarDropdownMenu,d=r?{isCollapsed:l}:{popoverProps:{POPOVER_PROPS:er}};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{...Xl[e],isActive:t===e,role:l?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},nr=e=>(0,s.createElement)(tr,i({},e,{isToolbar:!1})),or=e=>(0,s.createElement)(tr,i({},e,{isToolbar:!0})),lr={left:So,center:wo,right:Bo,"space-between":Io},rr=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:l,popoverProps:r,isToolbar:a}=e;const c=e=>{o(e===l?void 0:e)},u=l?lr[l]:lr.left,d=[{name:"left",icon:So,title:(0,h.__)("Justify items left"),isActive:"left"===l,onClick:()=>c("left")},{name:"center",icon:wo,title:(0,h.__)("Justify items center"),isActive:"center"===l,onClick:()=>c("center")},{name:"right",icon:Bo,title:(0,h.__)("Justify items right"),isActive:"right"===l,onClick:()=>c("right")},{name:"space-between",icon:Io,title:(0,h.__)("Space between items"),isActive:"space-between"===l,onClick:()=>c("space-between")}],p=a?m.ToolbarGroup:m.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(p,i({icon:u,popoverProps:r,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},ir=e=>(0,s.createElement)(rr,i({},e,{isToolbar:!1})),sr=e=>(0,s.createElement)(rr,i({},e,{isToolbar:!0})),ar={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},cr={left:"flex-start",right:"flex-end",center:"center"},ur={top:"flex-start",center:"center",bottom:"flex-end"},dr=["wrap","nowrap"],pr={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:l=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Flex,null,(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(gr,{layout:t,onChange:n})),(0,s.createElement)(m.FlexItem,null,l&&(0,s.createElement)(fr,{layout:t,onChange:n}))),(0,s.createElement)(hr,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:l=!0}=o;return(0,s.createElement)(Co,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(gr,{layout:t,onChange:n,isToolbar:!0}),l&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(mr,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:l,style:r,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=l,u=null!=r&&null!==(t=r.spacing)&&void 0!==t&&t.blockGap&&!ml(i,"spacing","blockGap")?Kl(null==r||null===(n=r.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=ar[l.justifyContent],p=dr.includes(l.flexWrap)?l.flexWrap:"wrap",m=ur[l.verticalAlignment],g=cr[l.justifyContent]||cr.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=`${Mo(o)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),s&&u&&(h+=No(o,a,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function mr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:l=ur.center}=t,r=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(nr,{onChange:r,value:l});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:l===e,onClick:()=>r(e)})))))}function gr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:l="left",orientation:r="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===r&&a.push("space-between"),o)return(0,s.createElement)(ir,{allowedControls:a,value:l,onChange:i,popoverProps:{position:"bottom right",variant:"toolbar"}});const c=[{value:"left",icon:So,label:(0,h.__)("Justify items left")},{value:"center",icon:wo,label:(0,h.__)("Justify items center")},{value:"right",icon:Bo,label:(0,h.__)("Justify items right")}];return"horizontal"===r&&c.push({value:"space-between",icon:Io,label:(0,h.__)("Space between items")}),(0,s.createElement)(m.__experimentalToggleGroupControl,{label:(0,h.__)("Justification"),value:l,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls"},c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})})))}function hr(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 fr(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)(m.__experimentalToggleGroupControl,{className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,h.__)("Orientation"),value:o,onChange:e=>n({...t,orientation:e})},(0,s.createElement)(m.__experimentalToggleGroupControlOptionIcon,{icon:xo,value:"horizontal",label:(0,h.__)("Horizontal")}),(0,s.createElement)(m.__experimentalToggleGroupControlOptionIcon,{icon:To,value:"vertical",label:(0,h.__)("Vertical")}))}const vr={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:l,hasBlockGapSupport:r,layoutDefinitions:i}=e;const s=Kl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let a="";ml(l,"spacing","blockGap")||(null!=s&&s.top?a=Kl(null==s?void 0:s.top):"string"==typeof s&&(a=Kl(s)));let c="";return r&&a&&(c+=No(n,i,"default",a)),c},getOrientation:()=>"vertical",getAlignments(e){const t=Po(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,l=[{name:"left"},{name:"center"},{name:"right"}];return n&&l.unshift({name:"full"}),o&&l.unshift({name:"wide",info:t.wide}),l.unshift({name:"none",info:t.none}),l}},br=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},kr=(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"})),_r=(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"})),yr=window.wp.styleEngine,Er={name:"constrained",label:(0,h.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:l,justifyContent:r="center"}=t,i=[{value:"left",icon:So,label:(0,h.__)("Justify items left")},{value:"center",icon:wo,label:(0,h.__)("Justify items center")},{value:"right",icon:Bo,label:(0,h.__)("Justify items right")}],a=(0,m.__experimentalUseCustomUnits)({availableUnits:Qo("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:l||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,s.createElement)(br,{icon:kr})),(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||l||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,s.createElement)(br,{icon:_r}))),(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,{label:(0,h.__)("Justification"),value:r,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:l={},style:r,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{contentSize:c,wideSize:u,justifyContent:d}=l,p=Kl(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap);let m="";ml(i,"spacing","blockGap")||(null!=p&&p.top?m=Kl(null==p?void 0:p.top):"string"==typeof p&&(m=Kl(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${Mo(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${Mo(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${Mo(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+=`${Mo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${g}; }`:"right"===d&&(f+=`${Mo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),null!=r&&null!==(n=r.spacing)&&void 0!==n&&n.padding&&(0,yr.getCSSRules)(r).forEach((e=>{"paddingRight"===e.key?f+=`\n\t\t\t\t\t${Mo(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${Mo(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+=No(o,a,"constrained",m)),f},getOrientation:()=>"vertical",getAlignments(e){const t=Po(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,l=[{name:"left"},{name:"center"},{name:"right"}];return n&&l.unshift({name:"full"}),o&&l.unshift({name:"wide",info:t.wide}),l.unshift({name:"none",info:t.none}),l}},Cr=[vr,pr,Er];function Sr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Cr.find((t=>t.name===e))}const wr={type:"default"},Br=(0,s.createContext)(wr),Ir=Br.Provider;function xr(){return(0,s.useContext)(Br)}function Tr(e){let{layout:t={},css:n,...o}=e;const l=Sr(t.type),r=null!==Qo("spacing.blockGap");if(l){var i;if(n)return(0,s.createElement)("style",null,n);const e=null===(i=l.getLayoutStyle)||void 0===i?void 0:i.call(l,{hasBlockGapSupport:r,layout:t,...o});if(e)return(0,s.createElement)("style",null,e)}return null}const Mr=["none","left","center","right","wide","full"],Nr=["wide","full"];function Pr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,d.useSelect)((e=>{const{getSettings:t}=e(mo),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=xr(),l=Sr(null==o?void 0:o.type),r=l.getAlignments(o);if(n){const t=r.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==l.name&&"constrained"!==l.name)return[];const{alignments:i=Mr}=o,s=e.filter((e=>(o.alignments||t||!Nr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Lr=(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"})),Rr=(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"})),Ar=(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"})),Dr=(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"})),Or={none:{icon:Lr,title:(0,h._x)("None","Alignment option")},left:{icon:Rr,title:(0,h.__)("Align left")},center:{icon:kr,title:(0,h.__)("Align center")},right:{icon:Ar,title:(0,h.__)("Align right")},wide:{icon:_r,title:(0,h.__)("Wide width")},full:{icon:Dr,title:(0,h.__)("Full width")}},zr={variant:"toolbar"},Fr=function(e){let{value:t,onChange:n,controls:o,isToolbar:l,isCollapsed:r=!0}=e;const a=Pr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Or[t],p=Or.none,g=l?m.ToolbarGroup:m.ToolbarDropdownMenu,f={icon:d?d.icon:p.icon,label:(0,h.__)("Align")},v=l?{isCollapsed:r,controls:a.map((e=>{let{name:n}=e;return{...Or[n],isActive:t===n||!t&&"none"===n,role:r?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{toggleProps:{describedBy:(0,h.__)("Change alignment")},popoverProps:zr,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:l}=e;const{icon:r,title:i}=Or[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(m.MenuItem,{key:o,icon:r,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:l},i)}))))}};return(0,s.createElement)(g,i({},f,v))},Vr=e=>(0,s.createElement)(Fr,i({},e,{isToolbar:!1})),Hr=e=>(0,s.createElement)(Fr,i({},e,{isToolbar:!0})),Gr=["left","center","right","wide","full"],Ur=["wide","full"];function Wr(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)?Gr.filter((t=>e.includes(t))):!0===e?[...Gr]:[],!o||!0===e&&!n?t.filter((e=>!Ur.includes(e))):t}const $r=(0,u.createHigherOrderComponent)((e=>t=>{const n=(0,s.createElement)(e,t),{name:o}=t,r=Pr(Wr((0,l.getBlockSupport)(o,"align"),(0,l.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),i=(0,d.useSelect)((e=>e(mo).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return!r.length||i?n:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Co,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Vr,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const r=(0,l.getBlockType)(t.name);(null==r||null===(n=r.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),jr=(0,u.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,a=Pr(Wr((0,l.getBlockSupport)(n,"align"),(0,l.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===r))&&(c={...c,"data-align":r}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,r.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,l.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Gr,""]}}),e})),(0,r.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",jr),(0,r.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",$r),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Wr((0,l.getBlockSupport)(t,"align"),(0,l.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,r.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 Kr=/[\s#]/g,qr={type:"string",source:"attribute",attribute:"id",selector:"*"},Yr=(0,u.createHigherOrderComponent)((e=>t=>{if((0,l.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(Kr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(kl,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(kl,null,(0,s.createElement)(m.PanelBody,{title:(0,h.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,r.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,l.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:qr}),e})),(0,r.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Yr),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,l.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Zr={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,r.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,l.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Zr}),e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,l.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Qr=(0,u.createHigherOrderComponent)((e=>t=>(0,l.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(kl,{__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,r.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,l.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,r.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Qr),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,l.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,r.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,l.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 r;const o=null===(r=t[n])||void 0===r?void 0:r.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,l.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,l.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,l.getBlockDefaultClassName)(t.name)),e}));const Xr=window.wp.dom,Jr=(0,s.createContext)({});function ei(e){let{value:t,children:n}=e;const o=(0,s.useContext)(Jr),l=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(Jr.Provider,{value:l,children:n})}const ti=Jr,ni={},oi=(0,m.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,l.getBlockType)(n),r=(0,s.useContext)(ti),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,p.pick)(r,o.usesContext):ni),[o,r]);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,l.hasBlockSupport)(o,"className",!0)?(0,l.getBlockDefaultClassName)(n):null,m=c()(d,t.className,e.className);return(0,s.createElement)(u,i({},e,{context:a,className:m}))}));function li(e){const{name:t,isSelected:n,clientId:o,__unstableLayoutClassNames:l}=e,r={name:t,isSelected:n,clientId:o,__unstableLayoutClassNames:l};return(0,s.createElement)(fo,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(oi,e))}const ri=(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"})),ii=function(e){let{className:t,actions:n,children:o,secondaryActions:l}=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||l)&&(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))),l&&(0,s.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:ri,label:(0,h.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(m.MenuGroup,null,l.map(((e,t)=>(0,s.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))};var si=n(1973);function ai(e){let{title:t,rawContent:n,renderedContent:o,action:l,actionText:r,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,Xr.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(m.Button,{variant:"secondary",tabIndex:"0",onClick:l},r)))}const ci=function(e){let{block:t,onKeep:n,onConvert:o,convertor:r,convertButtonText:i}=e;const a=(u=r(t),(Array.isArray(u)?u:[u]).map((e=>(0,l.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var u;const d=(p=t.originalContent,m=a,(0,si.Kx)(p,m).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 p,m;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(ai,{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)(ai,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:d,renderedContent:a}))},ui=e=>(0,l.rawHandler)({HTML:e.originalContent}),di=(0,u.compose)([(0,d.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(mo).getBlock(n)}})),(0,d.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(mo);return{convertToClassic(){o(n.clientId,(e=>(0,l.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,l.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,ui(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,l.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:r,block:i}=e;const a=!!(0,l.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)(ii,{actions:[(0,s.createElement)(m.Button,{key:"recover",onClick:r,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)(ci,{block:i,onKeep:t,onConvert:n,convertor:ui,convertButtonText:(0,h.__)("Convert to Blocks")})))})),pi=(0,s.createElement)(ii,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),mi=()=>pi;class gi 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 hi=gi;var fi=n(773);const vi=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),r=(0,d.useSelect)((e=>e(mo).getBlock(t)),[t]),{updateBlock:i}=(0,d.useDispatch)(mo);return(0,s.useEffect)((()=>{o((0,l.getBlockContent)(r))}),[r]),(0,s.createElement)(fi.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,l.getBlockType)(r.name);if(!e)return;const s=(0,l.getBlockAttributes)(e,n,r.attributes),a=n||(0,l.getSaveContent)(e,s),[c]=n?(0,l.validateBlock)({...r,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let bi=Ri();const ki=e=>Mi(e,bi);let _i=Ri();ki.write=e=>Mi(e,_i);let yi=Ri();ki.onStart=e=>Mi(e,yi);let Ei=Ri();ki.onFrame=e=>Mi(e,Ei);let Ci=Ri();ki.onFinish=e=>Mi(e,Ci);let Si=[];ki.setTimeout=(e,t)=>{let n=ki.now()+t,o=()=>{let e=Si.findIndex((e=>e.cancel==o));~e&&Si.splice(e,1),xi-=~e?1:0},l={time:n,handler:e,cancel:o};return Si.splice(wi(n),0,l),xi+=1,Ni(),l};let wi=e=>~(~Si.findIndex((t=>t.time>e))||~Si.length);ki.cancel=e=>{yi.delete(e),Ei.delete(e),Ci.delete(e),bi.delete(e),_i.delete(e)},ki.sync=e=>{Ti=!0,ki.batchedUpdates(e),Ti=!1},ki.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,ki.onStart(n)}return o.handler=e,o.cancel=()=>{yi.delete(n),t=null},o};let Bi="undefined"!=typeof window?window.requestAnimationFrame:()=>{};ki.use=e=>Bi=e,ki.now="undefined"!=typeof performance?()=>performance.now():Date.now,ki.batchedUpdates=e=>e(),ki.catch=console.error,ki.frameLoop="always",ki.advance=()=>{"demand"!==ki.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Li()};let Ii=-1,xi=0,Ti=!1;function Mi(e,t){Ti?(t.delete(e),e(0)):(t.add(e),Ni())}function Ni(){Ii<0&&(Ii=0,"demand"!==ki.frameLoop&&Bi(Pi))}function Pi(){~Ii&&(Bi(Pi),ki.batchedUpdates(Li))}function Li(){let e=Ii;Ii=ki.now();let t=wi(Ii);t&&(Ai(Si.splice(0,t),(e=>e.handler())),xi-=t),xi?(yi.flush(),bi.flush(e?Math.min(64,Ii-e):16.667),Ei.flush(),_i.flush(),Ci.flush()):Ii=-1}function Ri(){let e=new Set,t=e;return{add(n){xi+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(xi-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,xi-=t.size,Ai(t,(t=>t(n)&&e.add(t))),xi+=e.size,t=e)}}}function Ai(e,t){e.forEach((e=>{try{t(e)}catch(e){ki.catch(e)}}))}var Di=n(9196),Oi=n.n(Di);function zi(){}const Fi={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 Vi(e,t){if(Fi.arr(e)){if(!Fi.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 Hi=(e,t)=>e.forEach(t);function Gi(e,t,n){if(Fi.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 Ui=e=>Fi.und(e)?[]:Fi.arr(e)?e:[e];function Wi(e,t){if(e.size){const n=Array.from(e);e.clear(),Hi(n,t)}}const $i=(e,...t)=>Wi(e,(e=>e(...t))),ji=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Ki,qi,Yi=null,Zi=!1,Qi=zi;var Xi=Object.freeze({__proto__:null,get createStringInterpolator(){return Ki},get to(){return qi},get colors(){return Yi},get skipAnimation(){return Zi},get willAdvance(){return Qi},assign:e=>{e.to&&(qi=e.to),e.now&&(ki.now=e.now),void 0!==e.colors&&(Yi=e.colors),null!=e.skipAnimation&&(Zi=e.skipAnimation),e.createStringInterpolator&&(Ki=e.createStringInterpolator),e.requestAnimationFrame&&ki.use(e.requestAnimationFrame),e.batchedUpdates&&(ki.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Qi=e.willAdvance),e.frameLoop&&(ki.frameLoop=e.frameLoop)}});const Ji=new Set;let es=[],ts=[],ns=0;const os={get idle(){return!Ji.size&&!es.length},start(e){ns>e.priority?(Ji.add(e),ki.onStart(ls)):(rs(e),ki(ss))},advance:ss,sort(e){if(ns)ki.onFrame((()=>os.sort(e)));else{const t=es.indexOf(e);~t&&(es.splice(t,1),is(e))}},clear(){es=[],Ji.clear()}};function ls(){Ji.forEach(rs),Ji.clear(),ki(ss)}function rs(e){es.includes(e)||is(e)}function is(e){es.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(es),0,e)}function ss(e){const t=ts;for(let n=0;n<es.length;n++){const o=es[n];ns=o.priority,o.idle||(Qi(o),o.advance(e),o.idle||t.push(o))}return ns=0,ts=es,ts.length=0,es=t,es.length>0}const as="[-+]?\\d*\\.?\\d+",cs=as+"%";function us(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const ds=new RegExp("rgb"+us(as,as,as)),ps=new RegExp("rgba"+us(as,as,as,as)),ms=new RegExp("hsl"+us(as,cs,cs)),gs=new RegExp("hsla"+us(as,cs,cs,as)),hs=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,fs=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,vs=/^#([0-9a-fA-F]{6})$/,bs=/^#([0-9a-fA-F]{8})$/;function ks(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 _s(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o,r=ks(l,o,e+1/3),i=ks(l,o,e),s=ks(l,o,e-1/3);return Math.round(255*r)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function ys(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Es(e){return(parseFloat(e)%360+360)%360/360}function Cs(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Ss(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function ws(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=vs.exec(e))?parseInt(t[1]+"ff",16)>>>0:Yi&&void 0!==Yi[e]?Yi[e]:(t=ds.exec(e))?(ys(t[1])<<24|ys(t[2])<<16|ys(t[3])<<8|255)>>>0:(t=ps.exec(e))?(ys(t[1])<<24|ys(t[2])<<16|ys(t[3])<<8|Cs(t[4]))>>>0:(t=hs.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=bs.exec(e))?parseInt(t[1],16)>>>0:(t=fs.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ms.exec(e))?(255|_s(Es(t[1]),Ss(t[2]),Ss(t[3])))>>>0:(t=gs.exec(e))?(_s(Es(t[1]),Ss(t[2]),Ss(t[3]))|Cs(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 Bs=(e,t,n)=>{if(Fi.fun(e))return e;if(Fi.arr(e))return Bs({range:e,output:t,extrapolate:n});if(Fi.str(e.output[0]))return Ki(e);const o=e,l=o.output,r=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,r);return function(e,t,n,o,l,r,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===l?o:t===n?e<=t?o:l:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=r(c),o===-1/0?c=-c:l===1/0?c+=o:c=c*(l-o)+o,c)}(e,r[t],r[t+1],l[t],l[t+1],a,i,s,o.map)}};function Is(){return Is=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},Is.apply(this,arguments)}const xs=Symbol.for("FluidValue.get"),Ts=Symbol.for("FluidValue.observers"),Ms=e=>Boolean(e&&e[xs]),Ns=e=>e&&e[xs]?e[xs]():e,Ps=e=>e[Ts]||null;function Ls(e,t){let n=e[Ts];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Rs{constructor(e){if(this[xs]=void 0,this[Ts]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");As(this,e)}}const As=(e,t)=>zs(e,xs,t);function Ds(e,t){if(e[xs]){let n=e[Ts];n||zs(e,Ts,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Os(e,t){let n=e[Ts];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ts]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const zs=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Fs=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Vs=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Hs=new RegExp(`(${Fs.source})(%|[a-z]+)`,"i"),Gs=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Us=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Ws=e=>{const[t,n]=$s(e);if(!t||ji())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&&Us.test(n)?Ws(n):n||e},$s=e=>{const t=Us.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let js;const Ks=(e,t,n,o,l)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${l})`,qs=e=>{js||(js=Yi?new RegExp(`(${Object.keys(Yi).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Ns(e).replace(Us,Ws).replace(Vs,ws).replace(js,ws))),n=t.map((e=>e.match(Fs).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]})))),l=o.map((t=>Bs(Is({},e,{output:t}))));return e=>{var n;const o=!Hs.test(t[0])&&(null==(n=t.find((e=>Hs.test(e))))?void 0:n.replace(Fs,""));let r=0;return t[0].replace(Fs,(()=>`${l[r++](e)}${o||""}`)).replace(Gs,Ks)}},Ys="react-spring: ",Zs=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Ys}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Qs=Zs(console.warn),Xs=Zs(console.warn);function Js(e){return Fi.str(e)&&("#"==e[0]||/\d/.test(e)||!ji()&&Us.test(e)||e in(Yi||{}))}const ea=ji()?Di.useEffect:Di.useLayoutEffect;function ta(){const e=(0,Di.useState)()[1],t=(()=>{const e=(0,Di.useRef)(!1);return ea((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const na=e=>(0,Di.useEffect)(e,oa),oa=[];function la(e){const t=(0,Di.useRef)();return(0,Di.useEffect)((()=>{t.current=e})),t.current}const ra=Symbol.for("Animated:node"),ia=e=>e&&e[ra],sa=(e,t)=>{return n=e,o=ra,l=t,Object.defineProperty(n,o,{value:l,writable:!0,configurable:!0});var n,o,l},aa=e=>e&&e[ra]&&e[ra].getPayload();class ca{constructor(){this.payload=void 0,sa(this,this)}getPayload(){return this.payload||[]}}class ua extends ca{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,Fi.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new ua(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Fi.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,Fi.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class da extends ua{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Bs({output:[e,e]})}static create(e){return new da(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Fi.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=Bs({output:[this.getValue(),e]})),this._value=0,super.reset()}}const pa={dependencies:null};class ma extends ca{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Gi(this.source,((n,o)=>{var l;(l=n)&&l[ra]===l?t[o]=n.getValue(e):Ms(n)?t[o]=Ns(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Hi(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Gi(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){pa.dependencies&&Ms(e)&&pa.dependencies.add(e);const t=aa(e);t&&Hi(t,(e=>this.add(e)))}}class ga extends ma{constructor(e){super(e)}static create(e){return new ga(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(ha)),!0)}}function ha(e){return(Js(e)?da:ua).create(e)}function fa(e){const t=ia(e);return t?t.constructor:Fi.arr(e)?ga:Js(e)?da:ua}function va(){return va=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},va.apply(this,arguments)}const ba=(e,t)=>{const n=!Fi.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Di.forwardRef)(((o,l)=>{const r=(0,Di.useRef)(null),i=n&&(0,Di.useCallback)((e=>{r.current=function(e,t){return e&&(Fi.fun(e)?e(t):e.current=t),t}(l,e)}),[l]),[s,a]=function(e,t){const n=new Set;return pa.dependencies=n,e.style&&(e=va({},e,{style:t.createAnimatedStyle(e.style)})),e=new ma(e),pa.dependencies=null,[e,n]}(o,t),c=ta(),u=()=>{const e=r.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new ka(u,a),p=(0,Di.useRef)();ea((()=>(p.current=d,Hi(a,(e=>Ds(e,d))),()=>{p.current&&(Hi(p.current.deps,(e=>Os(e,p.current))),ki.cancel(p.current.update))}))),(0,Di.useEffect)(u,[]),na((()=>()=>{const e=p.current;Hi(e.deps,(t=>Os(t,e)))}));const m=t.getComponentProps(s.getValue());return Di.createElement(e,va({},m,{ref:i}))}))};class ka{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&ki.write(this.update)}}const _a=Symbol.for("AnimatedComponent"),ya=e=>Fi.str(e)?e:e&&Fi.str(e.displayName)?e.displayName:Fi.fun(e)&&e.name||null;function Ea(){return Ea=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},Ea.apply(this,arguments)}function Ca(e,...t){return Fi.fun(e)?e(...t):e}const Sa=(e,t)=>!0===e||!!(t&&e&&(Fi.fun(e)?e(t):Ui(e).includes(t))),wa=(e,t)=>Fi.obj(e)?t&&e[t]:e,Ba=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ia=e=>e,xa=(e,t=Ia)=>{let n=Ta;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const l of n){const n=t(e[l],l);Fi.und(n)||(o[l]=n)}return o},Ta=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Ma={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 Na(e){const t=function(e){const t={};let n=0;if(Gi(e,((e,o)=>{Ma[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Gi(e,((e,o)=>o in t||(n[o]=e))),n}return Ea({},e)}function Pa(e){return e=Ns(e),Fi.arr(e)?e.map(Pa):Js(e)?Xi.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function La(e){for(const t in e)return!0;return!1}function Ra(e){return Fi.fun(e)||Fi.arr(e)&&Fi.obj(e[0])}function Aa(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Da(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Oa=1.70158,za=1.525*Oa,Fa=Oa+1,Va=2*Math.PI/3,Ha=2*Math.PI/4.5,Ga=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},Ua={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=>Fa*e*e*e-Oa*e*e,easeOutBack:e=>1+Fa*Math.pow(e-1,3)+Oa*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-za)/2:(Math.pow(2*e-2,2)*((za+1)*(2*e-2)+za)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Va),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Va)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Ha)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Ha)/2+1,easeInBounce:e=>1-Ga(1-e),easeOutBounce:Ga,easeInOutBounce:e=>e<.5?(1-Ga(1-2*e))/2:(1+Ga(2*e-1))/2},Wa=Ea({},{tension:170,friction:26},{mass:1,damping:1,easing:Ua.linear,clamp:!1});class $a{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,Wa)}}function ja(e,t){if(Fi.und(t.decay)){const n=!Fi.und(t.tension)||!Fi.und(t.friction);!n&&Fi.und(t.frequency)&&Fi.und(t.damping)&&Fi.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Ka=[];class qa{constructor(){this.changed=!1,this.values=Ka,this.toValues=null,this.fromValues=Ka,this.to=void 0,this.from=void 0,this.config=new $a,this.immediate=!1}}function Ya(e,{key:t,props:n,defaultProps:o,state:l,actions:r}){return new Promise(((i,s)=>{var a;let c,u,d=Sa(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{Fi.und(n.pause)||(l.paused=Sa(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=l.paused||Sa(e,t)),c=Ca(n.delay||0,t),e?(l.resumeQueue.add(m),r.pause()):(r.resume(),m())}function p(){l.resumeQueue.add(m),l.timeouts.delete(u),u.cancel(),c=u.time-ki.now()}function m(){c>0&&!Xi.skipAnimation?(l.delayed=!0,u=ki.setTimeout(g,c),l.pauseQueue.add(p),l.timeouts.add(u)):g()}function g(){l.delayed&&(l.delayed=!1),l.pauseQueue.delete(p),l.timeouts.delete(u),e<=(l.cancelId||0)&&(d=!0);try{r.start(Ea({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Za=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Ja(e.get()):t.every((e=>e.noop))?Qa(e.get()):Xa(e.get(),t.every((e=>e.finished))),Qa=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Xa=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Ja=e=>({value:e,cancelled:!0,finished:!1});function ec(e,t,n,o){const{callId:l,parentId:r,onRest:i}=t,{asyncTo:s,promise:a}=n;return r||e!==s||t.reset?n.promise=(async()=>{n.asyncId=l,n.asyncTo=e;const c=xa(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=l<=(n.cancelId||0)&&Ja(o)||l!==n.asyncId&&Xa(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const r=new nc,i=new oc;return(async()=>{if(Xi.skipAnimation)throw tc(n),i.result=Xa(o,!1),d(i),i;m(r);const s=Fi.obj(e)?Ea({},e):Ea({},t,{to:e});s.parentId=l,Gi(c,((e,t)=>{Fi.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(r),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(Xi.skipAnimation)return tc(n),Xa(o,!1);try{let t;t=Fi.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=Xa(o.get(),!0,!1)}catch(e){if(e instanceof nc)h=e.result;else{if(!(e instanceof oc))throw e;h=e.result}}finally{l==n.asyncId&&(n.asyncId=r,n.asyncTo=r?s:void 0,n.promise=r?a:void 0)}return Fi.fun(i)&&ki.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function tc(e,t){Wi(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class nc 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 oc extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const lc=e=>e instanceof ic;let rc=1;class ic extends Rs{constructor(...e){super(...e),this.id=rc++,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=ia(this);return e&&e.getValue()}to(...e){return Xi.to(this,e)}interpolate(...e){return Qs(`${Ys}The "interpolate" function is deprecated in v9 (use "to" instead)`),Xi.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){Ls(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||os.sort(this),Ls(this,{type:"priority",parent:this,priority:e})}}const sc=Symbol.for("SpringPhase"),ac=e=>(1&e[sc])>0,cc=e=>(2&e[sc])>0,uc=e=>(4&e[sc])>0,dc=(e,t)=>t?e[sc]|=3:e[sc]&=-3,pc=(e,t)=>t?e[sc]|=4:e[sc]&=-5;class mc extends ic{constructor(e,t){if(super(),this.key=void 0,this.animation=new qa,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,!Fi.und(e)||!Fi.und(t)){const n=Fi.obj(e)?Ea({},e):Ea({},t,{from:e});Fi.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(cc(this)||this._state.asyncTo)||uc(this)}get goal(){return Ns(this.animation.to)}get velocity(){const e=ia(this);return e instanceof ua?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return ac(this)}get isAnimating(){return cc(this)}get isPaused(){return uc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:l,toValues:r}=o;const i=aa(o.to);!i&&Ms(o.to)&&(r=Ui(Ns(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==da?1:i?i[a].lastPosition:r[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,l.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],r=null!=s.v0?s.v0:s.v0=Fi.arr(l.velocity)?l.velocity[a]:l.velocity;let i;const p=l.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n)));if(Fi.und(l.duration))if(l.decay){const e=!0===l.decay?.998:l.decay,o=Math.exp(-(1-e)*t);d=n+r/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<=p,i=r*o}else{i=null==s.lastVelocity?r:s.lastVelocity;const t=l.restVelocity||p/10,o=l.clamp?0:l.bounce,a=!Fi.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*-l.tension*(d-c)+.001*-l.friction*i)/l.mass*f,d+=i*f}else{let o=1;l.duration>0&&(this._memoizedDuration!==l.duration&&(this._memoizedDuration=l.duration,s.durationProgress>0&&(s.elapsedTime=l.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(l.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+l.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,l.round)&&(n=!0)}));const s=ia(this),a=s.getValue();if(t){const e=Ns(o.to);a===e&&!n||l.decay?n&&l.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return ki.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(cc(this)){const{to:e,config:t}=this.animation;ki.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 Fi.und(e)?(n=this.queue||[],this.queue=[]):n=[Fi.obj(e)?e:Ea({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Za(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),tc(this._state,e&&this._lastCallId),ki.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=Fi.obj(n)?n[t]:n,(null==n||Ra(n))&&(n=void 0),o=Fi.obj(o)?o[t]:o,null==o&&(o=void 0);const l={to:n,from:o};return ac(this)||(e.reverse&&([n,o]=[o,n]),o=Ns(o),Fi.und(o)?ia(this)||this._set(n):this._set(o)),l}_update(e,t){let n=Ea({},e);const{key:o,defaultProps:l}=this;n.default&&Object.assign(l,xa(n,((e,t)=>/^on/.test(t)?wa(e,o):e))),_c(this,n,"onProps"),yc(this,"onProps",n,this);const r=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 Ya(++this._lastCallId,{key:o,props:n,defaultProps:l,state:i,actions:{pause:()=>{uc(this)||(pc(this,!0),$i(i.pauseQueue),yc(this,"onPause",Xa(this,gc(this,this.animation.to)),this))},resume:()=>{uc(this)&&(pc(this,!1),cc(this)&&this._resume(),$i(i.resumeQueue),yc(this,"onResume",Xa(this,gc(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=hc(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Ja(this));const o=!Fi.und(e.to),l=!Fi.und(e.from);if(o||l){if(!(t.callId>this._lastToId))return n(Ja(this));this._lastToId=t.callId}const{key:r,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!l||o||t.default&&!Fi.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Vi(d,c);p&&(s.from=d),d=Ns(d);const m=!Vi(u,a);m&&this._focus(u);const g=Ra(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||l)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(ja(n=Ea({},n),t),t=Ea({},n,t)),ja(e,t),Object.assign(e,t);for(const t in Wa)null==e[t]&&(e[t]=Wa[t]);let{mass:o,frequency:l,damping:r}=e;Fi.und(l)||(l<.01&&(l=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/l,2)*o,e.friction=4*Math.PI*r*o/l)}(h,Ca(t.config,r),t.config!==i.config?Ca(i.config,r):void 0);let b=ia(this);if(!b||Fi.und(u))return n(Xa(this,!0));const k=Fi.und(t.reset)?l&&!t.default:!Fi.und(d)&&Sa(t.reset,r),_=k?d:this.get(),y=Pa(u),E=Fi.num(y)||Fi.arr(y)||Js(y),C=!g&&(!E||Sa(i.immediate||t.immediate,r));if(m){const e=fa(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=Ms(u),B=!1;if(!w){const e=k||!ac(this)&&p;(m||e)&&(B=Vi(Pa(_),y),w=!B),(Vi(s.immediate,C)||C)&&Vi(h.decay,f)&&Vi(h.velocity,v)||(w=!0)}if(B&&cc(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!g&&((w||Ms(a))&&(s.values=b.getPayload(),s.toValues=Ms(u)?null:S==da?[1]:Ui(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Hi(kc,(e=>_c(this,t,e)));const o=Xa(this,gc(this,a));$i(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&ki.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Ca(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),g?n(ec(t.to,t,this._state,this)):w?this._start():cc(this)&&!m?this._pendingCalls.add(n):n(Qa(_))}_focus(e){const t=this.animation;e!==t.to&&(Ps(this)&&this._detach(),t.to=e,Ps(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ms(t)&&(Ds(t,this),lc(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Ms(e)&&Os(e,this)}_set(e,t=!0){const n=Ns(e);if(!Fi.und(n)){const e=ia(this);if(!e||!Vi(n,e.getValue())){const o=fa(n);e&&e.constructor==o?e.setValue(n):sa(this,o.create(n)),e&&ki.batchedUpdates((()=>{this._onChange(n,t)}))}}return ia(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,yc(this,"onStart",Xa(this,gc(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Ca(this.animation.onChange,e,this)),Ca(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;ia(this).reset(Ns(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),cc(this)||(dc(this,!0),uc(this)||this._resume())}_resume(){Xi.skipAnimation?this.finish():os.start(this)}_stop(e,t){if(cc(this)){dc(this,!1);const n=this.animation;Hi(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ls(this,{type:"idle",parent:this});const o=t?Ja(this.get()):Xa(this.get(),gc(this,null!=e?e:n.to));$i(this._pendingCalls,o),n.changed&&(n.changed=!1,yc(this,"onRest",o,this))}}}function gc(e,t){const n=Pa(t);return Vi(Pa(e.get()),n)}function hc(e,t=e.loop,n=e.to){let o=Ca(t);if(o){const l=!0!==o&&Na(o),r=(l||e).reverse,i=!l||l.reset;return fc(Ea({},e,{loop:t,default:!1,pause:void 0,to:!r||Ra(n)?n:void 0,from:i?e.from:void 0,reset:i},l))}}function fc(e){const{to:t,from:n}=e=Na(e),o=new Set;return Fi.obj(t)&&bc(t,o),Fi.obj(n)&&bc(n,o),e.keys=o.size?Array.from(o):null,e}function vc(e){const t=fc(e);return Fi.und(t.default)&&(t.default=xa(t)),t}function bc(e,t){Gi(e,((e,n)=>null!=e&&t.add(n)))}const kc=["onStart","onRest","onChange","onPause","onResume"];function _c(e,t,n){e.animation[n]=t[n]!==Ba(t,n)?wa(t[n],e.key):void 0}function yc(e,t,...n){var o,l,r,i;null==(o=(l=e.animation)[t])||o.call(l,...n),null==(r=(i=e.defaultProps)[t])||r.call(i,...n)}const Ec=["onStart","onChange","onRest"];let Cc=1;class Sc{constructor(e,t){this.id=Cc++,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(Ea({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];Fi.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(fc(e)),this}start(e){let{queue:t}=this;return e?t=Ui(e).map(fc):this.queue=[],this._flush?this._flush(this,t):(Nc(this,t),wc(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Hi(Ui(t),(t=>n[t].stop(!!e)))}else tc(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Fi.und(e))this.start({pause:!0});else{const t=this.springs;Hi(Ui(e),(e=>t[e].pause()))}return this}resume(e){if(Fi.und(e))this.start({pause:!1});else{const t=this.springs;Hi(Ui(e),(e=>t[e].resume()))}return this}each(e){Gi(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,l=this._changed.size>0;(o&&!this._started||l&&!this._started)&&(this._started=!0,Wi(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const r=!o&&this._started,i=l||r&&n.size?this.get():null;l&&t.size&&Wi(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),r&&(this._started=!1,Wi(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)}ki.onFrame(this._onFrame)}}function wc(e,t){return Promise.all(t.map((t=>Bc(e,t)))).then((t=>Za(e,t)))}async function Bc(e,t,n){const{keys:o,to:l,from:r,loop:i,onRest:s,onResolve:a}=t,c=Fi.obj(t.default)&&t.default;i&&(t.loop=!1),!1===l&&(t.to=null),!1===r&&(t.from=null);const u=Fi.arr(l)||Fi.fun(l)?l:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Hi(Ec,(n=>{const o=t[n];if(Fi.fun(o)){const l=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=l.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):l.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,$i(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===Ba(t,"cancel");(u||m&&d.asyncId)&&p.push(Ya(++e._lastAsyncId,{props:t,state:d,actions:{pause:zi,resume:zi,start(t,n){m?(tc(d,e._lastAsyncId),n(Ja(e))):(t.onRest=s,n(ec(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=Za(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=hc(t,i,l);if(n)return Nc(e,[n]),Bc(e,n,!0)}return a&&ki.batchedUpdates((()=>a(g,e,e.item))),g}function Ic(e,t){const n=Ea({},e.springs);return t&&Hi(Ui(t),(e=>{Fi.und(e.keys)&&(e=fc(e)),Fi.obj(e.to)||(e=Ea({},e,{to:void 0})),Mc(n,e,(e=>Tc(e)))})),xc(e,n),n}function xc(e,t){Gi(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Ds(t,e))}))}function Tc(e,t){const n=new mc;return n.key=e,t&&Ds(n,t),n}function Mc(e,t,n){t.keys&&Hi(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Nc(e,t){Hi(t,(t=>{Mc(e.springs,t,(t=>Tc(t,e)))}))}const Pc=["children"],Lc=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,l={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,Pc);const o=(0,Di.useContext)(Rc),l=n.pause||!!o.pause,r=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Di.useState)((()=>({inputs:t,result:e()}))),o=(0,Di.useRef)(),l=o.current;let r=l;if(r){const n=Boolean(t&&r.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,r.inputs));n||(r={inputs:t,result:e()})}else r=n;return(0,Di.useEffect)((()=>{o.current=r,l==n&&(n.inputs=n.result=void 0)}),[r]),r.result}((()=>({pause:l,immediate:r})),[l,r]);const{Provider:i}=Rc;return Di.createElement(i,{value:n},t)},Rc=(Ac=Lc,Dc={},Object.assign(Ac,Di.createContext(Dc)),Ac.Provider._context=Ac,Ac.Consumer._context=Ac,Ac);var Ac,Dc;Lc.Provider=Rc.Provider,Lc.Consumer=Rc.Consumer;const Oc=()=>{const e=[],t=function(t){Xs(`${Ys}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 Hi(e,((e,l)=>{if(Fi.und(t))o.push(e.start());else{const r=n(t,e,l);r&&o.push(e.start(r))}})),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 Hi(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Hi(e,(e=>e.resume(...arguments))),this},t.set=function(t){Hi(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Hi(e,((e,o)=>{if(Fi.und(t))n.push(e.start());else{const l=this._getProps(t,e,o);l&&n.push(e.start(l))}})),n},t.stop=function(){return Hi(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Hi(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Fi.fun(e)?e(n,t):e};return t._getProps=n,t};function zc(e,t,n){const o=Fi.fun(t)&&t;o&&!n&&(n=[]);const l=(0,Di.useMemo)((()=>o||3==arguments.length?Oc():void 0),[]),r=(0,Di.useRef)(0),i=ta(),s=(0,Di.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ic(e,t);return r.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?wc(e,t):new Promise((o=>{xc(e,n),s.queue.push((()=>{o(wc(e,t))})),i()}))}})),[]),a=(0,Di.useRef)([...s.ctrls]),c=[],u=la(e)||0;function d(e,n){for(let l=e;l<n;l++){const e=a.current[l]||(a.current[l]=new Sc(null,s.flush)),n=o?o(l,e):t[l];n&&(c[l]=vc(n))}}(0,Di.useMemo)((()=>{Hi(a.current.slice(e,u),(e=>{Aa(e,l),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Di.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Ic(e,c[t]))),m=(0,Di.useContext)(Lc),g=la(m),h=m!==g&&La(m);ea((()=>{r.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Hi(e,(e=>e()))),Hi(a.current,((e,t)=>{null==l||l.add(e),h&&e.start({default:m});const n=c[t];n&&(Da(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),na((()=>()=>{Hi(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>Ea({},e)));return l?[f,l]:f}let Fc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Fc||(Fc={}));class Vc extends ic{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Bs(...t);const n=this._get(),o=fa(n);sa(this,o.create(n))}advance(e){const t=this._get();Vi(t,this.get())||(ia(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Gc(this._active)&&Uc(this)}_get(){const e=Fi.arr(this.source)?this.source.map(Ns):Ui(Ns(this.source));return this.calc(...e)}_start(){this.idle&&!Gc(this._active)&&(this.idle=!1,Hi(aa(this),(e=>{e.done=!1})),Xi.skipAnimation?(ki.batchedUpdates((()=>this.advance())),Uc(this)):os.start(this))}_attach(){let e=1;Hi(Ui(this.source),(t=>{Ms(t)&&Ds(t,this),lc(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Hi(Ui(this.source),(e=>{Ms(e)&&Os(e,this)})),this._active.clear(),Uc(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=Ui(this.source).reduce(((e,t)=>Math.max(e,(lc(t)?t.priority:0)+1)),0))}}function Hc(e){return!1!==e.idle}function Gc(e){return!e.size||Array.from(e).every(Hc)}function Uc(e){e.idle||(e.idle=!0,Hi(aa(e),(e=>{e.done=!0})),Ls(e,{type:"idle",parent:e}))}Xi.assign({createStringInterpolator:qs,to:(e,t)=>new Vc(e,t)}),os.advance;const Wc=window.ReactDOM;function $c(e,t){if(null==e)return{};var n,o,l={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(l[n]=e[n]);return l}const jc=["style","children","scrollTop","scrollLeft"],Kc=/^--/;function qc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Kc.test(e)||Zc.hasOwnProperty(e)&&Zc[e]?(""+t).trim():t+"px"}const Yc={};let Zc={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 Qc=["Webkit","Ms","Moz","O"];Zc=Object.keys(Zc).reduce(((e,t)=>(Qc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Zc);const Xc=["x","y","z"],Jc=/^(matrix|translate|scale|rotate|skew)/,eu=/^(translate)/,tu=/^(rotate|skew)/,nu=(e,t)=>Fi.num(e)&&0!==e?e+t:e,ou=(e,t)=>Fi.arr(e)?e.every((e=>ou(e,t))):Fi.num(e)?e===t:parseFloat(e)===t;class lu extends ma{constructor(e){let{x:t,y:n,z:o}=e,l=$c(e,Xc);const r=[],i=[];(t||n||o)&&(r.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>nu(e,"px"))).join(",")})`,ou(e,0)]))),Gi(l,((e,t)=>{if("transform"===t)r.push([e||""]),i.push((e=>[e,""===e]));else if(Jc.test(t)){if(delete l[t],Fi.und(e))return;const n=eu.test(t)?"px":tu.test(t)?"deg":"";r.push(Ui(e)),i.push("rotate3d"===t?([e,t,o,l])=>[`rotate3d(${e},${t},${o},${nu(l,n)})`,ou(l,0)]:e=>[`${t}(${e.map((e=>nu(e,n))).join(",")})`,ou(e,t.startsWith("scale")?1:0)])}})),r.length&&(l.transform=new ru(r,i)),super(l)}}class ru extends Rs{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 Hi(this.inputs,((n,o)=>{const l=Ns(n[0]),[r,i]=this.transforms[o](Fi.arr(l)?l:n.map(Ns));e+=" "+r,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Hi(this.inputs,(e=>Hi(e,(e=>Ms(e)&&Ds(e,this)))))}observerRemoved(e){0==e&&Hi(this.inputs,(e=>Hi(e,(e=>Ms(e)&&Os(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ls(this,e)}}const iu=["scrollTop","scrollLeft"];Xi.assign({batchedUpdates:Wc.unstable_batchedUpdates,createStringInterpolator:qs,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 su=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ma(e)),getComponentProps:o=(e=>e)}={})=>{const l={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},r=e=>{const t=ya(e)||"Anonymous";return(e=Fi.str(e)?r[e]||(r[e]=ba(e,l)):e[_a]||(e[_a]=ba(e,l))).displayName=`Animated(${t})`,e};return Gi(e,((t,n)=>{Fi.arr(e)&&(n=ya(t)),r[n]=r(t)})),{animated:r}})(["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:l,children:r,scrollTop:i,scrollLeft:s}=o,a=$c(o,jc),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Yc[t]||(Yc[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in l)if(l.hasOwnProperty(t)){const n=qc(t,l[t]);Kc.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 lu(e),getComponentProps:e=>$c(e,iu)}),au=su.animated,cu=e=>e+1,uu=e=>({top:e.offsetTop,left:e.offsetLeft}),du=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:l}=e;const r=(0,s.useRef)(),i=(0,u.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(cu,0),[d,p]=(0,s.useReducer)(cu,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>r.current?uu(r.current):null),[l]),f=(0,s.useMemo)((()=>{if(!n||!r.current)return()=>{};const e=(0,Xr.getScrollContainer)(r.current);if(!e)return()=>{};const t=r.current.getBoundingClientRect();return()=>{const n=r.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[l,n]);return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();r.current.style.transform=void 0;const e=uu(r.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[l]),function(e,t){const n=Fi.fun(e),[[o],l]=zc(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(!r.current)return;let{x:o,y:l}=n;o=Math.round(o),l=Math.round(l);const i=0===o&&0===l;r.current.style.transformOrigin="center center",r.current.style.transform=i?void 0:`translate3d(${o}px,${l}px,0)`,r.current.style.zIndex=t?"1":"",f()}}),r},pu=".block-editor-block-list__block",mu=".block-list-appender",gu=".block-editor-button-block-appender";function hu(e,t){return t.closest([pu,mu,gu].join(","))===e}function fu(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(pu);return t?t.id.slice("block-".length):void 0}function vu(e){const t=(0,s.useRef)(),n=function(e){return(0,d.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:l}=t(mo);if(l(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:l}=(0,d.useSelect)(mo);return(0,s.useEffect)((()=>{if(!o(e)||l())return;if(null==n)return;if(!t.current)return;const{ownerDocument:r}=t.current;if(hu(t.current,r.activeElement))return;const i=Xr.focus.tabbable.find(t.current).filter((e=>(0,Xr.isTextField)(e))),s=-1===n,a=i[s?i.length-1:0]||t.current;if(hu(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Xr.focus.tabbable.findNext(t.current);if(e&&hu(t.current,e)&&(0,Xr.isFormElement)(e))return void e.focus()}(0,Xr.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function bu(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function ku(){const e=(0,d.useSelect)((e=>{const{getSettings:t}=e(mo);return t().outlineMode}),[]);return(0,u.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",bu),t.addEventListener("mouseover",bu),()=>{t.removeEventListener("mouseout",bu),t.removeEventListener("mouseover",bu),t.classList.remove("is-hovered")}}),[e])}function _u(e){return(0,d.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p,__unstableSelectionHasUnmergeableBlock:m}=t(mo),{outlineMode:g}=a(),h=n(e),f=r(e),v=s(e),b=u(e,!0),k=i(e);return c()({"is-selected":f,"is-highlighted":o(e),"is-multi-selected":k,"is-partially-selected":k&&!p()&&!m(),"is-reusable":(0,l.isReusableBlock)((0,l.getBlockType)(v)),"is-dragging":h,"has-child-selected":b,"remove-outline":f&&g&&d()})}),[e])}function yu(e){return(0,d.useSelect)((t=>{const n=t(mo).getBlockName(e),o=(0,l.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,l.getBlockDefaultClassName)(n)}),[e])}function Eu(e){return(0,d.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(mo),r=o(e);if(null==r||!r.className)return;const i=(0,l.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?r.className:void 0}),[e])}function Cu(e){return(0,d.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:l,getBlockRootClientId:r,isBlockSelected:i}=t(mo);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(l(s),r(e))}):void 0}),[e])}function Su(e){const{isBlockSelected:t}=(0,d.useSelect)(mo),{selectBlock:n,selectionChange:o}=(0,d.useDispatch)(mo);return(0,u.useRefEffect)((l=>{function r(r){l.parentElement.closest('[contenteditable="true"]')||(t(e)?r.target.isContentEditable||o(e):hu(l,r.target)&&n(e))}return l.addEventListener("focusin",r),()=>{l.removeEventListener("focusin",r)}}),[t,n])}const wu=window.wp.keycodes;function Bu(e){const t=(0,d.useSelect)((t=>t(mo).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,d.useSelect)(mo),{insertDefaultBlock:l,removeBlock:r}=(0,d.useDispatch)(mo);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!==wu.ENTER&&s!==wu.BACKSPACE&&s!==wu.DELETE||a!==i||(0,Xr.isTextField)(a)||(t.preventDefault(),s===wu.ENTER?l({},n(e),o(e)+1):r(e))}function a(e){e.preventDefault()}}),[e,t,n,o,l,r])}function Iu(e){const{isNavigationMode:t,isBlockSelected:n}=(0,d.useSelect)(mo),{setNavigationMode:o,selectBlock:l}=(0,d.useDispatch)(mo);return(0,u.useRefEffect)((r=>{function i(r){t()&&!r.defaultPrevented&&(r.preventDefault(),n(e)?o(!1):l(e))}return r.addEventListener("mousedown",i),()=>{r.addEventListener("mousedown",i)}}),[e,t,n,o])}function xu(){const e=(0,s.useContext)(bf);return(0,u.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Tu(e){return(0,d.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(mo);return n(e)}),[e])}function Mu(){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:r={},isAligned:i}=(0,s.useContext)(Nu),{index:a,mode:p,name:m,blockApiVersion:g,blockTitle:f,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,d.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:r,getBlockName:i,isTyping:s,getGlobalBlockCount:a,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p}=e(mo),{getActiveBlockVariation:m}=e(l.store),g=c(n),h=u(n)||d(n),f=i(n),v=(0,l.getBlockType)(f),b=m(f,t(n));return{index:o(n),mode:r(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]),_=Tu(n),y=(0,h.sprintf)((0,h.__)("Block: %s"),f),E="html"!==p||t?"":"-visual",C=(0,u.useMergeRefs)([e.ref,vu(n),Ao(n),Su(n),Bu(n),Iu(n),ku(),xu(),du({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a}),(0,u.useDisabled)({isDisabled:!_})]),S=vo();return g<2&&n===S.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...r,...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":_}),o,e.className,r.className,_u(n),yu(n),Eu(n),Cu(n)),style:{...r.style,...e.style}}}Mu.save=l.__unstableGetBlockProps;const Nu=(0,s.createContext)();function Pu(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Mu(o,{__unstableIsHtml:n}),t)}const Lu=(0,d.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:l,getBlockMode:r,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(mo),d=a(n),p=l(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:r(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),Ru=(0,d.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:i,replaceBlocks:s,toggleSelection:a,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d,selectBlock:p}=e(mo);return{setAttributes(e){const{getMultiSelectedBlockClientIds:l}=n.select(mo),r=l(),{clientId:i}=t,s=r.length?r:[i];o(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:i}=n.select(mo),s=i(o);r(e,s+1,l)},onMerge(e){const{clientId:o,rootClientId:r}=t,{getPreviousBlockClientId:a,getNextBlockClientId:c,getBlock:m,getBlockAttributes:g,getBlockName:h,getBlockOrder:f}=n.select(mo);if(e){if(r){const e=c(r);if(e){if(h(r)!==h(e))return void i(r,e);{const t=g(r),o=g(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(e),e,r),d(e,!1)}))}}}const e=c(o);if(!e)return;const t=(0,l.switchToBlockType)(m(e),"*");t&&t.length?s(e,t):i(o,e)}else{const e=a(o);if(e)i(e,o);else if(r){const e=a(r);if(e&&h(r)===h(e)){const t=g(r),o=g(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(r),r,e),d(r,!1)}))}const t=(0,l.switchToBlockType)(m(r),"*");t&&t.length&&n.batch((()=>{s(r,t),p(t[0].clientId,0)}))}}},onReplace(e,n,o){e.length&&!(0,l.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),s([t.clientId],e,n,o)},toggleSelection(e){a(e)}}})),Au=(0,u.compose)(u.pure,Lu,Ru,(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:r,canRemove:i,clientId:a,isSelected:u,isSelectionEnabled:p,className:m,__unstableLayoutClassNames:g,name:h,isValid:f,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const{themeSupportsLayout:S,hasContentLockedParent:w,isContentBlock:B,isContentLocking:I,isTemporarilyEditingAsBlocks:x}=(0,d.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(mo),i=!!n(a);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(l.store).__experimentalHasContentRoleAttribute(h),hasContentLockedParent:i,isContentLocking:"contentOnly"===o(a)&&!i,isTemporarilyEditingAsBlocks:r()===a}}),[h,a]),{removeBlock:T}=(0,d.useDispatch)(mo),M=(0,s.useCallback)((()=>T(a)),[a]);let N=(0,s.createElement)(li,{name:h,isSelected:u,attributes:v,setAttributes:k,insertBlocksAfter:r?void 0:y,onReplace:i?_:void 0,onRemove:i?M:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C,__unstableLayoutClassNames:g});const P=(0,l.getBlockType)(h);w&&!B&&(b={...b,tabIndex:-1}),null!=P&&P.getEditWrapperProps&&(b=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}(b,P.getEditWrapperProps(v)));const L=b&&!!b["data-align"]&&!S;let R;if(L&&(N=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},N)),f)R="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},N),(0,s.createElement)(Pu,{isHtml:!0},(0,s.createElement)(vi,{clientId:a}))):(null==P?void 0:P.apiVersion)>1?N:(0,s.createElement)(Pu,b,N);else{const e=n?(0,l.serializeRawBlock)(n):(0,l.getSaveContent)(P,v);R=(0,s.createElement)(Pu,{className:"has-warning"},(0,s.createElement)(di,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Xr.safeHTML)(e)))}const{"data-align":A,...D}=null!==(t=b)&&void 0!==t?t:{},O={clientId:a,className:c()({"is-content-locked":I,"is-content-locked-temporarily-editing-as-blocks":x,"is-content-block":w&&B},A&&S&&`align${A}`,m),wrapperProps:D,isAligned:L},z=(0,s.useMemo)((()=>O),Object.values(O));return(0,s.createElement)(Nu.Provider,{value:z},(0,s.createElement)(hi,{fallback:(0,s.createElement)(Pu,{className:"has-warning"},(0,s.createElement)(mi,null))},R))})),Du=window.wp.htmlEntities,Ou=(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"})),zu=[(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.")],Fu=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*zu.length));return(0,s.createElement)(m.Tip,null,zu[e])},Vu=(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"})),Hu=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:l}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:Vu});const r=(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",l,{"has-colors":o})},r)})),Gu=function(e){let{title:t,icon:n,description:o,blockType:l}=e;return l&&(V()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=l)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(Hu,{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)))},Uu=(0,u.createHigherOrderComponent)((e=>(0,d.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...l}=t;if(!n)return(0,s.createElement)(e,i({registry:o},l));const[r,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,d.createRegistry)({},o);e.registerStore(uo,po),a(e)}),[o]),r?(0,s.createElement)(d.RegistryProvider,{value:r},(0,s.createElement)(e,i({registry:r},l))):null}))),"withRegistryProvider"),Wu=()=>{};function $u(e){let{clientId:t=null,value:n,selection:o,onChange:r=Wu,onInput:i=Wu}=e;const a=(0,d.useRegistry)(),{resetBlocks:c,resetSelection:u,replaceInnerBlocks:p,setHasControlledInnerBlocks:m,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(mo),{getBlockName:h,getBlocks:f}=a.select(mo),v=(0,d.useSelect)((e=>!t||e(mo).areInnerBlocksControlled(t)),[t]),b=(0,s.useRef)({incoming:null,outgoing:[]}),k=(0,s.useRef)(!1),_=()=>{n&&(g(),t?a.batch((()=>{m(t,!0);const e=n.map((e=>(0,l.cloneBlock)(e)));k.current&&(b.current.incoming=e),g(),p(t,e)})):(k.current&&(b.current.incoming=n),c(n)))},y=(0,s.useRef)(i),E=(0,s.useRef)(r);(0,s.useEffect)((()=>{y.current=i,E.current=r}),[i,r]),(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=[],_(),o&&u(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{v||(b.current.outgoing=[],_())}),[v]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:l,__unstableIsLastBlockChangeIgnored:r,areInnerBlocksControlled:i}=a.select(mo);let s=f(t),c=l(),u=!1;k.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=l(),d=f(t),p=d!==s;if(s=d,p&&(b.current.incoming||r()))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 ju=Uu((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,d.useDispatch)(mo);return(0,s.useEffect)((()=>{o(n)}),[n]),$u(e),(0,s.createElement)(Ro,null,t)}));function Ku(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)(yf,null)))}function qu(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,d.useSelect)(mo),{clearSelectedBlock:o}=(0,d.useDispatch)(mo),{__experimentalClearBlockSelection:l}=e();return(0,u.useRefEffect)((e=>{if(l)return e.addEventListener("mousedown",r),()=>{e.removeEventListener("mousedown",r)};function r(l){(t()||n())&&l.target===e&&o()}}),[t,n,o,l])}function Yu(e){return(0,s.createElement)("div",i({ref:qu()},e))}function Zu(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:l,getSelectedBlocksInitialCaretPosition:r,__unstableIsFullySelected:i}=e(mo);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:l(),initialPosition:r(),isFullSelection:i()}}function Qu(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:l,isFullSelection:r}=(0,d.useSelect)(Zu,[]);return(0,u.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||r&&(l.contentEditable=!0,l.focus(),s.getSelection().removeAllRanges())}),[o,t,n,l,e,r])}function Xu(e,t,n,o){let l,r=Xr.focus.focusable.find(n);return t&&r.reverse(),r=r.slice(r.indexOf(e)+1),o&&(l=e.getBoundingClientRect()),r.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(pu)===t.closest(pu)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!Xr.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=l.right||t.right<=l.left)return!1}return!0}}))}function Ju(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:l}=(0,d.useSelect)(mo),{selectBlock:r}=(0,d.useDispatch)(mo);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===wu.UP,f=c===wu.DOWN,v=c===wu.LEFT,b=c===wu.RIGHT,k=h||v,_=v||b,y=h||f,E=_||y,C=d||p||m||g,S=y?Xr.isVerticalEdge:Xr.isHorizontalEdge,{ownerDocument:w}=i,{defaultView:B}=w;if(o()){if(!l())return;if(a.defaultPrevented)return;if(!E)return;if(d)return;return a.preventDefault(),void(k?r(e()):r(t(),-1))}if(y?s||(s=(0,Xr.computeCaretRect)(B)):s=null,a.defaultPrevented)return;if(!E)return;if(!function(e,t,n){if((t===wu.UP||t===wu.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,Xr.isRTL)(u)?!k:k,{keepCaretInsideBlock:x}=n();if(d)(function(e,t){const n=Xu(e,t,i);return n&&fu(n)})(u,k)&&S(u,k)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,Xr.isVerticalEdge)(u,k)||m&&!(0,Xr.isHorizontalEdge)(u,I)||x){if(_&&B.getSelection().isCollapsed&&(0,Xr.isHorizontalEdge)(u,I)&&!x){const e=Xu(u,I,i);(0,Xr.placeCaretAtHorizontalEdge)(e,k),a.preventDefault()}}else{const e=Xu(u,k,i,!0);e&&((0,Xr.placeCaretAtVerticalEdge)(e,m?!k:k,m?void 0:s),a.preventDefault())}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}const ed=window.wp.keyboardShortcuts;function td(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,d.useSelect)(mo),{multiSelect:o,selectBlock:l}=(0,d.useDispatch)(mo),r=(0,ed.__unstableUseShortcutEventMatch)();return(0,u.useRefEffect)((i=>{function s(s){if(!r("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,Xr.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(),l(u))}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[])}function nd(e,t){e.contentEditable=t,t&&e.focus()}function od(){const{startMultiSelect:e,stopMultiSelect:t}=(0,d.useDispatch)(mo),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:l}=(0,d.useSelect)(mo);return(0,u.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;let a,c;function u(){t(),s.removeEventListener("mouseup",u),c=s.requestAnimationFrame((()=>{if(o())return;nd(r,!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;l()||1===o&&c.getAttribute("contenteditable")&&n()&&(a=i.activeElement,e(),s.addEventListener("mouseup",u),nd(r,!0))}return r.addEventListener("mouseout",d),()=>{r.removeEventListener("mouseout",d),s.removeEventListener("mouseup",u),s.cancelAnimationFrame(c)}}),[e,t,n,o])}function ld(e,t){e.contentEditable=t,t&&e.focus()}function rd(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,d.useDispatch)(mo),{getBlockParents:o,getBlockSelectionStart:l}=(0,d.useSelect)(mo);return(0,u.useRefEffect)((n=>{const{ownerDocument:r}=n,{defaultView:i}=r;function s(r){const s=i.getSelection();if(!s.rangeCount)return;const a=r.shiftKey&&"mouseup"===r.type;if(s.isCollapsed&&!a)return void ld(n,!1);let c=fu(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(s)),u=fu(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=l(),t=fu(r.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],l=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[l],n[l])}else ld(n,!1)}function a(){r.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){r.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 id(){const{selectBlock:e}=(0,d.useDispatch)(mo),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,d.useSelect)(mo);return(0,u.useRefEffect)((l=>{function r(r){if(!t()||0!==r.button)return;const i=n(),s=fu(r.target);r.shiftKey?i!==s&&(l.contentEditable=!0,l.focus()):o()&&e(s)}return l.addEventListener("mousedown",r),()=>{l.removeEventListener("mousedown",r)}}),[e,t,n,o])}function sd(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,d.useSelect)(mo),{replaceBlocks:r,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,d.useDispatch)(mo);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===wu.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,l.createBlock)((0,l.getDefaultBlockName)())):i()):d.keyCode===wu.BACKSPACE||d.keyCode===wu.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===wu.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===wu.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 ad(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:l,getSelectedBlockClientId:r,getBlockCount:i}=(0,d.useSelect)(mo),{setNavigationMode:a}=(0,d.useDispatch)(mo),c=(0,d.useSelect)((e=>e(mo).isNavigationMode()),[])?void 0:"0",p=(0,s.useRef)();function m(t){if(p.current)p.current=null;else if(l())e.current.focus();else if(r())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Xr.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===wu.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==wu.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!l()&&!r())return void(e.target===s&&a(!0));if(((0,Xr.isFormElement)(e.target)||e.target.getAttribute("data-block")===r())&&(0,Xr.isFormElement)(Xr.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 l;if(o.keyCode!==wu.TAB)return;if("region"===(null===(l=o.target)||void 0===l?void 0:l.getAttribute("role")))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",i=Xr.focus.tabbable[r](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(mo).hasMultiSelection()),[]);return[e,(0,u.useMergeRefs)([t,sd(),od(),rd(),id(),Qu(),td(),Ju(),(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 cd=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[l,r,a]=ad();return(0,s.createElement)(s.Fragment,null,l,(0,s.createElement)("div",i({},o,{ref:(0,u.useMergeRefs)([r,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)})),ud="editor-styles-wrapper";function dd(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const pd=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:l,tabIndex:r=0,assets:a,isZoomedOut:d,...p}=e;const[,g]=(0,s.useReducer)((()=>({}))),[f,v]=(0,s.useState)(),[b,k]=(0,s.useState)([]),_=dd(null==a?void 0:a.styles),y=dd(null==a?void 0:a.scripts),E=qu(),[C,S,w]=ad(),[B,{height:I}]=(0,u.useResizeObserver)(),x=(0,u.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:l}=e,{readyState:r,documentElement:i}=o;return t=o,("interactive"===r||"complete"===r)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,l=window[o],r={};for(const t in e)r[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();r.clientX+=e.left,r.clientY+=e.top}const i=new l(e.type,r);!n.dispatchEvent(i)&&e.preventDefault()}const l=["dragover"];for(const t of l)e.addEventListener(t,o)}(o),v(o),E(i),k(Array.from(l.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=l.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 l,r;e.removeEventListener("load",o),null===(l=t)||void 0===l||l.removeEventListener("dragover",n),null===(r=t)||void 0===r||r.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,l)=>{const r=e.ownerDocument.createElement("script");r.id=n,o?(r.src=o,r.onload=()=>t(),r.onerror=()=>l()):t(),e.appendChild(r)}))}(e,n)))),Promise.resolve()).finally((()=>{g()}))}),[]),M=(0,u.useMergeRefs)([n,E,S]),N=(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:l}=t;return o?e(l):n&&(n.includes(`.${ud}`)||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 l=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"html{height:auto!important;}body{margin:0}"),_.map((e=>{let{tagName:t,href:n,id:o,rel:l,media:r,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:l,media:r,key:o})})),l),(0,s.createElement)(s.Fragment,null,r>=0&&C,(0,s.createElement)("iframe",i({},p,{ref:(0,u.useMergeRefs)([t,x]),tabIndex:r,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:T},l,(0,s.createElement)("style",null,`html { transition: background 5s; ${d?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,s.createElement)("body",{ref:M,className:c()("block-editor-iframe__body",ud,...b,{"is-zoomed-out":d}),style:d?{marginBottom:`-${.55*I-100}px`}:{}},B,(0,s.createElement)("div",{style:{display:"none"},ref:N}),(0,s.createElement)(m.__experimentalStyleProvider,{document:f},o))),f.documentElement)),r>=0&&w)}));var md={grad:.9,turn:360,rad:360/(2*Math.PI)},gd=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},hd=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},fd=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},vd=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},bd=function(e){return{r:fd(e.r,0,255),g:fd(e.g,0,255),b:fd(e.b,0,255),a:fd(e.a)}},kd=function(e){return{r:hd(e.r),g:hd(e.g),b:hd(e.b),a:hd(e.a,3)}},_d=/^#([0-9a-f]{3,8})$/i,yd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Ed=function(e){var t=e.r,n=e.g,o=e.b,l=e.a,r=Math.max(t,n,o),i=r-Math.min(t,n,o),s=i?r===t?(n-o)/i:r===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:r?i/r*100:0,v:r/255*100,a:l}},Cd=function(e){var t=e.h,n=e.s,o=e.v,l=e.a;t=t/360*6,n/=100,o/=100;var r=Math.floor(t),i=o*(1-n),s=o*(1-(t-r)*n),a=o*(1-(1-t+r)*n),c=r%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:l}},Sd=function(e){return{h:vd(e.h),s:fd(e.s,0,100),l:fd(e.l,0,100),a:fd(e.a)}},wd=function(e){return{h:hd(e.h),s:hd(e.s),l:hd(e.l),a:hd(e.a,3)}},Bd=function(e){return Cd((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},Id=function(e){return{h:(t=Ed(e)).h,s:(l=(200-(n=t.s))*(o=t.v)/100)>0&&l<200?n*o/100/(l<=100?l:200-l)*100:0,l:l/2,a:t.a};var t,n,o,l},xd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Td=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Md=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Pd={string:[[function(e){var t=_d.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?hd(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?hd(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Md.exec(e)||Nd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:bd({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=xd.exec(e)||Td.exec(e);if(!t)return null;var n,o,l=Sd({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(md[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Bd(l)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,l=e.a,r=void 0===l?1:l;return gd(t)&&gd(n)&&gd(o)?bd({r:Number(t),g:Number(n),b:Number(o),a:Number(r)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,l=e.a,r=void 0===l?1:l;if(!gd(t)||!gd(n)||!gd(o))return null;var i=Sd({h:Number(t),s:Number(n),l:Number(o),a:Number(r)});return Bd(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,l=e.a,r=void 0===l?1:l;if(!gd(t)||!gd(n)||!gd(o))return null;var i=function(e){return{h:vd(e.h),s:fd(e.s,0,100),v:fd(e.v,0,100),a:fd(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(r)});return Cd(i)},"hsv"]]},Ld=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]},Rd=function(e,t){var n=Id(e);return{h:n.h,s:fd(n.s+100*t,0,100),l:n.l,a:n.a}},Ad=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Dd=function(e,t){var n=Id(e);return{h:n.h,s:n.s,l:fd(n.l+100*t,0,100),a:n.a}},Od=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Ld(e.trim(),Pd.string):"object"==typeof e&&null!==e?Ld(e,Pd.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 hd(Ad(this.rgba),2)},e.prototype.isDark=function(){return Ad(this.rgba)<.5},e.prototype.isLight=function(){return Ad(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=kd(this.rgba)).r,n=e.g,o=e.b,r=(l=e.a)<1?yd(hd(255*l)):"","#"+yd(t)+yd(n)+yd(o)+r;var e,t,n,o,l,r},e.prototype.toRgb=function(){return kd(this.rgba)},e.prototype.toRgbString=function(){return t=(e=kd(this.rgba)).r,n=e.g,o=e.b,(l=e.a)<1?"rgba("+t+", "+n+", "+o+", "+l+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,l},e.prototype.toHsl=function(){return wd(Id(this.rgba))},e.prototype.toHslString=function(){return t=(e=wd(Id(this.rgba))).h,n=e.s,o=e.l,(l=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+l+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,l},e.prototype.toHsv=function(){return e=Ed(this.rgba),{h:hd(e.h),s:hd(e.s),v:hd(e.v),a:hd(e.a,3)};var e},e.prototype.invert=function(){return zd({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),zd(Rd(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),zd(Rd(this.rgba,-e))},e.prototype.grayscale=function(){return zd(Rd(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),zd(Dd(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),zd(Dd(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?zd({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):hd(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Id(this.rgba);return"number"==typeof e?zd({h:e,s:t.s,l:t.l,a:t.a}):hd(t.h)},e.prototype.isEqual=function(e){return this.toHex()===zd(e).toHex()},e}(),zd=function(e){return e instanceof Od?e:new Od(e)},Fd=[],Vd=function(e){e.forEach((function(e){Fd.indexOf(e)<0&&(e(Od,Pd),Fd.push(e))}))};function Hd(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 l in n)o[n[l]]=l;var r={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var l,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(!r.length)for(var d in n)r[d]=new e(n[d]).toRgb();for(var p in n){var m=(l=a,i=r[p],Math.pow(l.r-i.r,2)+Math.pow(l.g-i.g,2)+Math.pow(l.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),l="transparent"===o?"#0000":n[o];return l?new e(l).toRgb():null},"name"])}var Gd=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Ud=function(e){return.2126*Gd(e.r)+.7152*Gd(e.g)+.0722*Gd(e.b)};function Wd(e){e.prototype.luminance=function(){return e=Ud(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,l,r,i,s,a,c=t instanceof e?t:new e(t);return r=this.rgba,i=c.toRgb(),n=(s=Ud(r))>(a=Ud(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===l&&(l=Math.pow(10,o)),Math.floor(l*n)/l+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(r=(n=t).size)?"normal":r,"AAA"===(l=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===l&&"large"===i?3:4.5);var n,o,l,r,i}}var $d=n(3124),jd=n.n($d);const Kd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function qd(e,t){t=t||{};let n=1,o=1;function l(e){const t=e.match(/\n/g);t&&(n+=t.length);const l=e.lastIndexOf("\n");o=~l?e.length-l:o+e.length}function r(){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(l){const r=new Error(t.source+":"+n+":"+o+": "+l);if(r.reason=l,r.filename=t.source,r.line=n,r.column=o,r.source=e,!t.silent)throw r;s.push(r)}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 l(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=r();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,l(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function f(){const e=p(/^([^{]+)/);if(e)return Yd(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=r();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Yd(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Kd,""),value:n?Yd(n[0]).replace(Kd,""):""});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 k(){let e;const t=[],n=r();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 _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=r(),o=p(t);if(!o)return;const l={type:e};return l[e]=o[1].trim(),n(l)}}function S(){if("@"===e[0])return function(){const e=r();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 l,i=g();for(;l=k();)i.push(l),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=r(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Yd(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=r(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Yd(t[1]),media:Yd(t[2])})}()||function(){const e=r(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Yd(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 '}'")}()||_()||y()||E()||function(){const e=r(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Yd(t[1]),o=Yd(t[2]);if(!c())return a("@document missing '{'");const l=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:l}):a("@document missing '}'")}()||function(){const e=r();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=r();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=r();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=r(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Zd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Yd(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Zd(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){Zd(e,o)})):n&&"object"==typeof n&&Zd(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Qd=n(8575),Xd=n.n(Qd);const Jd=ep;function ep(e){this.options=e||{}}ep.prototype.emit=function(e){return e},ep.prototype.visit=function(e){return this[e.type](e)},ep.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,l=e.length;o<l;o++)n+=this.visit(e[o]),t&&o<l-1&&(n+=this.emit(t));return n};const tp=np;function np(e){Jd.call(this,e)}Xd()(np,Jd),np.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},np.prototype.comment=function(e){return this.emit("",e.position)},np.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},np.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},np.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("}")},np.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},np.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},np.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},np.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},np.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},np.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("}")},np.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},np.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},np.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},np.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("}"):""},np.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const op=lp;function lp(e){e=e||{},Jd.call(this,e),this.indentation=e.indent}Xd()(lp,Jd),lp.prototype.compile=function(e){return this.stylesheet(e)},lp.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},lp.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},lp.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},lp.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}")},lp.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}")},lp.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},lp.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},lp.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}")},lp.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)+"}")},lp.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")},lp.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}")},lp.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}")},lp.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}")},lp.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},lp.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()+"}"):""},lp.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},lp.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const rp=function(e,t){try{const l=qd(e),r=jd().map(l,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return n=r,((o=o||{}).compress?new tp(o):new op(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function ip(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 sp(e,t){return new URL(e,t).toString()}const ap=e=>t=>{if("declaration"===t.type){const r=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]};ip(e)&&o.push(e)}return o}(t.value).map((l=e,e=>({...e,newUrl:"url("+e.before+e.quote+sp(e.value,l)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=r,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,l;return t},cp=/^(body|html|:root).*$/,up=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(cp)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},dp=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 l=[];return t&&l.push(up(t)),o&&l.push(ap(o)),l.length?rp(n,(0,u.compose)(l)):n}))},pp=".editor-styles-wrapper";function mp(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,l=t.querySelector(pp);let r;if(l)r=n.getComputedStyle(l,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),r=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=zd(r);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function gp(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>dp(t,pp)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:mp(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function hp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=zd(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 fp(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 vp(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function bp(e){let{id:t,colors:n}=e;const o=hp(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 kp(e){let{preset:t}=e;return(0,s.createElement)(bp,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let _p;Vd([Hd,Wd]);const yp=2e3;function Ep(e){let{viewportWidth:t,containerWidth:n,__experimentalPadding:o,__experimentalMinHeight:l}=e;const[r,{height:i}]=(0,u.useResizeObserver)(),{styles:a,assets:c,duotone:p}=(0,d.useSelect)((e=>{var t,n;const o=e(mo).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]);_p=_p||(0,u.pure)(yf);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>yp?yp*f:void 0,minHeight:l}},(0,s.createElement)(pd,{head:(0,s.createElement)(gp,{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:yp,minHeight:0!==f&&f<1&&l?l/f:l}},r,h.map((e=>(0,s.createElement)(kp,{preset:e,key:e.slug}))),(0,s.createElement)(_p,{renderAppender:!1})))}function Cp(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)(Ep,i({},e,{containerWidth:n}))))}const Sp=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:l=!1,__experimentalOnClick:r,__experimentalMinHeight:i}=e;const a=(0,d.useSelect)((e=>e(mo).getSettings()),[]),c=(0,s.useMemo)((()=>({...a,__unstableIsPreviewMode:!0})),[a]),u=(0,s.useMemo)((()=>Array.isArray(t)?t:[t]),[t]);return t&&0!==t.length?(0,s.createElement)(ju,{value:u,settings:c},l?(0,s.createElement)(Ku,{onClick:r}):(0,s.createElement)(Cp,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function wp(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const l=(0,d.useSelect)((e=>e(mo).getSettings()),[]),r=(0,s.useMemo)((()=>({...l,__unstableIsPreviewMode:!0})),[l]),i=(0,u.useDisabled)(),a=(0,u.useMergeRefs)([n.ref,i]),p=(0,s.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),m=(0,s.createElement)(ju,{value:p,settings:r},(0,s.createElement)(Cf,{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?m:null}}const Bp=function(e){var t;let{item:n}=e;const{name:o,title:r,icon:i,description:a,initialAttributes:c,example:u}=n,d=(0,l.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)(Sp,{__experimentalPadding:16,viewportWidth:null!==(t=null==u?void 0:u.viewportWidth)&&void 0!==t?t:500,blocks:u?(0,l.getBlockFromExample)(o,{attributes:{...u.attributes,...c},innerBlocks:u.innerBlocks}):(0,l.createBlock)(o,c)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!d&&(0,s.createElement)(Gu,{title:r,icon:i,description:a}))},Ip=(0,s.createContext)(),xp=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:l,...r}=e;const a=(0,s.useContext)(Ip);return(0,s.createElement)(m.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},r),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,l):"function"==typeof l?l(t):(0,s.createElement)(m.Button,t,l)}))})),Tp=(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 Mp(e){let{count:t,icon:n,isPattern:o}=e;const l=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)(Hu,{icon:n}):l||(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)(Hu,{icon:Tp})))))}const Np=e=>{let{isEnabled:t,blocks:n,icon:o,children:l,isPattern:r}=e;const i={type:"inserter",blocks:n};return(0,s.createElement)(m.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:i,__experimentalDragComponent:(0,s.createElement)(Mp,{count:n.length,icon:o,isPattern:r})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return l({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))},Pp=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:r,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,l.createBlock)(o.name,o.initialAttributes,(0,l.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(Np,{isEnabled:u&&!o.disabled,blocks:h,icon:o.icon},(e=>{let{draggable:l,onDragStart:u,onDragEnd:h}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:l,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,h&&h(e)}},(0,s.createElement)(xp,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),r(o,(0,wu.isAppleOS)()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===wu.ENTER&&(e.preventDefault(),r(o,(0,wu.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)(Hu,{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))))}))})),Lp=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Yt.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))})),Rp=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(Ip);return(0,s.createElement)(m.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),Ap=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(Lp,{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)(Rp,{key:t},e.map(((e,r)=>(0,s.createElement)(Pp,{key:e.id,item:e,className:(0,l.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a&&!e.isDisabled,isFirst:0===t&&0===r})))))),r)},Dp=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))},Op=(e,t)=>{const{categories:n,collections:o,items:r}=(0,d.useSelect)((t=>{const{getInserterItems:n}=t(mo),{getCategories:o,getCollections:r}=t(l.store);return{categories:o(),collections:r(),items:n(e)}}),[e]);return[r,n,o,(0,s.useCallback)(((e,n)=>{let{name:o,initialAttributes:r,innerBlocks:i}=e;const s=(0,l.createBlock)(o,r,(0,l.createBlocksFromInnerBlocksTemplate)(i));t(s,void 0,n)}),[t])]},zp=function(e){let{children:t}=e;const n=(0,m.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(Ip.Provider,{value:n},t)},Fp=[],Vp=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:l}=e;const[r,i,a,c]=Op(t,n),d=(0,s.useMemo)((()=>(0,p.orderBy)(r,["frecency"],["desc"]).slice(0,6)),[r]),m=(0,s.useMemo)((()=>r.filter((e=>!e.category))),[r]),g=(0,s.useMemo)((()=>(0,u.pipe)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,p.groupBy)(e,"category")))(r)),[r]),f=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=r.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[r,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,u.useAsyncList)(i),b=i.length===v.length,k=(0,s.useMemo)((()=>Object.entries(a)),[a]),_=(0,u.useAsyncList)(b?k:Fp);return(0,s.createElement)(zp,null,(0,s.createElement)("div",null,l&&!!d.length&&(0,s.createElement)(Dp,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(Ap,{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)(Dp,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Ap,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Dp,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(Ap,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,p.map)(_,(e=>{let[t,n]=e;const l=f[t];return l&&l.length?(0,s.createElement)(Dp,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(Ap,{items:l,onSelect:c,onHover:o,label:n.title})):null}))))},Hp=(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"})),Gp=(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"})),Up=window.wp.notices,Wp=(e,t)=>{const{patternCategories:n,patterns:o}=(0,d.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(mo);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:r}=(0,d.useDispatch)(Up.store),i=(0,s.useCallback)(((t,n)=>{e((0,p.map)(n,(e=>(0,l.cloneBlock)(e))),t.name),r((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 $p(e){let{isDraggable:t,pattern:n,onClick:o,composite:l}=e;const{blocks:r,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,u.useInstanceId)($p)}`;return(0,s.createElement)(Np,{isEnabled:t,blocks:r,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"},l,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,r),"aria-label":n.title,"aria-describedby":n.description?c:void 0}),(0,s.createElement)(Sp,{blocks:r,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 jp(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const Kp=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:l,orientation:r,label:a=(0,h.__)("Block Patterns")}=e;const c=(0,m.__unstableUseCompositeState)({orientation:r});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)($p,{key:e.name,pattern:e,onClick:l,isDraggable:t,composite:c}):(0,s.createElement)(jp,{key:e.name}))))};function qp(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const l="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${l}__categories-list`},n.map((e=>{let{name:n,label:r}=e;return(0,s.createElement)(m.Button,{key:n,label:r,className:`${l}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},r)})))}function Yp(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 Zp=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:l,setFilterValue:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(Yp,{filterValue:l,setFilterValue:r}),!l&&(0,s.createElement)(qp,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Qp=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(br,{className:"block-editor-inserter__no-results-icon",icon:Vu}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))},Xp=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:r,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,d.useSelect)(mo),{destinationRootClientId:u,destinationIndex:p}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(mo),c=l();let u,d=t;return void 0!==n?u=n:o?u=s(o):!r&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,r]),{replaceBlocks:m,insertBlocks:g,showInsertionPoint:f,hideInsertionPoint:v}=(0,d.useDispatch)(mo),b=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!r&&o&&(0,l.isUnmodifiedDefaultBlock)(o)?m(o.clientId,e,null,a||n?0:null,t):g(e,p,u,!0,a||n?0:null,t);const s=Array.isArray(e)?e.length:1,d=(0,h.sprintf)(// translators: %d: the name of the block that has been added
|
17 |
+
(0,h._n)("%d block added.","%d blocks added.",s),s);(0,Yt.speak)(d),i&&i()}),[r,c,m,g,u,p,i,a]),k=(0,s.useCallback)((e=>{e?f(u,p):v()}),[f,v,u,p]);return[u,b,k]};var Jp=n(4793),em=n.n(Jp);function tm(e){return e.toLowerCase()}var nm=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],om=/[^A-Z0-9]+/gi;function lm(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?nm:n,l=t.stripRegexp,r=void 0===l?om:l,i=t.transform,s=void 0===i?tm:i,a=t.delimiter,c=void 0===a?" ":a,u=rm(rm(e,o,"$1\0$2"),r,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(s).join(c)}function rm(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const im=e=>e.name||"",sm=e=>e.title,am=e=>e.description||"",cm=e=>e.keywords||[],um=e=>e.category,dm=()=>null;function pm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return lm(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function mm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=em()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const gm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return pm(mm(e))},hm=(e,t)=>e.filter((e=>!gm(t).some((t=>t.includes(e))))),fm=(e,t,n,o)=>0===gm(o).length?e:vm(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}}),vm=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=gm(t);if(0===o.length)return e;const l=e.map((e=>[e,bm(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return l.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),l.map((e=>{let[t]=e;return t}))};function bm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=im,getTitle:l=sm,getDescription:r=am,getKeywords:i=cm,getCategory:s=um,getCollection:a=dm}=n,c=o(e),u=l(e),d=r(e),p=i(e),m=s(e),g=a(e),h=mm(t),f=mm(u);let v=0;if(h===f)v+=30;else if(f.startsWith(h))v+=20;else{const e=[c,u,d,...p,m,g].join(" "),t=pm(h);0===hm(t,e).length&&(v+=10)}return 0!==v&&c.startsWith("core/")&&(v+=c!==e.id?1:2),v}function km(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 _m=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const l=(0,u.useDebounce)(Yt.speak,500),[r,i]=Xp({shouldFocusBlock:!0}),[a,,c]=Wp(i,r),d=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?vm(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);l(n)}),[t,l]);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)(km,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(zp,null,!g&&(0,s.createElement)(Qp,null),g&&(0,s.createElement)(Kp,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function ym(e){let{initialCategory:t,patternCategories:n}=e;const[o,l]=(0,s.useState)(""),[r,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(Zp,{selectedCategory:r,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:l}),(0,s.createElement)(_m,{filterValue:o,selectedCategory:r,patternCategories:n}))}const Em=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)(ym,n))};function Cm(){const[e,t]=Wp(),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 Sm(e){let{rootClientId:t,onInsert:n,category:o}=e;const l=(0,s.useRef)();return(0,s.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Xr.focus.tabbable.find(l.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[o]),(0,s.createElement)("div",{ref:l,className:"block-editor-inserter__patterns-category-panel"},(0,s.createElement)(wm,{rootClientId:t,onInsert:n,category:o}))}function wm(e){let{rootClientId:t,onInsert:n,category:o}=e;const[l,,r]=Wp(n,t),i=Cm(),a=(0,s.useMemo)((()=>l.filter((e=>{var t,n,l;return"uncategorized"!==o.name?null===(l=e.categories)||void 0===l?void 0:l.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}))),[l,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)(Kp,{shownPatterns:c,blockPatterns:a,onClickPattern:r,label:o.label,orientation:"vertical",category:o.label,isDraggable:!0})):null}function Bm(e){let{onInsert:t,rootClientId:n}=e;const o=Cm();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)(br,{icon:(0,h.isRTL)()?Gp:Hp}))))))),o.map((e=>(0,s.createElement)(m.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,s.createElement)(m.__experimentalNavigatorBackButton,{icon:(0,h.isRTL)()?Hp:Gp,isSmall:!0,"aria-label":(0,h.__)("Navigate to the categories list")},(0,h.__)("Back")),(0,s.createElement)(wm,{category:e,rootClientId:n,onInsert:t})))))}const Im=function(e){let{onSelectCategory:t,selectedCategory:n,onInsert:o,rootClientId:l}=e;const[r,i]=(0,s.useState)(!1),a=Cm(),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)(br,{icon:Hp}))))),(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)(Bm,{onInsert:o,rootClientId:l}),r&&(0,s.createElement)(Em,{initialCategory:n,patternCategories:a,onModalClose:()=>i(!1)}))},xm=window.wp.url;function Tm(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[l,,,r]=Op(o,n),i=(0,s.useMemo)((()=>l.filter((e=>{let{category:t}=e;return"reusable"===t}))),[l]);return 0===i.length?(0,s.createElement)(Qp,null):(0,s.createElement)(Dp,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(Ap,{items:i,onSelect:r,onHover:t,label:(0,h.__)("Reusable blocks")}))}const Mm=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Tm,{onHover:o,onInsert:n,rootClientId:t}),(0,s.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,s.createElement)(m.Button,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,xm.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))},{Fill:Nm,Slot:Pm}=(0,m.createSlotFill)("__unstableInserterMenuExtension");Nm.Slot=Pm;const Lm=Nm,Rm=[],Am=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:l,clientId:r,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:d,showBlockDirectory:g=!1,isDraggable:f=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,u.useDebounce)(Yt.speak,500),[_,y]=Xp({onSelect:n,rootClientId:l,clientId:r,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=Op(_,y),[B,,I]=Wp(y,_),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=vm(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=d;b&&x.length>2&&(T=0);const M=(0,s.useMemo)((()=>{if(0===T)return[];const e=fm((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=M.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);k(n)}),[t,k]);const N=(0,u.useAsyncList)(M,{step:9}),P=(0,u.useAsyncList)(N.length===M.length?x:Rm),L=!(0,p.isEmpty)(M)||!(0,p.isEmpty)(x),R=!!M.length&&(0,s.createElement)(Dp,{title:(0,s.createElement)(m.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(Ap,{items:N,onSelect:w,onHover:o,label:(0,h.__)("Blocks"),isDraggable:f})),A=!!x.length&&(0,s.createElement)(Dp,{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)(Kp,{shownPatterns:P,blockPatterns:x,onClickPattern:I,isDraggable:f})));return(0,s.createElement)(zp,null,!g&&!L&&(0,s.createElement)(Qp,null),b?A:R,!!M.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?R:A,g&&(0,s.createElement)(Lm.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:L,rootClientId:_}},(e=>e.length?e:L?null:(0,s.createElement)(Qp,null))))},Dm={name:"blocks",
|
24 |
/* translators: Blocks tab title in the block inserter. */
|
25 |
+
title:(0,h.__)("Blocks")},Om={name:"patterns",
|
26 |
/* translators: Patterns tab title in the block inserter. */
|
27 |
+
title:(0,h.__)("Patterns")},zm={name:"reusable",
|
28 |
/* translators: Reusable blocks tab title in the block inserter. */
|
29 |
+
title:(0,h.__)("Reusable")},Fm=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:l,prioritizePatterns:r}=e;const i=(0,s.useMemo)((()=>{const e=[];return r&&n&&e.push(Om),e.push(Dm),!r&&n&&e.push(Om),o&&e.push(zm),e}),[r,Dm,n,Om,o,zm]);return(0,s.createElement)(m.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:l},t)},Vm=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:l,__experimentalInsertionIndex:r,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]=Xp({rootClientId:n,clientId:o,isAppender:l,insertionIndex:r,shouldFocusBlock:g}),{showPatterns:x,hasReusableBlocks:T}=(0,d.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(mo);return{showPatterns:!!n(w).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[w]),M=(0,s.useCallback)(((e,t,n)=>{B(e,t,n),i()}),[B,i]),N=(0,s.useCallback)(((e,t)=>{B(e,{patternName:t}),i()}),[B,i]),P=(0,s.useCallback)((e=>{I(!!e),_(e)}),[I,_]),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)(Vp,{rootClientId:w,onInsert:M,onHover:P,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)(Fu,null)))),[w,M,P,v,u,a]),A=(0,s.useMemo)((()=>(0,s.createElement)(Im,{rootClientId:w,onInsert:N,onSelectCategory:L,selectedCategory:y})),[w,N,L,y]),D=(0,s.useMemo)((()=>(0,s.createElement)(Mm,{rootClientId:w,onInsert:M,onHover:P})),[w,M,P]),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)(Am,{filterValue:v,onSelect:i,onHover:P,rootClientId:n,clientId:o,isAppender:l,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:g})),V&&(0,s.createElement)(Fm,{showPatterns:x,showReusableBlocks:T,prioritizePatterns:f,onSelect:S},O),!v&&!V&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},R)),a&&k&&(0,s.createElement)(Bp,{item:k}),F&&(0,s.createElement)(Sm,{rootClientId:w,onInsert:N,category:y}))}));function Hm(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:l,prioritizePatterns:r}=e;const[i,a]=(0,s.useState)(""),[u,p]=Xp({onSelect:t,rootClientId:n,clientId:o,isAppender:l}),[g]=Op(u,p),[f]=Wp(p,u),{setInserterIsOpened:v,insertionIndex:b}=(0,d.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:l}=e(mo),r=t(),i=n(o),s=l();return{setInserterIsOpened:r.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),k=f.length&&(!!i||r),_=k&&f.length>6||g.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return k&&(y=r?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":v})},_&&(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)(Am,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:l,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:r})),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 Gm=e=>{let t,{onToggle:n,disabled:o,isOpen:l,blockTitle:r,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"),r):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:Ou,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&&l,disabled:o},p))};class Um 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:l,hasSingleBlockType:r,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=Gm,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:l,hasSingleBlockType:r,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:l,showInserterHelpPanel:r,__experimentalIsQuick:i,prioritizePatterns:a}=this.props;return i?(0,s.createElement)(Hm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:l,prioritizePatterns:a}):(0,s.createElement)(Vm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:l,showInserterHelpPanel:r,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:l,onSelectOrClose:r}=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":l}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:r})}}const Wm=(0,u.compose)([(0,d.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:r}=t;const{getBlockRootClientId:i,hasInserterItems:s,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:c,getSettings:u}=e(mo),{getBlockVariations:d}=e(l.store);r=r||i(o)||void 0;const p=a(r),m=c(r),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(r),hasSingleBlockType:h,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:m,rootClientId:r,prioritizePatterns:g.__experimentalPreferPatternsOnRoot&&!r}})),(0,d.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!s&&!c)return;const{insertBlock:d}=e(mo);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=o(mo);if(!e||!r&&!n)return{};const i={};let s={};if(r){const e=t(r),n=t(l(r));(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,l.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,l.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:l,getBlockRootClientId:s}=o(mo);if(r)return e(r);const a=t();return!i&&a&&s(a)===n?e(a)+1:l(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,Yt.speak)(m)}}})),(0,u.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:l}=e;return t||!n&&!o&&!l}))])(Um),$m=(0,u.compose)((0,d.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:l}=e(mo),r=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:r,isLocked:!!l(t.rootClientId),placeholder:i}})),(0,d.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(mo);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:l,rootClientId:r}=e;if(t)return null;const i=(0,Du.decodeEntities)(l)||(0,h.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":r||"",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=>{wu.ENTER!==e.keyCode&&wu.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Wm,{rootClientId:r,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function jm(e,t){let{rootClientId:n,className:o,onFocus:l,tabIndex:r}=e;return(0,s.createElement)(Wm,{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:l,tabIndex:r,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)(br,{icon:Ou}));return(g||p)&&(f=(0,s.createElement)(m.Tooltip,{text:n},f)),f},isAppender:!0})}const Km=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),jm(e,t)))),qm=(0,s.forwardRef)(jm),Ym=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:r="div"}=e;const{hideInserter:i,canInsertDefaultBlock:a,selectedBlockClientId:u}=(0,d.useSelect)((e=>{const{canInsertBlockType:n,getTemplateLock:o,getSelectedBlockClientId:r,__unstableGetEditorMode:i}=e(mo);return{hideInserter:!!o(t)||"zoom-out"===i(),canInsertDefaultBlock:n((0,l.getDefaultBlockName)(),t),selectedBlockClientId:r()}}),[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)($m,{rootClientId:t}):(0,s.createElement)(qm,{rootClientId:t,className:"block-list-appender__toggle"})}return(0,s.createElement)(r,{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 Qm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:l,__unstableContentRef:r,...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:l,getBlockRootClientId:r,isBlockVisible:i}=e(mo),s=r(null!=t?t:n);return{orientation:(null===(o=l(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t,n]),b=Oo(t),k=Oo(n),_="vertical"===g,y=(0,s.useMemo)((()=>{if(u<0||!b&&!k||!v)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)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&&!k||!v)return;const{ownerDocument:e}=b||k;return{ownerDocument:e,getBoundingClientRect(){const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;let n=0,o=0;return _?(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,k,u,_,v]),C=El(r);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(!k)return;const e=new window.MutationObserver(p);return e.observe(k,{attributes:!0}),()=>{e.disconnect()}}),[k]),(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||k)&&v?(0,s.createElement)(m.Popover,i({ref:C,animate:!1,anchor:E,focusOnMount:!1,__unstableSlotName:l||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",variant:"unstyled"}),(0,s.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null},Xm={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}},Jm=function(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{clientId:o}=(0,d.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(mo),o=n(),l=t(o.rootClientId);return l.length?{clientId:l[o.index]}:{}}),[]),l=(0,u.useReducedMotion)();return(0,s.createElement)(Sl,{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:l?Xm.show:Xm.hide,animate:Xm.show,exit:l?Xm.show:Xm.exit,className:"block-editor-block-popover__drop-zone-foreground"}))},eg=(0,s.createContext)();function tg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:l}=(0,d.useDispatch)(mo),r=(0,s.useContext)(eg),i=(0,s.useRef)(),{orientation:a,previousClientId:p,nextClientId:g,rootClientId:h,isInserterShown:f,isDistractionFree:v,isNavigationMode:b}=(0,d.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:l,isBlockBeingDragged:r,getPreviousBlockClientId:i,getNextBlockClientId:s,getSettings:a,isNavigationMode:c}=e(mo),u=l(),d=n(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],m=d[u.index];for(;r(p);)p=i(p);for(;r(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}}),[]),k="vertical"===a,_=(0,u.useReducedMotion)(),y={start:{...k?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...k?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:f?.5:0,type:"tween"}},hover:{...k?{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"}}},E={start:{scale:_?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(v&&!b)return null;const C=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(Qm,{previousClientId:p,nextClientId:g,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(m.__unstableMotion.div,{layout:!_,initial:_?"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&&(r.current=!0)},className:c()(C,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||r.current||l()}},(0,s.createElement)(m.__unstableMotion.div,{variants:y,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,s.createElement)(m.__unstableMotion.div,{variants:E,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Wm,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{r.current=e},onSelectOrClose:()=>{r.current=!1}}))))}function ng(e){const{insertionPoint:t,isVisible:n}=(0,d.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n}=e(mo);return{insertionPoint:t(),isVisible:n()}}),[]);return n?"replace"===t.operation?(0,s.createElement)(Jm,i({key:`${t.rootClientId}-${t.index}`},e)):(0,s.createElement)(tg,e):null}function og(){const e=(0,s.useContext)(eg),t=(0,d.useSelect)((e=>e(mo).getSettings().isDistractionFree||"zoom-out"===e(mo).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:l,isBlockInsertionPointVisible:r,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c,__unstableIsWithinBlockOverlay:p}=(0,d.useSelect)(mo),{showInsertionPoint:m,hideInsertionPoint:g}=(0,d.useDispatch)(mo);return(0,u.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",r),()=>{o.removeEventListener("mousemove",r)};function r(t){var o;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void g();let r;if(t.target.classList.contains("is-root-container")||(r=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(r))return;const s=(null===(o=n(r))||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=l(f);0!==b?m(r,b,{__unstableWithInserter:!0}):g()}}),[e,n,o,l,r,i,m,g,a,t])}const lg="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,rg="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function ig(e){return(0,d.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(mo),{getBlockType:r,getActiveBlockVariation:i}=t(l.store),s=n(e),a=r(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 sg(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:r,name:i,reusableBlockTitle:s}=(0,d.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(mo),i=n(t);if(!i)return{};const s=(0,l.isReusableBlock)((0,l.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&r(o(t).ref)}}),[t]),a=ig(t);if(!i||!a)return null;const c=(0,l.getBlockType)(i),u=c?(0,l.__experimentalGetBlockLabel)(c,r,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 ag(e){let{clientId:t,maximumLength:n,context:o}=e;return sg({clientId:t,maximumLength:n,context:o})}const cg=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:r,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,d.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:r,getBlockName:i}=e(mo),s=r(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,l.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)((l=>{e.current=l.clientY,n.current=(0,Xr.getScrollContainer)(l.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 l=n.current.offsetHeight,r=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>r){const e=Math.max(l-r-50,0),n=Math.max(i-r-50,0)/e;t.current=25*n}else if(o.clientY<r){const e=Math.max(r-50,0),n=Math.max(r-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)(mo);if((0,s.useEffect)((()=>()=>{p.current&&b()}),[]),!c)return t({draggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(m.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),p.current=!0,g(e),r&&r()},onDragOver:h,onDragEnd:()=>{b(),p.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Mp,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},ug=(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"})),dg=(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"})),pg=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,h.isRTL)()?"left":"right":"down":null;const mg=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?Hp:Gp:ug:"down"===e?"horizontal"===t?(0,h.isRTL)()?Gp:Hp:dg:null,gg=(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,hg=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:r,...a}=e;const p=(0,u.useInstanceId)(hg),g=Array.isArray(n)?n:[n],f=g.length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,d.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:i,getBlock:s,getBlockListSettings:a}=e(mo),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,l.getBlockType)(h.name):null,isDisabled:"up"===o?f:v,rootClientId:u,firstIndex:d,isFirst:f,isLast:v,orientation:r||b}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,d.useDispatch)(mo),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:mg(o,C),label:gg(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(m.VisuallyHidden,{id:I},function(e,t,n,o,l,r,i){const s=n+1;if(e>1)return function(e,t,n,o,l,r){const i=t+1;if(n&&o)return(0,h.__)("All blocks are selected, and cannot be moved");if(l>0&&!o){const t=pg("down",r);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(l>0&&o){const e=pg("down",r);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(l<0&&!n){const t=pg("up",r);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(l<0&&n){const e=pg("up",r);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,l,r,i);if(o&&l)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(r>0&&!l){const e=pg("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(r>0&&l){const e=pg("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(r<0&&!o){const e=pg("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(r<0&&o){const e=pg("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,_,y,"up"===o?-1:1,C)))})),fg=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(hg,i({direction:"up",ref:t},e)))),vg=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(hg,i({direction:"down",ref:t},e)))),bg=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:l,isFirst:r,isLast:a,orientation:u}=(0,d.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:l,canMoveBlocks:r,getBlockOrder:i,getBlockRootClientId:s}=e(mo),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:r(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=l(u))||void 0===n?void 0:n.orientation}}),[t]);if(!o||r&&a&&!l)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)(cg,{clientIds:t},(e=>(0,s.createElement)(m.Button,i({icon:Tp,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)(fg,i({clientIds:t},e)))),(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(vg,i({clientIds:t},e))))))},kg=function(e){let{clientId:t,rootClientId:n}=e;const o=ig(t),r=(0,d.useSelect)((e=>{var o;const{getBlock:l,getBlockIndex:r,hasBlockMovingClientId:i,getBlockListSettings:s,__unstableGetEditorMode:a}=e(mo),c=r(t),{name:u,attributes:d}=l(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}=r,{setNavigationMode:b,removeBlock:k}=(0,d.useDispatch)(mo),_=(0,s.useRef)(),y=(0,l.getBlockType)(u),E=(0,l.__experimentalGetAccessibleBlockLabel)(y,p,a+1,f);(0,s.useEffect)((()=>{_.current.focus(),(0,Yt.speak)(E)}),[E]);const C=Oo(t),{hasBlockMovingClientId:S,getBlockIndex:w,getBlockRootClientId:B,getClientIdsOfDescendants:I,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:T,getPreviousBlockClientId:M,getNextBlockClientId:N}=(0,d.useSelect)(mo),{selectBlock:P,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,d.useDispatch)(mo),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)(Hu,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(m.FlexItem,null,"zoom-out"===v&&(0,s.createElement)(bg,{clientIds:[t],hideDragHandle:!0}),"navigation"===v&&(0,s.createElement)(cg,{clientIds:[t]},(e=>(0,s.createElement)(m.Button,i({icon:Tp,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:_,onClick:"navigation"===v?()=>b(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,o=n===wu.UP,l=n===wu.DOWN,r=n===wu.LEFT,i=n===wu.RIGHT,s=n===wu.TAB,a=n===wu.ESCAPE,c=n===wu.ENTER,u=n===wu.SPACE,d=e.shiftKey;if(n===wu.BACKSPACE||n===wu.DELETE)return k(t),void e.preventDefault();const p=x(),m=T(),g=M(m||p),h=N(m||p),f=s&&d||o,v=s&&!d||l,b=r,_=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(_){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),P(O),R(null)}if(v||f||b||_)if(y)e.preventDefault(),P(y);else if(s&&p){let t;if(v){t=C;do{t=Xr.focus.tabbable.findNext(t)}while(t&&C.contains(t));t||(t=C.ownerDocument.defaultView.frameElement,t=Xr.focus.tabbable.findNext(t))}else t=Xr.focus.tabbable.findPrevious(C);t&&(e.preventDefault(),t.focus(),L())}},label:E,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(ag,{clientId:t,maximumLength:35})))))};function _g(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const yg=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:l,...r}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!Xr.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,l){const[r]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=Xr.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,ed.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{r&&a()}),[n,r,a]),(0,s.useEffect)((()=>{let t=0;return i&&!r&&(t=window.requestAnimationFrame((()=>{const t=_g(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),!l||!e.current)return;const n=_g(e.current).findIndex((e=>0===e.tabIndex));l(n)}}),[i,r])}(a,n,c,o,l),c?(0,s.createElement)(m.Toolbar,i({label:r["aria-label"],ref:a},r),t):(0,s.createElement)(m.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},r),t)},{clearTimeout:Eg,setTimeout:Cg}=window,Sg=()=>{},wg=200;function Bg(e){let{ref:t,isFocused:n,debounceTimeout:o=wg,onChange:l=Sg}=e;const[r,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),l(e)},u=()=>{const e=a.current;e&&Eg&&Eg(e)};return(0,s.useEffect)((()=>()=>{c(!1),u()}),[]),{showMovers:r,debouncedShowMovers:e=>{e&&e.stopPropagation(),u(),r||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),u(),a.current=Cg((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function Ig(e){let{ref:t,debounceTimeout:n=wg,onChange:o=Sg}=e;const[l,r]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=Bg({ref:t,debounceTimeout:n,isFocused:l,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()&&(r(!0),a())},o=()=>{d()||(r(!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,r,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function xg(){const{selectBlock:e,toggleBlockHighlight:t}=(0,d.useDispatch)(mo),{firstParentClientId:n,shouldHide:o,isDistractionFree:r}=(0,d.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r}=e(mo),{hasBlockSupport:i}=e(l.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,l.getBlockType)(c),d=r();return{firstParentClientId:a,shouldHide:!i(u,"__experimentalParentSelector",!0),isDistractionFree:d.isDistractionFree}}),[]),a=ig(n),c=(0,s.useRef)(),{gestures:u}=Ig({ref:c,onChange(e){e&&r||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)(Hu,{icon:null==a?void 0:a.icon})}))}const Tg=(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 Mg(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",placement:"bottom-start",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)(Sp,{viewportWidth:500,blocks:t})))))}function Ng(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,s.createElement)(Pg,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function Pg(e){let{item:t,onSelect:n,setHoveredTransformItemName:o}=e;const{name:r,icon:i,title:a,isDisabled:c}=t;return(0,s.createElement)(m.MenuItem,{className:(0,l.getBlockMenuDefaultClassName)(r),onClick:e=>{e.preventDefault(),n(r)},disabled:c,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r)},(0,s.createElement)(Hu,{icon:i,showColors:!0}),a)}const Lg=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:r}=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:l}=n;return t[o]<t[l]?-1:1})),n}(n),d=c.length&&u.length,p=!!u.length&&(0,s.createElement)(Ng,{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)(Mg,{blocks:(0,l.switchToBlockType)(r,i)}),c.map((e=>(0,s.createElement)(Pg,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:a}))),!d&&p),!!d&&(0,s.createElement)(m.MenuGroup,{className:t},p))},Rg=(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"})),Ag=window.wp.tokenList;var Dg=n.n(Ag);function Og(e,t,n){const o=new(Dg())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function zg(e){return(0,p.find)(e,"isDefault")}function Fg(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:r,blockType:i,className:a}=(0,d.useSelect)((e=>{const{getBlock:n}=e(mo),o=n(t);if(!o)return{};const r=(0,l.getBlockType)(o.name),{getBlockStyles:i}=e(l.store);return{block:o,blockType:r,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,d.useDispatch)(mo),u=function(e){return e&&0!==e.length?zg(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),m=function(e,t){for(const n of new(Dg())(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,l.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,l.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(r,i);return{onSelect:e=>{const o=Og(a,m,e);c(t,{className:o}),n()},stylesToRender:u,activeStyle:m,genericPreviewBlock:g,className:a}}const Vg=()=>{};function Hg(e){let{clientId:t,onSwitch:n=Vg}=e;const{onSelect:o,stylesToRender:l,activeStyle:r}=Fg({clientId:t,onSwitch:n});return l&&0!==l.length?(0,s.createElement)(s.Fragment,null,l.map((e=>{const t=e.label||e.name;return(0,s.createElement)(m.MenuItem,{key:e.name,icon:r.name===e.name?Rg:null,onClick:()=>o(e)},(0,s.createElement)(m.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Gg(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)(Hg,{clientId:o,onSwitch:n}))}const Ug=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:l,innerBlocks:r=[]}=e;if(!n.has(o)){if(l===t)return e;for(const e of r){const o=Ug(e,t,n);if(o)return o}}},Wg=(e,t)=>{const n=((e,t)=>{const n=(0,l.__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 $g(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)(jg,{patterns:t,onSelect:n})))))}function jg(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)(Kg,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Kg(e){let{pattern:t,onSelect:n,composite:o}=e;const l="block-editor-block-switcher__preview-patterns-container",r=(0,u.useInstanceId)(Kg,`${l}-list__item-description`);return(0,s.createElement)("div",{className:`${l}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?r:void 0},(0,s.createElement)(m.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${l}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,s.createElement)(Sp,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,s.createElement)("div",{className:`${l}-list__item-title`},t.title)),!!t.description&&(0,s.createElement)(m.VisuallyHidden,{id:r},t.description))}const qg=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,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,l.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const l of n){const n=Ug(l,t.name,o);if(n){e=!0,o.add(n.clientId),Wg(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"},r&&(0,s.createElement)($g,{patterns:a,onSelect:o}),(0,s.createElement)(m.MenuItem,{onClick:e=>{e.preventDefault(),i(!r)},icon:Hp},(0,h.__)("Patterns"))):null},Yg=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o,multiSelect:r}=(0,d.useDispatch)(mo),i=ig(n[0].clientId),{possibleBlockTransformations:a,canRemove:c,hasBlockStyles:u,icon:p,patterns:g}=(0,d.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:s}=e(mo),{getBlockStyles:a,getBlockType:c}=e(l.store),{canRemoveBlocks:u}=e(mo),d=o(Array.isArray(t)?t[0]:t),[{name:p}]=n,m=1===n.length,g=m&&a(p);let h;var f;m?h=null==i?void 0:i.icon:h=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(f=c(p))||void 0===f?void 0:f.icon:Tg;return{possibleBlockTransformations:r(n,d),canRemove:u(t,d),hasBlockStyles:!(null==g||!g.length),icon:h,patterns:s(n,d)}}),[t,n,null==i?void 0:i.icon]),f=sg({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),v=1===n.length&&(0,l.isReusableBlock)(n[0]),b=1===n.length&&(0,l.isTemplatePart)(n[0]);function k(e){e.length>1&&r(e[0].clientId,e[e.length-1].clientId)}const _=!!a.length&&c&&!b,y=!(null==g||!g.length)&&c;if(!u&&!_)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)(Hu,{icon:p,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},f))}));const E=f,C=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),S=u||_||y;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:E,popoverProps:{position:"bottom right",variant:"toolbar",className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Hu,{icon:p,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},f)),toggleProps:{describedBy:C,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:r}=e;return S&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},y&&(0,s.createElement)(qg,{blocks:n,patterns:g,onSelect:e=>{!function(e){o(t,e),k(e)}(e),r()}}),_&&(0,s.createElement)(Lg,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:a,blocks:n,onSelect:e=>{!function(e){const r=(0,l.switchToBlockType)(n,e);o(t,r),k(r)}(e),r()}}),u&&(0,s.createElement)(Gg,{hoveredBlock:n[0],onSwitch:r}))})))))},Zg=e=>{let{clientIds:t}=e;const n=(0,d.useSelect)((e=>e(mo).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Yg,{clientIds:t,blocks:n})},{Fill:Qg,Slot:Xg}=(0,m.createSlotFill)("__unstableBlockToolbarLastItem");Qg.Slot=Xg;const Jg=Qg,eh=(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"})),th=window.wp.blob;function nh(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 oh(){const{getBlockName:e}=(0,d.useSelect)(mo),{getBlockType:t}=(0,d.useSelect)(l.store),{createSuccessNotice:n}=(0,d.useDispatch)(Up.store);return(0,s.useCallback)(((o,l)=>{let r="";if(1===l.length){var i;const n=l[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;r="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 r="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.",l.length),l.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.",l.length),l.length);n(r,{type:"snackbar"})}),[])}function lh(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,d.useSelect)(mo),{flashBlock:c,removeBlocks:p,replaceBlocks:m,__unstableDeleteSelection:g,__unstableExpandSelection:h}=(0,d.useDispatch)(mo),f=oh();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,Xr.documentHasUncollapsedSelection)(t):(0,Xr.documentHasSelection)(t))return}if(!u.contains(d.target.ownerDocument.activeElement))return;const b=d.defaultPrevented;d.preventDefault();const k=s(),_=i()||r(),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),_)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,l.createBlock)(n,JSON.parse(d.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,l.serialize)(t);d.clipboardData.setData("text/plain",(E=(E=o).replace(/<br>/g,"\n"),(0,Xr.__unstableStripHTML)(E).trim().replace(/\n\n+/g,"\n\n"))),d.clipboardData.setData("text/html",o)}var E;if("cut"===d.type)_&&!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 l=(0,Xr.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return l.length&&!nh(l,o)&&(o=l.map((e=>`<img src="${(0,th.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(d),r=(0,l.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});m(v,r,r.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 rh=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:lh()},t)};function ih(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:r,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,d.useSelect)(mo),{getDefaultBlockName:u,getGroupingBlockName:p}=(0,d.useSelect)(l.store),m=s(t),g=i(t[0]),h=m.every((e=>!!e&&(0,l.hasBlockSupport)(e.name,"multiple",!0)&&r(e.name,g))),f=r(u(),g),v=a(t,g),b=c(t,g),{removeBlocks:k,replaceBlocks:_,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I}=(0,d.useDispatch)(mo),x=oh();return n({canDuplicate:h,canInsertDefaultBlock:f,canMove:v,canRemove:b,rootClientId:g,blocks:m,onDuplicate:()=>y(t,o),onRemove:()=>k(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,l.switchToBlockType)(m,e);n&&_(t,n)},onUngroup(){if(!m.length)return;const e=m[0].innerBlocks;e.length&&_(t,e)},onCopy(){const e=m.map((e=>{let{clientId:t}=e;return t}));1===m.length&&S(e[0]),x("copy",e)}})}const sh=()=>{},ah=(0,u.compose)([(0,d.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:r,getSettings:i}=e(mo),s=o(n),a=i().codeEditingEnabled;return{mode:r(n),blockType:s?(0,l.getBlockType)(s.name):null,isCodeEditingEnabled:a}})),(0,d.withDispatch)(((e,t)=>{let{onToggle:n=sh,clientId:o}=t;return{onToggleMode(){e(mo).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:r=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!(0,l.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},!r&&a)})),ch=(0,u.compose)((0,d.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(mo).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,d.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(mo).replaceBlocks(n.clientId,(0,l.rawHandler)({HTML:(0,l.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const l=(0,h.__)("Convert to Blocks");return(0,s.createElement)(m.MenuItem,{onClick:n},!o&&l)})),{Fill:uh,Slot:dh}=(0,m.createSlotFill)("__unstableBlockSettingsMenuFirstItem");uh.Slot=dh;const ph=uh;function mh(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:r,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,d.useDispatch)(mo);return n||o?(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(m.MenuItem,{onClick:()=>{(()=>{const e=(0,l.switchToBlockType)(r,i);e&&c(t,e)})(),a()}},(0,h._x)("Group","verb")),o&&(0,s.createElement)(m.MenuItem,{onClick:()=>{(()=>{const e=r[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 gh(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=(0,d.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:i}=e(mo),{getGroupingBlockName:s}=e(l.store),a=i(),c=s(),u=r(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:r}}function hh(e){return(0,d.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:l,canLockBlockType:r,getBlockName:i,getBlockRootClientId:s,getTemplateLock:a}=t(mo),c=s(e),u=n(e),d=o(e,c),p=l(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:r(i(e)),isContentLocked:"contentOnly"===a(e),isLocked:!u||!d||!p}}),[e])}const fh=(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"})),vh=(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-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"})),bh=(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"})),kh=["core/block","core/navigation"];function _h(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function yh(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=hh(t),{allowsEditLocking:p,templateLock:g,hasTemplateLock:f}=(0,d.useSelect)((e=>{var n,o;const{getBlockName:r,getBlockAttributes:i}=e(mo),s=r(t),a=(0,l.getBlockType)(s);return{allowsEditLocking:kh.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:k}=(0,d.useDispatch)(mo),_=ig(t),y=(0,u.useInstanceId)(yh,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{r({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"),_.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(),k([t],{lock:o,templateLock:v?_h(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,{__nextHasNoMarginBottom:!0,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=>r({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,{__nextHasNoMarginBottom:!0,label:(0,h.__)("Restrict editing"),checked:!!o.edit,onChange:e=>r((t=>({...t,edit:e})))}),(0,s.createElement)(m.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?bh:fh})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,h.__)("Disable movement"),checked:o.move,onChange:e=>r((t=>({...t,move:e})))}),(0,s.createElement)(m.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?bh:fh})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,h.__)("Prevent removal"),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))}),(0,s.createElement)(m.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?bh:fh}))),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 Eh(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=hh(t),[l,r]=(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?fh:vh,onClick:r},i),l&&(0,s.createElement)(yh,{clientId:t,onClose:r}))}const{Fill:Ch,Slot:Sh}=(0,m.createSlotFill)("BlockSettingsMenuControls");function wh(e){let{...t}=e;return(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(Ch,t))}wh.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:o}=e;const{selectedBlocks:l,selectedClientIds:r,canRemove:a}=(0,d.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:l}=e(mo),r=null!==n?n:o();return{selectedBlocks:(0,p.map)(t(r).filter(Boolean),(e=>e.name)),selectedClientIds:r,canRemove:l(r)}}),[n]),{canLock:c}=hh(r[0]),u=1===r.length&&c,g=gh(),{isGroupable:h,isUngroupable:f}=g,v=(h||f)&&a;return(0,s.createElement)(Sh,{fillProps:{...t,__unstableDisplayLocation:o,selectedBlocks:l,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!v&&!u?null:(0,s.createElement)(m.MenuGroup,null,u&&(0,s.createElement)(Eh,{clientId:r[0]}),e,v&&(0,s.createElement)(mh,i({},g,{onClose:null==t?void 0:t.onClose})))))};const Bh=wh,Ih=()=>{},xh={className:"block-editor-block-settings-menu__popover",position:"bottom right",variant:"toolbar"};function Th(e){let{blocks:t,onCopy:n}=e;const o=(0,u.useCopyToClipboard)((()=>(0,l.serialize)(t)),n),r=t.length>1?(0,h.__)("Copy blocks"):(0,h.__)("Copy block");return(0,s.createElement)(m.MenuItem,{ref:o},r)}const Mh=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...a}=e;const c=Array.isArray(t)?t:[t],p=c.length,g=c[0],{firstParentClientId:f,isDistractionFree:v,onlyBlock:b,parentBlockType:k,previousBlockClientId:_,nextBlockClientId:y,selectedBlockClientIds:E}=(0,d.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a,getBlockAttributes:c}=e(mo),{getActiveBlockVariation:u}=e(l.store),d=o(g),p=d&&n(d);return{firstParentClientId:d,isDistractionFree:a().isDistractionFree,onlyBlock:1===t(d),parentBlockType:d&&(u(p,c(d))||(0,l.getBlockType)(p)),previousBlockClientId:r(g),nextBlockClientId:i(g),selectedBlockClientIds:s()}}),[g]),C=(0,d.useSelect)((e=>{const{getShortcutRepresentation:t}=e(ed.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:S,toggleBlockHighlight:w}=(0,d.useDispatch)(mo),B=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:Ih,[n]),I=sg({clientId:g,maximumLength:25}),x=(0,s.useCallback)(n?()=>{const e=_||y;e&&E.includes(g)&&!E.includes(e)&&n(e)}:Ih,[n,_,y,E]),T=(0,h.sprintf)(
|
64 |
/* translators: %s: block name */
|
65 |
+
(0,h.__)("Remove %s"),I),M=1===p?T:(0,h.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=Ig({ref:N,onChange(e){e&&v||w(f,e)}});return(0,s.createElement)(ih,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:l,canMove:c,canRemove:d,onDuplicate:v,onInsertAfter:_,onInsertBefore:y,onRemove:E,onCopy:w,onMoveTo:I,blocks:T}=e;return(0,s.createElement)(m.DropdownMenu,i({icon:eh,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:xh,noIcons:!0},a),(e=>{let{onClose:a}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,null,(0,s.createElement)(ph.Slot,{fillProps:{onClose:a}}),!!f&&(0,s.createElement)(m.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(Hu,{icon:k.icon}),onClick:()=>S(f)}),(0,h.sprintf)(
|
66 |
/* translators: %s: Name of the block's parent. */
|
67 |
+
(0,h.__)("Select parent block (%s)"),k.title)),1===p&&(0,s.createElement)(ch,{clientId:g}),(0,s.createElement)(Th,{blocks:T,onCopy:w}),n&&(0,s.createElement)(m.MenuItem,{onClick:(0,u.pipe)(a,v,B),shortcut:C.duplicate},(0,h.__)("Duplicate")),l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuItem,{onClick:(0,u.pipe)(a,y),shortcut:C.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(m.MenuItem,{onClick:(0,u.pipe)(a,_),shortcut:C.insertAfter},(0,h.__)("Insert after"))),c&&!b&&(0,s.createElement)(m.MenuItem,{onClick:(0,u.pipe)(a,I)},(0,h.__)("Move to")),1===p&&(0,s.createElement)(ah,{clientId:g,onToggle:a})),(0,s.createElement)(Bh.Slot,{fillProps:{onClose:a},clientIds:t,__unstableDisplayLocation:r}),"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,x),shortcut:C.remove},M)))}))}))},Nh=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(Mh,i({clientIds:t,toggleProps:e},n)))))};function Ph(e){let{clientId:t}=e;const n=ig(t),{canEdit:o,canMove:l,canRemove:r,canLock:i}=hh(t),[a,c]=(0,s.useReducer)((e=>!e),!1);return i?o&&l&&r?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(m.ToolbarButton,{icon:bh,label:(0,h.sprintf)(
|
68 |
/* translators: %s: block name */
|
69 |
+
(0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(yh,{clientId:t,onClose:c})):null}const Lh=(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"})),Rh=(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"})),Ah=(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"})),Dh={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}},Oh=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=gh(),{replaceBlocks:r}=(0,d.useDispatch)(mo),{canRemove:i,variations:a}=(0,d.useSelect)((e=>{const{canRemoveBlocks:o}=e(mo),{getBlockVariations:r}=e(l.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),c=o=>{const i=(0,l.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),i&&i.length>0&&(i[0].attributes.layout=Dh[o],r(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:Lh,label:(0,h._x)("Group","verb"),onClick:c}),u&&(0,s.createElement)(m.ToolbarButton,{icon:Rh,label:(0,h._x)("Row","single horizontal line"),onClick:()=>c("row")}),p&&(0,s.createElement)(m.ToolbarButton,{icon:Ah,label:(0,h._x)("Stack","verb"),onClick:()=>c("stack")}))};function zh(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,d.useSelect)((e=>!!n&&"html"===e(mo).getBlockMode(n)),[n]),{toggleBlockMode:l}=(0,d.useDispatch)(mo);return o?(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{onClick:()=>{l(n)}},(0,h.__)("Edit visually"))):null}const Fh=(0,s.createContext)(""),Vh=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:r,hasFixedToolbar:a,isDistractionFree:p,isValid:g,isVisual:h,isContentLocked:f}=(0,d.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:i,getSettings:s,__unstableGetContentLockingParent:a}=e(mo),c=o(),u=c[0],d=i(u),p=s();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,l.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,isDistractionFree:p.isDistractionFree,rootClientId:d,isValid:c.every((e=>r(e))),isVisual:c.every((e=>"visual"===n(e))),isContentLocked:!!a(u)}}),[]),{toggleBlockHighlight:v}=(0,d.useDispatch)(mo),b=(0,s.useRef)(),{showMovers:k,gestures:_}=Ig({ref:b,onChange(e){e&&p||v(o,e)}}),y=(0,u.useViewportMatch)("medium","<")||a;if(r&&!(0,l.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const E=y||k;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)(xg,null),(0,s.createElement)("div",i({ref:b},_),(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)(Ph,{clientId:n[0]}),(0,s.createElement)(bg,{clientIds:n,hideDragHandle:t}))),C&&S&&(0,s.createElement)(Oh,null),C&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Co.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Co.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Co.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Co.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Co.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Fh.Provider,{value:null==r?void 0:r.name},(0,s.createElement)(Jg.Slot,null))),(0,s.createElement)(zh,{clientIds:n}),!f&&(0,s.createElement)(Nh,{clientIds:n}))},Hh=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:r,hasParents:a,showParentSelector:u}=(0,d.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,__unstableGetContentLockingParent:r}=e(mo),{getBlockType:i}=e(l.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,l.hasBlockSupport)(u,"__experimentalParentSelector",!0)&&s.length<=1&&!r(a)}}),[]);if(r&&!(0,l.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const p=c()("block-editor-block-contextual-toolbar",{"has-parent":a&&u,"is-fixed":n});return(0,s.createElement)(yg,i({focusOnMount:t,className:p
|
70 |
+
/* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(Vh,{hideDragHandle:n}))},Gh={placement:"top-start"},Uh={...Gh,flip:!1,shift:!0},Wh={...Gh,flip:!0,shift:!1};function $h(e,t,n){if(!e||!t)return Uh;const o=t.getBoundingClientRect(),l=e.getBoundingClientRect(),r=e.ownerDocument.documentElement.clientHeight,i=o.top-l.top>n,s=o.height>r-n;return i||s?Uh:Wh}function jh(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:l,__experimentalIsBlockInterfaceHidden:r,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(mo);return{editorMode:t(),isMultiSelecting:n(),isTyping:l(),isBlockInterfaceHidden:r(),hasFixedToolbar:i().hasFixedToolbar,isDistractionFree:i().isDistractionFree,lastClientId:o()?s():null}}function Kh(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,showContents:l,capturingClientId:r,__unstablePopoverSlot:a,__unstableContentRef:p}=e;const{editorMode:m,isMultiSelecting:g,isTyping:h,isBlockInterfaceHidden:f,hasFixedToolbar:v,isDistractionFree:b,lastClientId:k}=(0,d.useSelect)(jh,[]),_=(0,d.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:l}=e(mo);if(!n())return!1;const r=o();return l(r.rootClientId)[r.index]===t}),[t]),y=(0,u.useViewportMatch)("medium"),E=(0,s.useRef)(!1),{stopTyping:C}=(0,d.useDispatch)(mo),S=!h&&"edit"===m&&o,w="navigation"===m||"zoom-out"===m,B="edit"===m&&!v&&y&&!g&&!S&&!h&&!f,I=!("edit"!==m||B||v||b||o);(0,ed.useShortcut)("core/block-editor/focus-toolbar",(()=>{E.current=!0,C(!0)}),{isDisabled:!I}),(0,s.useEffect)((()=>{E.current=!1}));const x=(0,s.useRef)(),T=function(e){let{contentElement:t,clientId:n}=e;const o=Oo(n),[l,r]=(0,s.useState)(0),[i,a]=(0,s.useState)((()=>$h(t,o,l))),c=(0,d.useSelect)((e=>e(mo).getBlockIndex(n)),[n]),p=(0,u.useRefEffect)((e=>{r(e.offsetHeight)}),[]),m=(0,s.useCallback)((()=>a($h(t,o,l))),[t,o,l]);return(0,s.useLayoutEffect)(m,[c,m]),(0,s.useLayoutEffect)((()=>{var e,n,l;if(!t||!o)return;const r=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let i;null==r||null===(n=r.addEventHandler)||void 0===n||n.call(r,"resize",m);const s=null==o||null===(l=o.ownerDocument)||void 0===l?void 0:l.defaultView;return s.ResizeObserver&&(i=new s.ResizeObserver(m),i.observe(o)),()=>{var e;null==r||null===(e=r.removeEventHandler)||void 0===e||e.call(r,"resize",m),i&&i.disconnect()}}),[m,t,o]),{...i,ref:p}}({contentElement:null==p?void 0:p.current,clientId:t});return w||B||S?(0,s.createElement)(s.Fragment,null,S&&(0,s.createElement)(Sl,i({clientId:r||t,__unstableCoverTarget:!0,bottomClientId:k,className:c()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":_}),__unstablePopoverSlot:a,__unstableContentRef:p,resize:!1,shift:!1},T),(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(Wm,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0}))),(w||B)&&(0,s.createElement)(Sl,i({clientId:r||t,bottomClientId:k,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstablePopoverSlot:a,__unstableContentRef:p,resize:!1},T),B&&l&&(0,s.createElement)(Hh,{focusOnMount:E.current,__experimentalInitialIndex:x.current,__experimentalOnIndexChange:e=>{x.current=e},key:t}),w&&(0,s.createElement)(kg,{clientId:t,rootClientId:n}))):null}function qh(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:r,getBlockParents:i,getSettings:s,isNavigationMode:a,__experimentalGetBlockListSettingsForBlocks:c}=e(mo),u=t()||n();if(!u)return;const{name:d,attributes:m={}}=r(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,l.isUnmodifiedDefaultBlock)({name:d,attributes:m}),capturingClientId:f}}function Yh(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,d.useSelect)(qh,[]);if(!o)return null;const{clientId:l,rootClientId:r,name:i,isEmptyDefaultBlock:a,capturingClientId:c,isDistractionFree:u,isNavigationMode:p}=o;return i?(0,s.createElement)(Kh,{clientId:l,rootClientId:r,isEmptyDefaultBlock:a,showContents:!u||p,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Zh(e){let{children:t}=e;const n=(0,s.useContext)(eg),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)(ng,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Yh,{__unstablePopoverSlot:"block-toolbar"}),t))}const Qh=(0,u.createHigherOrderComponent)((e=>t=>{const{clientId:n}=vo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Xh=Qh((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:l,isToggle:r}=e;return(0,s.createElement)(qm,{className:c()({"block-list-appender__toggle":r}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:l})})),Jh=(0,u.compose)([Qh,(0,d.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(mo),l=o(n);return{lastBlockClientId:l[l.length-1]}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)($m,{rootClientId:t})})),ef=new WeakMap,tf=new WeakMap;function nf(e,t,n,o,r,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,l.cloneBlock)(e)));i(e,!0,null)}if("block"===d){const l=n(u[0]);if(c===e&&l===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;r(u,c,i&&l<t?t-s:t)}}}function of(e,t,n,o,r,i){return t=>{if(!n)return;const s=(0,l.findTransform)((0,l.getBlockTransforms)("from"),(n=>"files"===n.type&&r(n.blockName,e)&&n.isMatch(t)));if(s){const e=s.transform(t,o);i(e)}}}function lf(e,t,n){return e=>{const t=(0,l.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}function rf(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{operation:o="insert"}=n,l=(0,d.useSelect)((e=>e(mo).getSettings().mediaUpload),[]),{canInsertBlockType:r,getBlockIndex:i,getClientIdsOfDescendants:a,getBlockOrder:c,getBlocksByClientId:u}=(0,d.useSelect)(mo),{insertBlocks:p,moveBlocksToPosition:m,updateBlockAttributes:g,clearSelectedBlock:h,replaceBlocks:f,removeBlocks:v}=(0,d.useDispatch)(mo),b=(0,d.useRegistry)(),k=(0,s.useCallback)((function(n){let l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("replace"===o){const o=c(e)[t];f(o,n,void 0,r)}else p(n,t,e,l,r)}),[o,c,p,f,t,e]),_=(0,s.useCallback)(((n,l,r)=>{if("replace"===o){const o=u(n),l=c(e)[t];b.batch((()=>{v(n,!1),f(l,o,void 0,0)}))}else m(n,l,e,r)}),[o,c,u,p,m,v,t,e]),y=nf(e,t,i,a,_,k,h),E=of(e,0,l,g,r,k),C=lf(0,0,k);return e=>{const t=(0,Xr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?E(t):y(e)}}function sf(e,t,n){const o="top"===n||"bottom"===n,{x:l,y:r}=e,i=o?l:r,s=o?r:l,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 af(e,t){let n,o,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return l.forEach((l=>{const r=sf(e,t,l);(void 0===n||r<n)&&(n=r,o=l)})),[n,o]}function cf(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}function uf(e,t){var n,o;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const r="horizontal"===l?["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:l}=e;const u=o();let[d,p]=af(t,u,r);n&&cf(t,u)&&(d=0),d<c&&(a="bottom"===p||!i&&"right"===p||i&&"left"===p?"after":"before",c=d,s=l)}));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 df(){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:l}=t(mo),r=n(e);return["all","contentOnly"].some((e=>e===r))||l(e)||o(e)}),[e]),{getBlockListSettings:r,getBlocks:i,getBlockIndex:a}=(0,d.useSelect)(mo),{showInsertionPoint:c,hideInsertionPoint:p}=(0,d.useDispatch)(mo),m=rf(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,l.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>o.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:a(t)}})),[p,m]=uf(d,{x:t.clientX,y:t.clientY},null===(s=r(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 pf(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:r,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,l,r,i,a){const{updateBlockListSettings:c}=(0,d.useDispatch)(mo),u=(0,d.useRegistry)(),{blockListSettings:p,parentLock:m}=(0,d.useSelect)((t=>{const n=t(mo).getBlockRootClientId(e);return{blockListSettings:t(mo).getBlockListSettings(e),parentLock:t(mo).getTemplateLock(n)}}),[e]),g=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:g,templateLock:void 0===l||"contentOnly"===m?m:l};if(void 0!==r&&(t.__experimentalCaptureToolbars=r),void 0!==i)t.orientation=i;else{const e=Sr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),yl()(p,t)||(ef.get(u)||ef.set(u,[]),ef.get(u).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=ef.get(u))&&void 0!==e&&e.length&&u.batch((()=>{ef.get(u).forEach((e=>{c(...e)})),ef.set(u,[])}))})))}),[e,p,g,n,o,l,m,r,i,c,a,u])}(t,n,o,r,a,m,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:r,isBlockSelected:i}=(0,d.useSelect)(mo),{replaceInnerBlocks:a}=(0,d.useDispatch)(mo),c=(0,d.useSelect)((t=>t(mo).getBlocks(e)),[e]),{getBlocks:u}=(0,d.useSelect)(mo),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,l.synchronizeBlocksWithTemplate)(s,t);(0,p.isEqual)(g,s)||a(e,g,0===s.length&&o&&0!==g.length&&i(e),r())}))}),[c,t,n,e])}(t,i,a,u);const k=(0,d.useSelect)((e=>{const n=e(mo).getBlock(t);if(!n)return;const o=(0,l.getBlockType)(n.name);return o&&o.providesContext?function(e,t){tf.has(t)||tf.set(t,new WeakMap);const n=tf.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)(ei,{value:k},(0,s.createElement)(Cf,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function mf(e){return $u(e),(0,s.createElement)(pf,e)}const gf=(0,s.forwardRef)(((e,t)=>{const n=hf({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function hf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o}=t,{clientId:r,__unstableLayoutClassNames:a=""}=vo(),p=(0,u.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:m,hasOverlay:g}=(0,d.useSelect)((e=>{if(!r)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:i}=e(mo),s=t(r),a="navigation"===i()||p;return{__experimentalCaptureToolbars:e(l.store).hasBlockSupport(s,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==s&&!n(r)&&!o(r,!0)&&a}}),[r,p]),h=df({rootClientId:r}),f=(0,u.useMergeRefs)([e.ref,o?null:h]),v={__experimentalCaptureToolbars:m,...t},b=v.value&&v.onChange?mf:pf;return{...e,ref:f,className:c()(e.className,"block-editor-block-list__layout",n?"":a,{"has-overlay":g}),children:r?(0,s.createElement)(b,i({},v,{clientId:r})):(0,s.createElement)(Cf,t)}}hf.save=l.__unstableGetInnerBlocksProps,gf.DefaultBlockAppender=Jh,gf.ButtonBlockAppender=Xh,gf.Content=()=>hf.save().children;const ff=gf,vf=(0,s.createContext)(),bf=(0,s.createContext)(),kf=new WeakMap;function _f(e){let{className:t,...n}=e;const[o,l]=(0,s.useState)(),r=(0,u.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,editorMode:p}=(0,d.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(mo),{outlineMode:o,focusMode:l}=t();return{isOutlineMode:o,isFocusMode:l,editorMode:n()}}),[]),m=(0,d.useRegistry)(),{setBlockVisibility:g}=(0,d.useDispatch)(mo),h=(0,u.useDebounce)((0,s.useCallback)((()=>{const e={};kf.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=>{kf.get(m)||kf.set(m,[]);for(const t of e){const e=t.target.getAttribute("data-block");kf.get(m).push([e,t.isIntersecting])}h()}))}),[]),v=hf({ref:(0,u.useMergeRefs)([qu(),og(),l]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&r,"is-navigate-mode":"navigation"===p})},n);return(0,s.createElement)(vf.Provider,{value:o},(0,s.createElement)(bf.Provider,{value:f},(0,s.createElement)("div",v)))}function yf(e){return function(){const{patterns:e,isPreviewMode:t}=(0,d.useSelect)((e=>{const{__experimentalBlockPatterns:t,__unstableIsPreviewMode:n}=e(mo).getSettings();return{patterns:t,isPreviewMode:n}}),[]);(0,s.useEffect)((()=>{if(t)return;if(null==e||!e.length)return;let n,o=-1;const l=()=>{o++,o>=e.length||((0,d.select)(mo).__experimentalGetParsedPattern(e[o].name),n=lg(l))};return n=lg(l),()=>rg(n)}),[e,t])}(),(0,s.createElement)(Zh,null,(0,s.createElement)(fo,{value:go},(0,s.createElement)(_f,e)))}function Ef(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:l,__experimentalLayout:r=wr}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,d.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:l}=e(mo);return{order:t(n),selectedBlocks:o(),visibleBlocks:l()}}),[n]);return(0,s.createElement)(Ir,{value:r},i.map((e=>(0,s.createElement)(d.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(Au,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(Ym,{tagName:l,rootClientId:n,renderAppender:o}))}function Cf(e){return(0,s.createElement)(d.AsyncModeProvider,{value:!1},(0,s.createElement)(Ef,e))}function Sf(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function wf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||Sf(Object.values(n).filter(Boolean))||"px"}function Bf(){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])),l=n.every((e=>e===n[0]))?n[0]:"",r=Sf(o),i=0===l||l?`${l}${r}`:void 0;return i}function If(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Bf(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function xf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Tf(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:l,...r}=e,a=Bf(l);void 0===a&&(a=wf(n));const c=xf(l)&&If(l),u=c?(0,h.__)("Mixed"):null;return(0,s.createElement)(m.__experimentalUnitControl,i({},r,{"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,size:"__unstable-large"}))}yf.__unstableElementContext=vf;const Mf={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function Nf(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:l,...r}=e;const a=e=>n=>{if(!t)return;const o=isNaN(parseFloat(n))?void 0:n;t({...c,[e]:o})},c="string"!=typeof l?l:{topLeft:l,topRight:l,bottomLeft:l,bottomRight:l};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(Mf).map((e=>{let[t,l]=e;const[u,d]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(c[t]),p=c[t]?d:n[t]||n.flat;return(0,s.createElement)(m.Tooltip,{text:l,position:"top",key:t},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(m.__experimentalUnitControl,i({},r,{"aria-label":l,value:[u,p].join(""),onChange:a(t),onUnitChange:(g=t,e=>{const t={...n};t[g]=e,o(t)}),size:"__unstable-large"}))));var g})))}function Pf(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?ll:rl,iconSize:24,"aria-label":o}))))}const Lf={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},Rf={px:100,em:20,rem:20};function Af(e){let{onChange:t,values:n}=e;const[o,l]=(0,s.useState)(!xf(n)||!If(n)),[r,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:Qo("spacing.units")||["px","em","rem"]}),c=wf(r),u=a&&a.find((e=>e.value===c)),d=(null==u?void 0:u.step)||1,[p]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(Bf(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)(Tf,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:r,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:Rf[c],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${c}`:void 0)},step:d,__nextHasNoMarginBottom:!0})):(0,s.createElement)(Nf,{min:0,onChange:t,selectedUnits:r,setSelectedUnits:i,values:n||Lf,units:a}),(0,s.createElement)(Pf,{onClick:()=>l(!o),isLinked:o})))}function Df(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Af,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=ul({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}Vd([Hd,Wd]);const Of=(e,t,n)=>{if(t){const n=(0,p.find)(e,{slug:t});if(n)return n}return{color:n}},zf=(e,t)=>(0,p.find)(e,{color:t});function Ff(e,t){if(e&&t)return`has-${(0,p.kebabCase)(t)}-${e}`}function Vf(){return{disableCustomColors:!Qo("color.custom"),disableCustomGradients:!Qo("color.customGradient")}}function Hf(){const e=Vf(),t=Qo("color.palette.custom"),n=Qo("color.palette.theme"),o=Qo("color.palette.default"),l=Qo("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}),l&&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 r=Qo("color.gradients.custom"),i=Qo("color.gradients.theme"),a=Qo("color.gradients.default"),c=Qo("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}),r&&r.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:r}),e}),[r,i,a]),e}const Gf="__experimentalBorder",Uf=["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}}}},$f=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},jf=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=$f(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return $f(t,"color",o)||{color:o}};function Kf(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function qf(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:r}=t,{colors:i}=Hf(),a=Yf(e.name),c=Qo("border.color")&&Yf(e.name,"color"),u=Qo("border.radius")&&Yf(e.name,"radius"),d=Qo("border.style")&&Yf(e.name,"style"),p=Qo("border.width")&&Yf(e.name,"width");if([!c,!u,!d,!p].every(Boolean)||!a)return null;const g=(0,l.getBlockSupport)(e.name,[Gf,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:l}=o||{};if(n){const{color:e}=jf({colors:t,namedColor:n});return e?{...l,color:e}:l}if(!l)return l;const r={...l};return Uf.forEach((e=>{var n;const o=Kf(null===(n=r[e])||void 0===n?void 0:n.color);if(o){const{color:n}=jf({colors:t,namedColor:o});r[e]={...r[e],color:n}}})),r})(t,i);return(0,s.createElement)(kl,{__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:l}=n;o({borderColor:void 0,style:{...l,border:ul({radius:null==l||null===(t=l.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,l={...e};if((0,m.__experimentalHasSplitBorders)(e))l={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},Uf.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=jf({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(l[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=jf({colors:i,customColor:t});o.slug&&(n=o.slug,l.color=void 0)}const s=ul({...r,border:{radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius,...l}});o({style:s,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",size:"__unstable-large",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:Zf(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)(Df,e)))}function Yf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,l.getBlockSupport)(e,Gf);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 Zf(e,t){return ul({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Qf(e,t,n){if(!Yf(t,"color")||ml(t,Gf,"color"))return e;const o=Xf(n),l=c()(e.className,o);return e.className=l||void 0,e}function Xf(e){var t;const{borderColor:n,style:o}=e,l=Ff("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[l]:!!l})}const Jf=(0,u.createHigherOrderComponent)((e=>t=>{var n,o,l,r,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=Hf();if(!Yf(m,"color")||ml(m,Gf,"color"))return(0,s.createElement)(e,t);const{color:b}=jf({colors:v,namedColor:h}),{color:k}=jf({colors:v,namedColor:Kf(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=jf({colors:v,namedColor:Kf(null==f||null===(l=f.border)||void 0===l||null===(r=l.right)||void 0===r?void 0:r.color)}),{color:y}=jf({colors:v,namedColor:Kf(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=jf({colors:v,namedColor:Kf(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||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 ev(e){if(e)return`has-${e}-gradient-background`}function tv(e,t){const n=(0,p.find)(e,["slug",t]);return n&&n.gradient}function nv(e,t){return(0,p.find)(e,["gradient",t])}function ov(e,t){const n=nv(e,t);return n&&n.slug}function lv(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=vo(),o=Qo("color.gradients.custom"),l=Qo("color.gradients.theme"),r=Qo("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...l||[],...r||[]]),[o,l,r]),{gradient:a,customGradient:c}=(0,d.useSelect)((o=>{const{getBlockAttributes:l}=o(mo),r=l(n)||{};return{customGradient:r[t],gradient:r[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,d.useDispatch)(mo),p=(0,s.useCallback)((o=>{const l=ov(i,o);u(n,l?{[e]:l,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),m=ev(a);let g;return g=a?tv(i,a):c,{gradientClass:m,gradientValue:g,setGradient:p}}(0,r.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Yf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Qf),(0,r.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Yf(e,"color")||ml(e,Gf,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Qf(o,e,n)},e})),(0,r.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Jf);const rv=["colors","disableCustomColors","gradients","disableCustomGradients"],iv={name:"color",title:"Solid",value:"color"},sv={name:"gradient",title:"Gradient",value:"gradient"},av=[iv,sv];function cv(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:l,__experimentalHasMultipleOrigins:r,__experimentalIsRenderedInSidebar:i,className:a,label:u,onColorChange:d,onGradientChange:g,colorValue:h,gradientValue:f,clearable:v,showTitle:b=!0,enableAlpha:k}=e;const _=d&&(!(0,p.isEmpty)(t)||!o),y=g&&(!(0,p.isEmpty)(n)||!l);if(!_&&!y)return null;const E={[iv.value]:(0,s.createElement)(m.ColorPalette,{value:h,onChange:y?e=>{d(e),g()}:d,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:r,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:k}),[sv.value]:(0,s.createElement)(m.GradientPicker,{__nextHasNoMargin:!0,value:f,onChange:_?e=>{g(e),d()}:g,gradients:n,disableCustomGradients:l,__experimentalHasMultipleOrigins:r,__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))),_&&y&&(0,s.createElement)(m.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:av,initialTabName:f?sv.value:!!_&&iv.value},(e=>C(e.value))),!y&&C(iv.value),!_&&C(sv.value))))}function uv(e){const t={};return t.colors=Qo("color.palette"),t.gradients=Qo("color.gradients"),t.disableCustomColors=!Qo("color.custom"),t.disableCustomGradients=!Qo("color.customGradient"),(0,s.createElement)(cv,i({},t,e))}const dv=function(e){return rv.every((t=>e.hasOwnProperty(t)))?(0,s.createElement)(cv,e):(0,s.createElement)(uv,e)},pv=e=>{let{setting:t,children:n,panelId:o,...l}=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},l,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},mv=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))},gv=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:l,label:r}=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)(mv,{colorValue:l,label:r}))};function hv(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:l,enableAlpha:r,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:l,enableAlpha:r,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)(pv,i({key:c,setting:e},p),(0,s.createElement)(m.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:gv(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)(dv,h)))}))})))}Vd([Hd,Wd]);const fv=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:l,fontSize:r,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const p=a||o,g=c||l;if(!p&&!g)return null;const f=[{color:p,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=zd(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&r>=24?"large":"small"};let y="",E="";for(const e of f){if(!e.color)continue;const t=zd(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<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,Yt.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 vv(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function bv(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:l=!0}=e;const[r,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.useState)(),m=Do(o),g=n.filter((e=>null==e?void 0:e.colorValue));(0,s.useEffect)((()=>{var e;if(!l)return;if(!g.length)return r&&a(),c&&u(),void(d&&u());if(!m.current)return;u(vv(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(vv(t).color);let n=m.current,o=vv(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=vv(n).backgroundColor;a(o)}));const h=Hf();return(0,s.createElement)(kl,{__experimentalGroup:"color"},(0,s.createElement)(hv,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},h)),l&&(0,s.createElement)(fv,{backgroundColor:r,textColor:c,enableAlphaChecker:t,linkColor:d}))}const kv="color",_v=e=>{const t=(0,l.getBlockSupport)(e,kv);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},yv=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,l.getBlockSupport)(e,kv);return null!==t&&"object"==typeof t&&!!t.link},Ev=e=>{const t=(0,l.getBlockSupport)(e,kv);return null!==t&&"object"==typeof t&&!!t.gradients},Cv=e=>{const t=(0,l.getBlockSupport)(e,kv);return t&&!1!==t.background},Sv=e=>{const t=(0,l.getBlockSupport)(e,kv);return t&&!1!==t.text},wv=(e,t)=>ul(dl(t,e,void 0)),Bv=e=>({textColor:void 0,style:wv(["color","text"],e.style)}),Iv=e=>({style:wv(["elements","link","color","text"],e.style)}),xv=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 Tv(e,t,n){var o,l,r,i,s,a;if(!_v(t)||ml(t,kv))return e;const u=Ev(t),{backgroundColor:d,textColor:p,gradient:m,style:g}=n,h=e=>!ml(t,kv,e),f=h("text")?Ff("color",p):void 0,v=h("gradients")?ev(m):void 0,b=h("background")?Ff("background-color",d):void 0,k=h("background")||h("gradients"),_=d||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||u&&(m||(null==g||null===(l=g.color)||void 0===l?void 0:l.gradient)),y=c()(e.className,f,v,{[b]:!(u&&null!=g&&null!==(r=g.color)&&void 0!==r&&r.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 Mv=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Of(e,n[1]).color:t};function Nv(e){var t,n,o,r,i,a,c,u,d;const{name:p,attributes:m}=e,g=Qo("color.palette.custom"),f=Qo("color.palette.theme"),v=Qo("color.palette.default"),b=(0,s.useMemo)((()=>[...g||[],...f||[],...v||[]]),[g,f,v]),k=Qo("color.gradients.custom"),_=Qo("color.gradients.theme"),y=Qo("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=Qo("color.custom"),S=Qo("color.customGradient"),w=Qo("color.background"),B=Qo("color.link"),I=Qo("color.text"),x=C||!f||(null==f?void 0:f.length)>0,T=S||!_||(null==_?void 0:_.length)>0,M=(0,s.useRef)(m);if((0,s.useEffect)((()=>{M.current=m}),[m]),!_v(p))return null;const N=yv(p)&&B&&x,P=Sv(p)&&I&&x,L=Cv(p)&&w&&x,R=Ev(p)&&T;if(!(N||P||L||R))return null;const{style:A,textColor:D,backgroundColor:O,gradient:z}=m;let F;if(R&&z)F=tv(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,l;const r=zf(b,n),i=t+"Color",s={...M.current.style,color:{...null===(o=M.current)||void 0===o||null===(l=o.style)||void 0===l?void 0:l.color,[t]:null!=r&&r.slug?void 0:n}},a=null!=r&&r.slug?r.slug:void 0,c={style:ul(s),[i]:a};e.setAttributes(c),M.current={...M.current,...c}},G=(0,l.getBlockSupport)(e.name,[kv,"__experimentalDefaultControls"]),U="web"===s.Platform.OS&&!z&&!(null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient)&&L&&(N||P)&&!1!==(0,l.getBlockSupport)(e.name,[kv,"enableContrastChecker"]);return(0,s.createElement)(bv,{enableContrastChecking:U,clientId:e.clientId,enableAlpha:!0,settings:[...P?[{label:(0,h.__)("Text"),onColorChange:H("text"),colorValue:Of(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==G?void 0:G.text,resetAllFilter:Bv}]:[],...L||R?[{label:(0,h.__)("Background"),onColorChange:L?H("background"):void 0,colorValue:Of(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:F,onGradientChange:R?t=>{const n=ov(E,t);let o;if(n){var l,r,i;const e={...null===(l=M.current)||void 0===l?void 0:l.style,color:{...null===(r=M.current)||void 0===r||null===(i=r.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:ul(e),gradient:n}}else{var s,a,c;const e={...null===(s=M.current)||void 0===s?void 0:s.style,color:{...null===(a=M.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:ul(e),gradient:void 0}}e.setAttributes(o),M.current={...M.current,...o}}:void 0,isShownByDefault:null==G?void 0:G.background,resetAllFilter:xv}]:[],...N?[{label:(0,h.__)("Link"),onColorChange:t=>{var n;const o=zf(b,t),l=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,r=ul(dl(null===(n=M.current)||void 0===n?void 0:n.style,["elements","link","color","text"],l));e.setAttributes({style:r}),M.current={...M.current,style:r}},colorValue:Mv(b,null==A||null===(r=A.elements)||void 0===r||null===(i=r.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:Iv}]:[]]})}const Pv=(0,u.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:l}=t,{backgroundColor:r,textColor:a}=l,c=Qo("color.palette.custom")||[],u=Qo("color.palette.theme")||[],d=Qo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!_v(o)||ml(o,kv))return(0,s.createElement)(e,t);const m={};var g,h;a&&!ml(o,kv,"text")&&(m.color=null===(g=Of(p,a))||void 0===g?void 0:g.color),r&&!ml(o,kv,"background")&&(m.backgroundColor=null===(h=Of(p,r))||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}))})),Lv={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,r.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return _v(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Ev(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Tv),(0,r.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!_v(e)||ml(e,kv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Tv(o,e,n)},e})),(0,r.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Pv),(0,r.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const l=e.name;return pl({linkColor:yv(l),textColor:Sv(l),backgroundColor:Cv(l),gradient:Ev(l)},Lv,e,t,n,o)}));const Rv=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],Av=[{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"}],Dv=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function Ov(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:l,fontWeight:r},...a}=e,c=n||o,u=Dv(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 Rv.forEach((t=>{let{name:n,value:o}=t;Av.forEach((t=>{let{name:l,value:r}=t;const i="normal"===o?l:(0,h.sprintf)(
|
73 |
/* translators: 1: Font weight name. 2: Font style name. */
|
74 |
+
(0,h.__)("%1$s %2$s"),l,n);e.push({key:`${o}-${r}`,name:i,style:{fontStyle:o,fontWeight:r}})}))})),e})():n?(()=>{const e=[d];return Rv.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 Av.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===l&&e.style.fontWeight===r))||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 zv=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:l="60px",...r}=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({},r,{__unstableInputWidth:l,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),l=((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:l}},onChange:n,label:(0,h.__)("Line height"),placeholder:1.5,step:.1,value:c,min:0,spinControls:"custom"})))},Fv="typography.lineHeight";function Vv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(zv,{__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:ul(t)})},size:"__unstable-large"})}function Hv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Qo("typography.lineHeight");return!(0,l.hasBlockSupport)(e,Fv)||t}const Gv="typography.__experimentalFontStyle",Uv="typography.__experimentalFontWeight";function Wv(e){var t,n;const{attributes:{style:o},setAttributes:l}=e,r=!$v(e),i=!jv(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)(Ov,{onChange:e=>{l({style:ul({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:r,hasFontWeights:i,value:{fontStyle:a,fontWeight:c},size:"__unstable-large"})}function $v(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,l.hasBlockSupport)(e,Gv),n=Qo("typography.fontStyle");return!t||!n}function jv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,l.hasBlockSupport)(e,Uv),n=Qo("typography.fontWeight");return!t||!n}function Kv(e){const t=$v(e),n=jv(e);return t&&n}function qv(e){let{value:t="",onChange:n,fontFamilies:o,...l}=e;const r=Qo("typography.fontFamilies");if(o||(o=r),(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"},l))}const Yv="typography.__experimentalFontFamily";function Zv(e,t,n){if(!(0,l.hasBlockSupport)(t,Yv))return e;if(ml(t,Ob,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Dg())(e.className);o.add(`has-${(0,p.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}function Qv(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const l=Qo("typography.fontFamilies"),r=null===(t=(0,p.find)(l,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(qv,{className:"block-editor-hooks-font-family-control",fontFamilies:l,value:r,onChange:function(e){const t=(0,p.find)(l,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Xv(e){let{name:t}=e;const n=Qo("typography.fontFamilies");return!n||0===n.length||!(0,l.hasBlockSupport)(t,Yv)}(0,r.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,l.hasBlockSupport)(e,Yv)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Zv),(0,r.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,l.hasBlockSupport)(e,Yv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zv(o,e,n)},e}));const Jv=(e,t,n)=>{if(t){const n=(0,p.find)(e,{slug:t});if(n)return n}return{size:n}};function eb(e,t){return(0,p.find)(e,{size:t})||{size:t}}function tb(e){if(e)return`has-${(0,p.kebabCase)(e)}-font-size`}const nb=function(e){const t=Qo("typography.fontSizes"),n=!Qo("typography.customFontSize");return(0,s.createElement)(m.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},ob="1600px",lb="768px",rb=1,ib=.75,sb="14px";function ab(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:o,minimumViewPortWidth:l=lb,maximumViewPortWidth:r=ob,scaleFactor:i=rb,minimumFontSizeFactor:s=ib,minimumFontSizeLimit:a=sb}=e;if(o){const e=cb(o);if(null==e||!e.unit)return null;const l=cb(a,{coerceTo:e.unit});if(null!=l&&l.value&&!t&&!n&&(null==e?void 0:e.value)<=(null==l?void 0:l.value))return null;if(n||(n=`${e.value}${e.unit}`),!t){const n=ub(e.value*s,3);t=null!=l&&l.value&&n<(null==l?void 0:l.value)?`${l.value}${l.unit}`:`${n}${e.unit}`}}const c=cb(t),u=(null==c?void 0:c.unit)||"rem",d=cb(n,{coerceTo:u});if(!c||!d)return null;const p=cb(t,{coerceTo:"rem"}),m=cb(r,{coerceTo:u}),g=cb(l,{coerceTo:u});if(!m||!g||!p)return null;const h=ub(g.value/100,3),f=ub(h,3)+u,v=ub(((d.value-c.value)/(m.value-g.value)*100||1)*i,3);return`clamp(${t}, ${p.value}${p.unit} + ((1vw - ${f}) * ${v}), ${n})`}function cb(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:l}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},r=null==l?void 0:l.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${r}){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:ub(u,3),unit:c}}function ub(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 db="typography.fontSize";function pb(e,t,n){if(!(0,l.hasBlockSupport)(t,db))return e;if(ml(t,Ob,"fontSize"))return e;const o=new(Dg())(e.className);o.add(tb(n.fontSize));const r=o.value;return e.className=r||void 0,e}function mb(e){var t,n;const{attributes:{fontSize:o,style:l},setAttributes:r}=e,i=Qo("typography.fontSizes"),a=Jv(i,o,null==l||null===(t=l.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==l||null===(n=l.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(nb,{onChange:e=>{const t=eb(i,e).slug;r({style:ul({...l,typography:{...null==l?void 0:l.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function gb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Qo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,l.hasBlockSupport)(e,db)||!n}const hb=(0,u.createHigherOrderComponent)((e=>t=>{var n,o;const r=Qo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,l.hasBlockSupport)(i,db)||ml(i,Ob,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=Jv(r,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"),fb={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,r.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,l.hasBlockSupport)(e,db)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",pb),(0,r.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,l.hasBlockSupport)(e,db))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),pb(o,e,n)},e})),(0,r.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",hb),(0,r.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return pl({fontSize:(0,l.hasBlockSupport)(r,db)},fb,e,t,n,o)})),(0,r.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,l.hasBlockSupport)(e,db)||ml(e,Ob,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,o,l;const r=t?t(e):{},i=null==r||null===(n=r.style)||void 0===n?void 0:n.fontSize,s=!(null===(o=(0,d.select)(mo).getSettings().__experimentalFeatures)||void 0===o||null===(l=o.typography)||void 0===l||!l.fluid),a=i&&s?ab({fontSize:i}):null;return null===a?r:{...r,style:{...null==r?void 0:r.style,fontSize:a}}},e}),11);const vb=(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"})),bb=(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"})),kb=(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"})),_b=[{name:(0,h.__)("None"),value:"none",icon:vb},{name:(0,h.__)("Underline"),value:"underline",icon:bb},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:kb}];function yb(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"},_b.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 Eb="typography.__experimentalTextDecoration";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.textDecoration,onChange:function(e){o({style:ul({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})},size:"__unstable-large"})}function Sb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,l.hasBlockSupport)(e,Eb),n=Qo("typography.textDecoration");return t||!n}const wb=(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"})),Bb=(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"})),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.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"})),xb=[{name:(0,h.__)("None"),value:"none",icon:vb},{name:(0,h.__)("Uppercase"),value:"uppercase",icon:wb},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:Bb},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:Ib}];function Tb(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"},xb.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 Mb="typography.__experimentalTextTransform";function Nb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Tb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:ul({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})},size:"__unstable-large"})}function Pb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,l.hasBlockSupport)(e,Mb),n=Qo("typography.textTransform");return t||!n}function Lb(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...l}=e;const r=(0,m.__experimentalUseCustomUnits)({availableUnits:Qo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(m.__experimentalUnitControl,i({},l,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n}))}const Rb="typography.__experimentalLetterSpacing";function Ab(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Lb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:ul({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%",size:"__unstable-large"})}function Db(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,l.hasBlockSupport)(e,Rb),n=Qo("typography.letterSpacing");return t||!n}const Ob="typography",zb=[Fv,db,Gv,Uv,Yv,Eb,Mb,Rb];function Fb(e){const{clientId:t}=e,n=Xv(e),o=gb(e),r=Kv(e),i=Hv(e),a=Sb(e),c=Pb(e),u=Db(e),d=!$v(e),p=!jv(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Kv(e),gb(e),Hv(e),Xv(e),Sb(e),Pb(e),Db(e)];return t.filter(Boolean).length===t.length}(e),f=Vb(e.name);if(g||!f)return null;const v=(0,l.getBlockSupport)(e.name,[Ob,"__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)(kl,{__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)(Qv,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:ul({...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)(mb,e)),!r&&(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:Dv(d,p),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ul({...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)(Wv,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:ul({...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)(Vv,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:ul({...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)(Ab,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:ul({...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)(Cb,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:ul({...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)(Nb,e)))}const Vb=e=>zb.some((t=>(0,l.hasBlockSupport)(e,t))),Hb=[...zb,Gf,kv,Dl,Ol],Gb=e=>Hb.some((t=>(0,l.hasBlockSupport)(e,t)));function Ub(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,yr.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const Wb={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[kv],[`${Ob}.__experimentalSkipSerialization`]:[Ob],[`${Dl}.__experimentalSkipSerialization`]:[Dl],[`${Ol}.__experimentalSkipSerialization`]:[Ol]},$b={...Wb,[`${Ol}`]:["spacing.blockGap"]},jb={gradients:"gradient"};function Kb(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;Kb(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function qb(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$b;if(!Gb(t))return e;let{style:r}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,l.getBlockSupport)(t,n);!0===i&&(r=Kb(r,o)),Array.isArray(i)&&i.forEach((e=>{const t=jb[e]||e;r=Kb(r,[[...o,t]])}))})),e.style={...Ub(r),...e.style},e}const Yb=(0,u.createHigherOrderComponent)((e=>t=>{const n=bo();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Nv,t),(0,s.createElement)(Fb,t),(0,s.createElement)(qf,t),(0,s.createElement)(Hl,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Zb=(0,u.createHigherOrderComponent)((e=>t=>{var n,o;const r=`wp-elements-${(0,u.useInstanceId)(e)}`,a=ml(t.name,kv,"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,yr.compileCSS)(n,{selector:`.editor-styles-wrapper .${r} ${l.__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)(yf.__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,r):t.className})))}));(0,r.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Gb(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",qb),(0,r.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Gb(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),qb(o,e,n,Wb)},e})),(0,r.addFilter)("editor.BlockEdit","core/style/with-block-controls",Yb),(0,r.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Zb),(0,r.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,l.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 Qb=(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"})),Xb=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:l,disableCustomDuotone:r,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)(br,{icon:Qb}),(0,s.createElement)(m.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),variant:"toolbar"},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!==wu.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:l,disableCustomDuotone:r,value:i,onChange:a}))})},Jb=[];function ek(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,s.createElement)(vp,{selector:t}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(bp,{id:n,colors:o}),(0,s.createElement)(fp,{id:n,selector:t}))}function tk(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Qo(n),l=Qo(`${t}.custom`)||Jb,r=Qo(`${t}.theme`)||Jb,i=Qo(`${t}.default`)||Jb;return(0,s.useMemo)((()=>[...l,...r,...o?Jb:i]),[o,l,r,i])}function nk(e){var t;let{attributes:n,setAttributes:o}=e;const l=null==n?void 0:n.style,r=null==l||null===(t=l.color)||void 0===t?void 0:t.duotone,i=tk({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=tk({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Qo("color.custom"),u=!Qo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(Co,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Xb,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:r,onChange:e=>{const t={...l,color:{...null==l?void 0:l.color,duotone:e}};o({style:t})}}))}Vd([Hd]);const ok=(0,u.createHigherOrderComponent)((e=>t=>{const n=(0,l.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,d.useSelect)((e=>e(mo).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&!o&&(0,s.createElement)(nk,t))}),"withDuotoneControls"),lk=(0,u.createHigherOrderComponent)((e=>t=>{var n,o,r;const a=(0,l.getBlockSupport)(t.name,"color.__experimentalDuotone"),d=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(r=o.color)||void 0===r?void 0:r.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(","),l=[];return n.forEach((e=>{o.forEach((t=>{l.push(`${e.trim()} ${t.trim()}`)}))})),l.join(", ")}(`.editor-styles-wrapper .${p}`,a),g=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(yf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(ek,{selector:m,id:p,colors:d}),h),(0,s.createElement)(e,i({},t,{className:g})))}),"withDuotoneStyles");(0,r.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,l.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,r.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",ok),(0,r.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",lk);const rk="__experimentalLayout";function ik(){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(mo);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),r=Qo("layout")||{},{attributes:i={},name:s}=n,{layout:a}=i,{default:c}=(0,l.getBlockSupport)(s,rk)||{},u=null!=a&&a.inherit||null!=a&&a.contentSize||null!=a&&a.wideSize?{...a,type:"constrained"}:a||c||{},m=[];var g,h;return null!=r&&null!==(e=r.definitions)&&void 0!==e&&null!==(t=e[(null==u?void 0:u.type)||"default"])&&void 0!==t&&t.className&&m.push(null==r||null===(g=r.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 sk(){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:l}=t,{layout:r={},style:i={}}=o,s=null!=r&&r.inherit||null!=r&&r.contentSize||null!=r&&r.wideSize?{...r,type:"constrained"}:r||{},a=Sr((null==s?void 0:s.type)||"default"),c=Qo("layout")||{},u=Qo("spacing.blockGap"),d=null!==u,p=null==a||null===(e=a.getLayoutStyle)||void 0===e?void 0:e.call(a,{blockName:l,selector:n,layout:r,layoutDefinitions:null==c?void 0:c.definitions,style:i,hasBlockGapSupport:d});return p}function ak(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:r}=n,i=Qo("layout"),a=(0,d.useSelect)((e=>{const{getSettings:t}=e(mo);return t().supportsLayout}),[]),c=(0,l.getBlockSupport)(o,rk,{}),{allowSwitching:u,allowEditing:p=!0,allowInheriting:g=!0,default:f}=c;if(!p)return null;const v=!(!g||!i||null!=r&&r.type&&"default"!==(null==r?void 0:r.type)&&"constrained"!==(null==r?void 0:r.type)&&(null==r||!r.inherit)),b=r||f||{},{inherit:k=!1,type:_="default",contentSize:y=null}=b;if(("default"===_||"constrained"===_)&&!a)return null;const E=Sr(_),C=Sr("constrained"),S=!b.type&&(y||k),w=!!k||!!y,B=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(kl,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.")})),!k&&u&&(0,s.createElement)(ck,{type:_,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}))),!k&&E&&(0,s.createElement)(E.toolBarControls,{layout:b,onChange:B,layoutBlockSupport:c}))}function ck(e){let{type:t,onChange:n}=e;return(0,s.createElement)(m.ButtonGroup,null,Cr.map((e=>{let{name:o,label:l}=e;return(0,s.createElement)(m.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},l)})))}const uk=(0,u.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,l.hasBlockSupport)(n,rk)&&(0,s.createElement)(ak,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),dk=(0,u.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:r}=t,a=(0,l.hasBlockSupport)(n,rk),p=(0,d.useSelect)((e=>{const{getSettings:t}=e(mo);return!!t().disableLayoutStyles})),m=a&&!p,g=(0,u.useInstanceId)(e),h=Qo("layout")||{},f=(0,s.useContext)(yf.__unstableElementContext),{layout:v}=o,{default:b}=(0,l.getBlockSupport)(n,rk)||{},k=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},_=a?ik(r):null,y=`.wp-container-${g}.wp-container-${g}`,E=null!==Qo("spacing.blockGap");let C;if(m){var S;const e=Sr((null==k?void 0:k.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:k,layoutDefinitions:null==h?void 0:h.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=c()({[`wp-container-${g}`]:m&&!!C},_);return(0,s.createElement)(s.Fragment,null,m&&f&&!!C&&(0,s.createPortal)((0,s.createElement)(Tr,{blockName:n,selector:y,css:C,layout:k,style:null==o?void 0:o.style}),f),(0,s.createElement)(e,i({},t,{__unstableLayoutClassNames:w})))}));function pk(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,d.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(mo);return n(t)||o(t,!0)}),[t]);return(0,s.useEffect)((()=>{o||n()}),[o]),null}(0,r.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,l.hasBlockSupport)(e,rk)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,r.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",dk),(0,r.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",uk);const mk=(0,u.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,d.useSelect)(mo),l=(0,s.useRef)(),{templateLock:r,isLockedByParent:a,isEditingAsBlocks:u}=(0,d.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:l}=e(mo);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:l()===t.clientId}}),[t.clientId]),{updateSettings:p,updateBlockListSettings:g,__unstableSetTemporarilyEditingAsBlocks:f}=(0,d.useDispatch)(mo),v=!a&&"contentOnly"===r,{__unstableMarkNextChangeAsNotPersistent:b,updateBlockAttributes:k}=(0,d.useDispatch)(mo),_=(0,s.useCallback)((()=>{b(),k(t.clientId,{templateLock:"contentOnly"}),g(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),p({focusMode:l.current}),f()}),[t.clientId,l,p,g,n,b,k,f]);return v||u?(0,s.createElement)(s.Fragment,null,u&&!v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pk,{clientId:t.clientId,stopEditingAsBlock:_}),(0,s.createElement)(Co,{group:"other"},(0,s.createElement)(m.ToolbarButton,{onClick:()=>{_()}},(0,h.__)("Done")))),!u&&v&&t.isSelected&&(0,s.createElement)(Bh,null,(e=>{let{onClose:r}=e;return(0,s.createElement)(m.MenuItem,{onClick:()=>{b(),k(t.clientId,{templateLock:void 0}),g(t.clientId,{...n(t.clientId),templateLock:!1}),l.current=o().focusMode,p({focusMode:!0}),f(t.clientId),r()}},(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,r.addFilter)("editor.BlockEdit","core/style/with-block-controls",mk);function gk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=(0,l.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function hk(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Xf(e)||void 0,style:Ub({border:n})}}function fk(e){const{colors:t}=Hf(),n=hk(e),{borderColor:o}=e;if(o){const e=jf({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function vk(e){var t,n,o,l,r,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Ff("background-color",s),m=Ff("color",a),g=ev(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===(l=d.color)||void 0===l?void 0:l.gradient),"has-link-color":null==d||null===(r=d.elements)||void 0===r||null===(i=r.link)||void 0===i?void 0:i.color})||void 0,style:Ub({color:(null==d?void 0:d.color)||{}})}}(0,r.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||gk(e,"name",!1)&&(e.attributes={...e.attributes,metadata:{type:"object"}}),e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return gk(t)&&(e.metadata=n.metadata),e})),(0,r.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||gk(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 bk={};function kk(e){const{backgroundColor:t,textColor:n,gradient:o}=e,l=Qo("color.palette.custom")||[],r=Qo("color.palette.theme")||[],i=Qo("color.palette.default")||[],a=Qo("color.gradients")||bk,c=(0,s.useMemo)((()=>[...l||[],...r||[],...i||[]]),[l,r,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=vk(e);if(t){const e=Of(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=tv(u,o)),n){const e=Of(c,n);d.style.color=e.color}return d}function _k(e){const{style:t}=e;return{style:Ub({spacing:(null==t?void 0:t.spacing)||{}})}}function yk(e,t){var n;let o=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};var l,r;t&&(o={...o,fontSize:ab({fontSize:null==e||null===(l=e.style)||void 0===l||null===(r=l.typography)||void 0===r?void 0:r.fontSize})});const i=Ub({typography:o}),s=null!=e&&e.fontFamily?`has-${(0,p.kebabCase)(e.fontFamily)}-font-family`:"";return{className:c()(s,tb(null==e?void 0:e.fontSize)),style:i}}function Ek(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Ck=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},Sk=e=>(0,u.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),wk=()=>(0,u.createHigherOrderComponent)((e=>t=>{const n=Qo("color.palette.custom"),o=Qo("color.palette.theme"),l=Qo("color.palette.default"),r=(0,s.useMemo)((()=>[...n||[],...o||[],...l||[]]),[n,o,l]);return(0,s.createElement)(e,i({},t,{colors:r}))}),"withEditorColorPalette");function Bk(e,t){const n=e.reduce(((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=zd(t),o=e=>{let{color:t}=e;return n.contrast(t)},l=Math.max(...e.map(o));return e.find((e=>o(e)===l)).color}(t,e)}createSetters(){return Object.keys(n).reduce(((e,t)=>{const n=Ck(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=zf(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:l}=e;return Object.entries(n).reduce(((e,n)=>{let[r,i]=n;const s=Of(l,o[r],o[`custom${Ck(r)}`]),a=t[r];return(null==a?void 0:a.color)===s.color&&a?e[r]=a:e[r]={...s,class:Ff(i,s.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Ik(e){return function(){const t=Sk(e);for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return(0,u.createHigherOrderComponent)(Bk(o,t),"withCustomColors")}}function xk(){const e=wk();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,u.createHigherOrderComponent)(Bk(n,e),"withColors")}const Tk=[],Mk=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},Nk=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=t.reduce(((e,t)=>(e[t]=`custom${Mk(t)}`,e)),{});return(0,u.createHigherOrderComponent)((0,u.compose)([(0,u.createHigherOrderComponent)((e=>t=>{const n=Qo("typography.fontSizes")||Tk;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 Object.entries(o).reduce(((e,t)=>{let[n,o]=t;return e[`set${Mk(n)}`]=this.createSetFontSize(n,o),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:l}=e;const r=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!Object.values(o).some(r))return null;const i=Object.entries((0,p.pickBy)(o,r)).reduce(((e,t)=>{let[o,r]=t;const i=n[o],s=Jv(l,i,n[r]);return e[o]={...s,class:tb(i)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Pk=(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"})),Lk=(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"})),Rk=(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"})),Ak=[{icon:Pk,title:(0,h.__)("Align text left"),align:"left"},{icon:Lk,title:(0,h.__)("Align text center"),align:"center"},{icon:Rk,title:(0,h.__)("Align text right"),align:"right"}],Dk={position:"bottom right",variant:"toolbar"},Ok=function(e){let{value:t,onChange:n,alignmentControls:o=Ak,label:l=(0,h.__)("Align"),describedBy:r=(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:r},popoverProps:Dk};return(0,s.createElement)(g,i({icon:d?d.icon:(0,h.isRTL)()?Rk:Pk,label:l,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:u(n)}}))},f))},zk=e=>(0,s.createElement)(Ok,i({},e,{isToolbar:!1})),Fk=e=>(0,s.createElement)(Ok,i({},e,{isToolbar:!0})),Vk=()=>{},Hk={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(mo),l=t();return{selectedBlockName:l?n(l):null,rootClientId:o().rootClientId}}),[]),[o,l,r]=Op(t,Vk),i=(0,s.useMemo)((()=>(e.trim()?fm(o,l,r,e):(0,p.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,l,r]),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)(Hu,{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,l.createBlock)(t,n,(0,l.createBlocksFromInnerBlocksTemplate)(o))}}},Gk=window.wp.apiFetch;var Uk=n.n(Gk);const Wk=(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"})),$k=(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"})),jk={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Uk()({path:(0,xm.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)(br,{key:"icon",icon:"page"===e.subtype?Wk:$k}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)},Kk=[];function qk(e){let{completers:t=Kk}=e;const{name:n}=vo();return(0,s.useMemo)((()=>{let e=[...t,jk];return(n===(0,l.getDefaultBlockName)()||(0,l.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,Hk]),(0,r.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(p.clone)),e=(0,r.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}const Yk=function(e){return(0,s.createElement)(m.Autocomplete,i({},e,{completers:qk(e)}))},Zk=(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"})),Qk=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:l}=e;return(0,s.createElement)(m.ToolbarButton,{isActive:t,icon:Zk,label:n,onClick:()=>o(!t),disabled:l})},Xk=()=>{},Jk=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=Xk,value:o="center",isDisabled:l}=e,r=(0,s.createElement)(m.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(m.Dropdown,{position:"bottom right",popoverProps:{variant:"toolbar"},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!==wu.DOWN||(e.preventDefault(),n())},label:t,icon:r,showTooltip:!0,disabled:l})},renderContent:()=>(0,s.createElement)(m.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},e_=(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"})),t_=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,d.useDispatch)(mo),{clientId:l,parents:r,hasSelection:i}=(0,d.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(mo),l=n();return{parents:o(l),clientId:l,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,!!l&&(0,s.createElement)(br,{icon:e_,className:"block-editor-block-breadcrumb__separator"})),r.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)(ag,{clientId:e,maximumLength:35})),(0,s.createElement)(br,{icon:e_,className:"block-editor-block-breadcrumb__separator"})))),!!l&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(ag,{clientId:l,maximumLength:35})))},n_=()=>(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"})),o_=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)(n_,null)))},l_=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:l}=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=>{l||e.keyCode!==wu.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(o_,null)))}))}},r_=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:l_(n),renderContent:()=>t})},i_=(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"})),s_=au(m.__experimentalTreeGridRow);function a_(e){let{isSelected:t,position:n,level:o,rowCount:l,children:r,className:a,path:u,...d}=e;const p=du({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(s_,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:l},d),r)}const c_=(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 u_(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)(br,{icon:(0,h.isRTL)()?c_:e_}))}const d_=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:l,onToggleExpanded:r,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:p}=e;const g=ig(o),h=sg({clientId:o,context:"list-view"}),{isLocked:f}=hh(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:l,onKeyDown:function(e){e.keyCode!==wu.ENTER&&e.keyCode!==wu.SPACE||l(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)(u_,{onClick:r}),(0,s.createElement)(Hu,{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)(br,{icon:bh})))))})),p_=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:l,isSelected:r,position:a,siblingBlockCount:u,level:p,isExpanded:m,selectedClientIds:g,...h}=e;const{clientId:f}=l,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,d.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(mo);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[f]),k=v&&b===f,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=g.includes(f)?g:[f];return(0,s.createElement)(cg,{clientIds:y},(e=>{let{draggable:c,onDragStart:d,onDragEnd:g}=e;return(0,s.createElement)(d_,i({ref:t,className:_,block:l,onClick:n,onToggleExpanded:o,isSelected:r,position:a,siblingBlockCount:u,level:p,draggable:c,onDragStart:d,onDragEnd:g,isExpanded:m},h))}))})),m_=p_,g_=(0,s.createContext)({}),h_=()=>(0,s.useContext)(g_),f_=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:i,selectBlock:a,position:p,level:g,rowCount:f,siblingBlockCount:v,showBlockMovers:b,path:k,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,{isLocked:I,isContentLocked:x,canEdit:T}=hh(B),M=(0,d.useSelect)((e=>!r&&!!x&&e(mo).hasSelectedInnerBlock(B,!0)),[x,B,r]),N=!x&&T,P=M||r&&y[0]===B,L=M||r&&y[y.length-1]===B,{toggleBlockHighlight:R}=(0,d.useDispatch)(mo),A=ig(B),D=(0,d.useSelect)((e=>e(mo).getBlockName(B)),[B]),O=(0,l.hasBlockSupport)(D,"__experimentalToolbar",!0),z=`list-view-block-select-button__${(0,u.useInstanceId)(e)}`,F=((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 V=(0,h.__)("Link");A&&(V=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)"),A.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"),A.title));const H=A?(0,h.sprintf)(// translators: %s: The title of the block.
|
84 |
+
(0,h.__)("Options for %s block"),A.title):(0,h.__)("Options"),{isTreeGridMounted:G,expand:U,collapse:W}=h_(),$=b&&v>0,j=c()("block-editor-list-view-block__mover-cell",{"is-visible":S||r}),K=c()("block-editor-list-view-block__menu-cell",{"is-visible":S||P});(0,s.useEffect)((()=>{!G&&r&&C.current.focus()}),[]);const q=(0,s.useCallback)((()=>{w(!0),R(B,!0)}),[B,w,R]),Y=(0,s.useCallback)((()=>{w(!1),R(B,!1)}),[B,w,R]),Z=(0,s.useCallback)((e=>{a(e,B),e.preventDefault()}),[B,a]),Q=(0,s.useCallback)((e=>{a(void 0,e)}),[a]),X=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?W(B):!1===_&&U(B)}),[B,U,W,_]);let J;$?J=2:O||(J=3);const ee=c()({"is-selected":r||M,"is-first-selected":P,"is-last-selected":L,"is-branch-selected":i,"is-dragging":o,"has-single-cell":!O}),te=y.includes(B)?y:[B];return(0,s.createElement)(a_,{className:ee,onMouseEnter:q,onMouseLeave:Y,onFocus:q,onBlur:Y,level:g,position:p,rowCount:f,path:k,id:`list-view-block-${B}`,"data-block":B,isExpanded:N?_:void 0,"aria-selected":!!r||M},(0,s.createElement)(m.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:J,ref:C,"aria-label":V,"aria-selected":!!r||M,"aria-expanded":N?_:void 0,"aria-describedby":z},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(m_,{block:n,onClick:Z,onToggleExpanded:X,isSelected:r,position:p,siblingBlockCount:v,level:g,ref:t,tabIndex:o,onFocus:l,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:z},F))})),$&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.__experimentalTreeGridCell,{className:j,withoutGridItem:!0},(0,s.createElement)(m.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(fg,{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)(vg,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),O&&(0,s.createElement)(m.__experimentalTreeGridCell,{className:K,"aria-selected":!!r||M},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Mh,{clientIds:te,icon:eh,label:H,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:Q})})))}));function v_(e,t,n,o){var l;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(l=t[e.clientId])&&void 0!==l?l:o)?1+e.innerBlocks.reduce(b_(t,n,o),0):1}const b_=(e,t,n)=>(o,l)=>{var r;return(null==t?void 0:t.includes(l.clientId))?o:(null!==(r=e[l.clientId])&&void 0!==r?r:n)&&l.innerBlocks.length>0?o+v_(l,e,t,n):o+1};function k_(e){const{blocks:t,selectBlock:n,showBlockMovers:o,selectedClientIds:l,level:r=1,path:i="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:p,parentId:m,shouldShowInnerBlocks:g=!0}=e,h=(0,d.useSelect)((e=>{if(!m)return!0;const t="contentOnly"===e(mo).getTemplateLock(m),n=e(mo).canEditBlock(m);return!t&&n}),[m]),{expandedState:f,draggedClientIds:v}=h_();if(!h)return null;const b=t.filter(Boolean),k=b.length;let _=c;return(0,s.createElement)(s.Fragment,null,b.map(((e,t)=>{var c;const{clientId:m,innerBlocks:h}=e;t>0&&(_+=v_(b[t-1],f,v,p));const{itemInView:y}=u,E=y(_),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,l),M=a||T&&w;return(0,s.createElement)(d.AsyncModeProvider,{key:m,value:!T},x&&(0,s.createElement)(f_,{block:e,selectBlock:n,isSelected:T,isBranchSelected:M,isDragged:I,level:r,position:C,rowCount:k,siblingBlockCount:k,showBlockMovers:o,path:S,isExpanded:B,listPosition:_,selectedClientIds:l}),!x&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),w&&B&&!I&&(0,s.createElement)(k_,{parentId:m,blocks:h,selectBlock:n,showBlockMovers:o,level:r+1,path:S,listPosition:_+1,fixedListWindow:u,isBranchSelected:M,selectedClientIds:l,isExpanded:p}))})))}k_.defaultProps={selectBlock:()=>{}};const y_=(0,s.memo)(k_);function E_(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:l,dropPosition:r}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[o?t.current.querySelector(`[data-block="${o}"]`):void 0,l?t.current.querySelector(`[data-block="${l}"]`):void 0]:[]),[o,l]),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"===r||"bottom"===r||"inside"===r))return{ownerDocument:c.ownerDocument,getBoundingClientRect(){const e=c.getBoundingClientRect(),t=u(),n=e.left+t,o=e.right;let l=0,i=0;"top"===r?(l=e.top,i=e.top):(l=e.bottom,i=e.bottom);const s=o-n,a=i-l;return new window.DOMRect(n,l,s,a)}}}),[c,r,u]);return c?(0,s.createElement)(m.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,s.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}const C_=["top","bottom"];const S_=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,w_=(0,s.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:r=!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:l}=t(mo);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||l()}}),[e])}(o),{visibleBlockCount:g,shouldShowInnerBlocks:f}=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(mo),l=(null==c?void 0:c.length)>0?n(c).length+1:0;return{visibleBlockCount:t()-l,shouldShowInnerBlocks:"zoom-out"!==o()}}),[c]),{updateBlockSelection:v}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,d.useDispatch)(mo),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:u,hasSelectedBlock:p}=(0,d.useSelect)(mo),{getBlockType:m}=(0,d.useSelect)(l.store),g=(0,s.useCallback)((async(l,s,a)=>{if(null==l||!l.shiftKey)return void n(s);l.preventDefault();const d="keydown"===l.type&&(l.keyCode===wu.UP||l.keyCode===wu.DOWN||l.keyCode===wu.HOME||l.keyCode===wu.END);if(!d&&!p()&&!u())return void n(s,null);const g=c(),f=[...r(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 k=r(v),_=r(b),{start:y,end:E}=function(e,t,n,o){const l=[...n,e],r=[...o,t],i=Math.min(l.length,r.length)-1;return{start:l[i],end:r[i]}}(v,b,k,_);await t(y,E,null);const C=c();if((l.keyCode===wu.HOME||l.keyCode===wu.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,Yt.speak)(w)}),[e,o,m,r,i,a,c,u,p,t,n]);return{updateBlockSelection:g}}(),[b,k]=(0,s.useReducer)(S_,{}),{ref:_,target:y}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:l}=(0,d.useSelect)(mo),[r,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=r||{},p=rf(a,c),m=o(),g=(0,u.useThrottle)((0,s.useCallback)(((o,r)=>{const s={x:o.clientX,y:o.clientY},a=!(null==m||!m.length),c=function(e,t){let n,o,l,r;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=af(t,s,C_),u=cf(t,s);if(void 0===l||a<l||u){l=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",r=d.element.getBoundingClientRect()):(o=i,n=c,r=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,r)))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(r.querySelectorAll("[data-block]")).map((o=>{const r=o.dataset.block,i=e(r);return{clientId:r,rootClientId:i,blockIndex:t(r),element:o,isDraggedBlock:!!a&&m.includes(r),innerBlockCount:n(r),canInsertDraggedBlocksAsSibling:!a||l(m,i),canInsertDraggedBlocksAsChild:!a||l(m,r)}})),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:r}}(),E=(0,s.useRef)(),C=(0,u.useMergeRefs)([E,_,t]),S=(0,s.useRef)(!1),{setSelectedTreeId:w}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,l]=(0,s.useState)(null),{selectedBlockParentClientIds:r}=(0,d.useSelect)((e=>{const{getBlockParents:n}=e(mo);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(r)&&r.length?r:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:r})}),[t]),{setSelectedTreeId:l}}({firstSelectedBlockClientId:p[0],setExpandedState:k}),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&&k({type:"expand",clientIds:[e]})}),[k]),T=(0,s.useCallback)((e=>{e&&k({type:"collapse",clientIds:[e]})}),[k]),M=(0,s.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),N=(0,s.useCallback)((e=>{var t;T(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[T]),P=(0,s.useCallback)(((e,t,n)=>{var o,l;e.shiftKey&&v(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(l=n.dataset)||void 0===l?void 0:l.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)(E_,{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:N,onExpandRow:M,onFocusRow:P,applicationAriaLabel:(0,h.__)("Block navigation structure")},(0,s.createElement)(g_.Provider,{value:L},(0,s.createElement)(y_,{blocks:a,selectBlock:B,showBlockMovers:r,fixedListWindow:I,selectedClientIds:p,isExpanded:i,shouldShowInnerBlocks:f}))))}));function B_(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:l,...r}=e;return(0,s.createElement)(m.Button,i({},r,{ref:l,icon:i_,"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 I_=(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 l=(0,d.useSelect)((e=>!!e(mo).getBlockCount()),[])&&!n;return(0,s.createElement)(m.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:r}=e;return(0,s.createElement)(B_,i({},o,{innerRef:t,isOpen:n,onToggle:r,isEnabled:l}))},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)(w_,null))})}));function x_(e){var t;let{genericPreviewBlock:n,style:o,className:r,activeStyle:i}=e;const a=null===(t=(0,l.getBlockType)(n.name))||void 0===t?void 0:t.example,c=Og(r,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)(Bp,{item:u,isStylePreview:!0})}const T_=()=>{};function M_(e){let{clientId:t,onSwitch:n=T_,onHoverClassName:o=T_}=e;const{onSelect:l,stylesToRender:r,activeStyle:i,genericPreviewBlock:a,className:d}=Fg({clientId:t,onSwitch:n}),[p,g]=(0,s.useState)(null),h=(0,u.useViewportMatch)("medium","<");if(!r||0===r.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"},r.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=>{l(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)(x_,{activeStyle:i,className:d,genericPreviewBlock:a,style:p}))))}const N_=M_;M_.Slot=()=>(V()("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);const P_=(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"})),L_=function(e){let{icon:t=P_,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("Select a variation to start with."),variations:l,onSelect:r,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":l.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")},l.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(m.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>r(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:()=>r()},(0,h.__)("Skip"))))},R_=(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"})),A_="carousel",D_="grid",O_=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")))},z_=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:l}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(m.Button,{icon:Gp,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(m.Button,{icon:Hp,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===l-1}))},F_=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:l,activeSlide:r,totalSlides:i,onBlockPatternSelect:a}=e;const c=t===A_,u=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(m.Button,{icon:Dr,label:(0,h.__)("Carousel view"),onClick:()=>n(A_),isPressed:c}),(0,s.createElement)(m.Button,{icon:R_,label:(0,h.__)("Grid view"),onClick:()=>n(D_),isPressed:t===D_}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,s.createElement)(z_,{handlePrevious:o,handleNext:l,activeSlide:r,totalSlides:i}),u,c&&(0,s.createElement)(O_,{onBlockPatternSelect:a}))},V_=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:l}=e;const r=(0,m.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===A_){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)(G_,{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({},r,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(H_,{key:e.name,pattern:e,onSelect:l,composite:r})))))};function H_(e){let{pattern:t,onSelect:n,composite:o}=e;const l="block-editor-block-pattern-setup-list",{blocks:r,description:a,viewportWidth:c=700}=t,d=(0,u.useInstanceId)(H_,`${l}__item-description`);return(0,s.createElement)("div",{className:`${l}__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:`${l}__item`,onClick:()=>n(r)}),(0,s.createElement)(Sp,{blocks:r,viewportWidth:c})),!!a&&(0,s.createElement)(m.VisuallyHidden,{id:d},a))}function G_(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:l,title:r,description:i}=n,a=(0,u.useInstanceId)(G_,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":r,"aria-describedby":i?a:void 0},(0,s.createElement)(Sp,{blocks:l,__experimentalMinHeight:o}),!!i&&(0,s.createElement)(m.VisuallyHidden,{id:a},i))}const U_=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:r}=e;const[i,a]=(0,s.useState)(A_),[c,u]=(0,s.useState)(0),{replaceBlock:p}=(0,d.useDispatch)(mo),m=function(e,t,n){return(0,d.useSelect)((o=>{const{getBlockRootClientId:l,__experimentalGetPatternsByBlockTypes:r,__experimentalGetAllowedPatterns:i}=o(mo),s=l(e);return n?i(s).filter(n):r(t,s)}),[e,t,n])}(t,n,o);if(null==m||!m.length)return null;const g=r||(e=>{const n=e.map((e=>(0,l.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)(V_,{viewMode:i,activeSlide:c,patterns:m,onBlockPatternSelect:g}),(0,s.createElement)(F_,{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 W_(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:l}=e;return(0,s.createElement)("fieldset",{className:t},(0,s.createElement)(m.VisuallyHidden,{as:"legend"},(0,h.__)("Transform to variation")),l.map((e=>(0,s.createElement)(m.Button,{key:e.name,icon:(0,s.createElement)(Hu,{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 */
|
91 |
+
(0,h.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function $_(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:l}=e;const r=l.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:dg,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${t}__container`},(0,s.createElement)(m.MenuGroup,null,(0,s.createElement)(m.MenuItemsChoice,{choices:r,value:o,onSelect:n})))))}const j_=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,d.useDispatch)(mo),{activeBlockVariation:o,variations:r}=(0,d.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(l.store),{getBlockName:r,getBlockAttributes:i}=e(mo),s=t&&r(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!!r&&(r.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===r.length)}),[r]);if(null==r||!r.length)return null;const c=a?W_:$_;return(0,s.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...r.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:r})},K_=(0,u.createHigherOrderComponent)((e=>t=>{const n=Qo("color.palette"),o=!Qo("color.custom"),l=void 0===t.colors?n:t.colors,r=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,p.isEmpty)(l)||!r;return(0,s.createElement)(e,i({},t,{colors:l,disableCustomColors:r,hasColorsToChoose:a}))}),"withColorContext"),q_=K_(m.ColorPalette);function Y_(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(dv,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}const Z_=window.wp.date,Q_=new Date(2022,0,25);function X_(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,Z_.dateI18n)(n,Q_))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(J_,{format:t,onChange:o}))}function J_(e){var t;let{format:n,onChange:o}=e;const l=[...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")])],r=l.map(((e,t)=>({key:`suggested-${t}`,name:(0,Z_.dateI18n)(e,Q_),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&&!l.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:[...r,i],value:a?i:null!==(t=r.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 ey=["colors","disableCustomColors","gradients","disableCustomGradients"],ty=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:l,disableCustomGradients:r,children:i,settings:a,title:g,showTitle:h=!0,__experimentalHasMultipleOrigins:f,__experimentalIsRenderedInSidebar:v,enableAlpha:b}=e;const k=(0,u.useInstanceId)(ty),{batch:_}=(0,d.useRegistry)();return(0,p.isEmpty)(n)&&(0,p.isEmpty)(o)&&l&&r&&null!=a&&a.every((e=>(0,p.isEmpty)(e.colors)&&(0,p.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:()=>{_((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:l}=e;t?o():n&&l()}))}))},panelId:k,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,s.createElement)(hv,{settings:a,panelId:k,colors:n,gradients:o,disableCustomColors:l,disableCustomGradients:r,__experimentalHasMultipleOrigins:f,__experimentalIsRenderedInSidebar:v,enableAlpha:b}),!!i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.__experimentalSpacer,{marginY:4})," ",i))},ny=e=>{const t=Vf();return t.colors=Qo("color.palette"),t.gradients=Qo("color.gradients"),(0,s.createElement)(ty,i({},t,e))},oy=e=>{const t=Hf();return(0,s.createElement)(ty,i({},t,e))},ly=e=>ey.every((t=>e.hasOwnProperty(t)))?(0,s.createElement)(ty,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(oy,e):(0,s.createElement)(ny,e);var ry=function(e,t){return ry=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])},ry(e,t)},iy=function(){return iy=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e},iy.apply(this,arguments)};Object.create,Object.create;var sy=n(7970),ay=n.n(sy);function cy(e,t,n,o,l,r){void 0===r&&(r=0);var i=_y(e,t,r),s=i.width,a=i.height,c=Math.min(s,n),u=Math.min(a,o);return c>u*l?{width:u*l,height:u}:{width:c,height:c/l}}function uy(e,t,n,o,l){void 0===l&&(l=0);var r=_y(t.width,t.height,l),i=r.width,s=r.height;return{x:dy(e.x,i,n.width,o),y:dy(e.y,s,n.height,o)}}function dy(e,t,n,o){var l=t*o/2-n/2;return yy(e,-l,l)}function py(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function my(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function gy(e,t,n,o,l,r,i){void 0===r&&(r=0),void 0===i&&(i=!0);var s=i?hy:fy,a=_y(t.width,t.height,r),c=_y(t.naturalWidth,t.naturalHeight,r),u={x:s(100,((a.width-n.width/l)/2-e.x/l)/a.width*100),y:s(100,((a.height-n.height/l)/2-e.y/l)/a.height*100),width:s(100,n.width/a.width*100/l),height:s(100,n.height/a.height*100/l)},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:iy(iy({},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 hy(e,t){return Math.min(e,Math.max(0,t))}function fy(e,t){return t}function vy(e,t,n,o,l,r){var i=_y(t.width,t.height,n),s=yy(o.width/i.width*(100/e.width),l,r);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 by(e,t,n,o,l,r){void 0===n&&(n=0);var i=_y(t.naturalWidth,t.naturalHeight,n),s=yy(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),l,r),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 ky(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function _y(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 yy(e,t,n){return Math.min(Math.max(e,t),n)}function Ey(){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 Cy=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=Oi().createRef(),n.videoRef=Oi().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=vy(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),o=t.crop,l=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(l)}else if(n.props.initialCroppedAreaPixels){var r=by(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=r.crop,l=r.zoom,n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(l)}},n.computeSizes=function(){var e,t,o,l,r,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===(l=n.videoRef.current)||void 0===l?void 0:l.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=iy(iy({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:cy(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(r=n.state.cropSize)||void 0===r?void 0:r.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,l=e.x,r=e.y;n.dragStartPosition={x:l,y:r},n.dragStartCrop=iy({},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,l=o-n.dragStartPosition.y,r={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+l},i=n.props.restrictPosition?uy(r,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):r;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),l=ay()(e).pixelY,r=n.props.zoom-l*n.props.zoomSpeed/200;n.setNewZoom(r,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,l=n.props,r=l.crop,i=l.zoom;return{x:(t+r.x)/i,y:(o+r.y)/i}},n.setNewZoom=function(e,t,o){var l=(void 0===o?{}:o).shouldUpdatePosition,r=void 0===l||l;if(n.state.cropSize&&n.props.onZoomChange){var i=n.getPointOnContainer(t),s=n.getPointOnMedia(i),a=yy(e,n.props.minZoom,n.props.maxZoom),c={x:s.x*a-i.x,y:s.y*a-i.y};if(r){var u=n.props.restrictPosition?uy(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?gy(n.props.restrictPosition?uy(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?uy(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}ry(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,l,r,i,s,a,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zo
|